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