Commit 72dea954 authored by Adrià Labay's avatar Adrià Labay
Browse files

fix counting of missing pages

parent 751dadf4
......@@ -180,9 +180,13 @@ class MissingPages(Resource):
if exam is None:
return dict(status=404, message='Exam does not exist.'), 404
all_pages = set(range(len(
PdfReader(os.path.join(app.config['DATA_DIRECTORY'], f'{exam_id}_data/exam.pdf')).pages)
))
if exam.layout == ExamLayout.templated:
all_pages = set(range(len(
PdfReader(os.path.join(app.config['DATA_DIRECTORY'], f'{exam_id}_data/exam.pdf')).pages)
))
elif exam.layout == ExamLayout.unstructured:
all_pages = set(problem.widget.page for problem in exam.problems)
return [
{
'number': copy.number,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment