Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402] [Versions 402 and 403]
(no description)
File Size: | 211 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
mod_quiz_generator:: (4 methods):
create_instance()
create_attempt()
submit_responses()
create_override()
Class: mod_quiz_generator - X-Ref
Quiz module test data generator classcreate_instance($record = null, array $options = null) X-Ref |
No description |
create_attempt($quizid, $userid, array $forcedrandomquestions = [],array $forcedvariants = []) X-Ref |
Create a quiz attempt for a particular user at a particular course. param: int $quizid the quiz id (from the mdl_quit table, not cmid). param: int $userid the user id. param: array $forcedrandomquestions slot => questionid. Optional, param: array $forcedvariants slot => variantno. Optional. Optional, return: stdClass the new attempt. |
submit_responses($attemptid, array $responses, $checkbutton, $finishattempt) X-Ref |
Submit responses to a quiz attempt. To be realistic, you should ensure that $USER is set to the user whose attempt it is before calling this. param: int $attemptid the id of the attempt which is being param: array $responses array responses to submit. See description on param: bool $checkbutton if simulate a click on the check button for each question, else simulate save. param: bool $finishattempt if true, the attempt will be submitted. |
create_override(array $data) X-Ref |
Create a quiz override (either user or group). param: array $data must specify quizid, and one of userid or groupid. |