Packing-desk practice: three source-based questions and explanatory feedback

HTML for this example

Select the code and use your copy shortcut. Changes in this preview are temporary.

<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; form-action 'none'; base-uri 'none'"><title>Packing-desk practice quiz</title><style>
*{box-sizing:border-box}body{margin:0;font:16px/1.5 Arial,sans-serif;color:#263644;background:#fff}main{max-width:860px;margin:auto;padding:22px}h1{font-size:26px;line-height:1.2;margin:8px 0 18px}h2{font-size:19px}.note{font-size:13px;color:#52616e}.source{background:#eef4f9;border-left:4px solid #456a88;padding:10px 14px}p{margin:10px 0}fieldset{min-width:0;margin:20px 0;padding:14px;border:1px solid #a9b7c3}legend{font-weight:bold;padding:0 6px;max-width:100%;white-space:normal}label{display:flex;align-items:flex-start;gap:10px;padding:9px 5px;cursor:pointer}input{flex:none;margin-top:6px;width:18px;height:18px}button{font:inherit;padding:10px 16px;background:#244f70;color:white;border:2px solid #244f70;cursor:pointer;margin:0 8px 8px 0}button.secondary{background:white;color:#244f70}:focus-visible{outline:3px solid #b44c00;outline-offset:3px}.feedback{border-left:4px solid #456a88;padding:10px;background:#f0f4f7}.feedback:empty{display:none}#status{font-weight:bold}#status.error{color:#8c2e1f}footer{border-top:1px solid #a9b7c3;margin-top:24px;padding-top:12px}@media(max-width:560px){main{padding:16px}h1{font-size:23px}fieldset{padding:10px}}@media print{button{display:none}}
</style></head><body><main><p class="note">Fictional note and original practice questions · no grade storage or competence claim</p><h1>Packing-desk handoff: check your decision</h1><section class="source"><h2>Source note</h2><p>The handout list requires 24 complete sets. The helper has counted 22. The shift lead arranges the missing sets; the helper recounts before marking the handout check complete. If an item label is unreadable, hold the item for the lead rather than inventing an identifier. At handoff, record unresolved items, responsible roles and the next check.</p></section><p>Choose one answer per question, then submit. Feedback explains each selected answer. Your selections stay only on this open page; reset clears them.</p><noscript>This quiz needs JavaScript for scoring. Read the source note; the form below cannot score without it.</noscript><form id="quiz" novalidate hidden>
<fieldset id="group1"><legend>1. How many complete sets are still needed?</legend><label><input id="q1a" type="radio" name="q1" value="0">22 sets</label><label><input id="q1b" type="radio" name="q1" value="1">2 sets</label><label><input id="q1c" type="radio" name="q1" value="2">24 sets</label><p class="feedback" id="f1" aria-live="polite"></p></fieldset>
<fieldset id="group2"><legend>2. What should happen if an item label cannot be read?</legend><label><input id="q2a" type="radio" name="q2" value="0">Invent an identifier to keep the line moving</label><label><input id="q2b" type="radio" name="q2" value="1">Return the item to stock without a record</label><label><input id="q2c" type="radio" name="q2" value="2">Hold it for the lead</label><p class="feedback" id="f2" aria-live="polite"></p></fieldset>
<fieldset id="group3"><legend>3. When is the handout check complete?</legend><label><input id="q3a" type="radio" name="q3" value="0">After a recount finds all 24 complete sets</label><label><input id="q3b" type="radio" name="q3" value="1">As soon as the lead promises more sets</label><label><input id="q3c" type="radio" name="q3" value="2">When 22 sets have been placed on the table</label><p class="feedback" id="f3" aria-live="polite"></p></fieldset>
<p id="status" role="status" tabindex="-1">0 of 3 answered. Submit when all are answered.</p><button id="submit" type="button">Check answers</button><button id="reset-practice" class="secondary" type="button">Reset practice</button></form><footer>Original practice only. The source note is fictional, not an approved workplace procedure. No responses, grades or identifiers are sent or stored. Use the required platform for formal assessment and reporting.</footer></main><script>
'use strict';
const form=document.getElementById('quiz'),status=document.getElementById('status'),key=[1,2,0];
const explanations=[['22 is the observed count, not the shortage. The required 24 minus 22 gives 2.','24 − 22 = 2. The note requires 24 and reports 22 counted.','24 is the requirement, not the missing quantity. Subtract the 22 already counted.'],['The note says not to invent an identifier. Hold the item for the lead.','Returning it to stock skips the hold rule and the unresolved-item record.','The note explicitly calls for holding an unreadable-label item for the lead.'],['The stated completion condition is a recount finding all 24 complete sets.','A promise is not a completed recount. Check the actual24-set condition.','22 is short of the required 24. The check stays unresolved until the recount meets it.']];
const selected=()=>[1,2,3].map(i=>form.querySelector('input[name="q'+i+'"]:checked'));
const clearFeedback=()=>[1,2,3].forEach(i=>document.getElementById('f'+i).textContent='');
form.hidden=false;
document.getElementById('submit').addEventListener('click',event=>{event.preventDefault();const answers=selected(),missing=answers.map((x,i)=>x?null:i+1).filter(Boolean);clearFeedback();if(missing.length){status.textContent='Answer question'+(missing.length>1?'s ':' ')+missing.join(', ')+' before scoring. '+(3-missing.length)+' of 3 answered.';status.className='error';document.getElementById('q'+missing[0]+'a').focus();return;}let score=0;answers.forEach((x,i)=>{const choice=Number(x.value),right=choice===key[i];if(right)score++;document.getElementById('f'+(i+1)).textContent=(right?'Correct. ':'Not quite. ')+explanations[i][choice];});status.className='';status.textContent='Score: '+score+' / 3. Review each explanation; change an answer and submit again to rescore.';status.focus();});
form.addEventListener('change',()=>{clearFeedback();status.className='';status.textContent=selected().filter(Boolean).length+' of 3 answered. Answers changed; submit to score current choices.';});
document.getElementById('reset-practice').addEventListener('click',()=>{form.reset();clearFeedback();status.className='';status.textContent='0 of 3 answered. Submit when all are answered.';document.getElementById('q1a').focus();});
</script></body></html>