From 964506a34c92f2c8b0c6a926bd9615fa9cfa36c0 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Fri, 13 Oct 2017 14:57:35 +0530 Subject: Sort students' name in grade user in alphabetical order --- yaksh/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yaksh/models.py b/yaksh/models.py index 787daa6..4c15fce 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1094,6 +1094,7 @@ class AnswerPaperManager(models.Manager): def get_users_for_questionpaper(self, questionpaper_id): return self._get_answerpapers_for_quiz(questionpaper_id, status=True)\ .values("user__id", "user__first_name", "user__last_name")\ + .order_by("user__first_name")\ .distinct() def get_user_all_attempts(self, questionpaper, user): -- cgit From 774b184347c0460117356ccae85acd9b2dc45b3d Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Tue, 17 Oct 2017 12:14:40 +0530 Subject: Yaml fields are sorted according to relevance --- yaksh/models.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/yaksh/models.py b/yaksh/models.py index 4c15fce..39a2a7a 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -504,8 +504,20 @@ class Question(models.Model): tmp_file_path = tempfile.mkdtemp() yaml_path = os.path.join(tmp_file_path, "questions_dump.yaml") for elem in q_dict: - sorted_dict = CommentedMap(sorted(elem.items(), key=lambda x:x[0])) - yaml_block = dict_to_yaml(sorted_dict) + relevant_dict = CommentedMap() + irrelevant_dict = CommentedMap() + relevant_dict['summary'] = elem.pop('summary') + relevant_dict['type'] = elem.pop('type') + relevant_dict['language'] = elem.pop('language') + relevant_dict['description'] = elem.pop('description') + relevant_dict['points'] = elem.pop('points') + relevant_dict['testcase'] = elem.pop('testcase') + relevant_dict.update(CommentedMap(sorted(elem.items(), + key=lambda x:x[0] + )) + ) + + yaml_block = dict_to_yaml(relevant_dict) with open(yaml_path, "a") as yaml_file: yaml_file.write(yaml_block) zip_file.write(yaml_path, os.path.basename(yaml_path)) -- cgit From 52c0408298a5559cb24f7e2f4251b207546c7d22 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Tue, 17 Oct 2017 12:43:03 +0530 Subject: Add shebang to bash code evaluator --- yaksh/bash_code_evaluator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaksh/bash_code_evaluator.py b/yaksh/bash_code_evaluator.py index a4f1389..038d39c 100644 --- a/yaksh/bash_code_evaluator.py +++ b/yaksh/bash_code_evaluator.py @@ -77,7 +77,8 @@ class BashCodeEvaluator(BaseEvaluator): if self.test_case_args: self.tc_args_path = self.create_submit_code_file('main.args') self.write_to_submit_code_file(self.tc_args_path, self.test_case_args) - self.user_answer = self.user_answer.replace("\r", "") + shebang = "#!/bin/bash\n" + self.user_answer = shebang + self.user_answer.replace("\r", "") self.test_case = self.test_case.replace("\r", "") self.write_to_submit_code_file(self.submit_code_path, self.user_answer) self.write_to_submit_code_file(self.test_code_path, self.test_case) -- cgit From 90e8295819f606bcf794a5bcd521b4ef08cb98e0 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Fri, 13 Oct 2017 14:57:35 +0530 Subject: Sort students' name in grade user in alphabetical order --- yaksh/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yaksh/models.py b/yaksh/models.py index f7d9906..3fcfa39 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1097,6 +1097,7 @@ class AnswerPaperManager(models.Manager): def get_users_for_questionpaper(self, questionpaper_id): return self._get_answerpapers_for_quiz(questionpaper_id, status=True)\ .values("user__id", "user__first_name", "user__last_name")\ + .order_by("user__first_name")\ .distinct() def get_user_all_attempts(self, questionpaper, user): -- cgit From 9e31fd95ac56165c4ed4923e92fd7b673295cf79 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Tue, 17 Oct 2017 12:14:40 +0530 Subject: Yaml fields are sorted according to relevance --- yaksh/models.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/yaksh/models.py b/yaksh/models.py index 3fcfa39..87f153c 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -506,8 +506,20 @@ class Question(models.Model): tmp_file_path = tempfile.mkdtemp() yaml_path = os.path.join(tmp_file_path, "questions_dump.yaml") for elem in q_dict: - sorted_dict = CommentedMap(sorted(elem.items(), key=lambda x:x[0])) - yaml_block = dict_to_yaml(sorted_dict) + relevant_dict = CommentedMap() + irrelevant_dict = CommentedMap() + relevant_dict['summary'] = elem.pop('summary') + relevant_dict['type'] = elem.pop('type') + relevant_dict['language'] = elem.pop('language') + relevant_dict['description'] = elem.pop('description') + relevant_dict['points'] = elem.pop('points') + relevant_dict['testcase'] = elem.pop('testcase') + relevant_dict.update(CommentedMap(sorted(elem.items(), + key=lambda x:x[0] + )) + ) + + yaml_block = dict_to_yaml(relevant_dict) with open(yaml_path, "a") as yaml_file: yaml_file.write(yaml_block) zip_file.write(yaml_path, os.path.basename(yaml_path)) -- cgit From da9cfe53f6c427d5cb918ae9dd03d98f7c21afa1 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Tue, 17 Oct 2017 12:43:03 +0530 Subject: Add shebang to bash code evaluator --- yaksh/bash_code_evaluator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaksh/bash_code_evaluator.py b/yaksh/bash_code_evaluator.py index a4f1389..038d39c 100644 --- a/yaksh/bash_code_evaluator.py +++ b/yaksh/bash_code_evaluator.py @@ -77,7 +77,8 @@ class BashCodeEvaluator(BaseEvaluator): if self.test_case_args: self.tc_args_path = self.create_submit_code_file('main.args') self.write_to_submit_code_file(self.tc_args_path, self.test_case_args) - self.user_answer = self.user_answer.replace("\r", "") + shebang = "#!/bin/bash\n" + self.user_answer = shebang + self.user_answer.replace("\r", "") self.test_case = self.test_case.replace("\r", "") self.write_to_submit_code_file(self.submit_code_path, self.user_answer) self.write_to_submit_code_file(self.test_code_path, self.test_case) -- cgit From aba4c79491fe6675948d584e572238eecf4fb82b Mon Sep 17 00:00:00 2001 From: mahesh Date: Fri, 20 Oct 2017 12:17:52 +0530 Subject: Add bash command instead of shebang --- yaksh/bash_code_evaluator.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/yaksh/bash_code_evaluator.py b/yaksh/bash_code_evaluator.py index 038d39c..4a15af3 100644 --- a/yaksh/bash_code_evaluator.py +++ b/yaksh/bash_code_evaluator.py @@ -77,8 +77,7 @@ class BashCodeEvaluator(BaseEvaluator): if self.test_case_args: self.tc_args_path = self.create_submit_code_file('main.args') self.write_to_submit_code_file(self.tc_args_path, self.test_case_args) - shebang = "#!/bin/bash\n" - self.user_answer = shebang + self.user_answer.replace("\r", "") + self.user_answer = self.user_answer.replace("\r", "") self.test_case = self.test_case.replace("\r", "") self.write_to_submit_code_file(self.submit_code_path, self.user_answer) self.write_to_submit_code_file(self.test_code_path, self.test_case) @@ -100,13 +99,13 @@ class BashCodeEvaluator(BaseEvaluator): return False, msg, 0.0 if not clean_test_case_path: - ret = self._run_command(clean_ref_code_path, + ret = self._run_command(["bash", clean_ref_code_path], stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) proc, inst_stdout, inst_stderr = ret - ret = self._run_command(self.submit_code_path, + ret = self._run_command(["bash", self.submit_code_path], stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE @@ -137,7 +136,7 @@ class BashCodeEvaluator(BaseEvaluator): for tc in test_cases: loop_count += 1 if valid_answer: - args = [clean_ref_code_path] + \ + args = ["bash", clean_ref_code_path] + \ [x for x in tc.split()] ret = self._run_command(args, stdin=None, @@ -147,7 +146,7 @@ class BashCodeEvaluator(BaseEvaluator): proc, inst_stdout, inst_stderr = ret if self.file_paths: self.files = copy_files(self.file_paths) - args = [self.submit_code_path] + \ + args = ["bash", self.submit_code_path] + \ [x for x in tc.split()] ret = self._run_command(args, stdin=None, -- cgit From e45b9cce359567c28001b34e1ccd14b51130cdb3 Mon Sep 17 00:00:00 2001 From: mahesh Date: Fri, 20 Oct 2017 13:28:18 +0530 Subject: Update changelog for the release of v0.7. --- CHANGELOG.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6812c34..8460bca 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,18 @@ +=== 0.7.0 (Tentatively 23-10-2017) === + +* Simplified Standard I/O type question error output. +* Added the facility to search questions using tags. +* Added the facility to search for user profiles on admin site. +* Replaced json format with yaml format for downloading and uploading questions. +* Fixed a bug that returned multiple answerpaper objects for a user. +* Fixed a bug that allowed anyonymous users access quit exam page. +* Fixed a bug that prevented moderators from changing passwords. +* Fixed a bug that returned nonetype object as the last attempted answer. +* Updated the validation of MCQ/MCC type question. +* Fixed a bug that did not allow expected input in Standard I/O type question to be none. +* UI changes in grade user, view answerpaper and monitor pages. +* Fixed a bug that would require shebang to be put in for Bash assertion based questions. + === 0.6.0 (11-05-2017) === * Added a course code field that can be used to search a course. -- cgit From b82a1a25e62d7eb73f16512dc8fc5a9985596dca Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Wed, 25 Oct 2017 13:17:44 +0530 Subject: Fix typo in changelog --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8460bca..ab9e4b2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,7 @@ * Added the facility to search for user profiles on admin site. * Replaced json format with yaml format for downloading and uploading questions. * Fixed a bug that returned multiple answerpaper objects for a user. -* Fixed a bug that allowed anyonymous users access quit exam page. +* Fixed a bug that allowed anonymous users access quit exam page. * Fixed a bug that prevented moderators from changing passwords. * Fixed a bug that returned nonetype object as the last attempted answer. * Updated the validation of MCQ/MCC type question. -- cgit