Merge branch 'MDL-35717-quiz-attempt-checkstate' of git://github.com/mpetrowi/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 26 Nov 2012 04:07:04 +0000 (12:07 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 26 Nov 2012 04:07:04 +0000 (12:07 +0800)
Conflicts:
mod/quiz/tests/generator/lib.php

1  2 
mod/quiz/lib.php
mod/quiz/module.js
mod/quiz/renderer.php
mod/quiz/tests/generator/lib.php

Simple merge
Simple merge
Simple merge
@@@ -50,55 -97,6 +50,55 @@@ class mod_quiz_generator extends phpuni
              $record->cmidnumber = '';
          }
  
-             'name'                   => get_string('pluginname', 'data').' '.$i,
 +        $alwaysvisible = mod_quiz_display_options::DURING | mod_quiz_display_options::IMMEDIATELY_AFTER |
 +                mod_quiz_display_options::LATER_WHILE_OPEN | mod_quiz_display_options::AFTER_CLOSE;
 +
 +        $defaultquizsettings = array(
++            'name'                   => get_string('pluginname', 'quiz').' '.$i,
 +            'intro'                  => 'Test quiz ' . $i,
 +            'introformat'            => FORMAT_MOODLE,
 +            'timeopen'               => 0,
 +            'timeclose'              => 0,
 +            'preferredbehaviour'     => 'deferredfeedback',
 +            'attempts'               => 0,
 +            'attemptonlast'          => 0,
 +            'grademethod'            => QUIZ_GRADEHIGHEST,
 +            'decimalpoints'          => 2,
 +            'questiondecimalpoints'  => -1,
 +            'reviewattempt'          => $alwaysvisible,
 +            'reviewcorrectness'      => $alwaysvisible,
 +            'reviewmarks'            => $alwaysvisible,
 +            'reviewspecificfeedback' => $alwaysvisible,
 +            'reviewgeneralfeedback'  => $alwaysvisible,
 +            'reviewrightanswer'      => $alwaysvisible,
 +            'reviewoverallfeedback'  => $alwaysvisible,
 +            'questionsperpage'       => 1,
 +            'shufflequestions'       => 0,
 +            'shuffleanswers'         => 1,
 +            'questions'              => '',
 +            'sumgrades'              => 0,
 +            'grade'                  => 0,
 +            'timecreated'            => time(),
 +            'timemodified'           => time(),
 +            'timelimit'              => 0,
 +            'overduehandling'        => 'autoabandon',
 +            'graceperiod'            => 86400,
 +            'quizpassword'           => '',
 +            'subnet'                 => '',
 +            'browsersecurity'        => '',
 +            'delay1'                 => 0,
 +            'delay2'                 => 0,
 +            'showuserpicture'        => 0,
 +            'showblocks'             => 0,
 +            'navmethod'              => QUIZ_NAVMETHOD_FREE,
 +        );
 +
 +        foreach ($defaultquizsettings as $name => $value) {
 +            if (!isset($record->{$name})) {
 +                $record->{$name} = $value;
 +            }
 +        }
 +
          $record->coursemodule = $this->precreate_course_module($record->course, $options);
          $id = quiz_add_instance($record);
          return $this->post_add_instance($id, $record->coursemodule);