summaryrefslogtreecommitdiff
path: root/docs/sample_questions.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2011-11-22 01:01:11 +0530
committerPrabhu Ramachandran2011-11-22 01:01:11 +0530
commitba2097a382b581dacced5cb9bd70087396a054f0 (patch)
tree5de8dc7caf92c63a81f9153d1f7bda7f95242193 /docs/sample_questions.py
parentab56c25d59a057c7b3cf811223808ce922a4750d (diff)
downloadonline_test-ba2097a382b581dacced5cb9bd70087396a054f0.tar.gz
online_test-ba2097a382b581dacced5cb9bd70087396a054f0.tar.bz2
online_test-ba2097a382b581dacced5cb9bd70087396a054f0.zip
ENH: The question description should be valid HTML
This allows us to render code nicely and format the question nicely. Modified the question template suitably.
Diffstat (limited to 'docs/sample_questions.py')
-rw-r--r--docs/sample_questions.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/sample_questions.py b/docs/sample_questions.py
index c77eb9d..2a9eaf8 100644
--- a/docs/sample_questions.py
+++ b/docs/sample_questions.py
@@ -5,9 +5,11 @@ Question(
summary='Factorial',
points=2,
description='''
-Write a function called "fact" which takes a single integer argument (say "n")
-and returns the factorial of the number.
-For example fact(3) -> 6''',
+Write a function called <code>fact</code> which takes a single integer argument
+(say <code>n</code>) and returns the factorial of the number.
+For example:<br/>
+<code>fact(3) -> 6</code>
+''',
test='''
assert fact(0) == 1
assert fact(5) == 120
@@ -16,8 +18,9 @@ assert fact(5) == 120
Question(
summary='Simple function',
points=1,
- description='''Create a simple function called "sqr" which takes a single
-argument and returns the square of the argument. For example sqr(3) -> 9.''',
+ description='''Create a simple function called <code>sqr</code> which takes a single
+argument and returns the square of the argument. For example: <br/>
+<code>sqr(3) -> 9</code>.''',
test='''
import math
assert sqr(3) == 9