$quiz->review = get_config('quiz', 'review');
require_login($courseid, false);
$quiz->course = $courseid;
+ $quiz->decimalpoints = get_config('quiz', 'decimalpoints');
$context = get_context_instance(CONTEXT_COURSE, $courseid);
} else if (!$quiz = $DB->get_record('quiz', array('id' => $quizid))) {
print_error('invalidquizid', 'quiz', '', $quizid);
$attempt->timemodified = $timenow;
$attempt->uniqueid = 0;
$attempt->id = 0;
+ $attempt->layout = $id;
// Restore the history of question sessions from the moodle session or create
// new sessions. Make $states a reference to the states array in the moodle
if ('' !== $state->last_graded->penalty && ((float)$state->last_graded->penalty) > 0.0) {
// A penalty was applied so display it
echo ' ';
- print_string('gradingdetailspenalty', 'quiz', $state->last_graded->penalty);
+ print_string('gradingdetailspenalty', 'quiz', question_format_grade($cmoptions, $state->last_graded->penalty));
} else {
/* No penalty was applied even though the answer was
not correct (eg. a syntax error) so tell the student