summaryrefslogtreecommitdiff
path: root/exam/models.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2011-11-24 02:11:40 +0530
committerPrabhu Ramachandran2011-11-24 02:11:40 +0530
commit11a2eaefaba6d2b547d35afbee3e85b18520afd2 (patch)
treef05aef4423f613c4d38232569df77a88c66978e7 /exam/models.py
parent30f56443790841901f15b5ab435f97fba1c81d85 (diff)
downloadonline_test-11a2eaefaba6d2b547d35afbee3e85b18520afd2.tar.gz
online_test-11a2eaefaba6d2b547d35afbee3e85b18520afd2.tar.bz2
online_test-11a2eaefaba6d2b547d35afbee3e85b18520afd2.zip
ENH/TMP: Preliminary support for bash scripts.
- Changing the Question model to add a language attribute. - Moving python_server.py -> code_server.py. - Adding functionality to test for Shell scripts. This is still incomplete since the shell code checker seems to have some problems. - Modified the xmlrpc_clients to support multiple languages and right now two. - Using setgid/setuid instead of setegid/seteuid in the code_server.py.. - Adding a bash example to the sample_questions.py. The shell script support doesn't quite work yet but this is really a code_server/checking issue.
Diffstat (limited to 'exam/models.py')
-rw-r--r--exam/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/exam/models.py b/exam/models.py
index d433c7c..ef4312f 100644
--- a/exam/models.py
+++ b/exam/models.py
@@ -12,6 +12,11 @@ class Profile(models.Model):
position = models.CharField(max_length=64)
+LANGUAGE_CHOICES = (
+ ("python", "Python"),
+ ("bash", "Bash"),
+ )
+
################################################################################
class Question(models.Model):
"""A question in the database."""
@@ -29,6 +34,9 @@ class Question(models.Model):
# This is simple Python code.
test = models.TextField()
+ # The language being tested.
+ language = models.CharField(max_length=10, choices=LANGUAGE_CHOICES)
+
# Is this question active or not. If it is inactive it will not be used
# when creating a QuestionPaper.
active = models.BooleanField(default=True)