[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/question/behaviour/ -> upgrade.txt (source)

   1  This files describes API changes for question behaviour plugins.
   2  
   3  === 2.7 ===
   4  
   5  1) question_behaviour_type has a new method allows_multiple_submitted_responses which defaults to false but should return
   6        true if this question behaviour accepts multiple submissions of responses within one attempt eg. multiple tries for the
   7        interactive or adaptive question behaviours.
   8     question_behaviour has a new method step_has_a_submitted_response($step). For question behaviours where it is not only the
   9        final response that is submitted by the student, you need to override this method to return true for other steps where a
  10        student has submitted a response. See question_behaviour_with_multiple_tries::step_has_a_submitted_response($step) for
  11        example. This method only needs to be overriden if you are returning true from allows_multiple_response_submissions
  12  
  13  
  14  === 2.6 ===
  15  
  16  1) Legacy required_question_definition_type no longer supported. (See 2.2 point 2) below.)
  17  
  18  2) Behaviours now have to define an extra class
  19  class qbehaviour_mybehaviour_type extends question_behaviour_type {
  20     This class returns information about the type of behaviour, as opposed to
  21     the qbehaviour_mybehaviour class which controls a particular
  22     question_attempt. That is like the difference between the qtype_mytype and
  23     the qtype_mytype_question classes.
  24  
  25     Practically, what this means is that any of the methods that used to be
  26     static methods of qbehaviour_mybehaviour class are now normal instance
  27     methods of the qbehaviour_mybehaviour_type class. Specifically.
  28      2.5 / qbehaviour_mybehaviour -> 2.6 / qbehaviour_mybehaviour_type
  29      IS_ARCHETYPAL                -> is_archetypal()
  30      adjust_random_guess_score()  -> adjust_random_guess_score()
  31      get_unused_display_options() -> get_unused_display_options()
  32  
  33  3) The static method is_manual_grade_in_range has moved from the
  34     question_behaviour class to the question_engine class.
  35  
  36  4) Behaviours can now control how the marks information is displayed in the
  37     grey info area to the left of the question. There is a new method
  38     mark_summary that you can override, although the default implementation is
  39     fine in most cases. it uses the marked_out_of_max and mark_out_of_max methods
  40     as appropriate, so you may just wish to override those.
  41  
  42  
  43  === 2.3 ===
  44  
  45  1) This plugin type now supports cron in the standard way. If required, Create a
  46     lib.php file containing
  47  function qbehaviour_mypluginname_cron() {};
  48  
  49  
  50  === 2.2 ===
  51  
  52  1) The old
  53      public static function get_required_behaviours()
  54     method is no more. Instead use the ->dependencies facility in version.php. E.g.
  55  $plugin->dependencies = array(
  56      'qbehaviour_immediatefeedback' => 2011102700,
  57      'qbehaviour_deferredcbm'       => 2011102700
  58  );
  59  
  60  2) The old required_question_definition_type method has been replaced by a new
  61     is_compatible_question method. You should change your behaviour to override
  62     the new method, not the old one. This change has been implemented in a
  63     backwards-compatible way, so behaviours will not break.


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1