Grader
RubricItem Class Reference

#include <RubricItem.h>

Public Member Functions

 RubricItem ()=default
 
 RubricItem (const std::function< bool()> &_callback)
 
 RubricItem (const std::string &_name)
 
 RubricItem (const std::string &_name, const std::function< bool()> &_callback)
 
void setCallback (const std::function< bool()> &)
 
void whenCorrect (const std::string &message)
 
void whenCorrect (const std::string &message, const std::string &tag)
 
void whenIncorrect (const std::string &message)
 
void whenIncorrect (const std::string &message, const std::string &tag)
 
void evaluate ()
 
bool ran ()
 
bool passed ()
 
bool failed ()
 
std::shared_ptr< FeedbackgetFeedback ()
 
double evaluationTimeMs ()
 

Public Attributes

std::string name
 
bool checkpoint = false
 
bool optional = false
 

Constructor & Destructor Documentation

§ RubricItem() [1/4]

RubricItem::RubricItem ( )
default

The default constructor.

§ RubricItem() [2/4]

RubricItem::RubricItem ( const std::function< bool()> &  _callback)
inline

A constructor that sets the callback.

§ RubricItem() [3/4]

RubricItem::RubricItem ( const std::string &  _name)
inline

A constructor that sets the name.

§ RubricItem() [4/4]

RubricItem::RubricItem ( const std::string &  _name,
const std::function< bool()> &  _callback 
)
inline

A constructor that sets the name and callback.

Member Function Documentation

§ evaluate()

void RubricItem::evaluate ( )

Run the callback to determine if this RubricItem passed or failed.

§ evaluationTimeMs()

double RubricItem::evaluationTimeMs ( )

High precision time in milliseconds representing how long the callback itself took to run.

§ failed()

bool RubricItem::failed ( )

Whether or not this RubricItem failed.

§ getFeedback()

shared_ptr< Feedback > RubricItem::getFeedback ( )

Only useful after the RubricItem is evaluated. Gets the corresponding Feedback to its pass/fail state.

§ passed()

bool RubricItem::passed ( )

Whether or not this RubricItem passed. Will be false until it actually runs.

§ ran()

bool RubricItem::ran ( )

Whether or not this RubricItem has run.

§ setCallback()

void RubricItem::setCallback ( const std::function< bool()> &  )

Set the work to be done when this RubricItem is evaluated. Likely a lambda function.

§ whenCorrect() [1/2]

void RubricItem::whenCorrect ( const std::string &  message)

Set the message to give to students if this RubricItem passes. Optional.

§ whenCorrect() [2/2]

void RubricItem::whenCorrect ( const std::string &  message,
const std::string &  tag 
)

Set the message and tag to give to students if this RubricItem passes. Optional.

§ whenIncorrect() [1/2]

void RubricItem::whenIncorrect ( const std::string &  message)

Set the message to give to students if this RubricItem fails. Optional.

§ whenIncorrect() [2/2]

void RubricItem::whenIncorrect ( const std::string &  message,
const std::string &  tag 
)

Set the message and tag to give to students if this RubricItem fails. Optional.

Member Data Documentation

§ checkpoint

bool RubricItem::checkpoint = false

If checkpoint, no RubricItems after this one will evaluate if this one fails.

§ name

std::string RubricItem::name

Optional identifier of the RubricItem.

§ optional

bool RubricItem::optional = false

If optional, the RubricItem does not count towards the Grader pass/fail state.


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