Commit 11742f35 authored by Adrià Labay's avatar Adrià Labay
Browse files

use global method to retrieve exam pdf path

parent 72dea954
import os
from flask import current_app as app
from flask_restful import Resource, reqparse
from pdfrw import PdfReader
from ..database import db, Exam, Submission, Student, Copy, Solution, ExamLayout
from ..pdf_generation import exam_pdf_path
def copy_to_data(copy):
......@@ -182,7 +181,7 @@ class MissingPages(Resource):
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)
PdfReader(exam_pdf_path(exam.id)).pages)
))
elif exam.layout == ExamLayout.unstructured:
all_pages = set(problem.widget.page for problem in exam.problems)
......
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