How to redirect the quiz review in one page at a time after submitting the "Submit all and finish" button

How to redirect the quiz review in one page at a time after submitting the "Submit all and finish" button

by Jesper Martinez -
Number of replies: 2

Hi, everyone. I just have the idea of changing the redirect URL after submitting the "Submit all and finish" button, instead of this URL "https://example.com/mod/quiz/review.php?attempt=843&cmid=550" I just want to add this "&showall=0" to the end of the link so that I can only redirect to one page at a time, not the whole question, and the URL should look like this "https://example.com/mod/quiz/review.php?attempt=843&cmid=550&showall=0". Is there any way to do it? By the way, I have a background in coding but it was hard for me to navigate the specific files if where it's located. Please, I need your help. Thank you 


Average of ratings: -
In reply to Jesper Martinez

Re: How to redirect the quiz review in one page at a time after submitting the "Submit all and finish" button

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The code which creates the URLs for the various pages in the quiz are all in mod/quiz/attemptlib.php.

(I won't repeat all the standard warning about being careful before changing core Moodle code in your install._
In reply to Tim Hunt

Re: How to redirect the quiz review in one page at a time after submitting the "Submit all and finish" button

by Jesper Martinez -
Thank you so much @Tim you save my life smile

I have found out the [review_url] method that has a parameter value of $showall is null by default. Then I'd changed it into 0 and it works. Thank you smile
public function review_url($slot = null, $page = -1, $showall = 0, $thispage = -1) {
       return $this->page_and_question_url('review', $slot, $page, $showall, $thispage);
}