MDL-45580 assignfeedback_editpdf: Delete draft content on new submission

This commit is contained in:
Frederic Massart
2014-06-23 14:17:24 +08:00
parent 098f7dd438
commit 7dbbb848c6
2 changed files with 20 additions and 1 deletions
@@ -438,8 +438,10 @@ class document_services {
if (!empty($files)) {
$first = reset($files);
if (!$readonly && $first->get_timemodified() < $submission->timemodified) {
// Image files are stale - regenerate them, except in readonly mode.
// Image files are stale, we need to regenerate them, except in readonly mode.
// We also need to remove the draft annotations and comments associated with this attempt.
$fs->delete_area_files($contextid, $component, $filearea, $itemid);
page_editor::delete_draft_content($itemid);
$files = array();
} else {