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
0903ba9c
Commit
0903ba9c
authored
Jul 19, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix optioninput to preserve author's ordering of options
parent
49ee1296
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
common/lib/capa/capa/inputtypes.py
+2
-1
common/lib/capa/capa/templates/optioninput.html
+1
-1
No files found.
common/lib/capa/capa/inputtypes.py
View file @
0903ba9c
...
@@ -132,7 +132,8 @@ def optioninput(element, value, status, render_template, msg=''):
...
@@ -132,7 +132,8 @@ def optioninput(element, value, status, render_template, msg=''):
oset
=
[
x
[
1
:
-
1
]
for
x
in
list
(
oset
)]
oset
=
[
x
[
1
:
-
1
]
for
x
in
list
(
oset
)]
# osetdict = dict([('option_%s_%s' % (eid,x),oset[x]) for x in range(len(oset)) ]) # make dict with IDs
# osetdict = dict([('option_%s_%s' % (eid,x),oset[x]) for x in range(len(oset)) ]) # make dict with IDs
osetdict
=
dict
([(
oset
[
x
],
oset
[
x
])
for
x
in
range
(
len
(
oset
))
])
# make dict with key,value same
osetdict
=
[(
oset
[
x
],
oset
[
x
])
for
x
in
range
(
len
(
oset
))
]
# make ordered list with (key,value) same
# TODO: allow ordering to be randomized
context
=
{
'id'
:
eid
,
context
=
{
'id'
:
eid
,
'value'
:
value
,
'value'
:
value
,
...
...
lms
/templates/optioninput.html
→
common/lib/capa/capa
/templates/optioninput.html
View file @
0903ba9c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<select
name=
"input_${id}"
id=
"input_${id}"
>
<select
name=
"input_${id}"
id=
"input_${id}"
>
<option
value=
"option_${id}_dummy_default"
>
</option>
<option
value=
"option_${id}_dummy_default"
>
</option>
% for option_id, option_description in options
.items()
:
% for option_id, option_description in options:
<option
value=
"${option_id}"
<option
value=
"${option_id}"
%
if
(
option_id=
=value):
%
if
(
option_id=
=value):
selected=
"true"
selected=
"true"
...
...
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