Commit 122a35

2026-06-11 09:10:54 lisa: Tool 3: show Algorithm 1 pseudocode verbatim before the hand-trace Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sd/C05/From SRS to Detailed Designs - Data and Logic.md ..
@@ 134,7 134,34 @@
### Tool 3 — Pseudocode: how the derived value is actually computed
-The data dictionary says a calculated score *is* derived. The object model says `calculated()` is a method. The pseudocode says **how**. Algorithm 1 derives it, hop by hop, for Cohen's C03 (`[8, 7]`, weights `[60, 40]`):
+The data dictionary says a calculated score *is* derived. The object model says `calculated()` is a method. The pseudocode says **how**. Algorithm 1, verbatim from the artefact:
+
+```
+ALGORITHM CalculateCriterionScore
+INPUT: indicatorScores[1..n] // teacher's score per indicator, 0–10 or empty
+ weights[1..n] // from the criterion's checklist, sums to 100
+OUTPUT: calculated // whole number 0–10, or NONE
+
+BEGIN
+ totalWeighted ← 0
+ totalWeight ← 0
+ FOR i ← 1 TO n DO
+ IF indicatorScores[i] IS NOT EMPTY THEN
+ totalWeighted ← totalWeighted + indicatorScores[i] × weights[i]
+ totalWeight ← totalWeight + weights[i]
+ END IF
+ END FOR
+
+ IF totalWeight = 0 THEN
+ RETURN NONE // nothing graded yet
+ END IF
+
+ weighted ← totalWeighted / totalWeight // e.g. 8×60 + 7×40 → 7.6
+ RETURN RoundHalfUp(weighted) // 7.6 → 8, 7.5 → 8, 7.4 → 7
+END
+```
+
+Now run it by hand for Cohen's C03 (`[8, 7]`, weights `[60, 40]`):
- For each scored indicator, add `indicatorScore × weight` to `totalWeighted` and `weight` to `totalWeight`: `8 × 60 = 480`, `7 × 40 = 280`, so `totalWeighted = 760`, `totalWeight = 100`.
- `weighted ← totalWeighted / totalWeight` → `760 / 100 = 7.6`.
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9