Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Class: generator_test  - X-Ref

Genarator tests class for mod_lesson.

test_create_instance()   X-Ref
No description

test_create_content()   X-Ref
No description

test_create_question_truefalse()   X-Ref
This tests the true/false question generator.


test_create_question_multichoice()   X-Ref
This tests the multichoice question generator.


test_create_question_essay()   X-Ref
This tests the essay question generator.


test_create_question_matching()   X-Ref
This tests the matching question generator.


test_create_question_numeric()   X-Ref
This tests the numeric question generator.


test_create_question_shortanswer()   X-Ref
This tests the shortanswer question generator.


test_create_cluster_pages(string $type)   X-Ref
This tests the generators for cluster, endofcluster and endofbranch pages.

param: string $type Type of page to test: LESSON_PAGE_CLUSTER, LESSON_PAGE_ENDOFCLUSTER or LESSON_PAGE_ENDOFBRANCH.

create_cluster_pages_provider()   X-Ref
Data provider for test_create_cluster_pages().

return: array

test_create_page_and_answers()   X-Ref
Test create some pages and their answers.


test_create_page_with_previouspage()   X-Ref
Test creating pages defining the previous pages.


test_create_page_invalid_previouspage()   X-Ref
Test creating a page with a previous page that doesn't exist.


test_create_page_previouspage_circular_dependency()   X-Ref
Test that circular dependencies are not allowed in previous pages.


test_create_answer_invalid_page()   X-Ref
Test creating an answer in a page that doesn't exist.


test_create_answer_jumpto()   X-Ref
Test that all the possible values of jumpto work as expected when creating an answer.


test_create_answer_invalid_jumpto()   X-Ref
Test invalid jumpto when creating answers.


test_create_answer_jumpto_circular_dependency()   X-Ref
Test that circular dependencies are not allowed when creating answers.