summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authorprathamesh2017-12-27 17:32:21 +0530
committerprathamesh2017-12-27 17:53:50 +0530
commit51a93b42b1d7b3a94e227796aa8d4f6e97de9929 (patch)
treedb35061da2b9891dd597337be78946eb67c5df3c /yaksh/forms.py
parentb44db042059e69df4c4a948d6dff73604c7abf83 (diff)
downloadonline_test-51a93b42b1d7b3a94e227796aa8d4f6e97de9929.tar.gz
online_test-51a93b42b1d7b3a94e227796aa8d4f6e97de9929.tar.bz2
online_test-51a93b42b1d7b3a94e227796aa8d4f6e97de9929.zip
Exercise feature in video lessons
Exercise is same as quiz except for following differences: - no time limit - no marks weightage - no instruction page - skip denied for a particular time An attribute 'is_exercise' in Quiz determines whether the quiz is exercise or not. Questions contains 'min_time' attribute. For an exercise a question cannot be skipped for an allotted minimum time, after which either django or JavaScript makes Next button available. Implementation is as such due to complexity of our existing views and templates. Also, after min_time, same question with Next button is available to move on, assuming that solution is present in the video.
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 52e6a12..84db33e 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -173,6 +173,12 @@ class UserLoginForm(forms.Form):
return user
+class ExerciseForm(forms.ModelForm):
+ class Meta:
+ model = Quiz
+ fields = ['description']
+
+
class QuizForm(forms.ModelForm):
"""Creates a form to add or edit a Quiz.
It has the related fields and functions required."""
@@ -209,7 +215,7 @@ class QuizForm(forms.ModelForm):
class Meta:
model = Quiz
- exclude = ["is_trial", "creator"]
+ exclude = ["is_trial", "creator", "is_exercise"]
class QuestionForm(forms.ModelForm):