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
4f5a712b
Commit
4f5a712b
authored
Jul 18, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix optioninput to keep order of items given
parent
163065fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
common/lib/capa/inputtypes.py
+1
-1
common/lib/capa/templates/optioninput.html
+1
-1
No files found.
common/lib/capa/inputtypes.py
View file @
4f5a712b
...
@@ -132,7 +132,7 @@ def optioninput(element, value, status, render_template, msg=''):
...
@@ -132,7 +132,7 @@ 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 dic
t with key,value same
osetdict
=
[(
oset
[
x
],
oset
[
x
])
for
x
in
range
(
len
(
oset
))
]
# make lis
t with key,value same
context
=
{
'id'
:
eid
,
context
=
{
'id'
:
eid
,
'value'
:
value
,
'value'
:
value
,
...
...
lms
/templates/optioninput.html
→
common/lib/capa
/templates/optioninput.html
View file @
4f5a712b
...
@@ -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