equal
deleted
inserted
replaced
25 |
25 |
26 class Answer(models.Model): |
26 class Answer(models.Model): |
27 """ A model for holding answers submitted by users. |
27 """ A model for holding answers submitted by users. |
28 """ |
28 """ |
29 |
29 |
30 question = models.ForeignKey(QuestionBank) |
30 question = models.ForeignKey(QuestionBank, related_name="%(class)s") |
31 submitted_ans = models.TextField() |
31 submitted_ans = models.TextField() |
32 is_correct = models.BooleanField(default=False) |
32 is_correct = models.BooleanField(default=False) |
33 |
33 |
34 class Quiz(models.Model): |
34 class Quiz(models.Model): |
35 """ A model to hold the proceeding of a quiz. |
35 """ A model to hold the proceeding of a quiz. |
40 user_ip = models.CharField(max_length=15) |
40 user_ip = models.CharField(max_length=15) |
41 key = models.CharField(max_length=10) |
41 key = models.CharField(max_length=10) |
42 |
42 |
43 quiz_num = models.CharField(max_length=2) |
43 quiz_num = models.CharField(max_length=2) |
44 que_remaining = models.CharField(max_length=100) |
44 que_remaining = models.CharField(max_length=100) |
45 que_answered = models.ManyToManyField(Answer) |
45 que_answered = models.ManyToManyField(Answer, related_name="%(class)s") |
46 |
46 |