mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-15538 - Rework attempt.php to use attemptlib.php - I had broken processing of submitted responses. Hopefully it is fixed again now.
This commit is contained in:
parent
4fc3d7e549
commit
66d07f81a1
5 changed files with 23 additions and 18 deletions
|
@ -7,7 +7,9 @@
|
|||
* are loaded.
|
||||
*//** */
|
||||
|
||||
require_once("../../config.php");
|
||||
if (!defined('MOODLE_INTERNAL')) {
|
||||
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page.
|
||||
}
|
||||
|
||||
/**
|
||||
* Class for quiz exceptions. Just saves a couple of arguments on the
|
||||
|
@ -410,7 +412,7 @@ class quiz_attempt extends quiz {
|
|||
if (!$newstates = get_question_states($questionstoprocess, $this->quiz, $this->attempt)) {
|
||||
throw new moodle_quiz_exception($this, 'cannotrestore');
|
||||
}
|
||||
$this->states = $this->states + $newstates;
|
||||
$this->states = $newstates + $this->states;
|
||||
}
|
||||
|
||||
// Simple getters ======================================================================
|
||||
|
@ -499,7 +501,7 @@ class quiz_attempt extends quiz {
|
|||
|
||||
case QUESTION_EVENTSAVE:
|
||||
case QUESTION_EVENTGRADE:
|
||||
return 'saved';
|
||||
return 'answered';
|
||||
|
||||
case QUESTION_EVENTCLOSEANDGRADE:
|
||||
case QUESTION_EVENTCLOSE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue