summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2016-11-30 17:37:03 +0530
committeradityacp2016-11-30 17:37:03 +0530
commit9b4416ecee8b7522d1c3f4de25557a31315df397 (patch)
tree52d08b4a35b932672c1815c49ea3acde4828380f
parent7fab5de07a05cf8f84e7beb8b4c166c0398172be (diff)
downloadonline_test-9b4416ecee8b7522d1c3f4de25557a31315df397.tar.gz
online_test-9b4416ecee8b7522d1c3f4de25557a31315df397.tar.bz2
online_test-9b4416ecee8b7522d1c3f4de25557a31315df397.zip
Added field Instructions in Quiz
-rw-r--r--yaksh/models.py7
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)