Commit 3a6d45e7 by John Jarvis

Grade a student even if they are on the restricted list

parent 0f39e046
...@@ -164,31 +164,29 @@ class XQueueCertInterface(object): ...@@ -164,31 +164,29 @@ class XQueueCertInterface(object):
if is_whitelisted or grade['grade'] is not None: if is_whitelisted or grade['grade'] is not None:
# check to see whether the student is on the
# the embargoed country restricted list
if self.restricted.filter(user=student).exists():
cert.status = status.restricted
cert.save()
return cert.status
cert_status = status.generating
key = make_hashkey(random.random()) key = make_hashkey(random.random())
cert.status = cert_status
cert.grade = grade['percent'] cert.grade = grade['percent']
cert.user = student cert.user = student
cert.course_id = course_id cert.course_id = course_id
cert.key = key cert.key = key
cert.name = profile.name cert.name = profile.name
contents = { # check to see whether the student is on the
'action': 'create', # the embargoed country restricted list
'username': student.username, # otherwise, put a new certificate request
'course_id': course_id, # on the queue
'name': profile.name, if self.restricted.filter(user=student).exists():
} cert.status = status.restricted
else:
self._send_to_xqueue(contents, key) contents = {
'action': 'create',
'username': student.username,
'course_id': course_id,
'name': profile.name,
}
cert.status = status.generating
self._send_to_xqueue(contents, key)
cert.save() cert.save()
else: else:
cert_status = status.notpassing cert_status = status.notpassing
......
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
% if cert_status['status'] == 'processing': % if cert_status['status'] == 'processing':
<p class="message-copy">Final course details are being wrapped up at <p class="message-copy">Final course details are being wrapped up at
this time. Your final standing will be available shortly.</p> this time. Your final standing will be available shortly.</p>
% elif cert_status['status'] in ('generating', 'ready', 'notpassing'): % elif cert_status['status'] in ('generating', 'ready', 'notpassing', 'restricted'):
<p class="message-copy">Your final grade: <p class="message-copy">Your final grade:
<span class="grade-value">${"{0:.0f}%".format(float(cert_status['grade'])*100)}</span>. <span class="grade-value">${"{0:.0f}%".format(float(cert_status['grade'])*100)}</span>.
% if cert_status['status'] == 'notpassing': % if cert_status['status'] == 'notpassing':
......
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