diff options
author | Prabhu Ramachandran | 2016-12-03 15:10:56 +0530 |
---|---|---|
committer | GitHub | 2016-12-03 15:10:56 +0530 |
commit | f416da9901ebca437c100bb80511eb87544f709d (patch) | |
tree | d63c7ce7e5f6d1c97d401d317a5211837fb011aa /yaksh/models.py | |
parent | 7fab5de07a05cf8f84e7beb8b4c166c0398172be (diff) | |
parent | f76c6c7aab4df2f743259334aa91ca295cb854ee (diff) | |
download | online_test-f416da9901ebca437c100bb80511eb87544f709d.tar.gz online_test-f416da9901ebca437c100bb80511eb87544f709d.tar.bz2 online_test-f416da9901ebca437c100bb80511eb87544f709d.zip |
Merge pull request #161 from adityacp/quiz_instructions_editable
Quiz instructions editable
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 2018198..dc12707 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -80,6 +80,10 @@ def has_profile(user): def get_upload_dir(instance, filename): return "question_%s/%s" % (instance.question.id, filename) +def get_quiz_instructions_info(): + file_path = os.path.join(os.getcwd(), "Quiz_instructions.txt") + with open(file_path, 'r') as file: + return file.read() ############################################################################### class CourseManager(models.Manager): @@ -534,6 +538,9 @@ class Quiz(models.Model): is_trial = models.BooleanField(default=False) + instructions = models.TextField('Instructions for Students', + default=get_quiz_instructions_info) + view_answerpaper = models.BooleanField('Allow student to view their answer\ paper', default=False) |