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
679c5eef
Commit
679c5eef
authored
May 28, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix inconsistent indentation in inputtypes
parent
69ba90ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
34 deletions
+34
-34
djangoapps/courseware/capa/inputtypes.py
+34
-34
No files found.
djangoapps/courseware/capa/inputtypes.py
View file @
679c5eef
...
...
@@ -216,45 +216,45 @@ def textline(element, value, state, msg=""):
@register_render_function
def
js_textline
(
element
,
value
,
status
,
msg
=
''
):
'''
Plan: We will inspect element to figure out type
'''
# TODO: Make a wrapper for <formulainput>
# TODO: Make an AJAX loop to confirm equation is okay in real-time as user types
## TODO: Code should follow PEP8 (4 spaces per indentation level)
'''
textline is used for simple one-line inputs, like formularesponse and symbolicresponse.
'''
eid
=
element
.
get
(
'id'
)
count
=
int
(
eid
.
split
(
'_'
)[
-
2
])
-
1
# HACK
size
=
element
.
get
(
'size'
)
dojs
=
element
.
get
(
'dojs'
)
# dojs is used for client-side javascript display & return
# when dojs=='math', a <span id=display_eid>`{::}`</span>
# and a hidden textarea with id=input_eid_fromjs will be output
context
=
{
'id'
:
eid
,
'value'
:
value
,
'state'
:
status
,
'count'
:
count
,
'size'
:
size
,
'dojs'
:
dojs
,
'msg'
:
msg
,
}
html
=
render_to_string
(
"jstext.html"
,
context
)
return
etree
.
XML
(
html
)
'''
Plan: We will inspect element to figure out type
'''
# TODO: Make a wrapper for <formulainput>
# TODO: Make an AJAX loop to confirm equation is okay in real-time as user types
## TODO: Code should follow PEP8 (4 spaces per indentation level)
'''
textline is used for simple one-line inputs, like formularesponse and symbolicresponse.
'''
eid
=
element
.
get
(
'id'
)
count
=
int
(
eid
.
split
(
'_'
)[
-
2
])
-
1
# HACK
size
=
element
.
get
(
'size'
)
dojs
=
element
.
get
(
'dojs'
)
# dojs is used for client-side javascript display & return
# when dojs=='math', a <span id=display_eid>`{::}`</span>
# and a hidden textarea with id=input_eid_fromjs will be output
context
=
{
'id'
:
eid
,
'value'
:
value
,
'state'
:
status
,
'count'
:
count
,
'size'
:
size
,
'dojs'
:
dojs
,
'msg'
:
msg
,
}
html
=
render_to_string
(
"jstext.html"
,
context
)
return
etree
.
XML
(
html
)
#-----------------------------------------------------------------------------
## TODO: Make a wrapper for <codeinput>
@register_render_function
def
textbox
(
element
,
value
,
status
,
msg
=
''
):
'''
The textbox is used for code input. The message is the return HTML string from
evaluating the code, eg error messages, and output from the code tests.
TODO: make this use rows and cols attribs, not size
'''
eid
=
element
.
get
(
'id'
)
count
=
int
(
eid
.
split
(
'_'
)[
-
2
])
-
1
# HACK
size
=
element
.
get
(
'size'
)
if
not
value
:
value
=
element
.
text
# if no student input yet, then use the default input given by the problem
context
=
{
'id'
:
eid
,
'value'
:
value
,
'state'
:
status
,
'count'
:
count
,
'size'
:
size
,
'msg'
:
msg
}
html
=
render_to_string
(
"textbox.html"
,
context
)
return
etree
.
XML
(
html
)
'''
The textbox is used for code input. The message is the return HTML string from
evaluating the code, eg error messages, and output from the code tests.
TODO: make this use rows and cols attribs, not size
'''
eid
=
element
.
get
(
'id'
)
count
=
int
(
eid
.
split
(
'_'
)[
-
2
])
-
1
# HACK
size
=
element
.
get
(
'size'
)
if
not
value
:
value
=
element
.
text
# if no student input yet, then use the default input given by the problem
context
=
{
'id'
:
eid
,
'value'
:
value
,
'state'
:
status
,
'count'
:
count
,
'size'
:
size
,
'msg'
:
msg
}
html
=
render_to_string
(
"textbox.html"
,
context
)
return
etree
.
XML
(
html
)
#-----------------------------------------------------------------------------
@register_render_function
...
...
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