summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaheshgudi2018-07-12 13:09:35 +0530
committermaheshgudi2018-07-12 13:09:35 +0530
commit7311255743aabd59bf0244257cf6377cae05d23e (patch)
treecf107a34abfe3a43fbebc4a676d3aece4ad6dd4f
parent00f01038b2a4653d87ca2529009fa873f6a4a26d (diff)
downloadonline_test-7311255743aabd59bf0244257cf6377cae05d23e.tar.gz
online_test-7311255743aabd59bf0244257cf6377cae05d23e.tar.bz2
online_test-7311255743aabd59bf0244257cf6377cae05d23e.zip
Make pep9 changes for question-yaml features
-rw-r--r--yaksh/models.py10
-rw-r--r--yaksh/test_views.py10
2 files changed, 11 insertions, 9 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 3e4644b..ddd7e01 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -1092,7 +1092,10 @@ class Question(models.Model):
files_list = []
for f in files:
zip_file.write(f.file.path, os.path.join("additional_files",
- os.path.basename(f.file.path))
+ os.path.basename(
+ f.file.path
+ )
+ )
)
files_list.append(((os.path.basename(f.file.path)), f.extract))
return files_list
@@ -1136,8 +1139,9 @@ class Question(models.Model):
def read_yaml(self, file_path, user, files=None):
msg = "Failed to upload Questions"
for ext in ["yaml", "yml"]:
- for yaml_file in glob.glob(
- os.path.join(file_path, "*.{0}".format(ext))):
+ for yaml_file in glob.glob(os.path.join(file_path,
+ "*.{0}".format(ext)
+ )):
if os.path.exists(yaml_file):
with open(yaml_file, 'r') as q_file:
questions_list = q_file.read()
diff --git a/yaksh/test_views.py b/yaksh/test_views.py
index edac077..46d3929 100644
--- a/yaksh/test_views.py
+++ b/yaksh/test_views.py
@@ -3989,10 +3989,10 @@ class TestShowQuestions(TestCase):
active=True
)
test_case_upload_data = [{"test_case": "assert fact(3)==6",
- "test_case_type": "standardtestcase",
- "test_case_args": "",
- "weight": 1.0
- }]
+ "test_case_type": "standardtestcase",
+ "test_case_args": "",
+ "weight": 1.0
+ }]
question_data_1 = {"snippet": "def fact()", "active": True,
"points": 1.0,
"description": "factorial of a no",
@@ -4019,7 +4019,6 @@ class TestShowQuestions(TestCase):
yaml_question_2.encode("utf-8")
)
-
def test_show_questions_denies_student(self):
"""
Check show questions denies student
@@ -4174,7 +4173,6 @@ class TestShowQuestions(TestCase):
self.assertTemplateUsed(response, 'yaksh/showquestions.html')
self.assertEqual(uploaded_ques, 1)
-
def test_attempt_questions(self):
"""
Check for testing questions