summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2020-09-09 17:07:21 +0530
committeradityacp2020-09-09 17:07:21 +0530
commit28f9fc3fa8b6ad7866c7ef72f13883af7d6ab7e7 (patch)
tree3b6b3e1ee7c3181edf9edbe6d43f7f6f2000cdde /yaksh/models.py
parent196e5df3930d4c3f18dfd7e33c9821ca2f74a51e (diff)
downloadonline_test-28f9fc3fa8b6ad7866c7ef72f13883af7d6ab7e7.tar.gz
online_test-28f9fc3fa8b6ad7866c7ef72f13883af7d6ab7e7.tar.bz2
online_test-28f9fc3fa8b6ad7866c7ef72f13883af7d6ab7e7.zip
Show the toc quiz on the student dashboard
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 9ba4afd..851e5c6 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -2762,9 +2762,9 @@ class TableOfContents(models.Model):
def get_toc_text(self):
if self.content == 1:
- content_name = Topic.objects.get(id=self.object_id).name
+ content_name = self.content_object.name
else:
- content_name = Question.objects.get(id=self.object_id).summary
+ content_name = self.content_object.summary
return content_name
def __str__(self):
@@ -2779,6 +2779,15 @@ class Topic(models.Model):
return f"{self.name}"
+class VideoQuizAnswer(models.Model):
+ toc = models.ForeignKey(TableOfContents, on_delete=models.CASCADE)
+ student = models.ForeignKey(User, on_delete=models.CASCADE)
+ answer = models.ForeignKey(Answer, on_delete=models.CASCADE)
+
+ def __str__(self):
+ return f"Lesson answer of {self.toc} by {self.user.get_full_name()}"
+
+
class MicroManager(models.Model):
manager = models.ForeignKey(User, on_delete=models.CASCADE,
related_name='micromanaging', null=True)