mirror of
https://github.com/moodle/moodle.git
synced 2025-04-07 09:23:31 +02:00
MDL-47397 assignfeedback_editpdf: Copy stamps to other students in team
During a team submission the stamps were attached to the user that was graded and not to the other users. This could lead to errors when generating the PDF for each user.
This commit is contained in:
parent
47ff1cd93b
commit
20942dd702
@ -338,6 +338,23 @@ class page_editor {
|
||||
$DB->insert_record('assignfeedback_editpdf_cmnt', $comment);
|
||||
}
|
||||
|
||||
// Delete the existing stamps and copy the source ones.
|
||||
$fs = get_file_storage();
|
||||
$fs->delete_area_files($assignment->get_context()->id, 'assignfeedback_editpdf', 'stamps', $grade->id);
|
||||
if ($files = $fs->get_area_files($assignment->get_context()->id,
|
||||
'assignfeedback_editpdf',
|
||||
'stamps',
|
||||
$sourceusergrade->id,
|
||||
"filename",
|
||||
false)) {
|
||||
foreach ($files as $file) {
|
||||
$newrecord = new \stdClass();
|
||||
$newrecord->contextid = $assignment->get_context()->id;
|
||||
$newrecord->itemid = $grade->id;
|
||||
$fs->create_file_from_storedfile($newrecord, $file);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user