MDL-35038 quiz reports: document the API changes in 2.3.
[moodle.git] / mod / quiz / report / upgrade.txt
CommitLineData
c2f5e2ab
TH
1This files describes API changes for quiz report plugins.
2
3Overview of this plugin type at http://docs.moodle.org/dev/Quiz_reports
4
5
6=== earlier versions ===
7
8* ... API changes were not documented properly. Sorry. (There weren't many!)
9
10
11=== 2.2 ===
12
13* Plugins should be converted to implement cron in the standard way. In lib.php,
14define a
15function quiz_myreportname_cron() {};
16This replaces the old way of having a separate cron.php file. Also, the cron
17frequency should be defined in version.php, not in the quiz_reports table.
18
19
20=== 2.3 ===
21
22* Support for the old way of doing cron in a separate cron.php file has been removed.
940f7b91
K
23You need a lib.php file inside the pluginneme (quiz report name) and a cron function
24with the name quiz_pluginname_cron(), where pluginnme is the report name (e.g.:
25quiz_statistics_cron()).
26
27* Some globally defined constants with the prefix "QUIZ_REPORT_ATTEMPTS_" are put inside
28the abstract class "quiz_attempts_report" in Moodle 2.3.and they associate as follows:
29
30withis the classes drived from "quiz_attempts_report":
31
32parent::ALL_WITH replaces QUIZ_REPORT_ATTEMPTS_ALL
33parent::ENROLLED_ALL replaces QUIZ_REPORT_ATTEMPTS_ALL_STUDENTS
34parent::ENROLLED_WITH replaces QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH
35parent::ENROLLED_WITHOUT replaces QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH_NO
36
37anywhere else:
38quiz_attempts_report::ALL_WITH replaces QUIZ_REPORT_ATTEMPTS_ALL
39quiz_attempts_report::ENROLLED_ALL replaces QUIZ_REPORT_ATTEMPTS_ALL_STUDENTS
40quiz_attempts_report::ENROLLED_WITH replaces QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH
41quiz_attempts_report::ENROLLED_WITHOUT replaces QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH_NO
42
43* The clas "quiz_attempt_report" ahd been renbamed as "quiz_attempts_report"