summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorprathamesh2020-06-10 11:56:49 +0530
committerprathamesh2020-06-10 11:56:49 +0530
commitc27bc87afd68266da59af6e7f2b3b8cc8db13fad (patch)
tree9075a0019cbba086f4bdefb54346b259d8580cb6 /yaksh/models.py
parent73dc8f6820c6c86fd8e70a68456ca2e541801bde (diff)
downloadonline_test-c27bc87afd68266da59af6e7f2b3b8cc8db13fad.tar.gz
online_test-c27bc87afd68266da59af6e7f2b3b8cc8db13fad.tar.bz2
online_test-c27bc87afd68266da59af6e7f2b3b8cc8db13fad.zip
Allow moderator to hide test cases from the user
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 7d4dd98..1b076a8 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -2534,11 +2534,13 @@ class StandardTestCase(TestCase):
test_case = models.TextField()
weight = models.FloatField(default=1.0)
test_case_args = models.TextField(blank=True)
+ hidden = models.BooleanField(default=False)
def get_field_value(self):
return {"test_case_type": "standardtestcase",
"test_case": self.test_case,
"weight": self.weight,
+ "hidden": self.hidden,
"test_case_args": self.test_case_args}
def __str__(self):
@@ -2549,11 +2551,13 @@ class StdIOBasedTestCase(TestCase):
expected_input = models.TextField(default=None, blank=True, null=True)
expected_output = models.TextField(default=None)
weight = models.IntegerField(default=1.0)
+ hidden = models.BooleanField(default=False)
def get_field_value(self):
return {"test_case_type": "stdiobasedtestcase",
"expected_output": self.expected_output,
"expected_input": self.expected_input,
+ "hidden": self.hidden,
"weight": self.weight}
def __str__(self):
@@ -2599,10 +2603,11 @@ class HookTestCase(TestCase):
)
weight = models.FloatField(default=1.0)
+ hidden = models.BooleanField(default=False)
def get_field_value(self):
return {"test_case_type": "hooktestcase", "hook_code": self.hook_code,
- "weight": self.weight}
+ "hidden": self.hidden, "weight": self.weight}
def __str__(self):
return u'Hook Testcase | Correct: {0}'.format(self.hook_code)