diff options
author | adityacp | 2020-02-18 13:29:24 +0530 |
---|---|---|
committer | adityacp | 2020-02-18 13:29:24 +0530 |
commit | 2db246f7abb2b8781e60673edec9912166621f4c (patch) | |
tree | e5b8ed04dc4c8fd28c401216313d1968d0d59edb /yaksh/forms.py | |
parent | 8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a (diff) | |
download | online_test-2db246f7abb2b8781e60673edec9912166621f4c.tar.gz online_test-2db246f7abb2b8781e60673edec9912166621f4c.tar.bz2 online_test-2db246f7abb2b8781e60673edec9912166621f4c.zip |
Change forms, views, models, templates
- Fix UI in add question page
- Add test case form for question formset with custom attributes
- Add a model method in question class to get question test cases
based on type and language of the question
- Retain the state of the list view and grid view in courses page
- Requested students list will be shown on top in the course detail page
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r-- | yaksh/forms.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py index 73d4b54..767e51f 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -1,7 +1,7 @@ from django import forms from yaksh.models import ( get_model_class, Profile, Quiz, Question, Course, QuestionPaper, Lesson, - LearningModule + LearningModule, TestCase ) from grades.models import GradingSystem from django.contrib.auth import authenticate @@ -537,3 +537,15 @@ class LearningModuleForm(forms.ModelForm): class Meta: model = LearningModule fields = ['name', 'description', 'active'] + + +class TestcaseForm(forms.ModelForm): + + type = forms.CharField( + widget=forms.TextInput( + attrs={'readonly': 'readonly', 'class': form_input_class}) + ) + + class Meta: + model = TestCase + fields = ["type"] |