Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 31 additions & 28 deletions extension/shared/dossier-compiler.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ function compileSingleAuditToMarkdown(item) {

if (Array.isArray(result.findings) && result.findings.length > 0) {
md += `## Evidence-Based Findings & Recommendations\n\n`;
result.findings.forEach((f, idx) => {
md += `### ${idx + 1}. [${f.tier || 'T1'}] ${f.citation || 'Citation'}\n\n`;
md += `- **Severity:** \`${(f.severity || 'info').toUpperCase()}\`\n`;
md += `- **Observation:** ${f.observation || ''}\n`;
md += `- **Empirical Evidence:** ${f.evidence || ''}\n`;
md += `- **Actionable Recommendation:** ${f.recommendation || ''}\n\n`;
});
md += result.findings.map((f, idx) =>
`### ${idx + 1}. [${f.tier || 'T1'}] ${f.citation || 'Citation'}\n\n` +
`- **Severity:** \`${(f.severity || 'info').toUpperCase()}\`\n` +
`- **Observation:** ${f.observation || ''}\n` +
`- **Empirical Evidence:** ${f.evidence || ''}\n` +
`- **Actionable Recommendation:** ${f.recommendation || ''}\n\n`
).join('');
}

if (result.improvedDraft && result.improvedDraft.content) {
Expand All @@ -52,39 +52,42 @@ function compileDossierToMarkdown(dossierItems, courseTitle = 'Canvas Course') {
md += `## Table of Audited Materials\n\n`;
md += `| # | Component Title | Type | Bloom's Demand | Alignment Score |\n`;
md += `| :--- | :--- | :--- | :--- | :--- |\n`;
dossierItems.forEach((item, idx) => {

md += dossierItems.map((item, idx) => {
const s = item.result?.summary || {};
md += `| ${idx + 1} | ${item.title || 'Untitled'} | ${item.pageType || 'Page'} | ${s.bloomsLevel || 'N/A'} | ${s.alignmentScore || 'N/A'} |\n`;
});
return `| ${idx + 1} | ${item.title || 'Untitled'} | ${item.pageType || 'Page'} | ${s.bloomsLevel || 'N/A'} | ${s.alignmentScore || 'N/A'} |\n`;
}).join('');

md += `\n---\n\n`;

dossierItems.forEach((item, idx) => {
md += `## Section ${idx + 1}: ${item.title || 'Component'}\n\n`;
md += `> **Type:** ${item.pageType || 'Page'} | **Source:** ${item.url || 'N/A'}\n\n`;
md += dossierItems.map((item, idx) => {
let sectionMd = `## Section ${idx + 1}: ${item.title || 'Component'}\n\n`;
sectionMd += `> **Type:** ${item.pageType || 'Page'} | **Source:** ${item.url || 'N/A'}\n\n`;

const r = item.result || {};
md += `### Summary\n`;
md += `- **Cognitive Demand:** ${r.summary?.bloomsLevel || 'N/A'}\n`;
md += `- **Alignment Rating:** ${r.summary?.alignmentScore || 'N/A'}\n`;
md += `- **Takeaway:** ${r.summary?.keyTakeaway || 'N/A'}\n\n`;
sectionMd += `### Summary\n`;
sectionMd += `- **Cognitive Demand:** ${r.summary?.bloomsLevel || 'N/A'}\n`;
sectionMd += `- **Alignment Rating:** ${r.summary?.alignmentScore || 'N/A'}\n`;
sectionMd += `- **Takeaway:** ${r.summary?.keyTakeaway || 'N/A'}\n\n`;

if (Array.isArray(r.findings) && r.findings.length > 0) {
md += `### Findings & Evidence\n\n`;
r.findings.forEach((f, fIdx) => {
md += `#### ${idx + 1}.${fIdx + 1} [${f.tier || 'T1'}] ${f.citation || 'Citation'}\n`;
md += `- **Observation:** ${f.observation || ''}\n`;
md += `- **Evidence:** ${f.evidence || ''}\n`;
md += `- **Recommendation:** ${f.recommendation || ''}\n\n`;
});
sectionMd += `### Findings & Evidence\n\n`;
sectionMd += r.findings.map((f, fIdx) =>
`#### ${idx + 1}.${fIdx + 1} [${f.tier || 'T1'}] ${f.citation || 'Citation'}\n` +
`- **Observation:** ${f.observation || ''}\n` +
`- **Evidence:** ${f.evidence || ''}\n` +
`- **Recommendation:** ${f.recommendation || ''}\n\n`
).join('');
}

if (r.improvedDraft && r.improvedDraft.content) {
md += `### ${r.improvedDraft.title || 'Revised Draft'}\n\n`;
md += `${r.improvedDraft.content}\n\n`;
sectionMd += `### ${r.improvedDraft.title || 'Revised Draft'}\n\n`;
sectionMd += `${r.improvedDraft.content}\n\n`;
}

md += `---\n\n`;
});
sectionMd += `---\n\n`;
return sectionMd;
}).join('');

md += `*Generated by [idstack](https://github.com/savvides/idstack) — Evidence-Based Course Design.*`;
return md;
Expand Down
59 changes: 31 additions & 28 deletions extension/shared/dossier-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export function compileSingleAuditToMarkdown(item) {

if (Array.isArray(result.findings) && result.findings.length > 0) {
md += `## Evidence-Based Findings & Recommendations\n\n`;
result.findings.forEach((f, idx) => {
md += `### ${idx + 1}. [${f.tier || 'T1'}] ${f.citation || 'Citation'}\n\n`;
md += `- **Severity:** \`${(f.severity || 'info').toUpperCase()}\`\n`;
md += `- **Observation:** ${f.observation || ''}\n`;
md += `- **Empirical Evidence:** ${f.evidence || ''}\n`;
md += `- **Actionable Recommendation:** ${f.recommendation || ''}\n\n`;
});
md += result.findings.map((f, idx) =>
`### ${idx + 1}. [${f.tier || 'T1'}] ${f.citation || 'Citation'}\n\n` +
`- **Severity:** \`${(f.severity || 'info').toUpperCase()}\`\n` +
`- **Observation:** ${f.observation || ''}\n` +
`- **Empirical Evidence:** ${f.evidence || ''}\n` +
`- **Actionable Recommendation:** ${f.recommendation || ''}\n\n`
).join('');
}

if (result.improvedDraft && result.improvedDraft.content) {
Expand All @@ -52,39 +52,42 @@ export function compileDossierToMarkdown(dossierItems, courseTitle = 'Canvas Cou
md += `## Table of Audited Materials\n\n`;
md += `| # | Component Title | Type | Bloom's Demand | Alignment Score |\n`;
md += `| :--- | :--- | :--- | :--- | :--- |\n`;
dossierItems.forEach((item, idx) => {

md += dossierItems.map((item, idx) => {
const s = item.result?.summary || {};
md += `| ${idx + 1} | ${item.title || 'Untitled'} | ${item.pageType || 'Page'} | ${s.bloomsLevel || 'N/A'} | ${s.alignmentScore || 'N/A'} |\n`;
});
return `| ${idx + 1} | ${item.title || 'Untitled'} | ${item.pageType || 'Page'} | ${s.bloomsLevel || 'N/A'} | ${s.alignmentScore || 'N/A'} |\n`;
}).join('');

md += `\n---\n\n`;

dossierItems.forEach((item, idx) => {
md += `## Section ${idx + 1}: ${item.title || 'Component'}\n\n`;
md += `> **Type:** ${item.pageType || 'Page'} | **Source:** ${item.url || 'N/A'}\n\n`;
md += dossierItems.map((item, idx) => {
let sectionMd = `## Section ${idx + 1}: ${item.title || 'Component'}\n\n`;
sectionMd += `> **Type:** ${item.pageType || 'Page'} | **Source:** ${item.url || 'N/A'}\n\n`;

const r = item.result || {};
md += `### Summary\n`;
md += `- **Cognitive Demand:** ${r.summary?.bloomsLevel || 'N/A'}\n`;
md += `- **Alignment Rating:** ${r.summary?.alignmentScore || 'N/A'}\n`;
md += `- **Takeaway:** ${r.summary?.keyTakeaway || 'N/A'}\n\n`;
sectionMd += `### Summary\n`;
sectionMd += `- **Cognitive Demand:** ${r.summary?.bloomsLevel || 'N/A'}\n`;
sectionMd += `- **Alignment Rating:** ${r.summary?.alignmentScore || 'N/A'}\n`;
sectionMd += `- **Takeaway:** ${r.summary?.keyTakeaway || 'N/A'}\n\n`;

if (Array.isArray(r.findings) && r.findings.length > 0) {
md += `### Findings & Evidence\n\n`;
r.findings.forEach((f, fIdx) => {
md += `#### ${idx + 1}.${fIdx + 1} [${f.tier || 'T1'}] ${f.citation || 'Citation'}\n`;
md += `- **Observation:** ${f.observation || ''}\n`;
md += `- **Evidence:** ${f.evidence || ''}\n`;
md += `- **Recommendation:** ${f.recommendation || ''}\n\n`;
});
sectionMd += `### Findings & Evidence\n\n`;
sectionMd += r.findings.map((f, fIdx) =>
`#### ${idx + 1}.${fIdx + 1} [${f.tier || 'T1'}] ${f.citation || 'Citation'}\n` +
`- **Observation:** ${f.observation || ''}\n` +
`- **Evidence:** ${f.evidence || ''}\n` +
`- **Recommendation:** ${f.recommendation || ''}\n\n`
).join('');
}

if (r.improvedDraft && r.improvedDraft.content) {
md += `### ${r.improvedDraft.title || 'Revised Draft'}\n\n`;
md += `${r.improvedDraft.content}\n\n`;
sectionMd += `### ${r.improvedDraft.title || 'Revised Draft'}\n\n`;
sectionMd += `${r.improvedDraft.content}\n\n`;
}

md += `---\n\n`;
});
sectionMd += `---\n\n`;
return sectionMd;
}).join('');

md += `*Generated by [idstack](https://github.com/savvides/idstack) — Evidence-Based Course Design.*`;
return md;
Expand Down
Loading