Description: | {{ form.description}} {{form.description.errors}}
diff --git a/yaksh/views.py b/yaksh/views.py
index 049788a..d26c5df 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -915,12 +915,10 @@ def show_all_questions(request):
if request.POST.get('delete') == 'delete':
data = request.POST.getlist('question')
if data is not None:
- questions = Question.objects.filter(id__in=data, user_id=user.id)
- files = FileUpload.objects.filter(question_id__in=questions)
- if files:
- for file in files:
- file.remove()
- questions.delete()
+ questions = Question.objects.filter(id__in=data, user_id=user.id, active=True)
+ for q in questions:
+ q.active = False
+ q.save()
if request.POST.get('upload') == 'upload':
form = UploadFileForm(request.POST, request.FILES)
@@ -959,7 +957,7 @@ def show_all_questions(request):
else:
context["msg"] = "Please select atleast one question to test"
- questions = Question.objects.filter(user_id=user.id)
+ questions = Question.objects.filter(user_id=user.id, active=True)
form = QuestionFilterForm(user=user)
upload_form = UploadFileForm()
context['papers'] = []
--
cgit
From 3d1d4a50524301d03526e4857844d0e6e4536527 Mon Sep 17 00:00:00 2001
From: ankitjavalkar
Date: Fri, 7 Oct 2016 16:04:25 +0530
Subject: Minor fixes: Hide question instead of deletion
---
yaksh/models.py | 5 ++--
yaksh/views.py | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 3 deletions(-)
(limited to 'yaksh')
diff --git a/yaksh/models.py b/yaksh/models.py
index 432f25e..60c4349 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -623,8 +623,7 @@ class QuestionPaper(models.Model):
def _get_questions_for_answerpaper(self):
""" Returns fixed and random questions for the answer paper"""
- questions = []
- questions = list(self.fixed_questions.all())
+ questions = list(self.fixed_questions.filter(active=True))
for question_set in self.random_questions.all():
questions += question_set.get_random_questions()
return questions
@@ -993,7 +992,7 @@ class AnswerPaper(models.Model):
return q_a
def get_questions(self):
- return self.questions.all()
+ return self.questions.filter(active=True)
def get_questions_answered(self):
return self.questions_answered.all()
diff --git a/yaksh/views.py b/yaksh/views.py
index d26c5df..1b977f9 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1085,6 +1085,86 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None):
)
+<<<<<<< HEAD
+=======
+@csrf_exempt
+def ajax_questionpaper(request, query):
+ """
+ During question paper creation, ajax call made to get question details.
+ """
+
+ user = request.user
+ if query == 'marks':
+ question_type = request.POST.get('question_type')
+ questions = Question.objects.filter(type=question_type, user=user, active=True)
+ marks = questions.values_list('points').distinct()
+ return my_render_to_response('yaksh/ajax_marks.html', {'marks': marks})
+ elif query == 'questions':
+ question_type = request.POST['question_type']
+ marks_selected = request.POST['marks']
+ fixed_questions = request.POST.getlist('fixed_list[]')
+ fixed_question_list = ",".join(fixed_questions).split(',')
+ random_questions = request.POST.getlist('random_list[]')
+ random_question_list = ",".join(random_questions).split(',')
+ question_list = fixed_question_list + random_question_list
+ questions = list(Question.objects.filter(type=question_type,
+ points=marks_selected,
+ user=user,
+ active=True)
+ )
+ questions = [question for question in questions \
+ if not str(question.id) in question_list]
+ return my_render_to_response('yaksh/ajax_questions.html',
+ {'questions': questions})
+
+
+@login_required
+def design_questionpaper(request):
+ user = request.user
+ ci = RequestContext(request)
+
+ if not is_moderator(user):
+ raise Http404('You are not allowed to view this page!')
+
+ if request.method == 'POST':
+ fixed_questions = request.POST.getlist('fixed')
+ random_questions = request.POST.getlist('random')
+ random_number = request.POST.getlist('number')
+ is_shuffle = request.POST.get('shuffle_questions', False)
+ if is_shuffle == 'on':
+ is_shuffle = True
+
+ question_paper = QuestionPaper(shuffle_questions=is_shuffle)
+ quiz = Quiz.objects.order_by("-id")[0]
+ tot_marks = 0
+ question_paper.quiz = quiz
+ question_paper.total_marks = tot_marks
+ question_paper.save()
+ if fixed_questions:
+ fixed_questions_ids = ",".join(fixed_questions)
+ fixed_questions_ids_list = fixed_questions_ids.split(',')
+ for question_id in fixed_questions_ids_list:
+ question_paper.fixed_questions.add(question_id)
+ if random_questions:
+ for random_question, num in zip(random_questions, random_number):
+ qid = random_question.split(',')[0]
+ question = Question.objects.get(id=int(qid))
+ marks = question.points
+ question_set = QuestionSet(marks=marks, num_questions=num)
+ question_set.save()
+ for question_id in random_question.split(','):
+ question_set.questions.add(question_id)
+ question_paper.random_questions.add(question_set)
+ question_paper.update_total_marks()
+ question_paper.save()
+ return my_redirect('/exam/manage/courses')
+ else:
+ form = RandomQuestionForm()
+ context = {'form': form, 'questionpaper':True}
+ return my_render_to_response('yaksh/design_questionpaper.html',
+ context, context_instance=ci)
+
+>>>>>>> Minor fixes: Hide question instead of deletion
@login_required
def view_profile(request):
""" view moderators and users profile """
--
cgit
From d33e97e4081037d92f89c7ae5742f74411b51931 Mon Sep 17 00:00:00 2001
From: ankitjavalkar
Date: Thu, 13 Oct 2016 15:11:05 +0530
Subject: Fix variable name in for loop
---
yaksh/views.py | 86 ++--------------------------------------------------------
1 file changed, 3 insertions(+), 83 deletions(-)
(limited to 'yaksh')
diff --git a/yaksh/views.py b/yaksh/views.py
index 1b977f9..270a47c 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -916,9 +916,9 @@ def show_all_questions(request):
data = request.POST.getlist('question')
if data is not None:
questions = Question.objects.filter(id__in=data, user_id=user.id, active=True)
- for q in questions:
- q.active = False
- q.save()
+ for question in questions:
+ question.active = False
+ question.save()
if request.POST.get('upload') == 'upload':
form = UploadFileForm(request.POST, request.FILES)
@@ -1085,86 +1085,6 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None):
)
-<<<<<<< HEAD
-=======
-@csrf_exempt
-def ajax_questionpaper(request, query):
- """
- During question paper creation, ajax call made to get question details.
- """
-
- user = request.user
- if query == 'marks':
- question_type = request.POST.get('question_type')
- questions = Question.objects.filter(type=question_type, user=user, active=True)
- marks = questions.values_list('points').distinct()
- return my_render_to_response('yaksh/ajax_marks.html', {'marks': marks})
- elif query == 'questions':
- question_type = request.POST['question_type']
- marks_selected = request.POST['marks']
- fixed_questions = request.POST.getlist('fixed_list[]')
- fixed_question_list = ",".join(fixed_questions).split(',')
- random_questions = request.POST.getlist('random_list[]')
- random_question_list = ",".join(random_questions).split(',')
- question_list = fixed_question_list + random_question_list
- questions = list(Question.objects.filter(type=question_type,
- points=marks_selected,
- user=user,
- active=True)
- )
- questions = [question for question in questions \
- if not str(question.id) in question_list]
- return my_render_to_response('yaksh/ajax_questions.html',
- {'questions': questions})
-
-
-@login_required
-def design_questionpaper(request):
- user = request.user
- ci = RequestContext(request)
-
- if not is_moderator(user):
- raise Http404('You are not allowed to view this page!')
-
- if request.method == 'POST':
- fixed_questions = request.POST.getlist('fixed')
- random_questions = request.POST.getlist('random')
- random_number = request.POST.getlist('number')
- is_shuffle = request.POST.get('shuffle_questions', False)
- if is_shuffle == 'on':
- is_shuffle = True
-
- question_paper = QuestionPaper(shuffle_questions=is_shuffle)
- quiz = Quiz.objects.order_by("-id")[0]
- tot_marks = 0
- question_paper.quiz = quiz
- question_paper.total_marks = tot_marks
- question_paper.save()
- if fixed_questions:
- fixed_questions_ids = ",".join(fixed_questions)
- fixed_questions_ids_list = fixed_questions_ids.split(',')
- for question_id in fixed_questions_ids_list:
- question_paper.fixed_questions.add(question_id)
- if random_questions:
- for random_question, num in zip(random_questions, random_number):
- qid = random_question.split(',')[0]
- question = Question.objects.get(id=int(qid))
- marks = question.points
- question_set = QuestionSet(marks=marks, num_questions=num)
- question_set.save()
- for question_id in random_question.split(','):
- question_set.questions.add(question_id)
- question_paper.random_questions.add(question_set)
- question_paper.update_total_marks()
- question_paper.save()
- return my_redirect('/exam/manage/courses')
- else:
- form = RandomQuestionForm()
- context = {'form': form, 'questionpaper':True}
- return my_render_to_response('yaksh/design_questionpaper.html',
- context, context_instance=ci)
-
->>>>>>> Minor fixes: Hide question instead of deletion
@login_required
def view_profile(request):
""" view moderators and users profile """
--
cgit
From 1bfd71cc024dc7ea72099deff52efbeac7db87b5 Mon Sep 17 00:00:00 2001
From: adityacp
Date: Mon, 17 Oct 2016 12:43:13 +0530
Subject: extract uploaded questions zip in temp
---
yaksh/bash_code_evaluator.py | 2 +-
yaksh/file_utils.py | 27 ++++++++++++++++---------
yaksh/models.py | 47 +++++++++++++++++++++++++-------------------
yaksh/views.py | 4 ++--
4 files changed, 48 insertions(+), 32 deletions(-)
(limited to 'yaksh')
diff --git a/yaksh/bash_code_evaluator.py b/yaksh/bash_code_evaluator.py
index e148fa8..e4b961c 100644
--- a/yaksh/bash_code_evaluator.py
+++ b/yaksh/bash_code_evaluator.py
@@ -22,10 +22,10 @@ class BashCodeEvaluator(CodeEvaluator):
def teardown(self):
# Delete the created file.
- super(BashCodeEvaluator, self).teardown()
os.remove(self.submit_code_path)
if self.files:
delete_files(self.files)
+ super(BashCodeEvaluator, self).teardown()
def check_code(self, user_answer, file_paths, test_case):
""" Function validates student script using instructor script as
diff --git a/yaksh/file_utils.py b/yaksh/file_utils.py
index afcf9e8..ba3ead0 100644
--- a/yaksh/file_utils.py
+++ b/yaksh/file_utils.py
@@ -1,7 +1,8 @@
import shutil
import os
import zipfile
-
+import tempfile
+from online_test.settings import OUTPUT_DIR
def copy_files(file_paths):
""" Copy Files to current directory, takes
@@ -14,16 +15,19 @@ def copy_files(file_paths):
files.append(file_name)
shutil.copy(file_path, os.getcwd())
if extract:
- z_files = extract_files(file_name)
+ z_files, path = extract_files(file_name, OUTPUT_DIR)
for file in z_files:
files.append(file)
return files
-def delete_files(files):
- """ Delete Files from current directory """
-
- for file in files:
+def delete_files(files, file_path=None):
+ """ Delete Files from directory """
+ for file_name in files:
+ if file_path:
+ file = os.path.join(file_path, file_name)
+ else:
+ file = file_name
if os.path.exists(file):
if os.path.isfile(file):
os.remove(file)
@@ -31,13 +35,18 @@ def delete_files(files):
shutil.rmtree(file)
-def extract_files(zip_file):
+def extract_files(zip_file, path=None):
+ """ extract files from zip """
zfiles = []
if zipfile.is_zipfile(zip_file):
zip_file = zipfile.ZipFile(zip_file, 'r')
for z_file in zip_file.namelist():
zfiles.append(z_file)
- zip_file.extractall()
+ if path:
+ extract_path = path
+ else:
+ extract_path = tempfile.gettempdir()
+ zip_file.extractall(extract_path)
zip_file.close()
- return zfiles
+ return zfiles, extract_path
diff --git a/yaksh/models.py b/yaksh/models.py
index f098cd2..95683c5 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -22,7 +22,7 @@ from os.path import join, abspath, dirname, exists
import shutil
import zipfile
import tempfile
-from .file_utils import extract_files
+from .file_utils import extract_files, delete_files
from yaksh.xmlrpc_clients import code_server
from django.conf import settings
@@ -174,7 +174,7 @@ class Course(models.Model):
demo_ques = Question()
demo_ques.create_demo_questions(user)
demo_que_ppr = QuestionPaper()
- demo_que_ppr.create_demo_quiz_ppr(demo_quiz)
+ demo_que_ppr.create_demo_quiz_ppr(demo_quiz, user)
success = True
else:
success = False
@@ -290,7 +290,7 @@ class Question(models.Model):
question._add_json_to_zip(zip_file, questions_dict)
return zip_file_name
- def load_questions(self, questions_list, user):
+ def load_questions(self, questions_list, user, file_path=None, files_list=None):
questions = json.loads(questions_list)
for question in questions:
question['user'] = user
@@ -298,10 +298,12 @@ class Question(models.Model):
test_cases = question.pop('testcase')
que, result = Question.objects.get_or_create(**question)
if file_names:
- que._add_files_to_db(file_names)
+ que._add_files_to_db(file_names, file_path)
model_class = get_model_class(que.test_case_type)
for test_case in test_cases:
model_class.objects.get_or_create(question=que, **test_case)
+ if files_list:
+ delete_files(files_list, file_path)
def get_test_cases(self, **kwargs):
test_case_ctype = ContentType.objects.get(app_label="yaksh",
@@ -333,15 +335,18 @@ class Question(models.Model):
files_list.append(((os.path.basename(f.file.path)), f.extract))
return files_list
- def _add_files_to_db(self, file_names):
+ def _add_files_to_db(self, file_names, path):
for file_name, extract in file_names:
- que_file = open(file_name, 'r')
- #Converting to Python file object with some Django-specific additions
- django_file = File(que_file)
- FileUpload.objects.get_or_create(file=django_file,
- question=self,
- extract=extract)
- os.remove(file_name)
+ q_file = os.path.join(path, file_name)
+ if os.path.exists(q_file):
+ que_file = open(q_file, 'r')
+ #Converting to Python file object with
+ # some Django-specific additions
+ django_file = File(que_file)
+ file_upload = FileUpload()
+ file_upload.question = self
+ file_upload.extract = extract
+ file_upload.file.save(file_name, django_file, save=True)
def _add_json_to_zip(self, zip_file, q_dict):
json_data = json.dumps(q_dict, indent=2)
@@ -353,18 +358,19 @@ class Question(models.Model):
zip_file.close()
shutil.rmtree(tmp_file_path)
- def read_json(self, json_file, user):
+ def read_json(self, file_path, user, files=None):
+ json_file = os.path.join(file_path, "questions_dump.json")
if os.path.exists(json_file):
with open(json_file, 'r') as q_file:
questions_list = q_file.read()
- self.load_questions(questions_list, user)
- os.remove(json_file)
+ print(questions_list)
+ self.load_questions(questions_list, user, file_path, files)
def create_demo_questions(self, user):
zip_file_path = os.path.join(os.getcwd(), 'yaksh',
- 'fixtures', 'demo_questions.zip')
- extract_files(zip_file_path)
- self.read_json("questions_dump.json", user)
+ 'fixtures', 'demo_questions.zip')
+ files, extract_path = extract_files(zip_file_path)
+ self.read_json(extract_path, user, files)
def __str__(self):
@@ -674,13 +680,14 @@ class QuestionPaper(models.Model):
prerequisite = self._get_prequisite_paper()
return prerequisite._is_questionpaper_passed(user)
- def create_demo_quiz_ppr(self, demo_quiz):
+ def create_demo_quiz_ppr(self, demo_quiz, user):
question_paper = QuestionPaper.objects.create(quiz=demo_quiz,
total_marks=5.0,
shuffle_questions=True
)
questions = Question.objects.filter(active=True,
- summary="Yaksh Demo Question")
+ summary="Yaksh Demo Question",
+ user=user)
# add fixed set of questions to the question paper
for question in questions:
question_paper.fixed_questions.add(question)
diff --git a/yaksh/views.py b/yaksh/views.py
index 049788a..611403d 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -929,8 +929,8 @@ def show_all_questions(request):
file_name = questions_file.name.split('.')
if file_name[-1] == "zip":
ques = Question()
- extract_files(questions_file)
- ques.read_json("questions_dump.json", user)
+ files, extract_path = extract_files(questions_file)
+ ques.read_json(extract_path, user, files)
else:
message = "Please Upload a ZIP file"
context['message'] = message
--
cgit
From 908797ed67fba67bbc40eae7bb8b85381b3e5141 Mon Sep 17 00:00:00 2001
From: adityacp
Date: Mon, 17 Oct 2016 12:59:34 +0530
Subject: changes in evaluator and file utils
---
yaksh/bash_stdio_evaluator.py | 2 +-
yaksh/file_utils.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
(limited to 'yaksh')
diff --git a/yaksh/bash_stdio_evaluator.py b/yaksh/bash_stdio_evaluator.py
index e5e0da6..a7ea1a4 100644
--- a/yaksh/bash_stdio_evaluator.py
+++ b/yaksh/bash_stdio_evaluator.py
@@ -17,10 +17,10 @@ class BashStdioEvaluator(StdIOEvaluator):
self.submit_code_path = self.create_submit_code_file('Test.sh')
def teardown(self):
- super(BashStdioEvaluator, self).teardown()
os.remove(self.submit_code_path)
if self.files:
delete_files(self.files)
+ super(BashStdioEvaluator, self).teardown()
def compile_code(self, user_answer, file_paths, expected_input, expected_output):
self.files = []
diff --git a/yaksh/file_utils.py b/yaksh/file_utils.py
index ba3ead0..f41c531 100644
--- a/yaksh/file_utils.py
+++ b/yaksh/file_utils.py
@@ -2,7 +2,7 @@ import shutil
import os
import zipfile
import tempfile
-from online_test.settings import OUTPUT_DIR
+
def copy_files(file_paths):
""" Copy Files to current directory, takes
@@ -15,7 +15,7 @@ def copy_files(file_paths):
files.append(file_name)
shutil.copy(file_path, os.getcwd())
if extract:
- z_files, path = extract_files(file_name, OUTPUT_DIR)
+ z_files, path = extract_files(file_name, os.getcwd())
for file in z_files:
files.append(file)
return files
--
cgit
From 4371bacf65cf6f174d0827b77efb8eecebee78a4 Mon Sep 17 00:00:00 2001
From: adityacp
Date: Mon, 17 Oct 2016 13:55:31 +0530
Subject: removed print statement
---
yaksh/models.py | 1 -
1 file changed, 1 deletion(-)
(limited to 'yaksh')
diff --git a/yaksh/models.py b/yaksh/models.py
index 95683c5..82b9fff 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -363,7 +363,6 @@ class Question(models.Model):
if os.path.exists(json_file):
with open(json_file, 'r') as q_file:
questions_list = q_file.read()
- print(questions_list)
self.load_questions(questions_list, user, file_path, files)
def create_demo_questions(self, user):
--
cgit
From 8e06cee7b1fea13d121d2d0677b0a8e3ea7f2e38 Mon Sep 17 00:00:00 2001
From: adityacp
Date: Tue, 18 Oct 2016 12:00:10 +0530
Subject: changed comment spacing
---
yaksh/models.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'yaksh')
diff --git a/yaksh/models.py b/yaksh/models.py
index 82b9fff..c4a280a 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -340,7 +340,7 @@ class Question(models.Model):
q_file = os.path.join(path, file_name)
if os.path.exists(q_file):
que_file = open(q_file, 'r')
- #Converting to Python file object with
+ # Converting to Python file object with
# some Django-specific additions
django_file = File(que_file)
file_upload = FileUpload()
--
cgit
From 3fcf7c6772bf6a3a91c4348a309e80ccc4592bba Mon Sep 17 00:00:00 2001
From: adityacp
Date: Tue, 25 Oct 2016 15:01:43 +0530
Subject: removed creation of user output directory
---
yaksh/models.py | 8 +-------
yaksh/output/README.txt | 4 ----
yaksh/views.py | 2 --
3 files changed, 1 insertion(+), 13 deletions(-)
delete mode 100644 yaksh/output/README.txt
(limited to 'yaksh')
diff --git a/yaksh/models.py b/yaksh/models.py
index cc64b98..7f9eead 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -206,12 +206,6 @@ class Profile(models.Model):
"""Return the output directory for the user."""
user_dir = join(settings.OUTPUT_DIR, str(self.user.username))
- if not exists(user_dir):
- os.makedirs(user_dir)
- # Make it rwx by others.
- os.chmod(user_dir, stat.S_IROTH | stat.S_IWOTH | stat.S_IXOTH
- | stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
- | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP)
return user_dir
@@ -680,7 +674,7 @@ class QuestionPaper(models.Model):
def create_demo_quiz_ppr(self, demo_quiz, user):
question_paper = QuestionPaper.objects.create(quiz=demo_quiz,
- total_marks=5.0,
+ total_marks=7.0,
shuffle_questions=True
)
questions = Question.objects.filter(active=True,
diff --git a/yaksh/output/README.txt b/yaksh/output/README.txt
deleted file mode 100644
index 3163ed4..0000000
--- a/yaksh/output/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains files generated/saved by users as per their
-username. The test executor will chdir into this user directory for each
-user when they run the test. Do not delete this directory and ensure that
-it is writeable by all.
\ No newline at end of file
diff --git a/yaksh/views.py b/yaksh/views.py
index 68e641e..4706222 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -415,8 +415,6 @@ def start(request, questionpaper_id=None, attempt_num=None):
msg = 'You do not have a profile and cannot take the quiz!'
raise Http404(msg)
new_paper = quest_paper.make_answerpaper(user, ip, attempt_num)
- # Make user directory.
- user_dir = new_paper.user.profile.get_user_dir()
return show_question(request, new_paper.current_question(), new_paper)
--
cgit
From 450954e5140b5c9a447127508e324841d311386a Mon Sep 17 00:00:00 2001
From: adityacp
Date: Tue, 25 Oct 2016 15:03:27 +0530
Subject: creation of user output directory from code evaluator
---
yaksh/code_evaluator.py | 3 +++
1 file changed, 3 insertions(+)
(limited to 'yaksh')
diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py
index 870a67f..e2097b0 100644
--- a/yaksh/code_evaluator.py
+++ b/yaksh/code_evaluator.py
@@ -94,6 +94,9 @@ class CodeEvaluator(object):
# Private Protocol ##########
def setup(self):
+ if self.in_dir:
+ if not os.path.exists(self.in_dir):
+ os.mkdir(self.in_dir)
self._change_dir(self.in_dir)
def safe_evaluate(self, user_answer, test_case_data, file_paths=None):
--
cgit
From a08fab86403b7aa2f813e5bafab08f7777ac3537 Mon Sep 17 00:00:00 2001
From: adityacp
Date: Tue, 25 Oct 2016 16:49:47 +0530
Subject: changed mkdir to makedirs
---
yaksh/code_evaluator.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'yaksh')
diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py
index e2097b0..79f616d 100644
--- a/yaksh/code_evaluator.py
+++ b/yaksh/code_evaluator.py
@@ -96,7 +96,7 @@ class CodeEvaluator(object):
def setup(self):
if self.in_dir:
if not os.path.exists(self.in_dir):
- os.mkdir(self.in_dir)
+ os.makedirs(self.in_dir)
self._change_dir(self.in_dir)
def safe_evaluate(self, user_answer, test_case_data, file_paths=None):
--
cgit
|