Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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.

Differences Between: [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Matching question definition class.

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

Defines 2 classes

qtype_randomsamatch_question:: (3 methods):
  start_attempt()
  find_right_answer()
  apply_attempt_state()

qtype_randomsamatch_question_loader:: (2 methods):
  __construct()
  load_questions()


Class: qtype_randomsamatch_question  - X-Ref

Represents a randomsamatch question.

start_attempt(question_attempt_step $step, $variant)   X-Ref
No description

find_right_answer($wrappedquestion)   X-Ref
Find the corresponding choice id of the first correct answer of a shortanswer question.
choice is added to the randomsamatch question if it doesn't already exist.

param: object $wrappedquestion short answer question.
return: int correct choice id.

apply_attempt_state(question_attempt_step $step)   X-Ref
No description

Class: qtype_randomsamatch_question_loader  - X-Ref

This class is responsible for loading the questions that a question needs from the database.

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

param: array $availablequestions array of available question ids.
param: int $choose how many questions to load.

load_questions()   X-Ref
Choose and load the desired number of questions.

return: array of short answer questions.