fix: resolve all QA/UAT report issues (P0-P3)
Made-with: Cursor
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -27,14 +27,33 @@ class EncoachAdaptiveController(http.Controller):
|
||||
from odoo.fields import Datetime as DT
|
||||
today_start = DT.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
||||
total_students = len(Path.search([]).mapped('student_id'))
|
||||
active_courses = len(Path.search([]).mapped('course_id').filtered(lambda c: c))
|
||||
all_paths = Path.search([])
|
||||
total_students = len(all_paths.mapped('student_id'))
|
||||
active_courses = len(all_paths.mapped('course_id').filtered(lambda c: c))
|
||||
|
||||
signals_today = Event.search_count([
|
||||
('event_type', '=', 'signal'),
|
||||
('created_at', '>=', today_start),
|
||||
])
|
||||
|
||||
avg_progress = 0.0
|
||||
if all_paths:
|
||||
progress_values = []
|
||||
for p in all_paths:
|
||||
try:
|
||||
module_queue = json.loads(p.module_queue or '[]')
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
module_queue = []
|
||||
total_modules = len(module_queue) if module_queue else 1
|
||||
completed = sum(
|
||||
1 for m in module_queue
|
||||
if isinstance(m, dict) and m.get('done')
|
||||
)
|
||||
progress_values.append(
|
||||
round(completed / total_modules * 100, 1) if total_modules else 0.0
|
||||
)
|
||||
avg_progress = round(sum(progress_values) / len(progress_values), 1) if progress_values else 0.0
|
||||
|
||||
recent_decisions = []
|
||||
decisions = Event.search(
|
||||
[('event_type', '=', 'decision')],
|
||||
@@ -52,7 +71,7 @@ class EncoachAdaptiveController(http.Controller):
|
||||
return _json_response({
|
||||
'total_students': total_students,
|
||||
'active_courses': active_courses,
|
||||
'avg_progress': 0.0,
|
||||
'avg_progress': avg_progress,
|
||||
'signals_today': signals_today,
|
||||
'recent_decisions': recent_decisions,
|
||||
})
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16,6 +16,9 @@
|
||||
""",
|
||||
"author": "EnCoach",
|
||||
"depends": ["base", "encoach_core"],
|
||||
"external_dependencies": {
|
||||
"python": ["openai", "boto3"],
|
||||
},
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
"views/ai_settings_views.xml",
|
||||
|
||||
BIN
custom_addons/encoach_ai/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
custom_addons/encoach_ai/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -125,54 +125,6 @@ class MediaController(http.Controller):
|
||||
except Exception as e:
|
||||
return _json_response({"video_id": video_id, "status": "error", "error": str(e)})
|
||||
|
||||
# ── POST /api/placement/speaking-upload — transcribe speaking audio ──
|
||||
@http.route("/api/placement/speaking-upload", type="http", auth="user", methods=["POST"], csrf=False)
|
||||
def speaking_upload(self, **kw):
|
||||
try:
|
||||
audio_file = request.httprequest.files.get("audio")
|
||||
if not audio_file:
|
||||
return _json_response({"error": "No audio file"}, 400)
|
||||
audio_data = audio_file.read()
|
||||
from odoo.addons.encoach_ai.services.whisper_service import WhisperService
|
||||
whisper = WhisperService(request.env)
|
||||
transcript = whisper.transcribe(audio_data, use_api=True)
|
||||
|
||||
from odoo.addons.encoach_ai.services.openai_service import OpenAIService
|
||||
ai = OpenAIService(request.env)
|
||||
grade = ai.grade_speaking("IELTS Speaking Band Descriptors", transcript["text"])
|
||||
|
||||
return _json_response({
|
||||
"transcript": transcript["text"],
|
||||
"scores": grade.get("scores", {}),
|
||||
"overall_band": grade.get("overall_band", 0),
|
||||
"feedback": grade.get("feedback", ""),
|
||||
"status": "completed",
|
||||
})
|
||||
except Exception as e:
|
||||
_logger.exception("Speaking upload failed")
|
||||
return _json_response({"status": "error", "error": str(e)}, 500)
|
||||
|
||||
# ── GET /api/placement/speaking-status — poll speaking evaluation ──
|
||||
@http.route("/api/placement/speaking-status", type="http", auth="user", methods=["GET"], csrf=False)
|
||||
def speaking_status(self, **kw):
|
||||
try:
|
||||
AiLog = request.env.get("encoach.ai.log")
|
||||
if AiLog:
|
||||
log = AiLog.sudo().search([
|
||||
("action", "=", "grade_speaking"),
|
||||
("create_uid", "=", request.env.uid),
|
||||
], limit=1, order="create_date desc")
|
||||
if log:
|
||||
return _json_response({
|
||||
"status": log.status or "completed",
|
||||
"log_id": log.id,
|
||||
"latency_ms": log.latency_ms,
|
||||
"created_at": log.create_date.isoformat() if log.create_date else "",
|
||||
})
|
||||
return _json_response({"status": "completed"})
|
||||
except Exception:
|
||||
return _json_response({"status": "completed"})
|
||||
|
||||
# ── POST /api/courses/ai-generate — AiCreationAssistant.tsx ──
|
||||
@http.route("/api/courses/ai-generate", type="http", auth="user", methods=["POST"], csrf=False)
|
||||
def ai_generate_course(self, **kw):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,9 @@
|
||||
'summary': 'Base controller utilities (JWT auth, response helpers) for EnCoach REST API',
|
||||
'author': 'EnCoach',
|
||||
'depends': ['base', 'encoach_core'],
|
||||
'external_dependencies': {
|
||||
'python': ['PyJWT'],
|
||||
},
|
||||
'data': [],
|
||||
'installable': True,
|
||||
'license': 'LGPL-3',
|
||||
|
||||
BIN
custom_addons/encoach_api/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
custom_addons/encoach_api/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
'category': 'Education',
|
||||
'summary': 'Whitelabeling and custom branding per entity',
|
||||
'author': 'EnCoach',
|
||||
'depends': ['encoach_core'],
|
||||
'depends': ['encoach_core', 'encoach_api'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'views/branding_views.xml',
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
custom_addons/encoach_core/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
custom_addons/encoach_core/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
"""Placeholder migration script for EnCoach Core v19.0.1.1.
|
||||
|
||||
Add actual migration logic here when schema changes are introduced.
|
||||
"""
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def migrate(cr, version):
|
||||
if not version:
|
||||
return
|
||||
_logger.info('EnCoach Core: pre-migrate from %s', version)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user