summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorankitjavalkar2016-03-04 21:54:59 +0530
committerankitjavalkar2016-05-05 18:57:52 +0530
commitceb4f2cbc1a03835a3c7e34d806ec21e47e3f059 (patch)
treede58fcf13fb19308149021e82b3891936b2361db /yaksh/models.py
parent3b56d8259d6aa8311f86e0561e40d0b17bc62534 (diff)
downloadonline_test-ceb4f2cbc1a03835a3c7e34d806ec21e47e3f059.tar.gz
online_test-ceb4f2cbc1a03835a3c7e34d806ec21e47e3f059.tar.bz2
online_test-ceb4f2cbc1a03835a3c7e34d806ec21e47e3f059.zip
add test case selection
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py39
1 files changed, 23 insertions, 16 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 6e59d7a..c4f3561 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -8,21 +8,6 @@ from django.contrib.auth.models import User
from taggit.managers import TaggableManager
-###############################################################################
-class ConcurrentUser(models.Model):
- concurrent_user = models.OneToOneField(User, null=False)
- session_key = models.CharField(null=False, max_length=40)
-
-
-###############################################################################
-class Profile(models.Model):
- """Profile for a user to store roll number and other details."""
- user = models.OneToOneField(User)
- roll_number = models.CharField(max_length=20)
- institute = models.CharField(max_length=128)
- department = models.CharField(max_length=64)
- position = models.CharField(max_length=64)
-
languages = (
("python", "Python"),
("bash", "Bash"),
@@ -45,6 +30,12 @@ enrollment_methods = (
("open", "Open Course"),
)
+test_case_types = (
+ ("assert_based", "Assertion Based Testcase"),
+ # ("argument_based", "Multiple Correct Choices"),
+ # ("stdout_based", "Code"),
+ )
+
attempts = [(i, i) for i in range(1, 6)]
attempts.append((-1, 'Infinite'))
days_between_attempts = ((j, j) for j in range(401))
@@ -54,7 +45,6 @@ test_status = (
('completed', 'Completed'),
)
-
def get_assignment_dir(instance, filename):
return '%s/%s' % (instance.user.roll_number, instance.assignmentQuestion.id)
@@ -132,6 +122,21 @@ class Course(models.Model):
def __unicode__(self):
return self.name
+###############################################################################
+class ConcurrentUser(models.Model):
+ concurrent_user = models.OneToOneField(User, null=False)
+ session_key = models.CharField(null=False, max_length=40)
+
+
+###############################################################################
+class Profile(models.Model):
+ """Profile for a user to store roll number and other details."""
+ user = models.OneToOneField(User)
+ roll_number = models.CharField(max_length=20)
+ institute = models.CharField(max_length=128)
+ department = models.CharField(max_length=64)
+ position = models.CharField(max_length=64)
+
###############################################################################
class Question(models.Model):
@@ -163,6 +168,8 @@ class Question(models.Model):
# The type of question.
type = models.CharField(max_length=24, choices=question_types)
+ # The type of evaluator
+ test_case_type = models.CharField(max_length=24, choices=test_case_types)
# Is this question active or not. If it is inactive it will not be used
# when creating a QuestionPaper.
active = models.BooleanField(default=True)