Commit 4feb3c6b authored by Ruben Young On's avatar Ruben Young On

Changed the way problems are fetched in pregrading

parent d7caab4f
Pipeline #18650 failed with stages
in 3 minutes and 47 seconds
......@@ -19,9 +19,13 @@ def grade_mcq(sub, page, page_img):
page_img : np.array
image of the page
"""
problems_on_page = [prob for prob in sub.exam.problems if prob.widget.page == page]
problems_to_grade = [
sol.problem
for sol in sub.solutions
if sol.graded_id and sol.problem.widget.page == page
]
for problem in problems_on_page:
for problem in problems_to_grade:
sol = Solution.query.filter(Solution.problem_id == problem.id, Solution.submission_id == sub.id).one()
for mc_option in problem.mc_options:
......
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