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.

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

This file contains classes for handling the different question behaviours during upgrade.

Copyright: 2010 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 561 lines (19 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 6 classes

question_behaviour_attempt_updater:: (25 methods):
  __construct()
  discard()
  get_converted_qa()
  create_missing_first_step()
  supply_missing_qa()
  initialise_qa()
  convert_steps()
  process_state()
  finish_up()
  add_step()
  discard_last_state()
  unexpected_event()
  process0()
  process1()
  process2()
  process3()
  process4()
  process5()
  process8()
  process9()
  make_qtype_updater()
  to_text()
  graded_state_for_fraction()
  manual_graded_state_for_fraction()
  make_step()

qbehaviour_deferredfeedback_converter:: (3 methods):
  behaviour_name()
  process6()
  process7()

qbehaviour_manualgraded_converter:: (3 methods):
  behaviour_name()
  process6()
  process7()

qbehaviour_informationitem_converter:: (7 methods):
  behaviour_name()
  process0()
  process2()
  process3()
  process6()
  process7()
  process8()

qbehaviour_adaptive_converter:: (7 methods):
  behaviour_name()
  finish_up()
  process0()
  process2()
  process3()
  process6()
  process7()

qbehaviour_adaptivenopenalty_converter:: (1 method):
  behaviour_name()


Class: question_behaviour_attempt_updater  - X-Ref

Base class for managing the upgrade of a question using a particular behaviour.

This class takes as input:
1. Various backgroud data like $quiz, $attempt and $question.
2. The data about the question session to upgrade $qsession and $qstates.
Working through that data, it builds up
3. The equivalent new data $qa. This has roughly the same data as a
question_attempt object belonging to the new question engine would have, but
$this->qa is built up from stdClass objects.

__construct($quiz, $attempt, $question, $qsession, $qstates, $logger, $qeupdater)   X-Ref


discard()   X-Ref
No description

get_converted_qa()   X-Ref
No description

create_missing_first_step()   X-Ref
No description

supply_missing_qa()   X-Ref
No description

initialise_qa()   X-Ref
No description

convert_steps()   X-Ref
No description

process_state($state)   X-Ref
No description

finish_up()   X-Ref
No description

add_step($step)   X-Ref
No description

discard_last_state()   X-Ref
No description

unexpected_event($state)   X-Ref
No description

process0($step, $state)   X-Ref
No description

process1($step, $state)   X-Ref
No description

process2($step, $state)   X-Ref
No description

process3($step, $state)   X-Ref
No description

process4($step, $state)   X-Ref
No description

process5($step, $state)   X-Ref
No description

process8($step, $state)   X-Ref
No description

process9($step, $state)   X-Ref
No description

make_qtype_updater()   X-Ref

param: object $question a question definition
return: qtype_updater

to_text($html)   X-Ref
No description

graded_state_for_fraction($fraction)   X-Ref
No description

manual_graded_state_for_fraction($fraction)   X-Ref
No description

make_step($state)   X-Ref
No description

Class: qbehaviour_deferredfeedback_converter  - X-Ref

behaviour_name()   X-Ref
No description

process6($step, $state)   X-Ref
No description

process7($step, $state)   X-Ref
No description

Class: qbehaviour_manualgraded_converter  - X-Ref

behaviour_name()   X-Ref
No description

process6($step, $state)   X-Ref
No description

process7($step, $state)   X-Ref
No description

Class: qbehaviour_informationitem_converter  - X-Ref

behaviour_name()   X-Ref
No description

process0($step, $state)   X-Ref
No description

process2($step, $state)   X-Ref
No description

process3($step, $state)   X-Ref
No description

process6($step, $state)   X-Ref
No description

process7($step, $state)   X-Ref
No description

process8($step, $state)   X-Ref
No description

Class: qbehaviour_adaptive_converter  - X-Ref

behaviour_name()   X-Ref
No description

finish_up()   X-Ref
No description

process0($step, $state)   X-Ref
No description

process2($step, $state)   X-Ref
No description

process3($step, $state)   X-Ref
No description

process6($step, $state)   X-Ref
No description

process7($step, $state)   X-Ref
No description