MDL-66626 assignfeedback_editpdf: Count files outside of foreach loop.

Co-Authored-By: John Yao <johnyao@catalyst-au.net>
This commit is contained in:
Mikhail Golenkov 2020-07-20 16:42:47 +10:00
parent 94fdac9117
commit 78572f186d

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);