Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 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