Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Test helpers for the randomsamatch question type.

Copyright: 2013 Jean-Michel Vedrine
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 139 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

qtype_randomsamatch_test_helper:: (2 methods):
  get_test_questions()
  make_randomsamatch_question_animals()

qtype_randomsamatch_test_question_loader:: (2 methods):
  __construct()
  load_questions()


Class: qtype_randomsamatch_test_helper  - X-Ref

Test helper class for the randomsamatch question type.

get_test_questions()   X-Ref
No description

make_randomsamatch_question_animals()   X-Ref
Makes a randomsamatch question similar to the match question returned
by {@link make_a_matching_question}, but with no 'insect' distractor.

return: qtype_randomsamatch_question

Class: qtype_randomsamatch_test_question_loader  - X-Ref

Test implementation of {@link qtype_randomsamatch_question_loader}. Gets the questions
from an array passed to the constructor, rather than querying the database.

__construct($availablequestions, $choose, $questions)   X-Ref
Constructor

param: array $availablequestions not used for tests.
param: int $choose how many questions to load (not used here).
param: array $questions array of questions to use.

load_questions()   X-Ref
Just return the shortanswers questions passed to the constructor.

return: array of short answer questions.