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.

Question behaviour that is like the interactive behaviour, but where the student is credited for parts of the question they got right on earlier tries.

Copyright: 2009 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 93 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 question/behaviour/interactive/behaviour.php

Defines 1 class

qbehaviour_interactivecountback:: (2 methods):
  is_compatible_question()
  adjust_fraction()


Class: qbehaviour_interactivecountback  - X-Ref

Question behaviour for interactive mode with count-back scoring.

As an example, suppose we have a matching question with 4 parts, and 3 tries
(penalty 1/3), and the question is worth 12 marks (so, 3 marks for each part).
Suppose also that:
- on the first try, the student gets the first two parts right, and the
other two wrong.
- on the second try, they are sure they got the first part right, so keep
their answer the same, but they change their answer to the second part.
They also get the answer to the thrid part right on this try, but still
get the 4th part wrong.
- On the final try, they get the first 3 parts right, but the 4th part still
wrong.
We want to grade them as follows.
- For the first part, they were right first time, and did not change their
answer, so we credit that part as right first time: 3/3
- For the second part, although they were right first time, they then changed
their mind, an only finally got it right on the third try, so 1/3.
- For the third part, they got it right on the second try, and then did not
change their answer, so 2/3.
- For the last part, they were wrong at the last try, so 0/3.
So, total mark is 6/12. (Really, a fraction of 0.5.)

Of course, the details of the grading are actually up to the particular
question type. The point is that the final grade can take into account all
of the tries the student made.

is_compatible_question(question_definition $question)   X-Ref
No description

adjust_fraction($fraction, question_attempt_pending_step $pendingstep)   X-Ref
No description