Write quiz questions in the style of the course's real exams
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 30s
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 30s
Modelled on a real 50-question course exam and the V1 question set: - Stems are short and plain (usually 15-30 words, one paragraph, no scene-setting), end in the exam's own question phrasing, and about a third may ask directly about a fact the nurse uses. - Bold and underline are stripped from generated stems (plainStem). - Choices are concise and parallel: a term or value, a 4-12 word action or finding, or quoted speech; explanations go in "why" (1-2 sentences). - Distractors come from related facts in the material. - Select-all items have 6 choices with 2-5 correct, mostly 3 or 4. - The planner varies the kind of question instead of setting and role. - Review, proofread, "improve questions" and the outside-chatbot instructions follow the same rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5fef59b07b
commit
39a85ebb0c
6 changed files with 55 additions and 21 deletions
|
|
@ -219,7 +219,7 @@ stored DeepSeek connection still holding the old key; it was updated from `.env`
|
||||||
## Verification status
|
## Verification status
|
||||||
|
|
||||||
Baseline: 162 tests passed, TypeScript passed and production web/server builds passed.
|
Baseline: 162 tests passed, TypeScript passed and production web/server builds passed.
|
||||||
Added six regression tests. Full `npm run check` passes: **290 tests** (V1 importer removed, 2026-11-16; 291 after full-backup restore; 289 after rationale layout; 285 after varied openers; 281 after generation steps; 280 after the check loop and second review; 274 after the fifth revision; 261 after share-link generation, 2026-11-15; 257 after the fourth revision; 247 after the third, 208 after the second, 181 on 2026-11-12), TypeScript
|
Added six regression tests. Full `npm run check` passes: **291 tests** (exam-style questions, 2026-11-16; 290 after V1 importer removed; 291 after full-backup restore; 289 after rationale layout; 285 after varied openers; 281 after generation steps; 280 after the check loop and second review; 274 after the fifth revision; 261 after share-link generation, 2026-11-15; 257 after the fourth revision; 247 after the third, 208 after the second, 181 on 2026-11-12), TypeScript
|
||||||
and both production builds. The Docker `test` stage runs the same 181 tests on Node 24. Tests were run with loopback access for the mock provider.
|
and both production builds. The Docker `test` stage runs the same 181 tests on Node 24. Tests were run with loopback access for the mock provider.
|
||||||
|
|
||||||
The earlier agent manually exercised quiz completion/results, flashcards, streak effects,
|
The earlier agent manually exercised quiz completion/results, flashcards, streak effects,
|
||||||
|
|
|
||||||
14
docs/AI.md
14
docs/AI.md
|
|
@ -93,6 +93,20 @@ from the original, keeps "Select all that apply." and no longer opens the repeat
|
||||||
Calculations keep their wording. The writing rules, the batch prompt (which names openers already
|
Calculations keep their wording. The writing rules, the batch prompt (which names openers already
|
||||||
overused) and the planner (setting, role, trigger) also ask for varied openings.
|
overused) and the planner (setting, role, trigger) also ask for varied openings.
|
||||||
|
|
||||||
|
**Item style** is modelled on a real course exam (`NCLEX_RULES`, editable in Settings →
|
||||||
|
Templates as "NCLEX style"). Stems are short and plain, usually 15 to 30 words: only the cues
|
||||||
|
needed, then one direct question in the exam's own phrasing ("Which action should the nurse take
|
||||||
|
first?", "Which statement by the parent indicates a need for further teaching?"), in one
|
||||||
|
paragraph with no scene-setting that does not change the answer. About a third may ask directly
|
||||||
|
about a fact the nurse uses (an injection site, a pain tool, expected lab results). Bold or
|
||||||
|
underlined words are removed from generated stems (`plainStem`). Choices are concise and
|
||||||
|
parallel: a term or value when that is what is asked, a 4 to 12 word action or finding, or quoted
|
||||||
|
speech for client statements and nurse responses. Explanations go in each choice's "why" (1 or
|
||||||
|
2 sentences), not on the end of the choice. Distractors come from related facts in the material.
|
||||||
|
Select-all items have exactly 6 choices with 2 to 5 correct, most often 3 or 4. The same rules
|
||||||
|
appear in the batch prompt, the planner, the review and proofread rewrites, "improve questions"
|
||||||
|
and the outside-chatbot instructions.
|
||||||
|
|
||||||
**Rationales** are asked for as Markdown: one bold key sentence, then 2 to 4 short bullet points,
|
**Rationales** are asked for as Markdown: one bold key sentence, then 2 to 4 short bullet points,
|
||||||
without repeating the per-choice "why" (`RATIONALE_FORMAT`, also in the question schema, the
|
without repeating the per-choice "why" (`RATIONALE_FORMAT`, also in the question schema, the
|
||||||
review's rewrite schema, "improve questions" and the outside-chatbot instructions). The web app
|
review's rewrite schema, "improve questions" and the outside-chatbot instructions). The web app
|
||||||
|
|
|
||||||
|
|
@ -322,6 +322,11 @@ export type GenerateRequest = z.infer<typeof generateRequestSchema>;
|
||||||
|
|
||||||
/* ------------------------------ prompts ------------------------------ */
|
/* ------------------------------ prompts ------------------------------ */
|
||||||
|
|
||||||
|
/** Exam stems carry no emphasis: bold or underlined words in a generated stem become plain text. */
|
||||||
|
export function plainStem(stem: string): string {
|
||||||
|
return stem.replace(/\*\*(\S(?:[^*]*?\S)?)\*\*/g, '$1').replace(/__(\S(?:[^_]*?\S)?)__/g, '$1');
|
||||||
|
}
|
||||||
|
|
||||||
/** How a rationale is laid out, so it reads at a glance instead of as one block of text. */
|
/** How a rationale is laid out, so it reads at a glance instead of as one block of text. */
|
||||||
const RATIONALE_FORMAT =
|
const RATIONALE_FORMAT =
|
||||||
'Format the rationale in Markdown for quick reading: one bold sentence with the key point, then 2 to 4 short bullet points (one idea each, such as the principle or framework, the physiology or drug action, the safety point). No long paragraphs, and do not repeat the choices\' "why" text, which is shown beside each choice.';
|
'Format the rationale in Markdown for quick reading: one bold sentence with the key point, then 2 to 4 short bullet points (one idea each, such as the principle or framework, the physiology or drug action, the safety point). No long paragraphs, and do not repeat the choices\' "why" text, which is shown beside each choice.';
|
||||||
|
|
@ -339,16 +344,16 @@ const QUESTION_SCHEMA = {
|
||||||
enum: ['single', 'multi', 'numeric'],
|
enum: ['single', 'multi', 'numeric'],
|
||||||
description: 'single = one correct answer; multi = select all that apply; numeric = a calculation the student answers by typing the number',
|
description: 'single = one correct answer; multi = select all that apply; numeric = a calculation the student answers by typing the number',
|
||||||
},
|
},
|
||||||
stem: { type: 'string', description: 'The question. Markdown allowed.' },
|
stem: { type: 'string', description: 'The question, usually 15 to 30 words: a short situation with only the cues needed, then one direct question. One plain paragraph, no bold or italics.' },
|
||||||
options: {
|
options: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
description: 'Answer choices. For numeric questions: exactly one option, the correct answer with its unit (e.g. "12.5 mL"), correct = true, and "why" showing the calculation.',
|
description: 'Answer choices. For numeric questions: exactly one option, the correct answer with its unit (e.g. "12.5 mL"), correct = true, and "why" showing the calculation.',
|
||||||
items: {
|
items: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
text: { type: 'string' },
|
text: { type: 'string', description: 'The choice only, parallel to the other choices: a term or value, a short action or finding (about 4 to 12 words), or one or two sentences of quoted speech. No explanation tacked on.' },
|
||||||
correct: { type: 'boolean' },
|
correct: { type: 'boolean' },
|
||||||
why: { type: 'string', description: 'One sentence on why this choice is right or wrong.' },
|
why: { type: 'string', description: '1 or 2 sentences: the specific clinical reason this choice is right or wrong.' },
|
||||||
},
|
},
|
||||||
required: ['text', 'correct', 'why'],
|
required: ['text', 'correct', 'why'],
|
||||||
},
|
},
|
||||||
|
|
@ -397,16 +402,18 @@ const MATH_LEVELS: Record<string, string> = {
|
||||||
|
|
||||||
const NUMERIC_RULE = `- Only write calculation items when the source material itself involves calculations (or the request asks for medication math), and never more than the number allowed in the request. Calculation items (dosages, weight-based doses, IV and drip rates, conversions, intake and output) use type "numeric": the student types the number instead of choosing. Give exactly one option, the correct answer with its unit (for example "12.5 mL"), marked correct, with "why" showing the working. State the unit and the rounding rule in the stem ("Round to the nearest tenth."). Only the number is checked, so the student may leave out the unit.`;
|
const NUMERIC_RULE = `- Only write calculation items when the source material itself involves calculations (or the request asks for medication math), and never more than the number allowed in the request. Calculation items (dosages, weight-based doses, IV and drip rates, conversions, intake and output) use type "numeric": the student types the number instead of choosing. Give exactly one option, the correct answer with its unit (for example "12.5 mL"), marked correct, with "why" showing the working. State the unit and the rounding rule in the stem ("Round to the nearest tenth."). Only the number is checked, so the student may leave out the unit.`;
|
||||||
|
|
||||||
const NCLEX_RULES = `Write NCLEX-style (Next Generation NCLEX) items:
|
const NCLEX_RULES = `Write NCLEX-style (Next Generation NCLEX) items that read like a real nursing exam:
|
||||||
- Test clinical judgment at the application and analysis level: recognise cues, analyse, prioritise, choose and evaluate actions. Avoid pure recall.
|
- Test clinical judgment: recognise cues, analyse, prioritise, choose and evaluate actions. Most questions are a short client situation that needs a decision, and many need two cues put together (a symptom plus a lab value, a risk factor plus a presentation, a treatment plus an adverse finding). About a third may ask directly about a fact the nurse uses, still framed around the nurse or client ("Which injection site is most appropriate?", "Which laboratory results should the nurse expect?", "Which mechanism of heat loss is the nurse most concerned about?"). Mix assessment, expected findings, complications, diagnostic results, treatment decisions, safety, teaching and priority questions.
|
||||||
- Give a brief, realistic client scenario containing only relevant data (age, diagnosis, key findings, vital signs or lab values with units).
|
- Keep stems short and plain, usually 15 to 30 words: at most one or two sentences of situation with only the cues needed (the age, diagnosis, key findings, vital signs or lab values with units), then one direct question. Leave out scene-setting that does not change the answer (the unit, the clinic, the time of day). Typical questions: "Which action should the nurse take first?", "What is the nurse's priority action?", "Which finding requires follow-up?", "Which finding should the nurse report immediately?", "Which response by the nurse is best?", "Which statement by the parent indicates a need for further teaching?", "Which statement shows understanding?", "Which nursing action is contraindicated?", "Which client should the nurse assess first?", "Which instructions should the nurse include? Select all that apply." Write the stem as one paragraph, with no bold, italics or other emphasis.
|
||||||
- Vary how stems open, as a real exam does: with the client ("A 68-year-old client…", "A client with…"), the nurse's situation ("The nurse is caring for…", "After receiving report…"), the setting or role ("In the emergency department…", "The charge nurse…", "During discharge teaching…"), a finding, order or report ("A client with heart failure reports…", "The health care provider prescribes…"), or the question itself. Mix these so no single opening dominates the quiz.
|
- Vary how stems open, as a real exam does: with the client ("A 4-year-old with…", "A client with…", "A newborn…"), the nurse ("The nurse is teaching…", "The nurse receives report on four clients."), a family member ("The parent of a…", "A parent calls the clinic…"), a time or event ("Two weeks after…", "Immediately after…", "During a well-child visit…"), or the question itself ("Which finding in a 2-day-old newborn…"). Mix these so no single opening dominates the quiz.
|
||||||
- Ask one clear question. Use priority wording where it fits (first, best, most important, requires immediate follow-up) and build it on a real framework: ABCs, Maslow, the nursing process, acute before chronic, unstable before stable, safety, least invasive first.
|
- Use priority wording where it fits (first, best, most important, requires immediate follow-up) and build it on a real framework: ABCs, Maslow, the nursing process, acute before chronic, unstable before stable, safety, least invasive first.
|
||||||
- Cover the client-needs areas where the material allows: safe and effective care, pharmacology, physiological adaptation, reduction of risk, health promotion, psychosocial integrity, delegation and assignment.
|
- Cover the client-needs areas where the material allows: safe and effective care, pharmacology, physiological adaptation, reduction of risk, health promotion, psychosocial integrity, delegation and assignment.
|
||||||
- Every distractor must be plausible to a student with partial knowledge and wrong for a specific reason. Keep choices parallel in grammar and similar in length. Never use "all of the above" or "none of the above". Do not give the answer away through wording or length.
|
- Answer choices are concise and parallel. When the question asks for a term, site, tool, value or condition, each choice is just that ("Conduction", "Vastus lateralis", "FLACC scale", "0.8 mL"). Actions and findings are short phrases, usually 4 to 12 words ("Place the child in a knee-chest position", "Cola-colored urine and puffy eyelids"). Statements by a client or parent, and responses by the nurse, are quoted speech of one or two sentences. Do not tack explanations onto action or finding choices ("…so that…", "…to prevent…"): the explanation belongs in "why". A quoted nurse response may give its reason ("…because the symptoms can come back"), but then the other responses do too, so a reason never marks the answer. Write every choice of a question in the same form and about the same length, and do not let the correct one stand out as the longest, most specific or most qualified.
|
||||||
- Multiple-choice items have exactly 4 choices with exactly one best answer. Select-all-that-apply items have 5 or 6 choices with 2 to 5 correct, and the stem ends with "Select all that apply."
|
- Build distractors from related facts in the same material: a similar condition, a different stage or time frame, another test or drug, an intervention that is right for a related condition, a common misconception. Each must be plausible to a student with partial knowledge and wrong for a specific reason, and at least two in every multiple-choice item need real content knowledge to rule out. No absurd, obviously unsafe or simple opposite-action choices, and never invent terms, conditions or procedures. Never use "all of the above" or "none of the above". Do not give the answer away through wording or length.
|
||||||
- Use generic drug names. Use current, standard practice.
|
- Multiple-choice items have exactly 4 choices with exactly one best answer. Select-all-that-apply items have exactly 6 choices with 2 to 5 correct, most often 3 or 4, and always at least one plausible wrong choice. The stem ends with "Select all that apply."
|
||||||
- The rationale teaches: state why the correct answer is correct, name the principle behind it, and give each choice its own "why".
|
- Never refer to the source in a stem or choice ("according to the study guide", "listed in the slides", "in the material"): every question reads as a standalone clinical question.
|
||||||
|
- Use clear, direct exam language, without contractions or a conversational tone (quoted client statements may sound natural). Use generic drug names and current, standard practice.
|
||||||
|
- Give each choice a "why" of 1 or 2 sentences with the specific clinical reason that choice is right or wrong, about that choice's own content rather than a restatement of the correct answer.
|
||||||
- ${RATIONALE_FORMAT}
|
- ${RATIONALE_FORMAT}
|
||||||
${NUMERIC_RULE}`;
|
${NUMERIC_RULE}`;
|
||||||
|
|
||||||
|
|
@ -944,6 +951,7 @@ async function runGeneration(app: AppContext, draftId: string, req: GenerateRequ
|
||||||
`Topic labels must be broad (the main condition, drug class or body system, 1-3 words), not subtypes or aspects.${topicsSoFar.length ? ` Reuse these existing topics wherever they fit: ${topicsSoFar.slice(0, 40).join(', ')}.` : ''}`,
|
`Topic labels must be broad (the main condition, drug class or body system, 1-3 words), not subtypes or aspects.${topicsSoFar.length ? ` Reuse these existing topics wherever they fit: ${topicsSoFar.slice(0, 40).join(', ')}.` : ''}`,
|
||||||
difficulty === 'mixed' ? 'Mix difficulty: mostly medium, with a few easy and a few hard.' : `Difficulty: ${difficulty}.`,
|
difficulty === 'mixed' ? 'Mix difficulty: mostly medium, with a few easy and a few hard.' : `Difficulty: ${difficulty}.`,
|
||||||
'Vary how the stems open (the client and their age, the nurse\'s situation, the setting, a finding or order, or the question itself) so no single opening dominates.',
|
'Vary how the stems open (the client and their age, the nurse\'s situation, the setting, a finding or order, or the question itself) so no single opening dominates.',
|
||||||
|
'Keep stems short and plain (usually 15 to 30 words, no bold, no scene-setting that does not change the answer), and keep answer choices concise and parallel with no explanation tacked on: the reasons go in each choice\'s "why".',
|
||||||
draft.kind === 'quiz' ? openerAdvice(draft.questions) : '',
|
draft.kind === 'quiz' ? openerAdvice(draft.questions) : '',
|
||||||
sources.groups.length > 0 ? 'Spread the questions across the excerpts instead of clustering on one. Set "source" to the id of the excerpt each question is based on.' : '',
|
sources.groups.length > 0 ? 'Spread the questions across the excerpts instead of clustering on one. Set "source" to the id of the excerpt each question is based on.' : '',
|
||||||
req.source.deckId ? 'Turn the flashcards into questions: use each card\'s answer as the correct choice and write distractors that a student could confuse with it.' : '',
|
req.source.deckId ? 'Turn the flashcards into questions: use each card\'s answer as the correct choice and write distractors that a student could confuse with it.' : '',
|
||||||
|
|
@ -987,6 +995,7 @@ async function runGeneration(app: AppContext, draftId: string, req: GenerateRequ
|
||||||
}
|
}
|
||||||
if ('stem' in item && item.type === 'numeric' && (numericLeft === 0 || numericCount() >= numericCap)) continue; // over the calculation allowance; a top-up replaces it
|
if ('stem' in item && item.type === 'numeric' && (numericLeft === 0 || numericCount() >= numericCap)) continue; // over the calculation allowance; a top-up replaces it
|
||||||
if (math && (!('stem' in item) || item.type !== 'numeric')) continue; // a math batch keeps only calculations
|
if (math && (!('stem' in item) || item.type !== 'numeric')) continue; // a math batch keeps only calculations
|
||||||
|
if ('stem' in item) item.stem = plainStem(item.stem);
|
||||||
if ('stem' in item && item.type !== 'numeric') item.options = shuffleOptions(item.options);
|
if ('stem' in item && item.type !== 'numeric') item.options = shuffleOptions(item.options);
|
||||||
seen.add(k);
|
seen.add(k);
|
||||||
(items() as (DraftQuestion | DraftCard)[]).push(item);
|
(items() as (DraftQuestion | DraftCard)[]).push(item);
|
||||||
|
|
@ -1012,7 +1021,7 @@ async function runGeneration(app: AppContext, draftId: string, req: GenerateRequ
|
||||||
task: 'plan',
|
task: 'plan',
|
||||||
purpose: 'planning questions',
|
purpose: 'planning questions',
|
||||||
modelId: req.modelId,
|
modelId: req.modelId,
|
||||||
system: `${baseSystem(db, req, hasSources)}\n\nYou plan NCLEX-style quizzes. List distinct angles, one per question: each names the client situation and the single decision or fact it tests, in one line (for example "Continuous IV heparin, aPTT 3x control with gum bleeding: first action"). No two angles may test the same decision, fact or teaching point, even in a different scenario. Vary the framing too: the setting (unit, clinic, home, emergency department), the nurse's role (bedside, charge nurse, delegating, teaching) and what prompts the question (a finding, a report, an order, a call light). Spread them over the client-needs areas the material supports (pharmacology, safety, prioritisation, delegation, teaching, lab values, complications, psychosocial). When the material is short, vary the situations and the area tested rather than repeating its points.`,
|
system: `${baseSystem(db, req, hasSources)}\n\nYou plan NCLEX-style quizzes. List distinct angles, one per question: each names the client situation and the single decision or fact it tests, in one line (for example "Continuous IV heparin, aPTT 3x control with gum bleeding: first action"). No two angles may test the same decision, fact or teaching point, even in a different scenario. Vary the kind of question too: a priority action, a finding to report or follow up, an expected finding or lab result, teaching and what a statement shows about understanding, a nurse's response, which client to see first, delegation, and some direct questions about a fact the nurse uses (the right site, tool, test or precaution). Vary what prompts the question (a finding, a report, an order, a family member's question) without adding scene-setting that does not change the answer. Spread them over the client-needs areas the material supports (pharmacology, safety, prioritisation, delegation, teaching, lab values, complications, psychosocial). When the material is short, vary the situations and the area tested rather than repeating its points.`,
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: 'user',
|
role: 'user',
|
||||||
|
|
@ -1428,8 +1437,9 @@ export function startImprove(app: AppContext, input: z.input<typeof improveReque
|
||||||
const system = `You are an expert nursing educator and item writer reviewing existing exam questions.
|
const system = `You are an expert nursing educator and item writer reviewing existing exam questions.
|
||||||
Improve each question while keeping what it tests and its correct answer(s) unless the keyed answer is factually wrong (if so, fix it and say so at the start of the rationale).
|
Improve each question while keeping what it tests and its correct answer(s) unless the keyed answer is factually wrong (if so, fix it and say so at the start of the rationale).
|
||||||
- Make the stem clear, complete and free of clues; fix grammar. Vary how the stems open so they do not all start the same way.
|
- Make the stem clear, complete and free of clues; fix grammar. Vary how the stems open so they do not all start the same way.
|
||||||
- Replace weak or implausible distractors; keep choices parallel and similar in length; remove "all/none of the above".
|
- Replace weak or implausible distractors with related facts a student could confuse; keep choices concise, parallel and similar in length (a term or value when the question asks for one, otherwise a short action or finding, or one or two sentences of quoted speech), with no explanation tacked on; remove "all/none of the above". Select-all items have 6 choices with 2 to 5 correct.
|
||||||
- Write a teaching rationale, and give every choice a one-sentence "why". ${RATIONALE_FORMAT}
|
- Keep stems short and plain: only the cues needed and one direct question, with no bold or other emphasis.
|
||||||
|
- Write a teaching rationale, and give every choice a "why" of 1 or 2 sentences with its specific clinical reason. ${RATIONALE_FORMAT}
|
||||||
- Keep the same question type unless it is clearly wrong for the content. Set a short topic label and a difficulty.
|
- Keep the same question type unless it is clearly wrong for the content. Set a short topic label and a difficulty.
|
||||||
Return the questions in the same order, one output question per input question.${req.instructions ? `\n\nAdditional instructions: ${req.instructions}` : ''}`;
|
Return the questions in the same order, one output question per input question.${req.instructions ? `\n\nAdditional instructions: ${req.instructions}` : ''}`;
|
||||||
for (let i = 0; i < questions.length; i += 8) {
|
for (let i = 0; i < questions.length; i += 8) {
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ function rulesFor(req: QuizRequestFacts): string {
|
||||||
`Requested: ${req.count} NCLEX-style questions, difficulty "${req.difficulty ?? 'mixed'}", select-all (multi) share: ${expectedMulti}, calculation (numeric) questions: ${req.numericRequested ? (req.numericCap ? `exactly ${req.numericCap} medication math questions, requested by the user (they need not come from the material)` : 'none') : req.numericCap ? `at most ${req.numericCap}` : 'none (the material has no calculations)'}.`,
|
`Requested: ${req.count} NCLEX-style questions, difficulty "${req.difficulty ?? 'mixed'}", select-all (multi) share: ${expectedMulti}, calculation (numeric) questions: ${req.numericRequested ? (req.numericCap ? `exactly ${req.numericCap} medication math questions, requested by the user (they need not come from the material)` : 'none') : req.numericCap ? `at most ${req.numericCap}` : 'none (the material has no calculations)'}.`,
|
||||||
'Rules each question must meet:',
|
'Rules each question must meet:',
|
||||||
'- single: exactly one correct option and 4 options.',
|
'- single: exactly one correct option and 4 options.',
|
||||||
'- multi (select all that apply): at least 2 correct options; for NCLEX style 5 or 6 options with 2 to 5 correct and a stem ending with "Select all that apply."',
|
'- multi (select all that apply): at least 2 correct options; for NCLEX style 6 options with 2 to 5 correct and a stem ending with "Select all that apply."',
|
||||||
'- numeric: the student types a number; options holds the accepted answer(s), all marked correct. The answer must equal the value computed from the stem, rounded as the stem says.',
|
'- numeric: the student types a number; options holds the accepted answer(s), all marked correct. The answer must equal the value computed from the stem, rounded as the stem says.',
|
||||||
'- No duplicate or near-duplicate stems; no identical options within a question; no "all of the above" / "none of the above".',
|
'- No duplicate or near-duplicate stems; no identical options within a question; no "all of the above" / "none of the above".',
|
||||||
'- The keyed answer must be the clinically correct one (check against the rationale and standard practice).',
|
'- The keyed answer must be the clinically correct one (check against the rationale and standard practice).',
|
||||||
|
|
@ -461,7 +461,7 @@ Flag a question only for a real problem:
|
||||||
- data needed to answer is missing, or the stem contradicts itself, the options or the rationale;
|
- data needed to answer is missing, or the stem contradicts itself, the options or the rationale;
|
||||||
- two options are defensible, or none is correct; the rationale disagrees with the keyed answer;
|
- two options are defensible, or none is correct; the rationale disagrees with the keyed answer;
|
||||||
- an option gives the answer away, or the content is clinically wrong or outdated.
|
- an option gives the answer away, or the content is clinically wrong or outdated.
|
||||||
For each problem give the complete corrected question with rewrite (same type, the same clinical point, following the rules for its type: single = 4 options with exactly one correct; multi = 5 or 6 options with 2 to 5 correct and a stem ending "Select all that apply."; numeric = one option, the correct answer with its unit, and "why" showing the working), or remove it if it cannot be saved. Do not flag style preferences or answer order. Call submit_proofread once; an empty list is the right answer when every question is sound.`;
|
For each problem give the complete corrected question with rewrite (same type, the same clinical point, following the rules for its type: single = 4 options with exactly one correct; multi = 6 options with 2 to 5 correct and a stem ending "Select all that apply."; a short plain stem; choices concise and parallel, with no explanation tacked on; numeric = one option, the correct answer with its unit, and "why" showing the working), or remove it if it cannot be saved. Do not flag style preferences or answer order. Call submit_proofread once; an empty list is the right answer when every question is sound.`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An independent read of the whole quiz by a fresh model call, for problems the mechanical
|
* An independent read of the whole quiz by a fresh model call, for problems the mechanical
|
||||||
|
|
|
||||||
|
|
@ -634,10 +634,11 @@ Use exactly this shape:
|
||||||
Rules:
|
Rules:
|
||||||
- "type" is "single" (multiple choice), "multi" (select all that apply) or "numeric" (the student types a number).
|
- "type" is "single" (multiple choice), "multi" (select all that apply) or "numeric" (the student types a number).
|
||||||
- "single" questions have exactly 4 options and exactly one with "correct": true.
|
- "single" questions have exactly 4 options and exactly one with "correct": true.
|
||||||
- "multi" questions have 5 or 6 options, 2 to 5 of them correct, and the stem ends with "Select all that apply."
|
- "multi" questions have exactly 6 options, 2 to 5 of them correct (most often 3 or 4), and the stem ends with "Select all that apply."
|
||||||
- Use "numeric" for calculations (dosages, IV rates, drip rates, conversions, intake and output). Its "options" holds only the correct answer, e.g. [{ "text": "12.5 mL", "correct": true, "why": "Show the calculation" }]. The stem states the unit and how to round, e.g. "Round to the nearest tenth." Only the number is checked, so units in the answer are optional.
|
- Use "numeric" for calculations (dosages, IV rates, drip rates, conversions, intake and output). Its "options" holds only the correct answer, e.g. [{ "text": "12.5 mL", "correct": true, "why": "Show the calculation" }]. The stem states the unit and how to round, e.g. "Round to the nearest tenth." Only the number is checked, so units in the answer are optional.
|
||||||
- Write NCLEX-style questions that test clinical judgment: a short client scenario (vary how stems open so they do not all start the same way), one clear question, priority wording where it fits (first, best, most important), and distractors that are plausible but wrong for a specific reason. Never use "all of the above" or "none of the above".
|
- Write NCLEX-style questions that test clinical judgment: a short, plain stem of usually 15 to 30 words with only the cues needed (vary how stems open so they do not all start the same way, and use no bold in stems), then one direct question such as "Which action should the nurse take first?" or "Which statement by the parent indicates a need for further teaching?". About a third may ask directly about a fact the nurse uses ("Which injection site is most appropriate?"). Never refer to the material itself in a question.
|
||||||
- Every option needs a one-sentence "why". The "rationale" explains the principle behind the correct answer, laid out for quick reading: one bold key sentence, then 2 to 4 short bullet points (use \\n between lines).
|
- Answer choices are concise and parallel: a term or value when the question asks for one, otherwise a short action or finding (about 4 to 12 words), or one or two sentences of quoted speech for client statements and nurse responses. No explanation tacked on, and the correct one never stands out as the longest or most detailed. Build distractors from related facts (a similar condition, a different stage, another drug or test) so they are plausible but wrong for a specific reason. Never use "all of the above" or "none of the above".
|
||||||
|
- Every option needs a "why" of 1 or 2 sentences with its specific clinical reason. The "rationale" explains the principle behind the correct answer, laid out for quick reading: one bold key sentence, then 2 to 4 short bullet points (use \\n between lines).
|
||||||
- "topic" is a short label. Reuse the same label for related questions and keep the number of different topics small.
|
- "topic" is a short label. Reuse the same label for related questions and keep the number of different topics small.
|
||||||
- "difficulty" is "easy", "medium" or "hard".
|
- "difficulty" is "easy", "medium" or "hard".
|
||||||
- Markdown is allowed inside strings (bold, lists, tables). Write line breaks inside strings as \\n.
|
- Markdown is allowed inside strings (bold, lists, tables). Write line breaks inside strings as \\n.
|
||||||
|
|
|
||||||
|
|
@ -45,3 +45,12 @@ describe('question openers', () => {
|
||||||
expect(acceptRewording(original, 'A 72-year-old client on the unit has a potassium of 3.1 mEq/L and a heart rate of 52.', repeated)).toBeNull();
|
expect(acceptRewording(original, 'A 72-year-old client on the unit has a potassium of 3.1 mEq/L and a heart rate of 52.', repeated)).toBeNull();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('plain stems', () => {
|
||||||
|
it('drops bold and underline emphasis from generated stems but keeps the words', async () => {
|
||||||
|
const { plainStem } = await import('../server/ai/generate.ts');
|
||||||
|
expect(plainStem('Which instruction is **most important for absorption**?')).toBe('Which instruction is most important for absorption?');
|
||||||
|
expect(plainStem('Give __elexacaftor__ with fat.')).toBe('Give elexacaftor with fat.');
|
||||||
|
expect(plainStem('A dose of 2 * 3 mg is ordered.')).toBe('A dose of 2 * 3 mg is ordered.');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue