Last active
December 13, 2015 20:38
-
-
Save ir4y/4970907 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuestionType(models.Model): | |
""" | |
Типы тестов | |
""" | |
name = models.CharField(u'Название типа теста',max_length=50) | |
duration = models.PositiveIntegerField(u'продолжительность теста в минутах',blank=True,null=True) | |
class Question(models.Model): | |
""" | |
Вопросы тестов | |
""" | |
text = models.CharField(u'Текст вопроса',max_length=300) | |
type = models.ForeignKey('testing.QuestionType',verbose_name=u'Тип теста') | |
right_answer = models.ForeignKey('testing.Answer',verbose_name=u'Правильный ответ',related_name='rightanswer_set',null=True,blank=True) | |
has_user_input = models.BooleanField(u'Возможен ручой ввод ответа',default=False) | |
user_input_right = models.CharField(u'Правильный ответ ручного ввода',max_length=150,blank=True,null=True) | |
class Answer(models.Model): | |
""" | |
Варианты ответов | |
""" | |
text = models.CharField(u'Вариант ответа',max_length=50) | |
question = models.ForeignKey('testing.Question',verbose_name=u'Вопрос') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment