diff --git a/zesje/resources/submissions.py b/zesje/resources/submissions.py
index 7c9e929dc00ed4fcda56c197410e671dbc2948e5..0acedcbc3875d15596282c74ebcc85476bab46cc 100644
--- a/zesje/resources/submissions.py
+++ b/zesje/resources/submissions.py
@@ -1,8 +1,45 @@
+import re
+
 from flask_restful import Resource, reqparse
 from pony import orm
 
 from ..models import Exam, Submission, Student
 
+page_match = re.compile(r'.*page(\d+).jpg').match
+
+
+def page_nr(path):
+    return int(page_match(path).group(1))
+
+
+def sub_to_data(sub, all_pages):
+    """Transform a submission into a data structure frontend expects."""
+    return {
+        'id': sub.copy_number,
+        'student':
+            {
+                'id': sub.student.id,
+                'firstName': sub.student.first_name,
+                'lastName': sub.student.last_name,
+                'email': sub.student.email
+            } if sub.student else None,
+        'validated': sub.signature_validated,
+        'problems':
+        [
+            {
+                'id': sol.problem.id,
+                'graded_by': sol.graded_by,
+                'graded_at': sol.graded_at.isoformat() if sol.graded_at else None,
+                'feedback': [
+                    fb.id for fb in sol.feedback
+                ],
+                'remark': sol.remarks
+            } for sol in sub.solutions.order_by(lambda s: s.problem.id)
+        ],
+        'missing_pages': sorted(all_pages - set(page_nr(i) for i in sub.pages.path)),
+    }
+
+
 class Submissions(Resource):
     """Getting a list of submissions, and assigning students to them."""
 
@@ -26,62 +63,27 @@ class Submissions(Resource):
                 Student that completed this submission, null if not assigned.
             validated: bool
                 True if the assigned student has been validated by a human.
+            problems: list of problems
+            missing_pages: list of int
+                pages that are missing from submission
         """
         # This makes sure we raise ObjectNotFound if the exam does not exist
         exam = Exam[exam_id]
 
+        all_pages = set(page_nr(i) for i in exam.submissions.pages.path)
+
         if submission_id is not None:
             sub = Submission.get(exam=exam, copy_number=submission_id)
             if not sub:
                 raise orm.core.ObjectNotFound(Submission)
-            return {
-                'id': sub.copy_number,
-                'student':
-                    {
-                        'id': sub.student.id,
-                        'firstName': sub.student.first_name,
-                        'lastName': sub.student.last_name,
-                        'email': sub.student.email
-                    } if sub.student else None,
-                'validated': sub.signature_validated,
-                'problems':
-                [
-                    {
-                        'id': sol.problem.id,
-                        'graded_by': sol.graded_by,
-                        'graded_at': sol.graded_at.isoformat() if sol.graded_at else None,
-                        'feedback': [
-                            fb.id for fb in sol.feedback
-                        ],
-                        'remark': sol.remarks
-                    } for sol in sub.solutions.order_by(lambda s: s.problem.id)
-                ]
-            }
+
+            return sub_to_data(sub, all_pages)
 
         return [
-            {
-                'id': sub.copy_number,
-                'student':
-                    {
-                        'id': sub.student.id,
-                        'firstName': sub.student.first_name,
-                        'lastName': sub.student.last_name,
-                        'email': sub.student.email
-                    } if sub.student else None,
-                'validated': sub.signature_validated,
-                'problems':
-                [
-                    {
-                        'id': sol.problem.id,
-                        'graded_by': sol.graded_by,
-                        'graded_at': sol.graded_at.isoformat() if sol.graded_at else None,
-                        'feedback': [
-                            fb.id for fb in sol.feedback
-                        ],
-                        'remark': sol.remarks
-                    } for sol in sub.solutions.order_by(lambda s: s.problem.id)
-                ]
-            } for sub in Submission.select(lambda s: s.exam == exam).order_by(lambda s: s.copy_number)
+            sub_to_data(sub, all_pages) for sub
+            in (Submission
+                .select(lambda s: s.exam == exam)
+                .order_by(lambda s: s.copy_number))
         ]
 
     put_parser = reqparse.RequestParser()