Skip to content

Commit

Permalink
Merge branch 'MDL-47397-26' of git://github.com/FMCorz/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_26_STABLE
  • Loading branch information
danpoltawski committed Oct 24, 2014
2 parents 8322bda + bb83e02 commit 1828700
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions mod/assign/feedback/editpdf/classes/page_editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,23 @@ public static function copy_drafts_from_to($assignment, $grade, $sourceuserid) {
$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;
}

Expand Down
4 changes: 2 additions & 2 deletions mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ Feature: In an assignment, teacher can annotate PDF files during grading
And I follow "View/grade all submissions"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I follow "Launch PDF editor..."
And I click on ".linebutton" "css_element"
And I drag ".drawingcanvas" "css_element" and I drop it in ".assignfeedback_editpdf_widget" "css_element"
And I click on ".stampbutton" "css_element"
And I click on ".drawingcanvas" "css_element"
And I click on "Close" "button"
And I press "Save changes"
And I should see "The grade changes were saved"
Expand Down

0 comments on commit 1828700

Please sign in to comment.