mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-27520 core_grades: accept feedback files via grade_update()
This commit is contained in:
parent
3cced42eb3
commit
5d7a9ea6f9
5 changed files with 158 additions and 4 deletions
|
@ -1864,9 +1864,19 @@ class grade_item extends grade_object {
|
|||
* @param int $dategraded A timestamp of when the student's work was graded
|
||||
* @param int $datesubmitted A timestamp of when the student's work was submitted
|
||||
* @param grade_grade $grade A grade object, useful for bulk upgrades
|
||||
* @param array $feedbackfiles An array identifying the location of files we want to copy to the gradebook feedback area.
|
||||
* Example -
|
||||
* [
|
||||
* 'contextid' => 1,
|
||||
* 'component' => 'mod_xyz',
|
||||
* 'filearea' => 'mod_xyz_feedback',
|
||||
* 'itemid' => 2
|
||||
* ];
|
||||
* @return bool success
|
||||
*/
|
||||
public function update_raw_grade($userid, $rawgrade=false, $source=NULL, $feedback=false, $feedbackformat=FORMAT_MOODLE, $usermodified=null, $dategraded=null, $datesubmitted=null, $grade=null) {
|
||||
public function update_raw_grade($userid, $rawgrade = false, $source = null, $feedback = false,
|
||||
$feedbackformat = FORMAT_MOODLE, $usermodified = null, $dategraded = null, $datesubmitted=null,
|
||||
$grade = null, array $feedbackfiles = []) {
|
||||
global $USER;
|
||||
|
||||
$result = true;
|
||||
|
@ -1929,6 +1939,7 @@ class grade_item extends grade_object {
|
|||
if ($feedback !== false and !$grade->is_overridden()) {
|
||||
$grade->feedback = $feedback;
|
||||
$grade->feedbackformat = $feedbackformat;
|
||||
$grade->feedbackfiles = $feedbackfiles;
|
||||
}
|
||||
|
||||
// update final grade if possible
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue