Merge branch 'MOODLE_38_MDL-66626' of https://github.com/golenkovm/moodle into MOODLE_38_STABLE

This commit is contained in:
Adrian Greeve
2020-08-06 09:08:26 +08:00
2 changed files with 10 additions and 8 deletions
+7 -7
View File
@@ -125,14 +125,14 @@ if ($action === 'pollconversions') {
$annotations = page_editor::get_annotations($grade->id, $index, $draft);
$page->annotations = $annotations;
$response->pages[] = $page;
$component = 'assignfeedback_editpdf';
$filearea = document_services::PAGE_IMAGE_FILEAREA;
$filepath = '/';
$fs = get_file_storage();
$files = $fs->get_directory_files($context->id, $component, $filearea, $grade->id, $filepath);
$response->pageready = count($files);
}
$component = 'assignfeedback_editpdf';
$filearea = document_services::PAGE_IMAGE_FILEAREA;
$filepath = '/';
$fs = get_file_storage();
$files = $fs->get_directory_files($context->id, $component, $filearea, $grade->id, $filepath);
$response->pageready = count($files);
}
echo json_encode($response);
@@ -576,7 +576,9 @@ EOD;
}
}
if (empty($pages)) {
$totalpagesforattempt = self::page_number_for_attempt($assignment, $userid, $attemptnumber, false);
// Here we are comparing the total number of images against the total number of pages from the combined PDF.
if (empty($pages) || count($pages) != $totalpagesforattempt) {
if ($readonly) {
// This should never happen, there should be a version of the pages available
// whenever we are requesting the readonly version.