Verified Commit 230811cb authored by Hugo Kerstens's avatar Hugo Kerstens
Browse files

Only check problem size for templated exams

parent e375ce64
......@@ -97,10 +97,11 @@ class Problems(Resource):
msg = f"Exam with id {exam_id} doesn't exist"
return dict(status=400, message=msg), 400
page_size = current_app.config['PAGE_FORMATS'][current_app.config['PAGE_FORMAT']]
if not (0 <= args['x'] < args['width'] + args['x'] < page_size[0]
and 0 <= args['y'] < args['height'] + args['y'] < page_size[1]):
return dict(status=409, message='Problem size exceeds the page size.'), 409
if exam.layout == ExamLayout.templated:
page_size = current_app.config['PAGE_FORMATS'][current_app.config['PAGE_FORMAT']]
if not (0 <= args['x'] < args['width'] + args['x'] < page_size[0]
and 0 <= args['y'] < args['height'] + args['y'] < page_size[1]):
return dict(status=409, message='Problem size exceeds the page size.'), 409
widget = ProblemWidget(
x=args['x'],
......
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