Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Question behaviour for the old adaptive mode.

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

Defines 2 classes

qbehaviour_adaptive:: (15 methods):
  is_compatible_question()
  get_expected_data()
  get_state_string()
  get_right_answer_summary()
  adjust_display_options()
  process_action()
  summarise_action()
  process_save()
  adjusted_fraction()
  process_submit()
  process_finish()
  get_graded_step()
  is_state_improvable()
  get_adaptive_marks()
  adaptive_mark_details_from_step()

qbehaviour_adaptive_mark_details:: (2 methods):
  __construct()
  get_formatted_marks()


Class: qbehaviour_adaptive  - X-Ref

Question behaviour for adaptive mode.

This is the old version of interactive mode.

is_compatible_question(question_definition $question)   X-Ref
No description

get_expected_data()   X-Ref
No description

get_state_string($showcorrectness)   X-Ref
No description

get_right_answer_summary()   X-Ref
No description

adjust_display_options(question_display_options $options)   X-Ref
No description

process_action(question_attempt_pending_step $pendingstep)   X-Ref
No description

summarise_action(question_attempt_step $step)   X-Ref
No description

process_save(question_attempt_pending_step $pendingstep)   X-Ref
No description

adjusted_fraction($fraction, $prevtries)   X-Ref
No description

process_submit(question_attempt_pending_step $pendingstep)   X-Ref
No description

process_finish(question_attempt_pending_step $pendingstep)   X-Ref
No description

get_graded_step()   X-Ref
Got the most recently graded step. This is mainly intended for use by the
renderer.

return: question_attempt_step the most recently graded step.

is_state_improvable(question_state $state)   X-Ref
Determine whether a question state represents an "improvable" result,
that is, whether the user can still improve their score.

param: question_state $state the question state.
return: bool whether the state is improvable

get_adaptive_marks()   X-Ref

return: qbehaviour_adaptive_mark_details the information about the current state-of-play, scoring-wise,

adaptive_mark_details_from_step(question_attempt_step $gradedstep,question_state $state, $maxmark, $penalty)   X-Ref
Actually populate the qbehaviour_adaptive_mark_details object.

param: question_attempt_step $gradedstep the step that holds the relevant mark details.
param: question_state $state the state corresponding to $gradedstep.
param: unknown_type $maxmark the maximum mark for this question_attempt.
param: unknown_type $penalty the penalty for this question, as a fraction.

Class: qbehaviour_adaptive_mark_details  - X-Ref

This class encapsulates all the information about the current state-of-play
scoring-wise. It is used to communicate between the beahviour and the renderer.

__construct($state, $maxmark = null, $actualmark = null, $rawmark = null,$currentpenalty = null, $totalpenalty = null, $improvable = null)   X-Ref
Constructor.

param: question_state $state

get_formatted_marks($markdp)   X-Ref
Get the marks, formatted to a certain number of decimal places, in the
form required by calls like get_string('gradingdetails', 'qbehaviour_adaptive', $a).

param: int $markdp the number of decimal places required.
return: array ready to substitute into language strings.