MDL-40990 qbehaviours: method to say if attempts can finish naturally

This commit is contained in:
Tim Hunt
2015-03-13 14:23:02 +00:00
parent 06122e46fd
commit fd7a8af50b
6 changed files with 58 additions and 7 deletions
+11
View File
@@ -271,6 +271,17 @@ class question_usage_by_activity {
return $this->get_question_attempt($slot)->get_state_class($showcorrectness);
}
/**
* Whether this attempt at a given question could be completed just by the
* student interacting with the question, before {@link finish_question()} is called.
*
* @param int $slot the number used to identify this question within this usage.
* @return boolean whether the attempt at the given question can finish naturally.
*/
public function can_question_finish_during_attempt($slot) {
return $this->get_question_attempt($slot)->can_finish_during_attempt();
}
/**
* 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.