Update Saqel Platform: 2026-09-04 03:09:10
This commit is contained in:
@@ -230,6 +230,7 @@ class CurriculumStudio
|
||||
<button type="button" class="btn-primary" style="padding: 8px 14px; font-size: 12px; background: linear-gradient(135deg, #7B2CBF, #9D4EDD);" onclick="copyAiVideoPrompt()">🎬 نسخ برومبت فيديو الشرح</button>
|
||||
<button type="button" class="btn-primary" style="padding: 8px 14px; font-size: 12px;" onclick="generateAiAssets()">✨ توليد الملخص والاختبار آلياً</button>
|
||||
<button type="button" class="btn-primary" style="padding: 8px 14px; font-size: 12px; background: linear-gradient(135deg, #0071E3, #00F5D4); color: #FFF; font-weight: 700;" onclick="generateAiQuestionBank()">🧠 توليد بنك أسئلة الوحدة (Gemini)</button>
|
||||
<button type="button" class="btn-primary" style="padding: 8px 14px; font-size: 12px; background: linear-gradient(135deg, #D97706, #F59E0B); color: #000; font-weight: 800;" onclick="bakeInteractiveLab()">⚡ بناء وتثبيت المختبر التفاعلي (Bake Lab)</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -617,6 +618,56 @@ class CurriculumStudio
|
||||
}
|
||||
}
|
||||
|
||||
async function bakeInteractiveLab() {
|
||||
if (!currentFilePath) {
|
||||
alert('⚠️ يرجى اختيار درس من الشجرة أولاً.');
|
||||
return;
|
||||
}
|
||||
|
||||
const btn = window.event ? window.event.currentTarget : null;
|
||||
let originalText = '';
|
||||
if (btn) {
|
||||
originalText = btn.innerHTML;
|
||||
btn.innerHTML = '⚡ جاري فحص الكتاب وخبز المختبر...';
|
||||
btn.disabled = true;
|
||||
}
|
||||
|
||||
let subjectType = 'arabic_10';
|
||||
if (currentFilePath.includes('physics')) subjectType = 'physics_10';
|
||||
else if (currentFilePath.includes('islamic')) subjectType = 'islamic_10';
|
||||
else if (currentFilePath.includes('history')) subjectType = 'history_10';
|
||||
else if (currentFilePath.includes('math')) subjectType = 'math_10';
|
||||
|
||||
const topic = currentFilePath.split('/').pop().replace('.md', '');
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/curriculum/bake-lab', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
file: currentFilePath,
|
||||
subject: subjectType,
|
||||
topic: topic
|
||||
})
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
if (res.ok && data.status === 'success') {
|
||||
alert(`✅ ${data.message}\n\nتم استخراج أمثلة الكتاب الوزاري بنجاح وتوليد 10 تدريبات إضافية وتثبيتها في الملف المرافق وقاعدة البيانات.`);
|
||||
} else {
|
||||
alert('⚠️ ' + (data.message || 'فشل بناء المختبر'));
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
alert('⚠️ حدث خطأ في الاتصال بالخادم أثناء بناء المختبر');
|
||||
} finally {
|
||||
if (btn) {
|
||||
btn.innerHTML = originalText;
|
||||
btn.disabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function saveActiveMarkdown() {
|
||||
if (!currentFilePath) return;
|
||||
const content = document.getElementById('lesson_markdown_editor').value;
|
||||
|
||||
Reference in New Issue
Block a user