from odoo import models, fields


class EncoachWritingPrompt(models.Model):
    _name = 'encoach.writing.prompt'
    _description = 'Writing Prompt'

    exam_type = fields.Selection([
        ('academic', 'Academic'),
        ('general_training', 'General Training'),
        ('general_english', 'General English'),
    ], required=True)
    task = fields.Selection([
        ('task1', 'Task 1'),
        ('task2', 'Task 2'),
    ], required=True)
    writing_type = fields.Char(size=100)
    prompt_text = fields.Text(required=True)
    visual_url = fields.Char(size=500)
    rubric_id = fields.Many2one('encoach.rubric', ondelete='set null')
    min_words = fields.Integer()
    model_answer = fields.Text()
    ai_generated = fields.Boolean(default=False)
    approved = fields.Boolean(default=False)
    ielts_certified = fields.Boolean(default=False)
    generation_brief = fields.Text()
    validation_errors = fields.Text()
