Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]
(no description)
File Size: | 599 lines (25 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
random_question_loader_test:: (21 methods):
test_empty_category_gives_null()
test_unknown_category_behaves_like_empty()
test_descriptions_not_returned()
test_hidden_questions_not_returned()
test_cloze_subquestions_not_returned()
test_random_questions_not_returned()
test_one_question_category_returns_that_q_then_null()
test_two_question_category_returns_both_then_null()
test_nested_categories()
test_used_question_not_returned_until_later()
test_previously_used_question_not_returned_until_later()
test_empty_category_does_not_have_question_available()
test_descriptions_not_available()
test_existing_question_is_available_but_then_marked_used()
get_questions_test_cases()
test_get_questions_variations()
test_get_questions_with_limit_and_offset()
test_get_questions_with_restricted_fields()
count_questions_test_cases()
test_count_questions_variations()
create_category_and_questions()
Class: random_question_loader_test - X-Ref
Tests for the {@link core_question\bank\random_question_loader} class.test_empty_category_gives_null() X-Ref |
No description |
test_unknown_category_behaves_like_empty() X-Ref |
No description |
test_descriptions_not_returned() X-Ref |
No description |
test_hidden_questions_not_returned() X-Ref |
No description |
test_cloze_subquestions_not_returned() X-Ref |
No description |
test_random_questions_not_returned() X-Ref |
No description |
test_one_question_category_returns_that_q_then_null() X-Ref |
No description |
test_two_question_category_returns_both_then_null() X-Ref |
No description |
test_nested_categories() X-Ref |
No description |
test_used_question_not_returned_until_later() X-Ref |
No description |
test_previously_used_question_not_returned_until_later() X-Ref |
No description |
test_empty_category_does_not_have_question_available() X-Ref |
No description |
test_descriptions_not_available() X-Ref |
No description |
test_existing_question_is_available_but_then_marked_used() X-Ref |
No description |
get_questions_test_cases() X-Ref |
Data provider for the get_questions test. |
test_get_questions_variations($categoryindex,$includesubcategories,$usetagnames,$expectedquestionindexes) X-Ref |
Test the get_questions function with various parameter combinations. This function creates a data set as follows: Category: cat1 Question: cat1q1 Tags: 'cat1', 'foo' Question: cat1q2 Category: cat2 Question: cat2q1 Tags: 'cat2', 'foo' Question: cat2q2 Category: subcat Question: subcatq1 Tags: 'subcat', 'foo' Question: subcatq2 Parent: cat1 Category: emptycat param: string $categoryindex The named index for the category to use param: bool $includesubcategories If the search should include subcategories param: string[] $usetagnames The tag names to include in the search param: string[] $expectedquestionindexes The questions expected in the result |
test_get_questions_with_limit_and_offset() X-Ref |
get_questions should allow limiting and offsetting of the result set. |
test_get_questions_with_restricted_fields() X-Ref |
get_questions should allow retrieving questions with only a subset of fields populated. |
count_questions_test_cases() X-Ref |
Data provider for the count_questions test. |
test_count_questions_variations($categoryindex,$includesubcategories,$usetagnames,$expectedcount) X-Ref |
Test the count_questions function with various parameter combinations. This function creates a data set as follows: Category: cat1 Question: cat1q1 Tags: 'cat1', 'foo' Question: cat1q2 Category: cat2 Question: cat2q1 Tags: 'cat2', 'foo' Question: cat2q2 Category: subcat Question: subcatq1 Tags: 'subcat', 'foo' Question: subcatq2 Parent: cat1 Category: emptycat param: string $categoryindex The named index for the category to use param: bool $includesubcategories If the search should include subcategories param: string[] $usetagnames The tag names to include in the search param: int $expectedcount The number of questions expected in the result |
create_category_and_questions($questioncount, $tagnames = [], $parentcategory = null) X-Ref |
Create a question category and create questions in that category. Tag the first question in each category with the given tags. param: int $questioncount How many questions to create. param: string[] $tagnames The list of tags to use. param: stdClass|null $parentcategory The category to set as the parent of the created category. return: array The category and questions. |