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
eb3d3a99
Commit
eb3d3a99
authored
May 28, 2015
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8246 from edx/christina/TNL-2251
Fix bug when student scoring error occurs with no message.
parents
9b0588db
4d4e2609
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
lms/djangoapps/instructor_task/tasks_helper.py
+4
-1
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
+4
-3
No files found.
lms/djangoapps/instructor_task/tasks_helper.py
View file @
eb3d3a99
...
@@ -798,8 +798,11 @@ def upload_problem_grade_report(_xmodule_instance_args, _entry_id, course_id, _t
...
@@ -798,8 +798,11 @@ def upload_problem_grade_report(_xmodule_instance_args, _entry_id, course_id, _t
student_fields
=
[
getattr
(
student
,
field_name
)
for
field_name
in
header_row
]
student_fields
=
[
getattr
(
student
,
field_name
)
for
field_name
in
header_row
]
task_progress
.
attempted
+=
1
task_progress
.
attempted
+=
1
if
err_msg
:
if
'percent'
not
in
gradeset
or
'raw_scores'
not
in
gradeset
:
# There was an error grading this student.
# There was an error grading this student.
# Generally there will be a non-empty err_msg, but that is not always the case.
if
not
err_msg
:
err_msg
=
u"Unknown error"
error_rows
.
append
(
student_fields
+
[
err_msg
])
error_rows
.
append
(
student_fields
+
[
err_msg
])
task_progress
.
failed
+=
1
task_progress
.
failed
+=
1
continue
continue
...
...
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
View file @
eb3d3a99
...
@@ -441,6 +441,7 @@ class TestInstructorDetailedEnrollmentReport(TestReportMixin, InstructorTaskCour
...
@@ -441,6 +441,7 @@ class TestInstructorDetailedEnrollmentReport(TestReportMixin, InstructorTaskCour
self
.
assertEqual
(
row
[
column_header
],
expected_cell_content
)
self
.
assertEqual
(
row
[
column_header
],
expected_cell_content
)
@ddt.ddt
class
TestProblemGradeReport
(
TestReportMixin
,
InstructorTaskModuleTestCase
):
class
TestProblemGradeReport
(
TestReportMixin
,
InstructorTaskModuleTestCase
):
"""
"""
Test that the problem CSV generation works.
Test that the problem CSV generation works.
...
@@ -510,14 +511,14 @@ class TestProblemGradeReport(TestReportMixin, InstructorTaskModuleTestCase):
...
@@ -510,14 +511,14 @@ class TestProblemGradeReport(TestReportMixin, InstructorTaskModuleTestCase):
@patch
(
'instructor_task.tasks_helper._get_current_task'
)
@patch
(
'instructor_task.tasks_helper._get_current_task'
)
@patch
(
'instructor_task.tasks_helper.iterate_grades_for'
)
@patch
(
'instructor_task.tasks_helper.iterate_grades_for'
)
def
test_grading_failure
(
self
,
mock_iterate_grades_for
,
_mock_current_task
):
@ddt.data
(
u'Cannöt grade student'
,
''
)
def
test_grading_failure
(
self
,
error_message
,
mock_iterate_grades_for
,
_mock_current_task
):
"""
"""
Test that any grading errors are properly reported in the progress
Test that any grading errors are properly reported in the progress
dict and uploaded to the report store.
dict and uploaded to the report store.
"""
"""
# mock an error response from `iterate_grades_for`
# mock an error response from `iterate_grades_for`
student
=
self
.
create_student
(
u'username'
,
u'student@example.com'
)
student
=
self
.
create_student
(
u'username'
,
u'student@example.com'
)
error_message
=
u'Cannöt grade student'
mock_iterate_grades_for
.
return_value
=
[
mock_iterate_grades_for
.
return_value
=
[
(
student
,
{},
error_message
)
(
student
,
{},
error_message
)
]
]
...
@@ -531,7 +532,7 @@ class TestProblemGradeReport(TestReportMixin, InstructorTaskModuleTestCase):
...
@@ -531,7 +532,7 @@ class TestProblemGradeReport(TestReportMixin, InstructorTaskModuleTestCase):
u'Student ID'
:
unicode
(
student
.
id
),
u'Student ID'
:
unicode
(
student
.
id
),
u'Email'
:
student
.
email
,
u'Email'
:
student
.
email
,
u'Username'
:
student
.
username
,
u'Username'
:
student
.
username
,
u'error_msg'
:
error_message
u'error_msg'
:
error_message
if
error_message
else
"Unknown error"
}
}
])
])
...
...
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