From 332f81a27cd96d39bf6db694b65936fac2590e5a Mon Sep 17 00:00:00 2001 From: dzhuang Date: Sat, 23 Sep 2017 14:06:12 +0800 Subject: [PATCH] No history submission/grading dropdown for pages not expects_answer --- course/grading.py | 9 +- course/templates/course/flow-page.html | 110 +++++++++--------- course/templates/course/grade-flow-page.html | 113 ++++++++++--------- 3 files changed, 120 insertions(+), 112 deletions(-) diff --git a/course/grading.py b/course/grading.py index 5691309d..c7d42d76 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 5b888087..824de5f1 100644 --- a/course/templates/course/flow-page.html +++ b/course/templates/course/flow-page.html @@ -155,23 +155,23 @@ {# }}} #} {# {{{ past submissions #} - -