-
امتحان تقييمي
+
+
امتحان تقييمي
+
+
@@ -2351,6 +2355,106 @@ class StudentPortal
`).join('');
}
+ // ==========================================
+ // Print Utility (طباعة المحتوى للطلاب)
+ // ==========================================
+ function printElement(elementId, title = 'صَقِل - طباعة') {
+ const el = document.getElementById(elementId);
+ if (!el) {
+ showError('المحتوى غير متوفر للطباعة');
+ return;
+ }
+
+ // Clone the element to safely modify it before printing
+ const clone = el.cloneNode(true);
+
+ // Remove interactive elements that shouldn't be printed
+ const removeSelectors = ['button', 'input[type="range"]', '.no-print'];
+ removeSelectors.forEach(sel => {
+ const elements = clone.querySelectorAll(sel);
+ elements.forEach(e => e.remove());
+ });
+
+ // Expand all steplab steps if they are hidden
+ const hiddenSteps = clone.querySelectorAll('.studio-card > div[style*="display: none"]');
+ hiddenSteps.forEach(e => { e.style.display = 'block'; });
+ const dimCards = clone.querySelectorAll('.studio-card[style*="opacity"]');
+ dimCards.forEach(e => { e.style.opacity = '1'; });
+
+ const printWindow = window.open('', '', 'width=900,height=900');
+ printWindow.document.write(`
+
+
+
${title}
+
+
+
+
+
+
+
منصة صَقِل التعليمية
+ المرجع المطبوع - استوديو الطالب
+
+
+
${title}
+
+
+ ${clone.innerHTML}
+
+
+ حقوق الطبع محفوظة لمنصة صَقِل - تم توليد هذه الورقة بناءً على المنهاج الوزاري الأردني.
+
+
+
+ `);
+
+ printWindow.document.close();
+ printWindow.focus();
+
+ setTimeout(() => {
+ printWindow.print();
+ printWindow.close();
+ }, 800);
+ }
+