Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
This files describes API changes for quiz report plugins.Overview of this plugin type at http://docs.moodle.org/dev/Quiz_reports=== 4.4 ===* The function quiz_grading_report::format_count_for_table now requires a string identifier anda component identifier so that it is possible to address strings outside ofquiz/report/grading/lang/en/quiz_grading.php.* The function quiz_grading_renderer::render_grade_link now requires a string identifier anda component identifier so that it is possible to address strings outside ofquiz/report/grading/lang/en/quiz_grading.php.=== 4.2 ===* There was an ill-advised, never documented, API change in quiz_report_get_significant_questionsin Moodle 4.0. The API has now been reverted to how it was before 4.0. Hopefully thiswill not cause anyone a problem. (The API revert did not require any changes in any automated testsor standard quiz reports.)* The quiz has a lot of old classes in lib.php files. These have now been moved into the classes folder,and so are now in namespaces. Because of Moodle's class renaming support, your code should continueworking, but output deprecated warnings, so you probably want to update. This should mostly bedoable by adding use statements, and a search/replace.- quiz_default_report => mod_quiz\local\reports\report_base- quiz_attempts_report => mod_quiz\local\reports\attempts_report- mod_quiz_attempts_report_form => mod_quiz\local\reports\attempts_report_options_form- mod_quiz_attempts_report_options => mod_quiz\local\reports\attempts_report_options- quiz_attempts_report_table => mod_quiz\local\reports\attempts_report_tableAs part of the clean-up, the following files are no longer required, and if you try toinclude them, you will get a debugging notices telling you not to:- mod/quiz/report/attemptsreport.php- mod/quiz/report/attemptsreport_form.php- mod/quiz/report/attemptsreport_options.php- mod/quiz/report/attemptsreport_table.php- mod/quiz/report/default.php* Final deprecation (complete removal) of the following functions which were deprecated long ago:- attempts_report::load_relevant_students - deprecated in 3.2- quiz_statistics_graph_get_new_colour - deprecated since 3.2- The file mod/quiz/report/overview/overviewgraph.php - deprecated since 3.2- The file mod/quiz/report/statistics/statistics_graph.php - deprecated since 3.2=== 3.9 ===* Quiz report plugins defining capabilities used to require an extra string like$string['statistics:componentname'] = 'Quiz statistics report';in addition to$string['pluginname'] = 'Statistics';This is no longer required.=== 3.8 ===* New quiz_attempts_report_table method: \quiz_attempts_report_table::checkbox_col_header()This generates a column header containing a checkbox that toggles the checked state of all the checkboxes corresponding to theentries listed on a given quiz report table. It requires the name of the checkbox column as a parameter in order to disablesorting on the checkbox column.=== 3.2 ===* A code refactoring based on new sql functions in MDL-31243 and removingget_users_by_capability from the quiz reports in MDL-27072. The classquiz_attempts_report is now initialised to return \core\dml\sql_join (joins,wheres, params) rather than arrays of userids. This allows the use of joinsin quiz report queries and is very important when thereare larger numbers of enrolled users. The signature of many quiz reportmethods now includes '$studentsjoins', rather than '$students' and similarfor '$groupstudentsjoins', '$allowedjoins' and '$usersjoins'. For clearexamples of the use of these changes please see attemptsreport_table.phpbase_sql() or almost any function in overview/report.php. The protectedfunction quiz_attempts_report::load_relevant_students is deprecated,please use quiz_attempts_report::get_students_joins() instead.=== 2.6 ===* Improving the display page and heading levels to have a proper nesting.We are reducing the amount of white spaces for the top report by making'separate group' options and attempts to be displayed inline.In grading report, we are changing 'no questions' from using heading tonotification message. (MDL-41615)=== 2.3 ===* Support for the old way of doing cron in a separate cron.php file has been removed.Instead, you need a lib.php file inside the plugin with a cron functioncalled quiz_myreportname_cron(). The statistics report is an example of howit should be done.* There was a big refactor of the quiz reports, in issues MDL-32300, MDL-32322 and MDL-3030.It is difficult to explain the changes. Probably the best way to understand whathappened is to look atgit log mod/quiz/report/overviewgit log mod/quiz/report/responsesand so on. Here are some notes on a few of the changes:The class quiz_attempt_report was renamed to quiz_attempts_report (with an extra s).Some globally defined constants with the prefix QUIZ_REPORT_ATTEMPTS_ moved intothe quiz_attempts_report class. Specificallyquiz_attempts_report::ALL_WITH replaces QUIZ_REPORT_ATTEMPTS_ALLquiz_attempts_report::ENROLLED_ALL replaces QUIZ_REPORT_ATTEMPTS_ALL_STUDENTSquiz_attempts_report::ENROLLED_WITH replaces QUIZ_REPORT_ATTEMPTS_STUDENTS_WITHquiz_attempts_report::ENROLLED_WITHOUT replaces QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH_NOYour if you have a table class, it needs to be renamed likequiz_report_myreportname_table -> quiz_myreportname_table. That is, all theclass names in your plugin should start with the frankenstyle plugin namequiz_myreportname.=== 2.2 ===* Plugins should be converted to implement cron in the standard way. In lib.php,define afunction quiz_myreportname_cron() {};This replaces the old way of having a separate cron.php file. Also, the cronfrequency should be defined in version.php, not in the quiz_reports table.=== earlier versions ===* ... API changes were not documented properly. Sorry. (There weren't many!)