Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: quiz_question_restore_test  - X-Ref

Quiz backup and restore tests.

setUp()   X-Ref
Called before every test.


test_quiz_restore_in_a_different_course_using_course_question_bank()   X-Ref
Test a quiz backup and restore in a different course without attempts for course question bank.


test_quiz_restore_in_a_different_course_using_quiz_question_bank()   X-Ref
Test a quiz backup and restore in a different course without attempts for quiz question bank.


question_count(int $contextid, string $extracondition = '')   X-Ref
Count the questions for the context.

param: int $contextid
param: string $extracondition
return: int the number of questions.

test_quiz_duplicate_does_not_duplicate_course_question_bank_questions()   X-Ref
Test if a duplicate does not duplicate questions in course question bank.


test_quiz_duplicate_for_quiz_question_bank_questions()   X-Ref
Test quiz duplicate for quiz question bank.


test_quiz_restore_with_attempts()   X-Ref
Test quiz restore with attempts.


test_pre_4_quiz_restore_for_regular_questions()   X-Ref
Test pre 4.0 quiz restore for regular questions.


test_pre_4_quiz_restore_for_random_questions()   X-Ref
Test pre 4.0 quiz restore for random questions.


test_pre_4_quiz_restore_for_random_question_tags()   X-Ref
Test pre 4.0 quiz restore for random question tags.


test_pre_4_quiz_restore_shared_random_question()   X-Ref
Test pre 4.0 quiz restore for random question used on multiple quizzes.


test_backup_restore_question_slots()   X-Ref
Ensure that question slots are correctly backed up and restored with all properties.

return: void