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
7fcaa20c
Commit
7fcaa20c
authored
May 13, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3702 from edx/will/opaque-keys-ora-fixes
Will/opaque keys ora fixes
parents
741cdf95
c6a02870
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
22 deletions
+16
-22
lms/djangoapps/instructor/enrollment.py
+2
-2
lms/djangoapps/instructor/tests/test_enrollment.py
+9
-11
lms/djangoapps/instructor/tests/test_legacy_reset.py
+3
-7
lms/djangoapps/instructor/views/legacy.py
+2
-2
No files found.
lms/djangoapps/instructor/enrollment.py
View file @
7fcaa20c
...
@@ -191,8 +191,8 @@ def reset_student_attempts(course_id, student, module_state_key, delete_module=F
...
@@ -191,8 +191,8 @@ def reset_student_attempts(course_id, student, module_state_key, delete_module=F
if
delete_module
:
if
delete_module
:
sub_api
.
reset_score
(
sub_api
.
reset_score
(
anonymous_id_for_user
(
student
,
course_id
),
anonymous_id_for_user
(
student
,
course_id
),
course_id
,
course_id
.
to_deprecated_string
()
,
module_state_key
,
module_state_key
.
to_deprecated_string
()
,
)
)
module_to_reset
=
StudentModule
.
objects
.
get
(
module_to_reset
=
StudentModule
.
objects
.
get
(
...
...
lms/djangoapps/instructor/tests/test_enrollment.py
View file @
7fcaa20c
...
@@ -315,33 +315,31 @@ class TestInstructorEnrollmentStudentModule(TestCase):
...
@@ -315,33 +315,31 @@ class TestInstructorEnrollmentStudentModule(TestCase):
def
test_delete_submission_scores
(
self
):
def
test_delete_submission_scores
(
self
):
user
=
UserFactory
()
user
=
UserFactory
()
course
=
CourseFactory
.
create
()
problem_location
=
self
.
course_key
.
make_usage_key
(
'dummy'
,
'module'
)
problem_location
=
msk_from_problem_urlname
(
course
.
id
,
'b3dce2586c9c4876b73e7f390e42ef8f'
,
block_type
=
'openassessment'
)
# Create a student module for the user
# Create a student module for the user
StudentModule
.
objects
.
create
(
StudentModule
.
objects
.
create
(
student
=
user
,
student
=
user
,
course_id
=
course
.
id
,
course_id
=
self
.
course_key
,
module_state_key
=
problem_location
,
module_state_key
=
problem_location
,
state
=
json
.
dumps
({})
state
=
json
.
dumps
({})
)
)
# Create a submission and score for the student using the submissions API
# Create a submission and score for the student using the submissions API
student_item
=
{
student_item
=
{
'student_id'
:
anonymous_id_for_user
(
user
,
course
.
id
),
'student_id'
:
anonymous_id_for_user
(
user
,
self
.
course_key
),
'course_id'
:
course
.
id
,
'course_id'
:
self
.
course_key
.
to_deprecated_string
()
,
'item_id'
:
problem_location
,
'item_id'
:
problem_location
.
to_deprecated_string
()
,
'item_type'
:
'openassessment'
'item_type'
:
'openassessment'
}
}
submission
=
sub_api
.
create_submission
(
student_item
,
'test answer'
)
submission
=
sub_api
.
create_submission
(
student_item
,
'test answer'
)
sub_api
.
set_score
(
submission
[
'uuid'
],
1
,
2
)
sub_api
.
set_score
(
submission
[
'uuid'
],
1
,
2
)
# Delete student state using the instructor dash
# Delete student state using the instructor dash
reset_student_attempts
(
course
.
id
,
user
,
problem_location
,
delete_module
=
True
)
reset_student_attempts
(
self
.
course_key
,
user
,
problem_location
,
delete_module
=
True
)
# Verify that the student's scores have been reset in the submissions API
# Verify that the student's scores have been reset in the submissions API
score
=
sub_api
.
get_score
(
student_item
)
score
=
sub_api
.
get_score
(
student_item
)
...
...
lms/djangoapps/instructor/tests/test_legacy_reset.py
View file @
7fcaa20c
...
@@ -36,11 +36,7 @@ class InstructorResetStudentStateTest(ModuleStoreTestCase, LoginEnrollmentTestCa
...
@@ -36,11 +36,7 @@ class InstructorResetStudentStateTest(ModuleStoreTestCase, LoginEnrollmentTestCa
CourseEnrollmentFactory
.
create
(
user
=
self
.
student
,
course_id
=
self
.
course
.
id
)
CourseEnrollmentFactory
.
create
(
user
=
self
.
student
,
course_id
=
self
.
course
.
id
)
def
test_delete_student_state_resets_scores
(
self
):
def
test_delete_student_state_resets_scores
(
self
):
problem_location
=
msk_from_problem_urlname
(
problem_location
=
self
.
course
.
id
.
make_usage_key
(
'dummy'
,
'module'
)
self
.
course
.
id
,
'b3dce2586c9c4876b73e7f390e42ef8f'
,
block_type
=
'openassessment'
)
# Create a student module for the user
# Create a student module for the user
StudentModule
.
objects
.
create
(
StudentModule
.
objects
.
create
(
...
@@ -53,8 +49,8 @@ class InstructorResetStudentStateTest(ModuleStoreTestCase, LoginEnrollmentTestCa
...
@@ -53,8 +49,8 @@ class InstructorResetStudentStateTest(ModuleStoreTestCase, LoginEnrollmentTestCa
# Create a submission and score for the student using the submissions API
# Create a submission and score for the student using the submissions API
student_item
=
{
student_item
=
{
'student_id'
:
anonymous_id_for_user
(
self
.
student
,
self
.
course
.
id
),
'student_id'
:
anonymous_id_for_user
(
self
.
student
,
self
.
course
.
id
),
'course_id'
:
self
.
course
.
id
,
'course_id'
:
self
.
course
.
id
.
to_deprecated_string
()
,
'item_id'
:
problem_location
,
'item_id'
:
problem_location
.
to_deprecated_string
()
,
'item_type'
:
'openassessment'
'item_type'
:
'openassessment'
}
}
submission
=
sub_api
.
create_submission
(
student_item
,
'test answer'
)
submission
=
sub_api
.
create_submission
(
student_item
,
'test answer'
)
...
...
lms/djangoapps/instructor/views/legacy.py
View file @
7fcaa20c
...
@@ -388,8 +388,8 @@ def instructor_dashboard(request, course_id):
...
@@ -388,8 +388,8 @@ def instructor_dashboard(request, course_id):
try
:
try
:
sub_api
.
reset_score
(
sub_api
.
reset_score
(
anonymous_id_for_user
(
student
,
course_key
),
anonymous_id_for_user
(
student
,
course_key
),
course_key
,
course_key
.
to_deprecated_string
()
,
module_state_key
,
module_state_key
.
to_deprecated_string
()
,
)
)
except
sub_api
.
SubmissionError
:
except
sub_api
.
SubmissionError
:
# Trust the submissions API to log the error
# Trust the submissions API to log the 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