I am making a system for a company which among other things must hold information about the satisfactory level about various things, I have made it work fine using a fixed model with fixed questions and answers, but I am sure that they will need to change or add questions.
So I want to make a system where users can make custom evaluation schemas that consists of custom questions defined by them. How do I go about making such a design?
Right now my model is this, but wrong:
RATING_CHOICES = ((0, u"Good"), (1, u"Bad"), (2, u"Dunno"),)
class EvaluationScheme(models.Model):
title = models.CharField(max_length=200)
class Evaluation(models.Model):
doctor = models.CharField(max_length=200)
agency = models.CharField(max_length=200)
scheme = models.ForeignKey(EvaluationScheme)
class EvaluationQuestion(models.Model):
question = models.CharField(max_length=200)
evaluation = models.ForeignKey(EvaluationScheme)
def __unicode__(self):
return self.question
class EvaluationAnswer(models.Model):
evaluation = models.ForeignKey(Evaluation)
question = models.ForeignKey(EvaluationQuestion)
answer = models.SmallIntegerField(choices=RATING_CHOICES)
This is sort of what I want, except that the EvaluationScheme is useless, since you still have to chose all questions and answers yourself - it does not display a list of only the questions related to the schema of choice.