MDL-27747 quiz summary, add a CSS class to the table rows based on question state.

The standard themes do not use this for anything, but it makes it easier for themers to do cool stuff.
Also improve the API for getting the question state class.
This commit is contained in:
Tim Hunt
2011-06-07 15:11:04 +01:00
parent 4464734bb6
commit 97cdc1de72
4 changed files with 36 additions and 1 deletions
+10
View File
@@ -246,6 +246,16 @@ class question_usage_by_activity {
return $this->get_question_attempt($slot)->get_state_string($showcorrectness);
}
/**
* @param int $slot the number used to identify this question within this usage.
* @param bool $showcorrectness Whether right/partial/wrong states should
* be distinguised.
* @return string a CSS class name for the current state.
*/
public function get_question_state_class($slot, $showcorrectness) {
return $this->get_question_attempt($slot)->get_state_class($showcorrectness);
}
/**
* Get the time of the most recent action performed on a question.
* @param int $slot the number used to identify this question within this usage.