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
5cecd0ac
Commit
5cecd0ac
authored
Mar 27, 2012
by
pmitros
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8 from MITx/textline_size
Input size now works
parents
79476eca
75f5a1cf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
djangoapps/courseware/capa/inputtypes.py
+2
-1
templates/textinput.html
+5
-1
No files found.
djangoapps/courseware/capa/inputtypes.py
View file @
5cecd0ac
...
...
@@ -8,7 +8,8 @@ class textline(object):
def
render
(
element
,
value
,
state
):
eid
=
element
.
get
(
'id'
)
count
=
int
(
eid
.
split
(
'_'
)[
-
2
])
-
1
# HACK
context
=
{
'id'
:
eid
,
'value'
:
value
,
'state'
:
state
,
'count'
:
count
}
size
=
element
.
get
(
'size'
)
context
=
{
'id'
:
eid
,
'value'
:
value
,
'state'
:
state
,
'count'
:
count
,
'size'
:
size
}
html
=
render_to_string
(
"textinput.html"
,
context
)
return
etree
.
XML
(
html
)
...
...
templates/textinput.html
View file @
5cecd0ac
<section
class=
"text-input"
>
<input
type=
"text"
name=
"input_${id}"
id=
"input_${id}"
value=
"${value}"
/>
<input
type=
"text"
name=
"input_${id}"
id=
"input_${id}"
value=
"${value}"
%
if
size:
size=
"${size}"
%
endif
/>
<span
id=
"answer_${id}"
></span>
...
...
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