SCORM Package Manifest File Editor

SCORM Package Manifest File Editor

1. Course Metadata

2. Sharable Content Objects (SCOs)

Each SCO is a trackable learning activity (e.g., a module or a quiz).

Current Activities

3. Sequencing Defaults (Optional)

Generated imsmanifest.xml

Copy the XML content below or download the file directly.

No SCOs added yet.

"; } appState.scos.forEach(function(sco) { var item = document.createElement("div"); item.className = "smf-sco-item"; item.innerHTML = ` ${sco.title} (${sco.identifier}) - ${sco.file} `; scoListDiv.appendChild(item); }); } addScoBtn.addEventListener("click", function() { var title = scoTitleInput.value.trim(); var id = scoIdInput.value.trim().toUpperCase().replace(/[^A-Z0-9_]/g, ''); var file = scoFileInput.value.trim(); if (!title || !id || !file) { alert("Please fill in the Title, Identifier, and Start File for the SCO."); return; } if (appState.scos.some(function(sco) { return sco.identifier === id; })) { alert("Error: Identifier must be unique."); return; } var newSco = { id: Date.now(), identifier: id, title: title, file: file }; appState.scos.push(newSco); renderConfigTab(); // Clear form fields scoTitleInput.value = ""; scoIdInput.value = ""; scoFileInput.value = ""; }); scoListDiv.addEventListener("click", function(e) { if (e.target.classList.contains("smf-remove-btn")) { var id = parseInt(e.target.dataset.id); appState.scos = appState.scos.filter(function(sco) { return sco.id !== id; }); renderConfigTab(); } }); // --- XML Generation Logic --- function generateManifestXML() { updateStateFromInputs(); var xml = '\n'; xml += '\n'; xml += '\n \n'; xml += ' ADL SCORM\n'; xml += ' 2004 4th Edition\n'; xml += ' \n'; xml += ' \n'; xml += ' <string lang="x-none">' + appState.title + '</string>\n'; xml += ' ' + appState.language + '\n'; xml += ' \n'; xml += ' ' + appState.version + '\n'; xml += ' \n'; xml += ' \n'; xml += '\n \n'; xml += ' \n'; xml += ' ' + appState.organization + '\n'; // Items (SCOs in the organization structure) appState.scos.forEach(function(sco) { xml += `\n \n`; xml += ` ${sco.title}\n`; // Default Sequencing (Simplified) xml += ' \n'; xml += ' \n'; xml += ` \n`; xml += ` \n`; xml += ' \n'; xml += ' \n'; }); xml += ' \n'; xml += ' \n'; xml += '\n \n'; // Resources (file mappings) appState.scos.forEach(function(sco) { xml += ` \n`; xml += ' \n'; xml += ' \n'; }); xml += ' \n'; xml += ''; return xml; } generateBtn.addEventListener("click", function() { var xml = generateManifestXML(); manifestOutput.value = xml; showTab(1); }); // --- File Handling --- copyXmlBtn.addEventListener('click', function() { manifestOutput.select(); try { document.execCommand('copy'); alert("XML copied to clipboard!"); } catch (err) { alert("Failed to copy XML."); } }); downloadXmlBtn.addEventListener('click', function() { var xmlContent = manifestOutput.value; if (!xmlContent || xmlContent.indexOf('

SCORM Configuration Summary

Course Metadata

Title:${appState.title}
Version:${appState.version}
Organization:${appState.organization}
Language:${appState.language}

Sequencing Defaults

Completion Req:${appState.sequencing.completionRequirement}
Flow Navigation:${appState.sequencing.flow === 'true' ? 'Allow Free Flow' : 'Enforce Linear'}

Sharable Content Objects (SCOs)

${appState.scos.map(function(sco) { return ``; }).join('')}
Identifier Title Start File
${sco.identifier} ${sco.title} ${sco.file}
`; var tempDiv = document.createElement('div'); tempDiv.innerHTML = summaryHtml; document.body.appendChild(tempDiv); html2canvas(tempDiv, { scale: 2, useCORS: true, backgroundColor: '#ffffff' }).then(function(canvas) { document.body.removeChild(tempDiv); var imgData = canvas.toDataURL('image/png'); var doc = new jsPDF({ orientation: 'p', unit: 'pt', format: 'letter' }); var pdfWidth = doc.internal.pageSize.getWidth(); var pdfHeight = doc.internal.pageSize.getHeight(); var imgProps = doc.getImageProperties(imgData); var imgWidth = imgProps.width; var imgHeight = imgProps.height; var margin = 40; var usableWidth = pdfWidth - (2 * margin); var ratio = usableWidth / imgWidth; var scaledHeight = imgHeight * ratio; if (scaledHeight > pdfHeight - (2 * margin)) { var pageHeight = pdfHeight - (2 * margin); var heightLeft = scaledHeight; var position = 0; while (heightLeft > 0) { doc.addImage(imgData, 'PNG', margin, position + margin, usableWidth, scaledHeight); heightLeft -= pageHeight; position -= pageHeight; if (heightLeft > 0) { doc.addPage(); } } } else { // Single page doc.addImage(imgData, 'PNG', margin, margin, usableWidth, scaledHeight); } doc.save(fileName); }).catch(function(err) { document.body.removeChild(tempDiv); console.error("SMF PDF Error:", err); alert("An error occurred while generating the PDF."); }); }); // --- Initial Load --- renderConfigTab(); // Initial display of the XML viewer placeholder manifestOutput.value = generateManifestXML(); showTab(0); });
Scroll to Top