Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Question type class for the drag-and-drop images onto images question type.

Author: Jamie Pratt <me@jamiep.org>
Copyright: 2012 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 376 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

question_hint_ddmarker:: (3 methods):
  __construct()
  load_from_record()
  adjust_display_options()

qtype_ddmarker:: (12 methods):
  save_defaults_for_new_questions()
  save_question_options()
  save_hints()
  make_hint()
  make_choice()
  make_place()
  initialise_combined_feedback()
  move_files()
  delete_files()
  export_to_xml()
  import_from_xml()
  get_random_guess_score()


Class: question_hint_ddmarker  - X-Ref

Question hint for ddmarker.

An extension of {@link question_hint} for questions like match and multiple
choice with multile answers, where there are options for whether to show the
number of parts right at each stage, and to reset the wrong parts.

__construct($id, $hint, $hintformat, $shownumcorrect,$clearwrong, $statewhichincorrect)   X-Ref
Constructor.

param: int the hint id from the database.
param: string $hint The hint text
param: int the corresponding text FORMAT_... type.
param: bool $shownumcorrect whether the number of right parts should be shown
param: bool $clearwrong whether the wrong parts should be reset.

load_from_record($row)   X-Ref
Create a basic hint from a row loaded from the question_hints table in the database.

param: object $row with property options as well as hint, shownumcorrect and clearwrong set.
return: question_hint_ddmarker

adjust_display_options(question_display_options $options)   X-Ref
No description

Class: qtype_ddmarker  - X-Ref

The drag-and-drop markers question type class.

save_defaults_for_new_questions(stdClass $fromform)   X-Ref
No description

save_question_options($formdata)   X-Ref
No description

save_hints($formdata, $withparts = false)   X-Ref
No description

make_hint($hint)   X-Ref
No description

make_choice($dragdata)   X-Ref
No description

make_place($dropdata)   X-Ref
No description

initialise_combined_feedback(question_definition $question,$questiondata, $withparts = false)   X-Ref
No description

move_files($questionid, $oldcontextid, $newcontextid)   X-Ref
No description

delete_files($questionid, $contextid)   X-Ref
Delete all the files belonging to this question.

param: int $questionid the question being deleted.
param: int $contextid the context the question is in.

export_to_xml($question, qformat_xml $format, $extra = null)   X-Ref
No description

import_from_xml($data, $question, qformat_xml $format, $extra=null)   X-Ref
No description

get_random_guess_score($questiondata)   X-Ref
No description