from odoo import models, fields


class EncoachExamAssignment(models.Model):
    _name = 'encoach.exam.assignment'
    _description = 'Exam Assignment'

    exam_id = fields.Many2one('encoach.exam.custom', required=True, ondelete='cascade')
    student_id = fields.Many2one('res.users', ondelete='cascade')
    batch_id = fields.Many2one('op.batch', ondelete='set null')
    access_start = fields.Datetime()
    access_end = fields.Datetime()
    status = fields.Selection([
        ('assigned', 'Assigned'),
        ('started', 'Started'),
        ('completed', 'Completed'),
        ('expired', 'Expired'),
    ], default='assigned', required=True)
