diff --git a/course/grading.py b/course/grading.py index 5691309d0f4123abfffef7988bf730b1c1f82cdd..c7d42d76c4524814b8261fce91955f6c6c2ba54c 100644 --- a/course/grading.py +++ b/course/grading.py @@ -202,7 +202,9 @@ def grade_flow_page(pctx, flow_session_id, page_ordinal): grade_data = None shown_grade = None - if fpctx.page.expects_answer(): + page_expects_answer = fpctx.page.expects_answer() + + if page_expects_answer: if fpctx.prev_answer_visit is not None and prev_grade_id is None: answer_data = fpctx.prev_answer_visit.answer @@ -263,7 +265,7 @@ def grade_flow_page(pctx, flow_session_id, page_ordinal): # {{{ grading form - if (fpctx.page.expects_answer() + if (page_expects_answer and fpctx.page.is_answer_gradable() and fpctx.prev_answer_visit is not None and not flow_session.in_progress @@ -340,7 +342,7 @@ def grade_flow_page(pctx, flow_session_id, page_ordinal): max_points = None points_awarded = None - if (fpctx.page.expects_answer() + if (page_expects_answer and fpctx.page.is_answer_gradable()): max_points = fpctx.page.max_points(fpctx.page_data) if feedback is not None and feedback.correctness is not None: @@ -379,6 +381,7 @@ def grade_flow_page(pctx, flow_session_id, page_ordinal): "points_awarded": points_awarded, "shown_grade": shown_grade, "prev_grade_id": prev_grade_id, + "expects_answer": page_expects_answer, "grading_opportunity": grading_opportunity, diff --git a/course/templates/course/flow-page.html b/course/templates/course/flow-page.html index 5b88808776d6ec4d424d0495a0a7028854ab169a..824de5f15483325774756af2a4e5f0e28344c768 100644 --- a/course/templates/course/flow-page.html +++ b/course/templates/course/flow-page.html @@ -155,23 +155,23 @@ {# }}} #} {# {{{ past submissions #} - -