summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authoradityacp2020-09-03 18:18:18 +0530
committeradityacp2020-09-03 18:18:18 +0530
commit23c6caab733f5bba6458a07a6666a0580ee2e6a9 (patch)
tree36a9f3d185e6106f30d50c1ff07b0744afd87943 /yaksh/forms.py
parent4183028cc7005cd46c8ccff2793030d736e232d7 (diff)
downloadonline_test-23c6caab733f5bba6458a07a6666a0580ee2e6a9.tar.gz
online_test-23c6caab733f5bba6458a07a6666a0580ee2e6a9.tar.bz2
online_test-23c6caab733f5bba6458a07a6666a0580ee2e6a9.zip
Change views, forms, models, urls
- Disable the question type in video question form - Change urls to add graded quiz, exercise, poll type question - Save the topic and question in table of contents - Rename lesson attribute in TableOfContents model
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 797f54e..eedd809 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -650,6 +650,7 @@ class CommentForm(forms.ModelForm):
class TopicForm(forms.ModelForm):
timer = forms.CharField()
+
def __init__(self, *args, **kwargs):
super(TopicForm, self).__init__(*args, **kwargs)
self.fields['name'].widget.attrs.update(
@@ -666,8 +667,6 @@ class TopicForm(forms.ModelForm):
class VideoQuizForm(forms.ModelForm):
- _types = dict(question_types)
-
type = forms.CharField()
timer = forms.CharField()
@@ -693,7 +692,7 @@ class VideoQuizForm(forms.ModelForm):
self.fields['type'].widget.attrs.update(
{'class': form_input_class, 'readonly': True}
)
- self.fields['type'].initial = self._types.get(question_type)
+ self.fields['type'].initial = question_type
self.fields['description'].widget.attrs.update(
{'class': form_input_class, 'placeholder': 'Description'}
)