Grader
Stats Class Reference

#include <Stats.h>

Public Member Functions

Statsoperator+= (const Stats &)
 
Stats operator+ (const Stats &)
 
bool passed ()
 
bool failed ()
 
void record (std::shared_ptr< RubricItem >)
 
std::string results ()
 
nlohmann::json resultsJson ()
 

Public Attributes

unsigned num_created {0}
 
unsigned num_run {0}
 
unsigned num_passed {0}
 
unsigned num_failed {0}
 
unsigned num_optional {0}
 
std::vector< std::shared_ptr< RubricItem > > items
 

Detailed Description

Record stats against RubricItems that have run.

Member Function Documentation

§ failed()

bool Stats::failed ( )

Whether or not at least one of the non-optional RubricItems failed.

§ operator+()

Stats Stats::operator+ ( const Stats rhs)

For adding Stats (likely from different Graders).

§ operator+=()

Stats & Stats::operator+= ( const Stats rhs)

For adding Stats (likely from different Graders).

§ passed()

bool Stats::passed ( )

Whether or not all of the non-optional RubricItems passed.

§ record()

void Stats::record ( std::shared_ptr< RubricItem )

Record pass/fail/optional state and feedback. Also aggregates overall stats. Noop if the RubricItem has not run.

§ results()

string Stats::results ( )

Get a stringified JSON of the overall stats.

§ resultsJson()

json Stats::resultsJson ( )

Get a JSON of the overall stats.

Member Data Documentation

§ items

std::vector<std::shared_ptr<RubricItem> > Stats::items

A collection of all the RubricItems that were evaluated. Public for overloading + and +=.

§ num_created

unsigned Stats::num_created {0}

Number of RubricItems created.

§ num_failed

unsigned Stats::num_failed {0}

Number of RubricItems that failed (and were not optional).

§ num_optional

unsigned Stats::num_optional {0}

Number of RubricItems that were optional.

§ num_passed

unsigned Stats::num_passed {0}

Number of RubricItems that passed (and were not optional).

§ num_run

unsigned Stats::num_run {0}

Number of RubricItems that were evaluated.


The documentation for this class was generated from the following files: