Commit d6e722a6 by Diana Huang

Remove unnecessary check and add better textline documentation

parent fd35b2c7
...@@ -457,8 +457,16 @@ class TextLine(InputTypeBase): ...@@ -457,8 +457,16 @@ class TextLine(InputTypeBase):
""" """
A text line input. Can do math preview if "math"="1" is specified. A text line input. Can do math preview if "math"="1" is specified.
If "trailing_text" is set to a value, then the textline will be shown with the value after the text input.
This is useful if you would like to specify a specific type of units for the text input.
If the hidden attribute is specified, the textline is hidden and the input id is stored in a div with name equal If the hidden attribute is specified, the textline is hidden and the input id is stored in a div with name equal
to the value of the hidden attribute. This is used e.g. for embedding simulations turned into questions. to the value of the hidden attribute. This is used e.g. for embedding simulations turned into questions.
Example:
<texline math="1" trailing_text="m/s" />
This example will render out a text line with a math preview and the text 'm/s' after the end of the text line.
""" """
template = "textline.html" template = "textline.html"
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
style="display:none;" style="display:none;"
% endif % endif
/> />
% if trailing_text:
${trailing_text} ${trailing_text}
% endif
<p class="status"> <p class="status">
% if status == 'unsubmitted': % if status == 'unsubmitted':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment