Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a66d4e48
Commit
a66d4e48
authored
Jul 24, 2015
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9054 from edx/christina/tnl-2848
Sort the grade cutoffs.
parents
a7635f81
1b93dd12
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
+10
-1
lms/djangoapps/instructor/views/instructor_dashboard.py
+2
-1
No files found.
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
View file @
a66d4e48
...
...
@@ -33,7 +33,9 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase):
Set up tests
"""
super
(
TestInstructorDashboard
,
self
)
.
setUp
()
self
.
course
=
CourseFactory
.
create
()
self
.
course
=
CourseFactory
.
create
(
grading_policy
=
{
"GRADE_CUTOFFS"
:
{
"A"
:
0.75
,
"B"
:
0.63
,
"C"
:
0.57
,
"D"
:
0.5
}}
)
self
.
course_mode
=
CourseMode
(
course_id
=
self
.
course
.
id
,
mode_slug
=
"honor"
,
...
...
@@ -234,3 +236,10 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase):
expected_result
,
'CCX Coaches are able to create their own Custom Courses based on this course'
in
response
.
content
)
def
test_grade_cutoffs
(
self
):
"""
Verify that grade cutoffs are displayed in the correct order.
"""
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertIn
(
'D: 0.5, C: 0.57, B: 0.63, A: 0.75'
,
response
.
content
)
lms/djangoapps/instructor/views/instructor_dashboard.py
View file @
a66d4e48
...
...
@@ -349,8 +349,9 @@ def _section_course_info(course, access):
section_data
[
'detailed_gitlogs_url'
]
=
reverse
(
'gitlogs_detail'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)})
try
:
sorted_cutoffs
=
sorted
(
course
.
grade_cutoffs
.
items
(),
key
=
lambda
i
:
i
[
1
],
reverse
=
True
)
advance
=
lambda
memo
,
(
letter
,
score
):
"{}: {}, "
.
format
(
letter
,
score
)
+
memo
section_data
[
'grade_cutoffs'
]
=
reduce
(
advance
,
course
.
grade_cutoffs
.
items
()
,
""
)[:
-
2
]
section_data
[
'grade_cutoffs'
]
=
reduce
(
advance
,
sorted_cutoffs
,
""
)[:
-
2
]
except
Exception
:
# pylint: disable=broad-except
section_data
[
'grade_cutoffs'
]
=
"Not Available"
# section_data['offline_grades'] = offline_grades_available(course_key)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment