From 5ec456d5208df78ef87d0660e4bef430d553d65d Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 11 Mar 2016 12:36:49 +0530 Subject: Revert testcase formsets --- yaksh/forms.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index c5bec4c..0eed8eb 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -180,10 +180,6 @@ class QuestionFilterForm(forms.Form): (choices=question_types)) -TestCaseFormSet = inlineformset_factory(Question, TestCase, fields='__all__', - can_order=False, can_delete=False, extra=1) - - class CourseForm(forms.ModelForm): class Meta: model = Course -- cgit From ceb4f2cbc1a03835a3c7e34d806ec21e47e3f059 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 4 Mar 2016 21:54:59 +0530 Subject: add test case selection --- yaksh/forms.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 0eed8eb..5c8dafa 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -28,6 +28,12 @@ question_types = ( ("upload", "Assignment Upload"), ) +test_case_types = ( + ("assert_based", "Assertion Based Testcase"), + # ("argument_based", "Multiple Correct Choices"), + # ("stdout_based", "Code"), + ) + UNAME_CHARS = letters + "._" + digits PWD_CHARS = letters + punctuation + digits -- cgit From 1e993bee18028c59d809f49d853b60e41326991c Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 11 Mar 2016 12:11:49 +0530 Subject: Add a python standard out evaluator --- yaksh/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 5c8dafa..5959dc4 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -31,7 +31,7 @@ question_types = ( test_case_types = ( ("assert_based", "Assertion Based Testcase"), # ("argument_based", "Multiple Correct Choices"), - # ("stdout_based", "Code"), + ("stdout_based", "Stdout Based Testcase"), ) UNAME_CHARS = letters + "._" + digits -- cgit From 195aead9b0fab0d8cdb86a9fc884ac3edca5db84 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 16 Mar 2016 10:57:07 +0530 Subject: - Connect test case type models to backend code server - Support for Stdout test case and Standard assertion test case - Add MCQ Test case and support for validations - Remove tester dir --- yaksh/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 5959dc4..94498a1 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -29,9 +29,9 @@ question_types = ( ) test_case_types = ( - ("assert_based", "Assertion Based Testcase"), + ("standardtestcase", "Standard Testcase"), # ("argument_based", "Multiple Correct Choices"), - ("stdout_based", "Stdout Based Testcase"), + ("stdoutbasedtestcase", "Stdout Based Testcase"), ) UNAME_CHARS = letters + "._" + digits -- cgit From f120f5763904589d3c18b6cc0f4e227bcaef9a0a Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 1 Apr 2016 11:18:04 +0530 Subject: Add testcase addition templates, views and forms --- yaksh/forms.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 94498a1..1375d10 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -214,3 +214,14 @@ class ProfileForm(forms.ModelForm): class UploadFileForm(forms.Form): file = forms.FileField() + +class StandardTestCaseForm(forms.ModelForm): + class Meta: + model = StandardTestCase + fields = ['test_case'] + + +class StdoutBasedTestCaseForm(forms.ModelForm): + class Meta: + model = StdoutBasedTestCase + fields = ['output'] -- cgit From c557e19470a389aaac569516ed56e1c5b453fd88 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 26 Apr 2016 19:37:42 +0530 Subject: Add views, forms and templates (with JS) for new test cases: - Add a view and template to list out test cases for particular question - Add a view and template to add/edit test cases --- yaksh/forms.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 1375d10..9ffef5e 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -1,8 +1,10 @@ from django import forms -from yaksh.models import Profile, Quiz, Question, TestCase, Course +from yaksh.models import Profile, Quiz, Question, TestCase, Course, StandardTestCase, StdoutBasedTestCase from django.contrib.auth import authenticate from django.contrib.auth.models import User +from django.contrib.contenttypes.models import ContentType + from taggit.managers import TaggableManager from taggit.forms import TagField from django.forms.models import inlineformset_factory @@ -30,8 +32,8 @@ question_types = ( test_case_types = ( ("standardtestcase", "Standard Testcase"), - # ("argument_based", "Multiple Correct Choices"), ("stdoutbasedtestcase", "Stdout Based Testcase"), + ("mcqtestcase", "MCQ Testcase"), ) UNAME_CHARS = letters + "._" + digits @@ -41,6 +43,22 @@ attempts = [(i, i) for i in range(1, 6)] attempts.append((-1, 'Infinite')) days_between_attempts = ((j, j) for j in range(401)) +def get_object_form(model, exclude_fields=None): + ctype = ContentType.objects.get(app_label="yaksh", model=model) + # ctype = ContentType.objects.get(pk=type_id) + model_class = ctype.model_class() + class _ObjectForm(forms.ModelForm): + # def __init__(self, *args, **kwargs): + # if "question" in kwargs: + # question = kwargs.pop("question") + # else: + # question = None + # self.fields["question"] = question + class Meta: + model = model_class + exclude = exclude_fields + return _ObjectForm + class UserRegisterForm(forms.Form): """A Class to create new form for User's Registration. -- cgit From 23216995e0fc0e94fd58c6186eed74c943ae5081 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 27 Apr 2016 18:44:18 +0530 Subject: Modify get_form_object method in forms.py --- yaksh/forms.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 9ffef5e..ddb1819 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -1,5 +1,5 @@ from django import forms -from yaksh.models import Profile, Quiz, Question, TestCase, Course, StandardTestCase, StdoutBasedTestCase +from yaksh.models import get_model_class, Profile, Quiz, Question, TestCase, Course, StandardTestCase, StdoutBasedTestCase from django.contrib.auth import authenticate from django.contrib.auth.models import User @@ -44,9 +44,10 @@ attempts.append((-1, 'Infinite')) days_between_attempts = ((j, j) for j in range(401)) def get_object_form(model, exclude_fields=None): - ctype = ContentType.objects.get(app_label="yaksh", model=model) + # ctype = ContentType.objects.get(app_label="yaksh", model=model) # ctype = ContentType.objects.get(pk=type_id) - model_class = ctype.model_class() + # model_class = ctype.model_class() + model_class = get_model_class(model) class _ObjectForm(forms.ModelForm): # def __init__(self, *args, **kwargs): # if "question" in kwargs: -- cgit From 23b7abd3c1125e4c875e214e4f673c48c4bf4752 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 2 May 2016 11:52:58 +0530 Subject: Remove commented code and cleanup --- yaksh/forms.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index ddb1819..2ce2cba 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -44,17 +44,8 @@ attempts.append((-1, 'Infinite')) days_between_attempts = ((j, j) for j in range(401)) def get_object_form(model, exclude_fields=None): - # ctype = ContentType.objects.get(app_label="yaksh", model=model) - # ctype = ContentType.objects.get(pk=type_id) - # model_class = ctype.model_class() model_class = get_model_class(model) class _ObjectForm(forms.ModelForm): - # def __init__(self, *args, **kwargs): - # if "question" in kwargs: - # question = kwargs.pop("question") - # else: - # question = None - # self.fields["question"] = question class Meta: model = model_class exclude = exclude_fields -- cgit From d953f6f9e62671eeb5d6ea6498475167301dfe91 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 2 May 2016 14:38:13 +0530 Subject: - Fix tests - Fix minor views.py - Fix minor errors caused due to conflict resolution, rebasing - Fix errors in forms, views - Minor Button label change in addquestion.html - Add snippet to question - Remove commented code --- yaksh/forms.py | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 2ce2cba..808262b 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -224,14 +224,3 @@ class ProfileForm(forms.ModelForm): class UploadFileForm(forms.Form): file = forms.FileField() - -class StandardTestCaseForm(forms.ModelForm): - class Meta: - model = StandardTestCase - fields = ['test_case'] - - -class StdoutBasedTestCaseForm(forms.ModelForm): - class Meta: - model = StdoutBasedTestCase - fields = ['output'] -- cgit