Skip to content

Commit

Permalink
Merge branch 'MDL-31407_21' of git://github.com/timhunt/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_21_STABLE
  • Loading branch information
Aparup Banerjee committed Feb 8, 2012
2 parents 4278e96 + a238e92 commit 60811b8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion mod/quiz/attemptlib.php
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions mod/quiz/editlib.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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;">';
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/lib.php
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions mod/quiz/locallib.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/override_form.php
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions mod/quiz/view.php
Expand Up @@ -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);

Expand Down

0 comments on commit 60811b8

Please sign in to comment.