additional minor change: allow "inline" attrib on textline

This commit is contained in:
ichuang
2012-08-19 23:18:06 -04:00
parent ed1a08d397
commit b23bfc75bc
2 changed files with 13 additions and 3 deletions

View File

@@ -293,7 +293,9 @@ def textline(element, value, status, render_template, msg=""):
hidden = element.get('hidden', '') # if specified, then textline is hidden and id is stored in div of name given by hidden
escapedict = {'"': '"'}
value = saxutils.escape(value, escapedict) # otherwise, answers with quotes in them crashes the system!
context = {'id': eid, 'value': value, 'state': status, 'count': count, 'size': size, 'msg': msg, 'hidden': hidden}
context = {'id': eid, 'value': value, 'state': status, 'count': count, 'size': size, 'msg': msg, 'hidden': hidden,
'inline': element.get('inline',''),
}
html = render_template("textinput.html", context)
try:
xhtml = etree.XML(html)

View File

@@ -1,6 +1,14 @@
<section id="textinput_${id}" class="textinput">
<section id="textinput_${id}" class="textinput"
% if inline:
style="display:inline"
% endif
>
% if state == 'unsubmitted':
<div class="unanswered" id="status_${id}">
<div class="unanswered" id="status_${id}"
% if inline:
style="display:inline"
% endif
>
% elif state == 'correct':
<div class="correct" id="status_${id}">
% elif state == 'incorrect':