MDL-52813 mod_quiz: New method for getting the type of a question

This commit is contained in:
Juan Leyva
2016-03-11 10:28:17 +01:00
parent b89544404e
commit 1d57e4fea5
+11
View File
@@ -1232,6 +1232,17 @@ class quiz_attempt {
return $this->quba->get_question_action_time($slot);
}
/**
* Return the question type name for a given slot within the current attempt.
*
* @param int $slot the number used to identify this question within this attempt.
* @return string the question type name
* @since Moodle 3.1
*/
public function get_question_type_name($slot) {
return $this->quba->get_question($slot)->get_type_name();
}
/**
* Get the time remaining for an in-progress attempt, if the time is short
* enought that it would be worth showing a timer.