diff options
author | ankitjavalkar | 2016-05-02 11:52:58 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-05-05 19:24:54 +0530 |
commit | 23b7abd3c1125e4c875e214e4f673c48c4bf4752 (patch) | |
tree | a76fccd392e054f33a3fc4bbd388c0aaa34bb40b /yaksh/models.py | |
parent | b40b668bcecd01b3c7f9f16b87775770ba06a33a (diff) | |
download | online_test-23b7abd3c1125e4c875e214e4f673c48c4bf4752.tar.gz online_test-23b7abd3c1125e4c875e214e4f673c48c4bf4752.tar.bz2 online_test-23b7abd3c1125e4c875e214e4f673c48c4bf4752.zip |
Remove commented code and cleanup
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index fa4121d..a200ae1 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -159,16 +159,6 @@ class Question(models.Model): # Number of points for the question. points = models.FloatField(default=1.0) - # Answer for MCQs. - # test = models.TextField(blank=True) - - # Test cases file paths (comma seperated for reference code path and test case code path) - # Applicable for CPP, C, Java and Scilab - # ref_code_path = models.TextField(blank=True) - - # # Any multiple choice options. Place one option per line. - # options = models.TextField(blank=True) - # The language for question. language = models.CharField(max_length=24, choices=languages) @@ -183,52 +173,12 @@ class Question(models.Model): # when creating a QuestionPaper. active = models.BooleanField(default=True) - # Snippet of code provided to the user. - # snippet = models.CharField(max_length=256) - # Tags for the Question. tags = TaggableManager(blank=True) # user for particular question user = models.ForeignKey(User, related_name="user") - # def consolidate_answer_data(self, test_cases, user_answer): - # def consolidate_answer_data(self, user_answer): - # test_case_data_dict = [] - # question_info_dict = {} - - # for test_case in test_cases: - # kw_args_dict = {} - # pos_args_list = [] - - # test_case_data = {} - # test_case_data['test_id'] = test_case.id - # test_case_data['func_name'] = test_case.func_name - # test_case_data['expected_answer'] = test_case.expected_answer - - # if test_case.kw_args: - # for args in test_case.kw_args.split(","): - # arg_name, arg_value = args.split("=") - # kw_args_dict[arg_name.strip()] = arg_value.strip() - - # if test_case.pos_args: - # for args in test_case.pos_args.split(","): - # pos_args_list.append(args.strip()) - - # test_case_data['kw_args'] = kw_args_dict - # test_case_data['pos_args'] = pos_args_list - # test_case_data_dict.append(test_case_data) - - # question_info_dict['language'] = self.language - # question_info_dict['id'] = self.id - # question_info_dict['user_answer'] = user_answer - # question_info_dict['test_parameter'] = test_case_data_dict - # question_info_dict['ref_code_path'] = self.ref_code_path - # question_info_dict['test'] = self.test - # question_info_dict['test_case_type'] = self.test_case_type - - # return json.dumps(question_info_dict) - def consolidate_answer_data(self, user_answer): question_data = {} test_case_data = [] @@ -239,18 +189,11 @@ class Question(models.Model): test_case_as_dict = test.get_field_value() test_case_data.append(test_case_as_dict) - # test_cases = self.testcase_set.all() - # for test in test_cases: - # test_case_child_instance = test.get_child_instance(self.test_case_type) - # test_case_instance_dict = test_case_child_instance.get_instance_as_dict() - # test_case_data.append(test_case_field_value) - question_data['test_case_data'] = test_case_data question_data['user_answer'] = user_answer return json.dumps(question_data) -<<<<<<< HEAD def dump_into_json(self, question_ids, user): questions = Question.objects.filter(id__in = question_ids, user_id = user.id) questions_dict = [] @@ -277,9 +220,6 @@ class Question(models.Model): return test_cases - # def get_test_case(self, test_case_id): - # test_case_ctype = ContentType.objects.get(app_label="yaksh", model=self.test_case_type) - # test_case = test_case_ctype.get_object_for_this_type(question=self, id=test_case_id) def get_test_case(self, **kwargs): test_case_ctype = ContentType.objects.get(app_label="yaksh", model=self.test_case_type) test_case = test_case_ctype.get_object_for_this_type(question=self, **kwargs) @@ -801,10 +741,6 @@ class AssignmentUpload(models.Model): class TestCase(models.Model): question = models.ForeignKey(Question, blank=True, null = True) - # def get_child_instance(self, type): - # return getattr(self, type) - - class StandardTestCase(TestCase): test_case = models.TextField(blank=True) |