Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-31407_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
commit 60811b8dc9784565521160166dc7c83fe25cc345 2 parents 4278e96 + a238e92
@nebgor nebgor authored
View
2  mod/quiz/attemptlib.php
@@ -1089,7 +1089,7 @@ public function finish_attempt($timestamp) {
$DB->update_record('quiz_attempts', $this->attempt);
if (!$this->is_preview()) {
- quiz_save_best_grade($this->get_quiz());
+ quiz_save_best_grade($this->get_quiz(), $this->attempt->userid);
// Trigger event
$eventdata = new stdClass();
View
4 mod/quiz/editlib.php
@@ -346,7 +346,7 @@ function quiz_move_question_down($layout, $questionid) {
*/
function quiz_print_question_list($quiz, $pageurl, $allowdelete, $reordertool,
$quiz_qbanktool, $hasattempts, $defaultcategoryobj) {
- global $USER, $CFG, $DB, $OUTPUT;
+ global $CFG, $DB, $OUTPUT;
$strorder = get_string('order');
$strquestionname = get_string('questionname', 'quiz');
$strgrade = get_string('grade');
@@ -1212,7 +1212,7 @@ protected function display_options($recurse, $showhidden, $showquestiontext) {
* the last value used +1.
*/
function quiz_print_grading_form($quiz, $pageurl, $tabindex) {
- global $USER, $OUTPUT;
+ global $OUTPUT;
$strsave = get_string('save', 'quiz');
echo '<form method="post" action="edit.php" class="quizsavegradesform"><div>';
echo '<fieldset class="invisiblefieldset" style="display: block;">';
View
2  mod/quiz/lib.php
@@ -1675,7 +1675,7 @@ function quiz_pluginfile($course, $cm, $context, $filearea, $args, $forcedownloa
*/
function mod_quiz_question_pluginfile($course, $context, $component,
$filearea, $qubaid, $slot, $args, $forcedownload) {
- global $USER, $CFG;
+ global $CFG;
require_once($CFG->dirroot . '/mod/quiz/locallib.php');
$attemptobj = quiz_attempt::create_from_usage_id($qubaid);
View
5 mod/quiz/locallib.php
@@ -530,8 +530,7 @@ function quiz_set_grade($newgrade, $quiz) {
* @return bool Indicates success or failure.
*/
function quiz_save_best_grade($quiz, $userid = null, $attempts = array()) {
- global $DB;
- global $USER, $OUTPUT;
+ global $DB, $OUTPUT, $USER;
if (empty($userid)) {
$userid = $USER->id;
@@ -1171,8 +1170,6 @@ function quiz_send_confirmation($recipient, $a) {
*/
function quiz_send_notification($recipient, $submitter, $a) {
- global $USER;
-
// Recipient info for template
$a->useridnumber = $recipient->idnumber;
$a->username = fullname($recipient);
View
2  mod/quiz/override_form.php
@@ -58,7 +58,7 @@ public function __construct($submiturl, $cm, $quiz, $context, $groupmode, $overr
}
protected function definition() {
- global $CFG, $USER, $DB;
+ global $CFG, $DB;
$cm = $this->cm;
$mform = $this->_form;
View
5 mod/quiz/view.php
@@ -79,11 +79,6 @@
// Initialize $PAGE, compute blocks
$PAGE->set_url('/mod/quiz/view.php', array('id' => $cm->id));
-$edit = optional_param('edit', -1, PARAM_BOOL);
-if ($edit != -1 && $PAGE->user_allowed_editing()) {
- $USER->editing = $edit;
-}
-
// Update the quiz with overrides for the current user
$quiz = quiz_update_effective_access($quiz, $USER->id);
Please sign in to comment.
Something went wrong with that request. Please try again.