diff --git a/ai-act-kompass/src/engine/quiz.test.ts b/ai-act-kompass/src/engine/quiz.test.ts index 9aff374..83e9746 100644 --- a/ai-act-kompass/src/engine/quiz.test.ts +++ b/ai-act-kompass/src/engine/quiz.test.ts @@ -82,10 +82,17 @@ describe('KI-Kompetenztest', () => { expect(md).not.toContain('richtige Antwort'); // keine Lösungen im Testbogen }); - it('Lösungsbogen nennt je Frage den richtigen Buchstaben', () => { + it('Lösungsbogen enthält je Frage den Fragetext, die richtige Antwort im Wortlaut und die Erklärung', () => { const md = answerKeyDoc(CONTENT_PACK, '2026-07-04', profile); expect(md).toContain('Lösungsbogen'); - expect((md.match(/\| \d+ \| \*\*[ABC]\*\* \|/g) ?? []).length).toBe(12); + // Fragetext enthalten (selbsterklärend, ohne Testbogen daneben): + expect((md.match(/^## \d+\./gm) ?? []).length).toBe(12); + expect(md).toContain('Was macht ein KI-System'); + // Richtige Antwort mit Buchstabe UND Wortlaut: + expect((md.match(/\*\*Richtige Antwort: [ABC]\)\*\*/g) ?? []).length).toBe(12); + expect(md).toContain('Nein — nur in vom Unternehmen freigegebene KI-Systeme.'); + // Erklärungen enthalten: + expect((md.match(/_Erklärung:_/g) ?? []).length).toBe(12); }); it('Schulungshandout enthält die 12 Erklärungen und ist lokalisiert', () => { diff --git a/ai-act-kompass/src/engine/quiz.ts b/ai-act-kompass/src/engine/quiz.ts index 0fa5037..4c672f4 100644 --- a/ai-act-kompass/src/engine/quiz.ts +++ b/ai-act-kompass/src/engine/quiz.ts @@ -175,7 +175,8 @@ interface PrintStrings { readonly testFooter: string; readonly keyTitle: string; readonly keyIntro: string; - readonly keyCols: string; + readonly keyCorrect: string; + readonly keyWhy: string; readonly handoutTitle: string; readonly handoutIntro: string; readonly handoutFooter: string; @@ -189,8 +190,9 @@ const PRINT: Readonly> = { nameDateLine: '**Name:** ______________________________ **Datum:** ______________ **Abteilung:** ______________________________', testFooter: 'Unterschrift Beschäftigte/r: _______________ Ausgewertet durch (Name, Unterschrift): _______________ Ergebnis: ______ / {total}', keyTitle: 'KI-Kompetenztest — Lösungsbogen (nur für Auswertende)', - keyIntro: 'Richtige Antworten und Erklärungen. Bestehensgrenze: {pct} % ({min} von {total} Fragen).', - keyCols: '| Nr. | Richtig | Erklärung |', + keyIntro: 'Alle Fragen mit richtiger Antwort und Erklärung. Bestehensgrenze: {pct} % ({min} von {total} Fragen).', + keyCorrect: 'Richtige Antwort', + keyWhy: 'Erklärung', handoutTitle: 'Schulungshandout: Die 12 wichtigsten Regeln im Umgang mit KI', handoutIntro: 'Dieses Handout fasst die Kernregeln für den Arbeitsalltag zusammen und dient als Schulungsunterlage nach Art. 4 EU-KI-VO. Es kann vor dem Kompetenztest ausgeteilt werden.', @@ -204,8 +206,9 @@ const PRINT: Readonly> = { nameDateLine: '**Name:** ______________________________ **Date:** ______________ **Department:** ______________________________', testFooter: 'Signature employee: _______________ Marked by (name, signature): _______________ Score: ______ / {total}', keyTitle: 'AI literacy test — answer key (for markers only)', - keyIntro: 'Correct answers and explanations. Pass threshold: {pct} % ({min} of {total} questions).', - keyCols: '| No. | Correct | Explanation |', + keyIntro: 'All questions with the correct answer and explanation. Pass threshold: {pct} % ({min} of {total} questions).', + keyCorrect: 'Correct answer', + keyWhy: 'Explanation', handoutTitle: 'Training handout: the 12 most important rules for working with AI', handoutIntro: 'This handout summarises the core rules for everyday work and serves as training material under Art. 4 EU AI Act. It can be handed out before the literacy test.', @@ -282,11 +285,16 @@ export function answerKeyDoc( '', fillIn(p.keyIntro), '', - p.keyCols, - '|---|---|---|', ]; getQuiz(locale).forEach((q, i) => { - lines.push(`| ${i + 1} | **${OPTION_LETTERS[q.correctIndex]}** | ${q.explanation} |`); + lines.push( + `## ${i + 1}. ${q.question}`, + '', + `**${p.keyCorrect}: ${OPTION_LETTERS[q.correctIndex]})** ${q.options[q.correctIndex]}`, + '', + `_${p.keyWhy}:_ ${q.explanation}`, + '', + ); }); return lines.join('\n'); }