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
9bedb066
Commit
9bedb066
authored
May 10, 2017
by
sanfordstudent
Committed by
GitHub
May 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15084 from edx/neem/grade_report_revert
Revert "Fix column alignment issue when Teams is disabled"
parents
1bbde007
b6b70401
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
23 deletions
+12
-23
lms/djangoapps/instructor_task/tasks_helper/grades.py
+2
-6
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
+10
-17
No files found.
lms/djangoapps/instructor_task/tasks_helper/grades.py
View file @
9bedb066
...
...
@@ -134,8 +134,7 @@ class _CertificateBulkContext(object):
class
_TeamBulkContext
(
object
):
def
__init__
(
self
,
context
,
users
):
self
.
enabled
=
context
.
teams_enabled
if
self
.
enabled
:
if
context
.
teams_enabled
:
self
.
teams_by_user
=
{
membership
.
user
.
id
:
membership
.
team
.
name
for
membership
in
...
...
@@ -327,10 +326,7 @@ class CourseGradeReport(object):
"""
Returns a list of names of teams in which the given user belongs.
"""
team_names
=
[]
if
bulk_teams
.
enabled
:
team_names
=
[
bulk_teams
.
teams_by_user
.
get
(
user
.
id
,
''
)]
return
team_names
return
[
bulk_teams
.
teams_by_user
.
get
(
user
.
id
,
''
)]
def
_user_verification_mode
(
self
,
user
,
context
,
bulk_enrollments
):
"""
...
...
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
View file @
9bedb066
...
...
@@ -96,13 +96,10 @@ class InstructorGradeReportTestCase(TestReportMixin, InstructorTaskCourseTestCas
report_store
=
ReportStore
.
from_config
(
config_name
=
'GRADES_DOWNLOAD'
)
report_csv_filename
=
report_store
.
links_for
(
course_id
)[
0
][
0
]
report_path
=
report_store
.
path_to
(
course_id
,
report_csv_filename
)
found_user
=
False
with
report_store
.
storage
.
open
(
report_path
)
as
csv_file
:
for
row
in
unicodecsv
.
DictReader
(
csv_file
):
if
row
.
get
(
'
U
sername'
)
==
username
:
if
row
.
get
(
'
u
sername'
)
==
username
:
self
.
assertEqual
(
row
[
column_header
],
expected_cell_content
)
found_user
=
True
self
.
assertTrue
(
found_user
)
@ddt.ddt
...
...
@@ -304,7 +301,7 @@ class TestInstructorGradeReport(InstructorGradeReportTestCase):
user_b
.
username
,
course
.
id
,
cohort_name_header
,
u''
,
u'
Default Group
'
,
)
@patch
(
'lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task'
)
...
...
@@ -1232,11 +1229,13 @@ class TestTeamStudentReport(TestReportMixin, InstructorTaskCourseTestCase):
""" Run the upload_students_csv task and verify that the correct team was added to the CSV. """
current_task
=
Mock
()
current_task
.
update_state
=
Mock
()
task_input
=
[
'id'
,
'username'
,
'name'
,
'email'
,
'language'
,
'location'
,
'year_of_birth'
,
'gender'
,
'level_of_education'
,
'mailing_address'
,
'goals'
,
'team'
]
task_input
=
{
'features'
:
[
'id'
,
'username'
,
'name'
,
'email'
,
'language'
,
'location'
,
'year_of_birth'
,
'gender'
,
'level_of_education'
,
'mailing_address'
,
'goals'
,
'team'
]
}
with
patch
(
'lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task'
)
as
mock_current_task
:
mock_current_task
.
return_value
=
current_task
result
=
upload_students_csv
(
None
,
None
,
self
.
course
.
id
,
task_input
,
'calculated'
)
...
...
@@ -1244,13 +1243,10 @@ class TestTeamStudentReport(TestReportMixin, InstructorTaskCourseTestCase):
report_store
=
ReportStore
.
from_config
(
config_name
=
'GRADES_DOWNLOAD'
)
report_csv_filename
=
report_store
.
links_for
(
self
.
course
.
id
)[
0
][
0
]
report_path
=
report_store
.
path_to
(
self
.
course
.
id
,
report_csv_filename
)
found_user
=
False
with
report_store
.
storage
.
open
(
report_path
)
as
csv_file
:
for
row
in
unicodecsv
.
DictReader
(
csv_file
):
if
row
.
get
(
'username'
)
==
username
:
self
.
assertEqual
(
row
[
'team'
],
expected_team
)
found_user
=
True
self
.
assertTrue
(
found_user
)
def
test_team_column_no_teams
(
self
):
self
.
_generate_and_verify_teams_column
(
self
.
student1
.
username
,
UNAVAILABLE
)
...
...
@@ -1702,14 +1698,11 @@ class TestGradeReportEnrollmentAndCertificateInfo(TestReportMixin, InstructorTas
report_store
=
ReportStore
.
from_config
(
config_name
=
'GRADES_DOWNLOAD'
)
report_csv_filename
=
report_store
.
links_for
(
self
.
course
.
id
)[
0
][
0
]
report_path
=
report_store
.
path_to
(
self
.
course
.
id
,
report_csv_filename
)
found_user
=
False
with
report_store
.
storage
.
open
(
report_path
)
as
csv_file
:
for
row
in
unicodecsv
.
DictReader
(
csv_file
):
if
row
.
get
(
'
U
sername'
)
==
username
:
if
row
.
get
(
'
u
sername'
)
==
username
:
csv_row_data
=
[
row
[
column
]
for
column
in
self
.
columns_to_check
]
self
.
assertEqual
(
csv_row_data
,
expected_data
)
found_user
=
True
self
.
assertTrue
(
found_user
)
def
_create_user_data
(
self
,
user_enroll_mode
,
...
...
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