Commit cb1489a7 by John Jarvis Committed by Carlos Andrés Rocha

docstring cleanup, grading for regen_cert

parent df37f111
......@@ -80,13 +80,11 @@ class XQueueCertInterface(object):
Removes certificate for a student, will change
the certificate status to 'regenerating'.
Will invalidate the old certificate and generate
a new one.
When completed the certificate status will change
to 'downloadable'
Certificate must be in the 'error' or 'downloadable' state
and the student must have a passing grade.
Returns the certificate status.
otherwise it will return the current state
"""
......@@ -96,6 +94,11 @@ class XQueueCertInterface(object):
student, course_id)['status']
if cert_status in VALID_STATUSES:
# grade the student
course = courses.get_course_by_id(course_id)
grade = grades.grade(student, self.request, course)
if grade['grade'] is not None:
profile = UserProfile.objects.get(user=student)
try:
......@@ -132,8 +135,8 @@ class XQueueCertInterface(object):
return cert_status
def del_cert(self, student, course_id):
"""
"""
Arguments:
student - User.object
course_id - courseenrollment.course_id (string)
......@@ -141,10 +144,8 @@ class XQueueCertInterface(object):
Removes certificate for a student, will change
the certificate status to 'deleting'.
When completed the certificate status will change
to 'deleted'.
Returns the certificate status.
Certificate must be in the 'error' or 'downloadable' state
otherwise it will return the current state
"""
......@@ -189,19 +190,14 @@ class XQueueCertInterface(object):
student - User.object
course_id - courseenrollment.course_id (string)
Adds a new certificate request to the queue only if
the current certificate status is 'unavailable', 'error'
or 'deleted' and the student has a passing grade for
the course.
When completed the certificate status will change
to 'downloadable'.
Request a new certificate for a student.
Will change the certificate status to 'deleting'.
If the current status is 'generating', 'regenerating'
or 'deleting' this function will return that status
Certificate must be in the 'unavailable', 'error',
or 'deleted' state and the student must have
a passing grade.
Returns 'unavailable' if the student is eligible for
a certificate but does not have a passing grade.
otherwise it will return the current state
"""
......
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