Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
This files describes API changes for quiz report plugins.
2
 
3
Overview of this plugin type at http://docs.moodle.org/dev/Quiz_reports
4
 
5
=== 4.4 ===
6
 
7
* The function quiz_grading_report::format_count_for_table now requires a string identifier and
8
  a component identifier so that it is possible to address strings outside of
9
  quiz/report/grading/lang/en/quiz_grading.php.
10
 
11
* The function quiz_grading_renderer::render_grade_link now requires a string identifier and
12
  a component identifier so that it is possible to address strings outside of
13
  quiz/report/grading/lang/en/quiz_grading.php.
14
 
15
=== 4.2 ===
16
 
17
* There was an ill-advised, never documented, API change in quiz_report_get_significant_questions
18
  in Moodle 4.0. The API has now been reverted to how it was before 4.0. Hopefully this
19
  will not cause anyone a problem. (The API revert did not require any changes in any automated tests
20
  or standard quiz reports.)
21
 
22
* The quiz has a lot of old classes in lib.php files. These have now been moved into the classes folder,
23
  and so are now in namespaces. Because of Moodle's class renaming support, your code should continue
24
  working, but output deprecated warnings, so you probably want to update. This should mostly be
25
  doable by adding use statements, and a search/replace.
26
  - quiz_default_report => mod_quiz\local\reports\report_base
27
  - quiz_attempts_report => mod_quiz\local\reports\attempts_report
28
  - mod_quiz_attempts_report_form => mod_quiz\local\reports\attempts_report_options_form
29
  - mod_quiz_attempts_report_options => mod_quiz\local\reports\attempts_report_options
30
  - quiz_attempts_report_table => mod_quiz\local\reports\attempts_report_table
31
 
32
  As part of the clean-up, the following files are no longer required, and if you try to
33
  include them, you will get a debugging notices telling you not to:
34
  - mod/quiz/report/attemptsreport.php
35
  - mod/quiz/report/attemptsreport_form.php
36
  - mod/quiz/report/attemptsreport_options.php
37
  - mod/quiz/report/attemptsreport_table.php
38
  - mod/quiz/report/default.php
39
 
40
* Final deprecation (complete removal) of the following functions which were deprecated long ago:
41
  - attempts_report::load_relevant_students - deprecated in 3.2
42
  - quiz_statistics_graph_get_new_colour - deprecated since 3.2
43
  - The file mod/quiz/report/overview/overviewgraph.php - deprecated since 3.2
44
  - The file mod/quiz/report/statistics/statistics_graph.php - deprecated since 3.2
45
 
46
 
47
=== 3.9 ===
48
 
49
* Quiz report plugins defining capabilities used to require an extra string like
50
    $string['statistics:componentname'] = 'Quiz statistics report';
51
in addition to
52
    $string['pluginname'] = 'Statistics';
53
This is no longer required.
54
 
55
=== 3.8 ===
56
 
57
* New quiz_attempts_report_table method: \quiz_attempts_report_table::checkbox_col_header()
58
  This generates a column header containing a checkbox that toggles the checked state of all the checkboxes corresponding to the
59
  entries listed on a given quiz report table. It requires the name of the checkbox column as a parameter in order to disable
60
  sorting on the checkbox column.
61
 
62
=== 3.2 ===
63
 
64
* A code refactoring based on new sql functions in MDL-31243 and removing
65
get_users_by_capability from the quiz reports in MDL-27072. The class
66
quiz_attempts_report is now initialised to return \core\dml\sql_join (joins,
67
wheres, params) rather than arrays of userids. This allows the use of joins
68
in quiz report queries and is very important when there
69
are larger numbers of enrolled users. The signature of many quiz report
70
methods now includes '$studentsjoins', rather than '$students' and similar
71
for '$groupstudentsjoins', '$allowedjoins' and '$usersjoins'. For clear
72
examples of the use of these changes please see attemptsreport_table.php
73
base_sql() or almost any function in overview/report.php. The protected
74
function quiz_attempts_report::load_relevant_students is deprecated,
75
please use quiz_attempts_report::get_students_joins() instead.
76
 
77
=== 2.6 ===
78
 
79
* Improving the display page and heading levels to have a proper nesting.
80
We are reducing the amount of white spaces for the top report by making
81
'separate group' options and attempts to be displayed inline.
82
In grading report, we are changing 'no questions' from using heading to
83
notification message. (MDL-41615)
84
 
85
=== 2.3 ===
86
 
87
* Support for the old way of doing cron in a separate cron.php file has been removed.
88
Instead, you need a lib.php file inside the plugin with a cron function
89
called quiz_myreportname_cron(). The statistics report is an example of how
90
it should be done.
91
 
92
* There was a big refactor of the quiz reports, in issues MDL-32300, MDL-32322 and MDL-3030.
93
It is difficult to explain the changes. Probably the best way to understand what
94
happened is to look at
95
    git log mod/quiz/report/overview
96
    git log mod/quiz/report/responses
97
and so on. Here are some notes on a few of the changes:
98
 
99
The class quiz_attempt_report was renamed to quiz_attempts_report (with an extra s).
100
 
101
Some globally defined constants with the prefix QUIZ_REPORT_ATTEMPTS_ moved into
102
the quiz_attempts_report class. Specifically
103
 
104
quiz_attempts_report::ALL_WITH         replaces QUIZ_REPORT_ATTEMPTS_ALL
105
quiz_attempts_report::ENROLLED_ALL     replaces QUIZ_REPORT_ATTEMPTS_ALL_STUDENTS
106
quiz_attempts_report::ENROLLED_WITH    replaces QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH
107
quiz_attempts_report::ENROLLED_WITHOUT replaces QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH_NO
108
 
109
Your if you have a table class, it needs to be renamed like
110
quiz_report_myreportname_table -> quiz_myreportname_table. That is, all the
111
class names in your plugin should start with the frankenstyle plugin name
112
quiz_myreportname.
113
 
114
 
115
=== 2.2 ===
116
 
117
* Plugins should be converted to implement cron in the standard way. In lib.php,
118
define a
119
function quiz_myreportname_cron() {};
120
This replaces the old way of having a separate cron.php file. Also, the cron
121
frequency should be defined in version.php, not in the quiz_reports table.
122
 
123
 
124
=== earlier versions ===
125
 
126
* ... API changes were not documented properly. Sorry. (There weren't many!)