diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 66ac57c..c7a4da4 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -132,7 +132,8 @@ def optioninput(element, value, status, render_template, msg=''): 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([(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, 'value':value, diff --git a/lms/templates/optioninput.html b/common/lib/capa/capa/templates/optioninput.html similarity index 95% rename from lms/templates/optioninput.html rename to common/lib/capa/capa/templates/optioninput.html index c23f433..6ceba78 100644 --- a/lms/templates/optioninput.html +++ b/common/lib/capa/capa/templates/optioninput.html @@ -2,7 +2,7 @@ <select name="input_${id}" id="input_${id}" > <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}" % if (option_id==value): selected="true"