Moodle PHP Documentation 5.0
Moodle 5.0.1+ (Build: 20250711) (61af040cd5f)
mod_quiz\tests Namespace Reference

  More...

Classes

class  attempt_walkthrough_testcase
 

Functions

 add_one_random_question ($questiongenerator, stdClass $quiz, $override=[])
 Helper method to add random question to quiz.
 
 add_random_questions (int $quizid, int $page, int $categoryid, int $number)
 Add random questions to a quiz, with a filter condition based on a category ID.
 
 add_two_regular_questions ($questiongenerator, stdClass $quiz, $override=null)
 Helper method to add regular questions in quiz.
 
 attempt_quiz (stdClass $quiz, stdClass $user, $attemptnumber=1)
 Attempt questions for a quiz and user.
 
 backup_quiz (stdClass $quiz, stdClass $user)
 A helper method to backup test quiz.
 
 create_test_quiz (stdClass $course)
 Create a test quiz for the specified course.
 
 duplicate_quiz ($course, $quiz)
 A helper method to emulate duplication of the quiz.
 
 restore_quiz (string $backupid, stdClass $course, stdClass $user)
 A helper method to restore provided backup.
 

Variables

stdClass $quiz
 $quiz A test quiz.
 
stdClass $user
 $user A test logged-in user.
 
trait question_helper_test_trait
 

Detailed Description