summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 6a19744..d067393 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -476,6 +476,12 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None):
except ValueError:
msg = ["Please enter an Integer Value"]
return show_question(request, current_question, paper, msg)
+ elif current_question.type == 'float':
+ try:
+ user_answer = float(request.POST.get('answer'))
+ except ValueError:
+ msg = ["Please enter a Decimal Value"]
+ return show_question(request, current_question, paper, msg)
elif current_question.type == 'string':
user_answer = str(request.POST.get('answer'))