Quiz

 
 
Picture of Reece Lipman
/mod/quiz/attempt.php 1.9 to 2.5
 

I was trying to decipher the new moodle 2.5 mod/quiz/attempt.php
in comparison

in 1.9 around 437 it has: if ($finishattempt) {

but what is the corresponding in the 2.5 version?

here are the two versions that I am looking at
https://github.com/moodle/moodle/blob/MOODLE_25_STABLE/mod/quiz/attempt.php
https://github.com/moodle/moodle/blob/MOODLE_19_STABLE/mod/quiz/attempt.php#L407

Line 407 is about where i'm looking for in the new 2.5

Thanks!

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: /mod/quiz/attempt.php 1.9 to 2.5
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

attempt.php was split into separate files startattempt.php, attempt.php and processattempt.php. This is shown on http://docs.moodle.org/dev/Quiz_user_interface_overview

 
Average of ratings:Useful (1)
Picture of Reece Lipman
Re: /mod/quiz/attempt.php 1.9 to 2.5
 

Oh yes now i see. Thanks

 
Average of ratings: -
Picture of Reece Lipman
Re: /mod/quiz/attempt.php 1.9 to 2.5
 

How do i get the quiz id within processattempt.php ?

 

1.9 did something like this:

if (! $quiz = get_record("quiz", "id", $cm->instance)) {
error("The quiz with id $cm->instance corresponding to this coursemodule $id is missing");
}
} else {
if (! $quiz = get_record("quiz", "id", $q)) {

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: /mod/quiz/attempt.php 1.9 to 2.5
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

$attemptobj->get_quizid(), or $attemptobj->get_quiz()->id.

Look at all the methods of $attmemptobj. Lots of good stuff there.

 
Average of ratings:Useful (1)