diff --git a/mod/quiz/constants.php b/mod/quiz/constants.php index 3f07df74a05..807fda24135 100644 --- a/mod/quiz/constants.php +++ b/mod/quiz/constants.php @@ -74,6 +74,7 @@ define('QUIZ_EVENTGRADE', '3'); define('QUIZ_EVENTDUPLICATEGRADE', '4'); define('QUIZ_EVENTVALIDATE', '5'); define('QUIZ_EVENTCLOSE', '6'); +define('QUIZ_EVENTSUBMIT', '7'); /**#@-*/ /**#@+ diff --git a/mod/quiz/questiontypes/essay/questiontype.php b/mod/quiz/questiontypes/essay/questiontype.php index 6c09dac3e9d..0abf413a47a 100644 --- a/mod/quiz/questiontypes/essay/questiontype.php +++ b/mod/quiz/questiontypes/essay/questiontype.php @@ -167,6 +167,7 @@ class quiz_essay_qtype extends quiz_default_questiontype { quiz_print_comment("
$answer->feedback
"); } } + $this->print_question_submit_buttons($question, $state, $cmoptions, $options); } function grade_responses(&$question, &$state, $cmoptions) { @@ -175,9 +176,9 @@ class quiz_essay_qtype extends quiz_default_questiontype { if (isset($state->responses['fraction'])) { $state->raw_grade = $state->responses['fraction']; $state->options->graded = 1; - } - if (empty($state->raw_grade)) { + } else { $state->raw_grade = 0; + $state->event = QUIZ_EVENTSUBMIT; } // Make sure we don't assign negative or too high marks