feat: EnCoach V2 — complete OWL refactor with 15 new modules
Full architectural refactor from React to Odoo OWL: - 15 new Odoo modules: signup, placement, exam_template, scoring, course_gen, entity_onboard, ai_course, quality_gate, ielts_validation, pdf_report, verification, math, it, portal, exam_session - 6 modified modules: core (new user fields), exam (template types), adaptive (events/paths/settings), branding (white-label), resources (CEFR/AI fields), taxonomy (Math+IT hierarchies) - ~79 new REST API endpoints across all controller packages - ~50 admin backend views (form/list/kanban/search/menu) - 5 custom OWL components: dashboard, content pool, exam validation, gap analysis, adaptive timeline - POS-inspired full-screen exam session with 9 question renderers - Student portal with 12 website pages (QWeb + OWL) - AI/ML services: IRT 3PL CAT engine, CEFR mapper, quality gates, IELTS validator, SymPy math scorer, speaking evaluator, adaptive engine - Seed data: IELTS/TOEFL/STEP/IC3 templates, 30+ sample questions, English/Math/IT taxonomy trees with 50+ topics - Updated requirements.txt with new dependencies Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class EncoachResource(models.Model):
|
||||
_name = 'encoach.resource'
|
||||
_description = 'Learning Resource'
|
||||
|
||||
name = fields.Char(required=True)
|
||||
type = fields.Selection([
|
||||
('video', 'Video'),
|
||||
('pdf', 'PDF'),
|
||||
('document', 'Document'),
|
||||
('link', 'Link'),
|
||||
('interactive', 'Interactive'),
|
||||
])
|
||||
review_status = fields.Selection([
|
||||
('pending', 'Pending'),
|
||||
('approved', 'Approved'),
|
||||
('rejected', 'Rejected'),
|
||||
], default='approved')
|
||||
subject_id = fields.Many2one('encoach.subject', ondelete='set null')
|
||||
topic_ids = fields.Many2many('encoach.topic')
|
||||
file = fields.Binary(attachment=True)
|
||||
url = fields.Char()
|
||||
difficulty = fields.Selection([
|
||||
('beginner', 'Beginner'), ('intermediate', 'Intermediate'), ('advanced', 'Advanced'),
|
||||
])
|
||||
duration_minutes = fields.Integer()
|
||||
active = fields.Boolean(default=True)
|
||||
creator_id = fields.Many2one('res.users', default=lambda self: self.env.user)
|
||||
|
||||
cefr_level = fields.Selection([
|
||||
('pre_a1', 'Pre-A1'), ('a1', 'A1'), ('a2', 'A2'),
|
||||
('b1', 'B1'), ('b2', 'B2'), ('c1', 'C1'), ('c2', 'C2'),
|
||||
])
|
||||
grammar_topic = fields.Char(size=200)
|
||||
vocab_band = fields.Char(size=50)
|
||||
ai_generated = fields.Boolean(default=False)
|
||||
approved = fields.Boolean(default=False)
|
||||
|
||||
def to_api_dict(self):
|
||||
self.ensure_one()
|
||||
creator = self.creator_id
|
||||
return {
|
||||
'id': self.id,
|
||||
'name': self.name,
|
||||
'type': self.type or '',
|
||||
'resource_type': self.type or 'document',
|
||||
'subject_id': self.subject_id.id if self.subject_id else None,
|
||||
'topic_ids': self.topic_ids.ids,
|
||||
'topic_names': self.topic_ids.mapped('name'),
|
||||
'url': self.url or '',
|
||||
'has_file': bool(self.file),
|
||||
'difficulty': self.difficulty or '',
|
||||
'duration_minutes': self.duration_minutes,
|
||||
'author_id': creator.id if creator else None,
|
||||
'author_name': creator.name if creator else '',
|
||||
'is_published': bool(self.active),
|
||||
'review_status': self.review_status or 'approved',
|
||||
'cefr_level': self.cefr_level or '',
|
||||
'grammar_topic': self.grammar_topic or '',
|
||||
'vocab_band': self.vocab_band or '',
|
||||
'ai_generated': self.ai_generated,
|
||||
'approved': self.approved,
|
||||
'created_at': self.create_date.isoformat() if self.create_date else '',
|
||||
'file_name': self.name,
|
||||
}
|
||||
Reference in New Issue
Block a user