from cpm_assessment import db

class Choice(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    text = db.Column(db.String(100), nullable=False)
    question_id = db.Column(db.Integer, db.ForeignKey('question.id'), nullable=False)
    weightage = db.Column(db.Integer, nullable=False, default=0)

    def __repr__(self):
        return f"Choice('{self.text}', '{self.weightage}')"
