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
b23bfc75
Commit
b23bfc75
authored
Aug 19, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
additional minor change: allow "inline" attrib on textline
parent
ed1a08d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
common/lib/capa/capa/inputtypes.py
+3
-1
common/lib/capa/capa/templates/textinput.html
+10
-2
No files found.
common/lib/capa/capa/inputtypes.py
View file @
b23bfc75
...
...
@@ -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
)
...
...
common/lib/capa/capa/templates/textinput.html
View file @
b23bfc75
<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':
...
...
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