mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-69253' of https://github.com/timhunt/moodle
This commit is contained in:
commit
e0f91914a7
@ -84,7 +84,7 @@ function quiz_add_instance($quiz) {
|
||||
$cmid = $quiz->coursemodule;
|
||||
|
||||
// Process the options from the form.
|
||||
$quiz->created = time();
|
||||
$quiz->timecreated = time();
|
||||
$result = quiz_process_options($quiz);
|
||||
if ($result && is_string($result)) {
|
||||
return $result;
|
||||
|
@ -49,7 +49,8 @@ class mod_quiz_generator_testcase extends advanced_testcase {
|
||||
|
||||
$generator->create_instance(array('course'=>$SITE->id));
|
||||
$generator->create_instance(array('course'=>$SITE->id));
|
||||
$quiz = $generator->create_instance(array('course'=>$SITE->id));
|
||||
$createtime = time();
|
||||
$quiz = $generator->create_instance(array('course' => $SITE->id, 'timecreated' => 0));
|
||||
$this->assertEquals(3, $DB->count_records('quiz'));
|
||||
|
||||
$cm = get_coursemodule_from_instance('quiz', $quiz->id);
|
||||
@ -59,5 +60,8 @@ class mod_quiz_generator_testcase extends advanced_testcase {
|
||||
|
||||
$context = context_module::instance($cm->id);
|
||||
$this->assertEquals($quiz->cmid, $context->instanceid);
|
||||
|
||||
$this->assertEqualsWithDelta($createtime,
|
||||
$DB->get_field('quiz', 'timecreated', ['id' => $cm->instance]), 2);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user