Commit db86b901 by Stephen Sanchez

Merge pull request #102 from edx/sanchez/fix-grading-incomplete-status

Updating the grading section to display all the remaining steps
parents b4fd1500 8dd156cc
......@@ -4,6 +4,6 @@
<div class="openassessment__grade__content">
<span class="grade__value">Not Completed</span>
<p>You have not completed the <span class="step">Peer Assessment</span> and <span class="step">Self Assessment</span> steps of this problem.</p>
<p>You have not completed the {% for step in incomplete_steps %}<span class="step">{{ step }} step </span> {% if not forloop.last %} and {% endif %}{% endfor %} of this problem.</p>
</div>
</div>
\ No newline at end of file
<!-- CASE: is incomplete and problem closed -->
<div id="openassessment__grade" class="openassessment__grade is--incomplete has--grade">
<div id="openassessment__grade" class="openassessment__grade is--unstarted">
<h2 class="openassessment__grade__title">Your Grade:</h2>
<div class="openassessment__grade__content">
<span class="grade__value">Not Completed</span>
<p>You did not complete the <span class="step">Peer Assessment</span> and <span class="step">Self Assessment</span> steps of this problem.</p>
<p>You have not started this problem</p>
</div>
</div>
\ No newline at end of file
from xblock.core import XBlock
from openassessment.assessment.peer_api import get_assessments
from openassessment.workflow import api as workflow_api
class GradeMixin(object):
......@@ -16,10 +15,11 @@ class GradeMixin(object):
@XBlock.handler
def render_grade(self, data, suffix=''):
problem_open, date = self.is_open()
workflow = self.get_workflow_info()
status = workflow.get('status')
context = {}
if workflow.get('status') == "done":
if status == "done":
path = 'openassessmentblock/grade/oa_grade_complete.html'
context = {
"score": workflow["score"],
......@@ -28,12 +28,17 @@ class GradeMixin(object):
for assessment in get_assessments(self.submission_uuid)
],
}
elif workflow.get('status') == "waiting":
elif status == "waiting":
path = 'openassessmentblock/grade/oa_grade_waiting.html'
elif not problem_open and date == "due":
path = 'openassessmentblock/grade/oa_grade_closed.html'
elif not status:
path = 'openassessmentblock/grade/oa_grade_not_started.html'
else:
incomplete_steps = []
if not workflow["status_details"]["peer"]["complete"]:
incomplete_steps.append("Peer Assessment")
if not workflow["status_details"]["self"]["complete"]:
incomplete_steps.append("Self Assessment")
context = {"incomplete_steps": incomplete_steps}
path = 'openassessmentblock/grade/oa_grade_incomplete.html'
# TODO: How do we determine which modules are incomplete?
return self.render_assessment(path, context)
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