DrAIStudio Mascot DrAIStudio Interactive Activities ▸ Path Picker Studio

Interactive Game Content

Edit generated scenarios, answers, correct sequences, and feedback.

Procedural AI Structuring...

Drafting curriculum-grounded options and SCORM score maps.

Analyzing curriculum domain & case goals
Generating scenario descriptions
Structuring decision paths & trap options
Writing explanation feedbacks
Injecting SCORM 1.2 tracking bridge
`; } function compileAndDownloadZip(version = '1.2') { const zip = new JSZip(); const gameTitle = document.getElementById('gameTitle').value || "Crisis Simulation Game"; const courseName = document.getElementById('courseName').value || "University Course"; const cleanTitle = escapeHtml(gameTitle); const cleanCourse = escapeHtml(courseName); let manifestXml = ''; if (version === '2004') { manifestXml = ` ADL SCORM 2004 3rd Edition ${cleanTitle} - ${cleanCourse} ${cleanTitle} `; } else { manifestXml = ` ADL SCORM 1.2 ${cleanTitle} - ${cleanCourse} ${cleanTitle} `; } // 2. Generate Launcher HTML const launcherHtml = compileIframeGameSource(); // 3. Add to ZIP zip.file("imsmanifest.xml", manifestXml); zip.file("index.html", launcherHtml); // 4. Download Trigger zip.generateAsync({type:"blob"}).then(function(content) { const url = window.URL.createObjectURL(content); const a = document.createElement("a"); a.href = url; // Clean filename const suffix = version === '2004' ? 'SCORM_2004' : 'SCORM_1_2'; const filename = `${courseName.replace(/[^a-zA-Z0-9]/g, '_')}_${gameTitle.replace(/[^a-zA-Z0-9]/g, '_')}_${suffix}.zip`; a.download = filename; document.body.appendChild(a); a.click(); document.body.removeChild(a); window.URL.revokeObjectURL(url); }); } function downloadStandaloneHtml() { const gameTitle = document.getElementById('gameTitle').value || "Crisis Simulation Game"; const courseName = document.getElementById('courseName').value || "University Course"; const htmlContent = compileIframeGameSource(); const blob = new Blob([htmlContent], {type: "text/html"}); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; const filename = `${courseName.replace(/[^a-zA-Z0-9]/g, '_')}_${gameTitle.replace(/[^a-zA-Z0-9]/g, '_')}_Standalone.html`; a.download = filename; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); } function exportGameJson() { const gameTitle = document.getElementById('gameTitle').value || "Crisis Simulation Game"; const courseName = document.getElementById('courseName').value || "University Course"; const schema = { generator: "EduGame Studio", version: "1.0", gameType: activeGameType, theme: activeTheme, title: gameTitle, course: courseName, content: gameContent }; const jsonStr = JSON.stringify(schema, null, 2); const blob = new Blob([jsonStr], {type: "application/json"}); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; const filename = `${courseName.replace(/[^a-zA-Z0-9]/g, '_')}_${gameTitle.replace(/[^a-zA-Z0-9]/g, '_')}_Config.json`; a.download = filename; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); } function importGameJson(input) { const file = input.files[0]; if (!file) return; const reader = new FileReader(); reader.onload = function(e) { try { const json = JSON.parse(e.target.result); if (!json || json.generator !== "EduGame Studio" || json.gameType !== "path" || !Array.isArray(json.content)) { alert("Invalid configuration file. This builder only supports Path Picker configurations (gameType: 'path')."); return; } // Apply details document.getElementById('gameTitle').value = json.title || ''; document.getElementById('courseName').value = json.course || ''; // Force theme to path (already hardcoded) activeGameType = 'path'; // Set theme activeTheme = json.theme || 'military'; document.querySelectorAll('.theme-option').forEach(el => { el.classList.remove('active'); if (el.getAttribute('data-theme') === activeTheme) el.classList.add('active'); }); // Force custom preset UI display const presetSelect = document.getElementById('subjectDomain'); presetSelect.value = 'custom'; document.getElementById('customTopicGroup').style.display = 'flex'; document.getElementById('customTopic').value = json.title || ''; document.getElementById('presetInfo').textContent = "Loaded from imported JSON configuration."; // Apply content gameContent = json.content; renderEditorUI(); alert("EduGame Studio configuration imported successfully!"); } catch(err) { alert("Error parsing imported JSON: " + err.message); } }; reader.readAsText(file); input.value = ''; // Reset input element } function downloadClassroomWorksheet() { const gameTitle = document.getElementById('gameTitle').value || "Crisis Simulation Game"; const courseName = document.getElementById('courseName').value || "University Course"; let md = `# Study Worksheet: ${gameTitle}\n`; md += `**Course**: ${courseName}\n`; md += `**Game Type**: ${activeGameType.toUpperCase()}\n`; md += `**Generated**: ${new Date().toLocaleDateString()}\n\n`; md += `---\n\n`; if (activeGameType === 'decision') { gameContent.forEach((scen, idx) => { md += `## Scenario ${idx + 1}: ${scen.title}\n\n`; md += `### Description\n${scen.desc}\n\n`; md += `### Decision Steps & Actions\n\n`; const correctSteps = scen.wires .filter(w => w.order > 0) .sort((a, b) => a.order - b.order); const traps = scen.wires.filter(w => w.order < 0); md += `#### Correct Execution Sequence:\n`; correctSteps.forEach(w => { md += `${w.order}. **[${w.color.toUpperCase()}] ${w.label}**\n *Effect / Feedback*: ${w.desc}\n`; }); if (traps.length > 0) { md += `\n#### Danger / Trap Decisions:\n`; traps.forEach(w => { md += `* **[${w.color.toUpperCase()}] ${w.label}** (TRAP)\n *Consequence*: ${w.desc}\n`; }); } md += `\n---\n\n`; }); } else if (activeGameType === 'shooter') { gameContent.forEach((scen, idx) => { md += `## Round ${idx + 1}: ${scen.title}\n\n`; md += `**Prompt / Mission**: ${scen.prompt}\n\n`; md += `### Target Options:\n\n`; scen.options.forEach(opt => { const status = opt.correct ? "✓ CORRECT TARGET" : "✗ DISTRACTOR (TRAP)"; md += `* **${opt.t}** [${status}]\n *Explanation*: ${opt.why}\n\n`; }); md += `---\n\n`; }); } else if (activeGameType === 'swipe') { gameContent.forEach((scen, idx) => { md += `## Swipe Round ${idx + 1}: ${scen.title}\n\n`; md += `### Classification Cards:\n\n`; scen.cards.forEach(card => { const status = card.approve ? "APPROVE (Swipe Right)" : "REJECT (Swipe Left)"; md += `* **Card Text**: "${card.text}"\n *Correct Action*: **${status}**\n *Justification*: ${card.why}\n\n`; }); md += `---\n\n`; }); } else if (activeGameType === 'path') { gameContent.forEach((scen, idx) => { md += `## Branching Case ${idx + 1}: ${scen.title}\n\n`; md += `### Dialogue Graph Nodes:\n\n`; Object.keys(scen.nodes).forEach(nKey => { const node = scen.nodes[nKey]; md += `#### Node: ${nKey}\n`; md += `**Text**: "${node.text}"\n\n`; if (node.end) { md += `* **Ending Node** (SCORM Score: ${node.score}/100)\n\n`; } else { md += `**Choices / Decision Options**:\n`; node.choices.forEach(ch => { md += `* "${ch.text}" → leads to **${ch.next}**\n`; }); md += `\n`; } }); md += `---\n\n`; }); } md += `*Document compiled using EduGame Studio.*`; const blob = new Blob([md], {type: "text/markdown"}); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; const filename = `${courseName.replace(/[^a-zA-Z0-9]/g, '_')}_${gameTitle.replace(/[^a-zA-Z0-9]/g, '_')}_Worksheet.md`; a.download = filename; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); }