From 474f810b3843432b1a41541d7d7f2e214b102faa Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Mon, 26 Nov 2012 16:29:45 -0500 Subject: [PATCH 1/7] Adding lowest_passing_grade() to CourseDescriptor --- common/lib/xmodule/xmodule/course_module.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 2b6232d366..3506c72bd7 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -149,6 +149,10 @@ class CourseDescriptor(SequenceDescriptor): def grade_cutoffs(self): return self._grading_policy['GRADE_CUTOFFS'] + @property + def lowest_passing_grade(self): + return min(self._grading_policy['GRADE_CUTOFFS'].values()) + @property def tabs(self): """ @@ -292,7 +296,7 @@ class CourseDescriptor(SequenceDescriptor): return False except: log.exception("Error parsing discussion_blackouts for course {0}".format(self.id)) - + return True @property From 631580ccaf9f4701c84c811b2e7a61adba1cfacf Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Mon, 26 Nov 2012 16:30:23 -0500 Subject: [PATCH 2/7] Changing grade info on the dashboard --- lms/templates/dashboard.html | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 177eb276af..a367c36b38 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -243,16 +243,13 @@ %>
- % if cert_status['status'] == 'processing': + % if cert_status['status'] in ('processing', 'generating'):

Final course details are being wrapped up at this time. Your final standing will be available shortly.

- % elif cert_status['status'] in ('generating', 'ready'): -

You have received a grade of - ${cert_status['grade']} - in this course.

- % elif cert_status['status'] == 'notpassing': -

You did not complete the necessary requirements for - completion of this course.

+ % elif cert_status['status'] in ('generating', 'ready', 'notpassing'): +

Your final grade: + ${cert_status['grade']}, + grade required for certificate: ${course.lowest_passing_grade()}.

% endif % if cert_status['show_disabled_download_button'] or cert_status['show_download_url'] or cert_status['show_survey_button']: From 9148d49ac72f98e929bf2045fc9db377105ba058 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Mon, 26 Nov 2012 16:57:00 -0500 Subject: [PATCH 3/7] lowest_passing_grade fix --- lms/templates/dashboard.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index a367c36b38..c293af0c29 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -249,7 +249,7 @@ % elif cert_status['status'] in ('generating', 'ready', 'notpassing'):

Your final grade: ${cert_status['grade']}, - grade required for certificate: ${course.lowest_passing_grade()}.

+ grade required for certificate: ${course.lowest_passing_grade}.

% endif % if cert_status['show_disabled_download_button'] or cert_status['show_download_url'] or cert_status['show_survey_button']: From 4e4a29e030b42e5e575902e2b8b597cc5c49007d Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Mon, 26 Nov 2012 17:40:55 -0500 Subject: [PATCH 4/7] Removing unnecessary test for 'generating' --- lms/templates/dashboard.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index c293af0c29..aa4dac98a0 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -246,7 +246,7 @@ % if cert_status['status'] in ('processing', 'generating'):

Final course details are being wrapped up at this time. Your final standing will be available shortly.

- % elif cert_status['status'] in ('generating', 'ready', 'notpassing'): + % elif cert_status['status'] in ('ready', 'notpassing'):

Your final grade: ${cert_status['grade']}, grade required for certificate: ${course.lowest_passing_grade}.

From d13509e6f303afd658721c94cea317b3d7f4eaa3 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Mon, 26 Nov 2012 17:42:55 -0500 Subject: [PATCH 5/7] Adding percentage formatting for final grade reporting --- lms/templates/dashboard.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index aa4dac98a0..cbba8bd4b5 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -248,8 +248,9 @@ this time. Your final standing will be available shortly.

% elif cert_status['status'] in ('ready', 'notpassing'):

Your final grade: - ${cert_status['grade']}, - grade required for certificate: ${course.lowest_passing_grade}.

+ ${"{0:.0f}%".format(float(cert_status['grade'])*100)}, + grade required for certificate: + ${"{0:.0f}%".format(float(course.lowest_passing_grade)*100)}.

% endif % if cert_status['show_disabled_download_button'] or cert_status['show_download_url'] or cert_status['show_survey_button']: From 792ddb4d8647628939609fe1682a86c3b037f486 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Mon, 26 Nov 2012 17:51:59 -0500 Subject: [PATCH 6/7] Show grade when certificate is generating --- lms/templates/dashboard.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index cbba8bd4b5..c254eb10ed 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -243,10 +243,10 @@ %>
- % if cert_status['status'] in ('processing', 'generating'): + % if cert_status['status'] == 'processing':

Final course details are being wrapped up at this time. Your final standing will be available shortly.

- % elif cert_status['status'] in ('ready', 'notpassing'): + % elif cert_status['status'] in ('generating', 'ready', 'notpassing'):

Your final grade: ${"{0:.0f}%".format(float(cert_status['grade'])*100)}, grade required for certificate: From 2db0efa2b4b617d8f2c3a8b6b7de932330dfaa89 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Mon, 26 Nov 2012 17:57:38 -0500 Subject: [PATCH 7/7] Only show certificate criteria for notpassing students --- lms/templates/dashboard.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index c254eb10ed..d9b57ac044 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -248,9 +248,12 @@ this time. Your final standing will be available shortly.

% elif cert_status['status'] in ('generating', 'ready', 'notpassing'):

Your final grade: - ${"{0:.0f}%".format(float(cert_status['grade'])*100)}, - grade required for certificate: - ${"{0:.0f}%".format(float(course.lowest_passing_grade)*100)}.

+ ${"{0:.0f}%".format(float(cert_status['grade'])*100)}. + % if cert_status['status'] == 'notpassing': + Grade required for a certificate: + ${"{0:.0f}%".format(float(course.lowest_passing_grade)*100)}. + % endif +

% endif % if cert_status['show_disabled_download_button'] or cert_status['show_download_url'] or cert_status['show_survey_button']: