Update Saqel Platform: 2026-09-08 18:19:28
This commit is contained in:
@@ -52,19 +52,19 @@ class TeacherRatingService
|
||||
Database::query("
|
||||
CREATE TABLE teacher_performance_metrics (
|
||||
teacher_id BIGINT UNSIGNED PRIMARY KEY,
|
||||
avg_response_minutes INT DEFAULT 4,
|
||||
response_rate_percentage DECIMAL(5, 2) DEFAULT 98.50,
|
||||
avg_response_minutes INT DEFAULT 0,
|
||||
response_rate_percentage DECIMAL(5, 2) DEFAULT 0,
|
||||
active_queue_count INT UNSIGNED DEFAULT 0,
|
||||
total_students_enrolled INT DEFAULT 0,
|
||||
total_reviews_count INT DEFAULT 0,
|
||||
raw_avg_rating DECIMAL(3, 2) DEFAULT 5.00,
|
||||
weighted_student_rating DECIMAL(3, 2) DEFAULT 5.00,
|
||||
ai_engagement_score DECIMAL(5, 2) DEFAULT 96.00,
|
||||
sla_speed_score DECIMAL(5, 2) DEFAULT 98.00,
|
||||
mastery_impact_score DECIMAL(5, 2) DEFAULT 94.00,
|
||||
composite_merit_score DECIMAL(5, 2) DEFAULT 96.50,
|
||||
star_equivalent DECIMAL(3, 2) DEFAULT 4.90,
|
||||
reputation_tier VARCHAR(100) DEFAULT 'معلم نخبوي معتمد 💎',
|
||||
raw_avg_rating DECIMAL(3, 2) DEFAULT 0,
|
||||
weighted_student_rating DECIMAL(3, 2) DEFAULT 0,
|
||||
ai_engagement_score DECIMAL(5, 2) DEFAULT 0,
|
||||
sla_speed_score DECIMAL(5, 2) DEFAULT 0,
|
||||
mastery_impact_score DECIMAL(5, 2) DEFAULT 0,
|
||||
composite_merit_score DECIMAL(5, 2) DEFAULT 0,
|
||||
star_equivalent DECIMAL(3, 2) DEFAULT 0,
|
||||
reputation_tier VARCHAR(100) DEFAULT 'بانتظار بيانات الأداء',
|
||||
last_calculated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
CONSTRAINT fk_tpm_teacher FOREIGN KEY (teacher_id) REFERENCES teachers(id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
@@ -308,10 +308,6 @@ class TeacherRatingService
|
||||
]
|
||||
);
|
||||
|
||||
if ($studentsCount <= 0) {
|
||||
$studentsCount = 83;
|
||||
}
|
||||
|
||||
return [
|
||||
'teacher_id' => $teacherId,
|
||||
'composite_merit_score' => $compositeScore,
|
||||
@@ -327,12 +323,12 @@ class TeacherRatingService
|
||||
'sla_speed_score' => $slaComponent,
|
||||
'mastery_impact_score' => $masteryComponent,
|
||||
'ai_engagement_score' => $aiEngagementScore,
|
||||
'success_rate_percentage' => 98.2,
|
||||
'curriculum_alignment_pct' => 96.0,
|
||||
'socratic_interaction_pct' => 89.0,
|
||||
'audio_clarity_pct' => 94.0,
|
||||
'cognitive_focus_pct' => 92.0,
|
||||
'ai_recommendation' => 'توجيه الذكاء الاصطناعي الأسبوعي: نسبة الالتزام الوزاري ممتازة (96%). يُوصى بإضافة وقفة سقراطية استنتاجية في الدقيقة 14 من الدرس القادم لتعزيز تفاعل الطلبة.'
|
||||
'success_rate_percentage' => 0.0,
|
||||
'curriculum_alignment_pct' => 0.0,
|
||||
'socratic_interaction_pct' => 0.0,
|
||||
'audio_clarity_pct' => 0.0,
|
||||
'cognitive_focus_pct' => 0.0,
|
||||
'ai_recommendation' => 'ستظهر التوصية بعد توفر حصص محللة وتفاعل فعلي من الطلبة.'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -419,7 +415,7 @@ class TeacherRatingService
|
||||
}
|
||||
} catch (\Throwable $e) {}
|
||||
|
||||
return 94.50;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,11 +427,11 @@ class TeacherRatingService
|
||||
|
||||
$teachers = Database::select(
|
||||
"SELECT t.id, t.full_name, t.specialization, t.bio,
|
||||
COALESCE(m.avg_response_minutes, 3) as avg_response_minutes,
|
||||
COALESCE(m.response_rate_percentage, 99.0) as response_rate_percentage,
|
||||
COALESCE(m.composite_merit_score, 96.50) as composite_merit_score,
|
||||
COALESCE(m.star_equivalent, 4.90) as star_equivalent,
|
||||
COALESCE(m.reputation_tier, 'معلم نخبوي معتمد 💎') as reputation_tier,
|
||||
COALESCE(m.avg_response_minutes, 0) as avg_response_minutes,
|
||||
COALESCE(m.response_rate_percentage, 0) as response_rate_percentage,
|
||||
COALESCE(m.composite_merit_score, 0) as composite_merit_score,
|
||||
COALESCE(m.star_equivalent, 0) as star_equivalent,
|
||||
COALESCE(m.reputation_tier, 'بانتظار بيانات الأداء') as reputation_tier,
|
||||
(SELECT COUNT(*) FROM lessons WHERE course_id IN (SELECT id FROM courses WHERE teacher_id = t.id)) as lessons_count
|
||||
FROM teachers t
|
||||
LEFT JOIN teacher_performance_metrics m ON t.id = m.teacher_id
|
||||
|
||||
Reference in New Issue
Block a user