Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
=== 4.5 Onwards ===
2
 
3
This file has been replaced by UPGRADING.md. See MDL-81125 for further information.
4
 
5
===
1 efrain 6
This files describes API changes for the core question engine.
7
 
8
=== 4.4 ===
9
 
10
* The method question_usage_by_activity::add_question_in_place_of_other has been made more flexible.
11
  There is a new argument $keepoldquestionattempt. That defaults to true, which behaves the same as
12
  the old API, but if you pass false, then the newly added question_attempt completely replaces the
13
  existing one in-place.
14
 
15
=== 4.2 ===
16
 
17
* A `$questionidentifier` property has been added to `\question_display_options` to enable question type plugins to associate the
18
question number to the question that is being rendered. This can be used to improve the accessibility of rendered
19
questions and can be especially be helpful for screen reader users as adding the question number on the answer field(s) labels
20
will allow them to distinguish between answer fields as they navigate through a quiz.
21
* Question type plugins can use \question_display_options::add_question_identifier_to_label() to add the question number to the
22
label of the answer field(s) of the question that is being rendered. The question number may be redundant when displayed, so the
23
function allows for it to be enclosed within an sr-only container.
24
 
25
=== 4.0 ===
26
1) A new optional parameter $extraselect has been added as a part of load_questions_usages_where_question_in_state()
27
   method in question/engine/datalib.php, anything passed here will be added to the SELECT list, use this to return extra data.
28
 
29
=== 3.9 ===
30
 
31
1) In the past, whenever a question_usage_by_activity was loaded from the database,
32
   the apply_attempt_state was immediately called on every question, whether the
33
   results of doing that were ever used, or not.
34
 
35
   Now we have changed the code flow, so that apply_attempt_state is only called
36
   when some data or processing is requested (e.g. analysing a response or rendering
37
   the question) which requires the question to be fully initialised. This is MDL-67183.
38
 
39
   This change should be completely invisible with everything handled by the question
40
   engine. If you don't change your code, it should continue to work.
41
 
42
   However, to get the full advantage of this change, you should review your code,
43
   and look at every call to get_question or get_behaviour (on a question_attempt or
44
   question_usage_by_activity). The problem with these methods is that the question engine
45
   cannot know what you are planning to do with the question once you have got it.
46
   Therefore, they have to assume that apply_attempt_state must be called - which can be expensive.
47
   If you know that you don't need that (because, for example, you are just going to
48
   look at ->id or ->questiontext or something simple) then you should pass
49
   false to these functions, to get the possible performance benefit.
50
   In addition, there is a new method $qa->get_question_id() to handle that case more simply.
51
 
52
   Note that you don't have worry about this in places like the renderer for your question
53
   type, because by the time you are in the renderer, the question will already have been
54
   initialised.
55
 
56
 
57
=== 3.7 ===
58
 
59
1) When a question is rendered, the outer div of the question has an id="q123"
60
   added. Unfortunately, this id was not actually unique, leading to bugs like
61
   MDL-52572. Therefore, we have had to change it. The id used now is what
62
   is returned by the new method $qa->get_outer_question_div_unique_id().
63
   The old code that you need to search for and replace with a call to this
64
   method is "'q' . $qa->get_slot()"
65
 
66
   Note, the new method has also been added to Moodle 3.5.6 and 3.6.4, but
67
   returning the old id. This is to help question types that want to support
68
   multiple Moodle versions.
69
 
70
=== 3.1, 3.0.3, 2.9.5 ===
71
 
72
1) The field question_display_options::$extrainfocontent is now displayed in the
73
   outcomes (yellow) div by default. It used to be in the info div. If you have
74
   overriden the question renderer, you may need to make a corresponding change.
75
 
76
 
77
=== 3.0, 2.9.2, 2.8.8 ===
78
 
79
1) The extra internal PARAM constant question_attempt::PARAM_MARK should no
80
   longer be used. (It should not have been used outside the core of the
81
   question system). See MDL-51090 if you want more explanation.
82
 
83
 
84
=== 2.9 ===
85
 
86
1) Some new methods on the question_usage class (and corresponding methods on
87
   question_attempt, question_attempt_step, question_usage_observer, ... requried
88
   to implement them, but almost certainly you should only be calling the
89
   question_usage methods from your code.
90
 
91
   * question_usage::add_question_in_place_of_other($slot, $question, $maxmark = null)
92
 
93
     This creates a new questoin_attempt in place of an existing one, moving the
94
     existing question_attempt to the end of the usage, in a new slot number.
95
     The new slot number is returned. The goal is to replace the old attempt, but
96
     not lose the old data.
97
 
98
   * question_usage::set_question_max_mark($slot, $maxmark)
99
 
100
     Sets the max mark for one question in this usage. Previously, you could
101
     only change this using the bulk operation question_usage::set_max_mark_in_attempts;
102
 
103
   * question_usage::set_question_attempt_metadata($slot, $name, $value);
104
     question_usage::get_question_attempt_metadata($slot, $name);
105
 
106
     You can now record metadata, that is, values stored by name, against
107
     question_attempts. The question engine ignores this data (other than storing
108
     and loading it) but you may find it useful in your code.
109
 
110
   To see examples of where these are used, look at the chagnes from MDL-40992.
111
 
112
2) New fields in question_display_options, ->extrainfocontent and ->extrahistorycontent.
113
   These default to blank, but can be used to inject extra content into those parts
114
   of the question display. If you have overridden the methods in
115
   core_question_renderer that use these fields, you may need to update your renderer.
116
 
117
 
118
=== 2.6 ===
119
 
120
1) The method question_behaviour::is_manual_grade_in_range and move and become
121
   question_engine::is_manual_grade_in_range.
122
 
123
2) The arguments to core_question_renderer::mark_summary changed from
124
   ($qa, $options) to ($qa, $behaviouroutput, $options). If you have overridden
125
   that method you will need to update your code.
126
 
127
3) Heading level for number(), add_part_heading() and respond_history()
128
   has been lowered by one level. These changes are part of improving the page
129
   accessibility and making heading to have proper nesting. (MDL-41615)
130
 
131
=== Earlier changes ===
132
 
133
* Were not documented in this way. Sorry.