summaryrefslogtreecommitdiff
path: root/exam/views.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/views.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/views.py')
-rw-r--r--exam/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/exam/views.py b/exam/views.py
index bafd0be..1f92553 100644
--- a/exam/views.py
+++ b/exam/views.py
@@ -13,7 +13,7 @@ from django.http import Http404
# Local imports.
from exam.models import Quiz, Question, QuestionPaper, Profile, Answer, User
from exam.forms import UserRegisterForm, UserLoginForm
-from exam.xmlrpc_clients import python_server
+from exam.xmlrpc_clients import code_server
from settings import URL_ROOT
# The directory where user data can be saved.
@@ -203,7 +203,8 @@ def check(request, q_id):
# with the code executed safely in a separate process (the python_server.py)
# running as nobody.
user_dir = get_user_dir(user)
- success, err_msg = python_server.run_code(answer, question.test, user_dir)
+ success, err_msg = code_server.run_code(answer, question.test,
+ user_dir, question.language)
new_answer.error = err_msg
if success: