Sub topic 6
Scoring, pass marks, and attempt limits
This chapter assumes you can already write quiz questions in common formats and store them as structured data, as covered in the earlier chapters on question types and writing. It also assumes you know the difference between formative and summative assessment. Here you will decide how a quiz turns answers into a score, what score counts as a pass, and how many tries a learner gets.
Why scoring rules are a design decision
A scoring rule is not a technical detail. It tells learners what the course values. A quiz that gives full marks for a lucky guess teaches different habits than one that requires every part of an answer to be right. The same questions can serve a low-stakes practice check or a certificate exam, depending only on the rules around them.
Three settings control this:
- The scoring rule for each question.
- The pass mark for the whole quiz.
- The attempt policy: how many tries, and what happens between them.
Choose them from the quiz's purpose. A formative quiz helps learners find gaps, so it should be forgiving. A summative quiz certifies a result, so it should be stricter.
Scoring a single question
All-or-nothing scoring
All-or-nothing scoring gives one point only when the learner's selection exactly matches the correct answer. This is simple to explain and simple to code. It suits single-choice, true/false, and short numeric answers.
The scorer below uses the question format from the earlier chapter, where correct is a list of choice ids.
function scoreQuestion(question, selected) {
const correct = new Set(question.correct);
const chosen = new Set(selected);
if (correct.size !== chosen.size) return 0;
for (const id of chosen) {
if (!correct.has(id)) return 0;
}
return 1;
}Comparing sizes first and then checking membership means the order of selections does not matter. Selecting ["a", "c"] and ["c", "a"] both match a correct answer of ["a", "c"].
Partial credit
All-or-nothing scoring is harsh on multiple-response questions. If a question has three correct choices and a learner finds two, they get zero, the same as someone who found none. Partial credit gives a fraction of the point instead.
A common method counts correct picks and subtracts wrong picks, never going below zero:
function scoreWithPartialCredit(question, selected) {
const correct = new Set(question.correct);
const chosen = new Set(selected);
let right = 0;
let wrong = 0;
for (const id of chosen) {
if (correct.has(id)) right += 1;
else wrong += 1;
}
const raw = (right - wrong) / correct.size;
return Math.max(0, Math.min(1, raw));
}The subtraction matters. Without it, a learner could select every choice and always collect full credit. With three correct choices out of five, selecting all five gives (3 - 2) / 3, about 0.33, not 1.
Use partial credit when the skill is naturally graded, such as spotting several errors in a document. Avoid it when a partly correct answer is dangerous in practice, such as a safety checklist where missing one step is a failure.
Negative marking
Negative marking takes points away for wrong answers to discourage guessing. It rarely belongs in online courses. It rewards test-taking strategy over knowledge, it can discourage learners who are unsure but capable, and it complicates the score a learner sees. If guessing worries you, write better distractors and add more questions instead.
Scoring the whole quiz
Once each question has a score, add them up and compare the ratio to a pass mark. Here is the quiz-level scorer:
function scoreQuiz(questions, answers, passMark = 0.7) {
const total = questions.length;
const earned = questions.reduce(
(sum, q) => sum + scoreQuestion(q, answers[q.id] ?? []),
0
);
const ratio = total > 0 ? earned / total : 0;
return { earned, total, ratio, passed: ratio >= passMark };
}Three details are worth noticing:
answers[q.id] ?? []treats an unanswered question as an empty selection, which scores 0. This avoids a crash and counts a skipped question as wrong.total > 0 ? ... : 0prevents a division by zero if a quiz has no questions.ratio >= passMarkmakes the pass mark inclusive. A learner who scores exactly 70% with a 0.7 mark passes.
Floating-point edge cases
Ratios and fractions of points are floating-point numbers, and comparisons can fail at the boundary. With partial credit, a sum such as 0.1 + 0.2 is not exactly 0.3. A learner who should pass at exactly the pass mark may fail by a tiny error. Two safe fixes are to count in whole points (for example, score each question out of 100) or to round the ratio to a fixed number of decimals before comparing.
Weighted questions
Some questions deserve more weight. Add a points field to each question and sum points instead of counting questions:
function scoreWeightedQuiz(questions, answers, passMark = 0.7) {
let earned = 0;
let total = 0;
for (const q of questions) {
const points = q.points ?? 1;
total += points;
earned += points * scoreQuestion(q, answers[q.id] ?? []);
}
const ratio = total > 0 ? earned / total : 0;
return { earned, total, ratio, passed: ratio >= passMark };
}Use weights sparingly. If every question has a different weight, learners cannot tell what matters, and your reports become harder to read.
Choosing a pass mark
A pass mark answers the question "what score shows the learner is ready for what comes next?" Do not copy 70% or 80% from habit. Consider these points:
- The consequence of failing. A certificate or a safety requirement justifies a higher mark. A practice quiz may need none.
- The number of questions. On a five-question quiz, each question is worth 20%. A learner who misses one drops to 80%, so a pass mark of 85% effectively demands a perfect score.
- Question difficulty. If the questions are very easy, a high pass mark proves little.
- Required topics. An overall score can hide a total failure on one critical topic. For high-stakes quizzes, require a minimum score in each section as well as overall.
After launch, check the pass rate. If almost everyone fails, the questions or the teaching may be the problem. If almost everyone passes on the first try, the quiz may not be measuring anything.
Attempt limits
An attempt limit sets how many times a learner may take a quiz. Match it to the purpose.
| Quiz purpose | Typical attempts | Typical feedback | Reasoning |
|---|---|---|---|
| Formative practice | Unlimited | Immediate, with explanations | Retrying is how learners improve |
| Module check | 2 to 3 | Immediate, correct answers after the last attempt | Encourages effort without allowing brute force |
| Final assessment | 1 to 3, often with a wait | Score only, or limited detail | Protects the validity of the result |
Deciding what counts
When learners can retry, you must decide which score is recorded. The options are the highest score, the latest score, or the average. Highest score is the most common and most encouraging. Latest score suits courses where you want the final state to reflect current knowledge. Average punishes early mistakes and tends to discourage retrying.
Preventing brute force
Unlimited immediate retries with full feedback let a learner click through every option until the quiz passes. This can be acceptable for practice, but not for certification. Several measures reduce it:
- Draw questions from a larger pool so each attempt differs.
- Shuffle the order of questions and choices.
- Add a waiting period between attempts, such as 24 hours.
- Show correct answers only after the last allowed attempt.
Shuffling answers needs care. If a choice reads "All of the above" or "Both A and B", shuffling breaks it. Avoid those choices or exclude them from shuffling.
Handling interruptions
A timer or an attempt limit can punish learners for problems that are not their fault, such as a lost connection. Decide in advance whether a dropped attempt counts. Save answers as the learner goes so they can resume, and give instructors a way to reset an attempt.
Common mistakes
- Setting a pass mark without checking what one missed question does to the percentage.
- Using partial credit without subtracting wrong picks.
- Comparing floating-point ratios at the boundary without rounding.
- Applying certification-level rules to a practice quiz, which discourages learners.
- Counting only the overall score when one topic is critical.
Summary of decisions
For each quiz, write down four choices before you build it: the per-question scoring rule, the pass mark and its reason, the attempt limit, and which score is recorded. Then test the boundary cases from the pre-launch chapter: an exact pass-mark score, a blank submission, and a final attempt.
Exercise
A quiz has four questions, each worth one point, and a pass mark of 0.75. A learner answers three correctly. Does the learner pass? Then explain what happens with scoreWithPartialCredit when a question has two correct choices out of four and the learner selects all four.
Show answer
The ratio is 3/4 = 0.75, and the check is ratio >= passMark, so the learner passes. For the partial credit case, the learner picks 2 right and 2 wrong, so the raw score is (2 - 2) / 2 = 0, and the function returns 0. Selecting everything earns nothing, which is the purpose of subtracting wrong picks.
Exercise
You are configuring a final certification quiz with 10 questions. Choose an attempt limit, a rule for which score is recorded, and two measures against brute-force guessing. Justify each choice in one sentence.
Show answer
A sample answer: allow 2 attempts, because the result certifies competence but one technical failure should not end a learner's chance. Record the highest score, since it reflects the best demonstrated knowledge. Draw questions from a pool of 25 so retries differ, and require a 24-hour wait between attempts so learners must study instead of guessing again. Any answer that matches the quiz's high-stakes purpose and gives reasons is acceptable.