from odoo import models, fields


class EncoachExamCustomSection(models.Model):
    _name = 'encoach.exam.custom.section'
    _description = 'Custom Exam Section'

    exam_id = fields.Many2one('encoach.exam.custom', required=True, ondelete='cascade')
    title = fields.Char(size=200, required=True)
    skill = fields.Char(size=100)
    question_count = fields.Integer()
    time_limit_min = fields.Integer()
    scoring_method = fields.Selection([
        ('auto', 'Auto'),
        ('rubric', 'Rubric'),
        ('mixed', 'Mixed'),
    ], default='auto')
    sequence = fields.Integer(default=10)
    question_ids = fields.Many2many(
        'encoach.question',
        'exam_custom_section_question_rel',
        'section_id',
        'question_id',
    )
