From fdc531b561565345847812f409ee44af0a784e82 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Fri, 25 Nov 2011 18:48:13 +0530 Subject: ENH: Adding support for Multiple Choice Questions Adds simple support for multiple choice questions that are also auto-checked. Many fixes to the templates and useful feature additions. This changes the database. --- docs/sample_questions.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'docs/sample_questions.py') diff --git a/docs/sample_questions.py b/docs/sample_questions.py index eac9479..5af9c4b 100644 --- a/docs/sample_questions.py +++ b/docs/sample_questions.py @@ -4,7 +4,7 @@ questions = [ Question( summary='Factorial', points=2, - language="python", + type="python", description=''' Write a function called fact which takes a single integer argument (say n) and returns the factorial of the number. @@ -19,7 +19,7 @@ assert fact(5) == 120 Question( summary='Simple function', points=1, - language="python", + type="python", description='''Create a simple function called sqr which takes a single argument and returns the square of the argument. For example:
sqr(3) -> 9.''', @@ -31,7 +31,7 @@ assert abs(sqr(math.sqrt(2)) - 2.0) < 1e-14 Question( summary='Bash addition', points=2, - language="bash", + type="bash", description='''Write a shell script which takes two arguments on the command line and prints the sum of the two on the output.''', test='''\ @@ -41,6 +41,19 @@ Question( 1 2 2 1 '''), +Question( + summary='Size of integer in Python', + points=0.5, + type="mcq", + description='''What is the largest integer value that can be represented +in Python?''', + options='''No Limit +2**32 +2**32 - 1 +None of the above +''', + test = "No Limit" + ), ] quiz = Quiz(start_date=date.today(), -- cgit