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
da470afc
Commit
da470afc
authored
Apr 04, 2014
by
Usman Khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3187 from edx/adam/fix-alter-xblock-student-state
Adam/fix alter xblock student state
parents
b3075e28
aefa456e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
lms/djangoapps/instructor/tests/test_api.py
+20
-3
lms/djangoapps/instructor/views/api.py
+3
-3
No files found.
lms/djangoapps/instructor/tests/test_api.py
View file @
da470afc
...
...
@@ -1745,9 +1745,26 @@ class TestInstructorAPIHelpers(TestCase):
self
.
assertEqual
(
_split_input_list
(
scary_unistuff
),
[
scary_unistuff
])
def
test_msk_from_problem_urlname
(
self
):
args
=
(
'MITx/6.002x/2013_Spring'
,
'L2Node1'
)
output
=
'i4x://MITx/6.002x/problem/L2Node1'
self
.
assertEqual
(
_msk_from_problem_urlname
(
*
args
),
output
)
course_id
=
'RobotU/Robots101/3001_Spring'
capa_urlname
=
'capa_urlname'
capa_urlname_xml
=
'capa_urlname.xml'
xblock_urlname
=
'notaproblem/someothername'
xblock_urlname_xml
=
'notaproblem/someothername.xml'
capa_msk
=
'i4x://RobotU/Robots101/problem/capa_urlname'
xblock_msk
=
'i4x://RobotU/Robots101/notaproblem/someothername'
for
urlname
in
[
capa_urlname
,
capa_urlname_xml
]:
self
.
assertEqual
(
_msk_from_problem_urlname
(
course_id
,
urlname
),
capa_msk
)
for
urlname
in
[
xblock_urlname
,
xblock_urlname_xml
]:
self
.
assertEqual
(
_msk_from_problem_urlname
(
course_id
,
urlname
),
xblock_msk
)
@raises
(
ValueError
)
def
test_msk_from_problem_urlname_error
(
self
):
...
...
lms/djangoapps/instructor/views/api.py
View file @
da470afc
...
...
@@ -1252,9 +1252,9 @@ def _msk_from_problem_urlname(course_id, urlname):
urlname
=
urlname
[:
-
4
]
# Combined open ended problems also have state that can be deleted. However,
#
ap
pending "problem" will only allow capa problems to be reset.
# Get around this for
combinedopenended
problems.
if
"
combinedopenended
"
not
in
urlname
:
#
pre
pending "problem" will only allow capa problems to be reset.
# Get around this for
xblock
problems.
if
"
/
"
not
in
urlname
:
urlname
=
"problem/"
+
urlname
parts
=
Location
.
parse_course_id
(
course_id
)
...
...
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