1 This files describes API changes in the assign code.
4 * The mod_assign_base_testcase unit test base class has been deprecated.
5 It encouraged poor unit test design and led to significant performance issues with unit tests. See MDL-55609 for
7 * The function can_grade() now has optional $user parameter.
8 * Feedback plugins can now specify whether or not they want to attach files to the
9 feedback that is stored in the gradebook via the new method files_for_gradebook().
10 An example of what this method would return is -
12 'contextid' => $modulecontext->id,
13 'component' => ASSIGNFEEDBACK_XYZ_COMPONENT,
14 'filearea' => ASSIGNFEEDBACK_XYZ_FILEAREA,
15 'itemid' => $grade->id
19 * Functions assign:get_assign_grading_summary_renderable, assign:can_view_submission, assign:count_submissions_with_status,
20 assign:count_submissions_need_grading and mod_assign_external::get_submission_status now admit an additional group parameter.
21 This parameter can be used to force those functions to retrieve data only for the given group.
24 * assign::add_attempt requires that set_most_recent_team_submission() be called if attempting to use this function with a team
28 * assign_refresh_events() Now takes two additional parameters to refine the update to a specific instance. This function
29 now optionally takes the module instance object or ID, and the course module object or ID. Please try to send the full
30 objects instead of the ids to save DB calls.
33 * All pluginfile file serving functions now pass through the options to send_stored_file() (all assignment plugins should do
35 * Fixed calendar event types for overridden due dates from 'close' to 'due'.
36 * Removed calendar event type of 'open', since mod_assign only has the 'due' event type. No point in creating an override event
37 for an event type that does not exist.
40 * External function mod_assign_external::get_assignments now returns additional optional fields:
41 - preventsubmissionnotingroup: Prevent submission not in group.
42 - submissionstatement and submissionstatementformat: When there is a submission statement defined.
43 * Proper checking for empty submissions
44 * Submission modification time checking - this will help students working in groups not clobber each others'
46 * External functions that were returning file information now return the following file fields:
47 filename, filepath, mimetype, filesize, timemodified and fileurl.
48 Those fields are now marked as VALUE_OPTIONAL for backwards compatibility.
49 Please, note that previously the filename was part of the filepath field, now they are separated.
50 * Submission and feedback plugins can now specify file areas related to their configuration data,
51 which will then be included in backup and restore; see assign_plugin::get_config_file_areas().
52 * Submission and feedback plugins must now return the specific list of configs available for external functions,
53 this can be done implementing the new assign plugin method get_config_for_external()
54 * Webservice function mod_assign_get_submissions returns a new field 'gradingstatus' from each submission.
57 * The feedback plugins now need to implement the is_feedback_modified() method. The default is to return true
58 for backwards compatibiltiy.
59 * When downloading all submissions as a zip each students' files are in a separate folder, are no longer renamed
60 and the folder structure is kept intact.
63 * assign_submission_status renderable now requires $usergroups in its constructor
64 * External function mod_assign_external::get_assignments now have a new optional parameter: includenotenrolledcourses.
65 Its default value is false, setting it to true will return assignments for courses a user can see even if it's not enroled.
68 * External parameter now returns PARAM_RAW instead of PARAM_TEXT for webservices using feedback comments.
69 * External function mod_assign_external::get_assignments now returns additional optional fields:
70 - intro: Assignment intro.
71 - introformat: Intro format.
72 - introattachments: Intro attachments files.
75 * Some DB changes were made to simplify the SQL required to query the latest attempt.
76 - The assign_submission table now has a column "latest" which is set to 1 for the latest submission attempt.
77 - There will always be a submission row if there is a grade (so the latest grade can be found by joining with the submission)
78 - There is a new submission status "new" for a submission that has never been attempted by a student (but the record exists purely
79 to mark the latest attempt number as 0). The function get_user_submission will create a record with the status set to "new"
80 by default (the previous default was "draft").
84 * Added setting sendstudentnotifications to assign DB table with admin defaults. This sets the default value for the
85 "Notify students" option on the grading forms. This setting can be retrieved via webservices.
87 * Web service function mod_assign_save_grade has an additional optional parameter $advancedgradingdata which allows
88 advanced grading data to be used.
89 * A new web service function mod_assign_save_grades has been added which allows multiple grades to be processed.
90 * The event submission_updated() [mod/assign/classes/event/submission_updated.php] has been altered to now be an abstract class
91 for submission events in the submission plug-ins.
95 * format_text() is no longer used for formating assignment content to be used in events (assign_submission_onlinetext::save()) or
96 the word count (assign_submission_onlinetext::format_for_log()) in mod/assign/submission/onlinetext/locallib.php. format_text()
97 should only be used when displaying information to the screen. It was being used incorrectly before in these areas. Plugins using
98 the event assessable_uploaded() should use file_rewrite_pluginfile_urls() to translate the text back to the desired output.
101 * To see submission/grades of inactive users, user should have moodle/course:viewsuspendedusers capability.
102 * count_* functions will return only active participants.
103 * assign_submission_plugin->lock and unlock methods have an additional parameter for user flags. A user will not
104 always have a submission record when the submission is locked/unlocked.
105 * Submission and feedback plugins can now participate in webservices. The plugin must implement get_external_parameters()
106 to describe the parameters it is expecting from the mod_assign_save_grade or mod_assign_save_submission functions. The
107 plugin will then handle the webservice via it's normal save() method with the extra data supplied in the $data argument.
111 * New feature - Attempt History
113 This adds settings so that a student can have build up a history of separate submission attempts and grades for the same
116 Extra settings on the assign table are:
117 attemptreopenmethod - The way attempts can be reopened. One of:
118 ASSIGN_ATTEMPT_REOPEN_METHOD_NONE - Attempts cannot be reopened (default)
119 ASSIGN_ATTEMPT_REOPEN_METHOD_UNTIL_PASS - Attempts are reopened on grading until the gradebook
120 indicates this student has passed.
121 ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL - Attempts are reopened on manually by the grader.
122 maxattempts - The maximum allowed number of attempts per student for this assign instance.
124 Extra settings on the submission and grade records:
125 attemptnumber - Starting from 0 until the latest attempt.
127 New table assign_user_flags holds user specific flags that were stored in the assign_grade table. (contains assignment,
128 userid, extensionduedate, mailed and locked)
131 "get_user_grade" function has an extra optional parameter to retrieve a specific attempt number.
132 "get_user_submission" function has an extra optional parameter to retrieve a specific attempt number.
133 "get_group_submission" function has an extra optional parameter to retrieve a specific attempt number.
134 new "get_user_flags" function can retrieve the user flags for a specific user (extensionduedate, mailed and locked).
135 new "update_user_flags" function can update the user flags for a specific user (extensionduedate, mailed and locked).
137 assign_submission_plugin changes:
138 "precheck_submission" function now takes a submission record so you can determine which submission is being checked.
139 "submit_for_grading" function now takes a submission record so you can determine which submission is being submitted.
140 new function "copy_submission" can be implemented to copy submission data from one submission to a new one.
142 New renderable object "assign_attempt_history" for rendering the list of previous submissions.
143 New renderable object "assign_gradingmessage" for rendering a generic grading message.
145 assign_grading_table changes:
146 get_group_and_submission is now protected and should not be called from outside this class.
149 === Earlier changes ===
151 * Were not documented in this way. Sorry.