From 47cdbd1f6487acf23b8bd973e6fb67dc559aa735 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 11 Jan 2007 12:18:10 +0000 Subject: [PATCH] Question session state logic improvement - if students have not yet entered an answer, don't do an EVENT_SAVE. --- lib/questionlib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/questionlib.php b/lib/questionlib.php index 9592a5220b..bdb7b98fbf 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -1064,8 +1064,10 @@ function question_process_responses(&$question, &$state, $action, $cmoptions, &$ // Check for unchanged responses (exactly unchanged, not equivalent). // We also have to catch questions that the student has not yet attempted - $sameresponses = !$state->last_graded->event == QUESTION_EVENTOPEN && - $QTYPES[$question->qtype]->compare_responses($question, $action, $state); + $sameresponses = $QTYPES[$question->qtype]->compare_responses($question, $action, $state); + if ($state->last_graded->event == QUESTION_EVENTOPEN && question_isgradingevent($action->event)) { + $sameresponses = false; + } // If the response has not been changed then we do not have to process it again // unless the attempt is closing or validation is requested -- 2.39.5