from odoo import models, fields


class EncoachScore(models.Model):
    _name = 'encoach.score'
    _description = 'Exam Score'

    attempt_id = fields.Many2one('encoach.student.attempt', required=True, ondelete='cascade', index=True)
    skill = fields.Selection([
        ('listening', 'Listening'),
        ('reading', 'Reading'),
        ('writing', 'Writing'),
        ('speaking', 'Speaking'),
        ('grammar', 'Grammar'),
        ('vocabulary', 'Vocabulary'),
        ('overall', 'Overall'),
    ], required=True)
    band_score = fields.Float()
    raw_score = fields.Float()
    max_score = fields.Float()
    cefr_level = fields.Selection([
        ('pre_a1', 'Pre-A1'),
        ('a1', 'A1'),
        ('a2', 'A2'),
        ('b1', 'B1'),
        ('b2', 'B2'),
        ('c1', 'C1'),
        ('c2', 'C2'),
    ])
    entity_id = fields.Many2one('encoach.entity', ondelete='set null')
