MDL-53304 question behaviour: don't show useless Check buttons

Previously, the Check button was often shown disabled when it
could not be used (e.g. when the question was finished, or when an
interactive question was in the try-again state). Eventually we
realised it was better usability to hide it in these cases.

Note that when a teacher reviews an in-progress quiz attempt, they will
see a disabled Check button if the student doing the quiz can see the
button.
This commit is contained in:
Tim Hunt
2016-03-04 14:06:19 +00:00
parent 7adc7ef14f
commit 81e47a35e8
19 changed files with 92 additions and 60 deletions
+3
View File
@@ -208,6 +208,9 @@ abstract class qbehaviour_renderer extends plugin_renderer_base {
* @return string HTML fragment.
*/
protected function submit_button(question_attempt $qa, question_display_options $options) {
if (!$qa->get_state()->is_active()) {
return '';
}
$attributes = array(
'type' => 'submit',
'id' => $qa->get_behaviour_field_name('submit'),