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
10128363
Commit
10128363
authored
Sep 09, 2014
by
Justin Riley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset choice if current choice was removed from XML
parent
cd54ac35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
common/lib/xmodule/xmodule/randomize_module.py
+10
-3
No files found.
common/lib/xmodule/xmodule/randomize_module.py
View file @
10128363
...
...
@@ -62,10 +62,17 @@ class RandomizeModule(RandomizeFields, XModule):
choices
=
self
.
get_choices
(
no_repeats
=
no_repeats
,
suspended
=
suspended
)
all_choices
=
self
.
get_choices
()
current_child
=
all_choices
.
get
(
self
.
choice
)
if
current_child
and
self
.
choice
not
in
choices
:
if
current_child
.
location
.
name
not
in
suspended
:
# Children changed. Reset.
if
current_child
:
cloc
=
current_child
.
location
if
cloc
.
url
()
not
in
choices
and
cloc
.
name
not
in
(
suspended
or
[]):
# child exists but is not in the list of choices. dont
# reset suspended problems otherwise students that passed will
# lose their grade.
self
.
choice
=
None
elif
self
.
choice
is
not
None
:
log
.
warn
(
"Problem removed from course XML:
%
s"
%
self
.
choice
)
# current choice no longer exists in course XML - reset
self
.
choice
=
None
if
self
.
choice
is
None
:
num_choices
=
len
(
choices
)
...
...
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