/** * Update the final grades for all attempts. This method is used following * a regrade. * @param object $quiz the quiz settings. * @param array $userids only update scores for these userids. * @param array $attemptids attemptids only update scores for these attempt ids. */ protected function update_overall_grades($quiz) { quiz_update_all_attempt_sumgrades($quiz); quiz_update_all_final_grades($quiz); quiz_update_grades($quiz); }
$quiz->questions = implode(',', $questions); // Update the database. $DB->set_field('quiz', 'questions', $quiz->questions, array('id' => $quiz->id)); $deletepreviews = true; } // If rescaling is required save the new maximum. $maxgrade = unformat_float(optional_param('maxgrade', -1, PARAM_RAW)); if ($maxgrade >= 0) { quiz_set_grade($maxgrade, $quiz); } if ($deletepreviews) { quiz_delete_previews($quiz); } if ($recomputesummarks) { quiz_update_sumgrades($quiz); quiz_update_all_attempt_sumgrades($quiz); quiz_update_all_final_grades($quiz); quiz_update_grades($quiz, 0, true); } redirect($afteractionurl); } $questionbank->process_actions($thispageurl, $cm); // End of process commands ===================================================== $PAGE->requires->yui2_lib('container'); $PAGE->requires->yui2_lib('dragdrop'); $PAGE->requires->skip_link_to('questionbank', get_string('skipto', 'access', get_string('questionbank', 'question'))); $PAGE->requires->skip_link_to('quizcontentsblock', get_string('skipto', 'access', get_string('questionsinthisquiz', 'quiz'))); $PAGE->set_title(get_string('editingquizx', 'quiz', format_string($quiz->name))); $PAGE->set_heading($course->fullname); $node = $PAGE->settingsnav->find('mod_quiz_edit', navigation_node::TYPE_SETTING); if ($node) {