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.

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.