diff options
author | ankitjavalkar | 2015-03-18 12:16:20 +0530 |
---|---|---|
committer | ankitjavalkar | 2015-04-26 19:46:00 +0530 |
commit | 28ba37e907553aeac3841e221853683b9171f0db (patch) | |
tree | 9926315f93ac82fb21ae1f98450cfa031da8f996 /testapp/exam/models.py | |
parent | a88e59fa419d7ab31aa430e7424ff0a25169713f (diff) | |
download | online_test-28ba37e907553aeac3841e221853683b9171f0db.tar.gz online_test-28ba37e907553aeac3841e221853683b9171f0db.tar.bz2 online_test-28ba37e907553aeac3841e221853683b9171f0db.zip |
Changes to Question model, Views, Add-Question UI
- ref_code_path is now part of Question model
- MCQ/MCC answers checked using solution field in question model
- Formset should reload even after errors
- add_question page chould display solution field only in MCQ/MCC
Diffstat (limited to 'testapp/exam/models.py')
-rw-r--r-- | testapp/exam/models.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/testapp/exam/models.py b/testapp/exam/models.py index dd0c806..5989be4 100644 --- a/testapp/exam/models.py +++ b/testapp/exam/models.py @@ -60,8 +60,11 @@ class Question(models.Model): # Number of points for the question. points = models.FloatField(default=1.0) - # # Test cases for the question in the form of code that is run. - # test = models.TextField(blank=True) + # Answer for MCQs. + solution = models.TextField(blank=True) + + # Test cases file paths + ref_code_path = models.TextField(blank=True) # Any multiple choice options. Place one option per line. options = models.TextField(blank=True) @@ -114,6 +117,7 @@ class Question(models.Model): info_parameter['id'] = self.id info_parameter['user_answer'] = user_answer info_parameter['test_parameter'] = test_case_parameter + info_parameter['ref_code_path'] = self.ref_code_path return json.dumps(info_parameter) @@ -449,5 +453,5 @@ class TestCase(models.Model): # Test case Expected answer in list form expected_answer = models.TextField(blank=True, null = True) - # Test case path to system test code applicable for CPP, C, Java and Scilab - ref_code_path = models.TextField(blank=True, null = True) + # # Test case path to system test code applicable for CPP, C, Java and Scilab + # ref_code_path = models.TextField(blank=True, null = True) |