{
  "_about": "Hand-verified attainment cases run against both public/assets/js/attainment-engine.js and src/Services/AttainmentService.php. Values are percentages; null = not assessed.",
  "cases": [
    {
      "name": "CE 207 parity with the original OBE Calculation Aid (Report CE 207.xlsx, students 2004001 and 2004002)",
      "course": {
        "credit": 3,
        "cos": [
          {
            "id": "co1",
            "code": "CO1",
            "po": {
              "1": 3,
              "2": 1
            }
          },
          {
            "id": "co2",
            "code": "CO2",
            "po": {
              "1": 1,
              "2": 3
            }
          },
          {
            "id": "co3",
            "code": "CO3",
            "po": {
              "1": 2,
              "2": 3
            }
          },
          {
            "id": "co4",
            "code": "CO4",
            "po": {
              "1": 1,
              "2": 3
            }
          },
          {
            "id": "co5",
            "code": "CO5",
            "po": {
              "1": 1,
              "2": 3
            }
          }
        ],
        "assessments": [
          {
            "id": "fin",
            "items": [
              {
                "coId": "co1",
                "max": 100
              },
              {
                "coId": "co2",
                "max": 100
              },
              {
                "coId": "co3",
                "max": 100
              },
              {
                "coId": "co4",
                "max": 100
              },
              {
                "coId": "co5",
                "max": 100
              }
            ]
          }
        ],
        "students": [
          {
            "id": "2004001"
          },
          {
            "id": "2004002"
          }
        ],
        "marks": {
          "2004001": {
            "fin_0": 83,
            "fin_1": 49,
            "fin_2": 10,
            "fin_3": 42,
            "fin_4": 0
          },
          "2004002": {
            "fin_0": 74,
            "fin_1": 23,
            "fin_2": 51,
            "fin_3": 70,
            "fin_4": 57
          }
        }
      },
      "expect": {
        "students": {
          "2004001": {
            "co": {
              "co1": 83,
              "co2": 49,
              "co3": 10,
              "co4": 42,
              "co5": 0
            },
            "po": {
              "1": 46.8421052631579,
              "2": 30.6451612903226
            }
          },
          "2004002": {
            "co": {
              "co1": 74,
              "co2": 23,
              "co3": 51,
              "co4": 70,
              "co5": 57
            },
            "po": {
              "1": 59.6842105263158,
              "2": 52.1290322580645
            }
          }
        },
        "cos": {
          "co1": {
            "nEvaluated": 2,
            "pctPass": 100
          },
          "co3": {
            "nEvaluated": 2,
            "pctPass": 50
          },
          "co5": {
            "nEvaluated": 2,
            "pctPass": 50
          }
        },
        "pos": {
          "1": {
            "pctPass": 100,
            "attained": true
          },
          "2": {
            "pctPass": 50,
            "attained": true
          },
          "3": {
            "hasMapping": false
          }
        },
        "poWeights": {
          "1": 24,
          "2": 39
        }
      }
    },
    {
      "name": "Methodology worked example: mandatory blank = 0 (R2), engaged choice unit (R3), untouched choice excluded (R4)",
      "course": {
        "credit": 3,
        "cfg": {
          "passMarks": 40,
          "kpiMarks": 50,
          "kpiTarget": 50
        },
        "cos": [
          {
            "id": "c1",
            "code": "CO1",
            "po": {
              "1": 3
            }
          },
          {
            "id": "c2",
            "code": "CO2",
            "po": {
              "1": 1,
              "2": 3
            }
          }
        ],
        "assessments": [
          {
            "id": "final",
            "items": [
              {
                "name": "Q1",
                "coId": "c1",
                "max": 20,
                "mandatory": true
              },
              {
                "name": "Q3a",
                "coId": "c2",
                "max": 10,
                "mandatory": false,
                "group": "Q3"
              },
              {
                "name": "Q3b",
                "coId": "c2",
                "max": 10,
                "mandatory": false,
                "group": "Q3"
              },
              {
                "name": "Q4",
                "coId": "c2",
                "max": 20,
                "mandatory": false
              }
            ]
          }
        ],
        "students": [
          {
            "id": "A"
          },
          {
            "id": "B"
          },
          {
            "id": "C"
          },
          {
            "id": "D"
          }
        ],
        "marks": {
          "A": {
            "final_0": 15,
            "final_1": 8
          },
          "B": {
            "final_0": 10,
            "final_3": 16
          },
          "C": {
            "final_0": 12,
            "final_1": 6,
            "final_2": 7
          },
          "D": {}
        }
      },
      "expect": {
        "students": {
          "A": {
            "co": {
              "c1": 75,
              "c2": 40
            },
            "po": {
              "1": 68,
              "2": 40
            }
          },
          "B": {
            "co": {
              "c1": 50,
              "c2": 80
            },
            "po": {
              "1": 56,
              "2": 80
            }
          },
          "C": {
            "co": {
              "c1": 60,
              "c2": 65
            },
            "po": {
              "1": 61,
              "2": 65
            }
          },
          "D": {
            "co": {
              "c1": 0,
              "c2": null
            },
            "po": {
              "1": 0,
              "2": null
            }
          }
        },
        "cos": {
          "c1": {
            "nEvaluated": 4,
            "pctPass": 75,
            "attained": true
          },
          "c2": {
            "nEvaluated": 3,
            "pctPass": 66.66666666666667,
            "attained": true
          }
        },
        "pos": {
          "1": {
            "nEvaluated": 4,
            "pctPass": 75
          },
          "2": {
            "nEvaluated": 3,
            "pctPass": 66.66666666666667
          }
        },
        "poWeights": {
          "1": 12,
          "2": 9
        }
      }
    },
    {
      "name": "Choice scheme: answer 4 of 6, shortfall drafted as zeros (R5); absent from the assessment excluded",
      "course": {
        "credit": 4,
        "cos": [
          {
            "id": "k3",
            "code": "CO3",
            "po": {
              "3": 2
            }
          }
        ],
        "assessments": [
          {
            "id": "ch",
            "chooseK": 4,
            "items": [
              {
                "coId": "k3",
                "max": 15,
                "mandatory": false
              },
              {
                "coId": "k3",
                "max": 15,
                "mandatory": false
              },
              {
                "coId": "k3",
                "max": 15,
                "mandatory": false
              },
              {
                "coId": "k3",
                "max": 15,
                "mandatory": false
              },
              {
                "coId": "k3",
                "max": 15,
                "mandatory": false
              },
              {
                "coId": "k3",
                "max": 15,
                "mandatory": false
              }
            ]
          }
        ],
        "students": [
          {
            "id": "two"
          },
          {
            "id": "absent"
          },
          {
            "id": "five"
          },
          {
            "id": "over"
          }
        ],
        "marks": {
          "two": {
            "ch_0": 12,
            "ch_3": 9
          },
          "five": {
            "ch_0": 10,
            "ch_1": 10,
            "ch_2": 10,
            "ch_3": 10,
            "ch_4": 10
          },
          "over": {
            "ch_0": 99,
            "ch_1": "15",
            "ch_2": 15,
            "ch_3": 15
          }
        }
      },
      "expect": {
        "students": {
          "two": {
            "co": {
              "k3": 35
            },
            "po": {
              "3": 35
            }
          },
          "absent": {
            "co": {
              "k3": null
            },
            "po": {
              "3": null
            }
          },
          "five": {
            "co": {
              "k3": 66.66666666666667
            },
            "po": {
              "3": 66.66666666666667
            }
          },
          "over": {
            "co": {
              "k3": 100
            },
            "po": {
              "3": 100
            }
          }
        },
        "cos": {
          "k3": {
            "nEvaluated": 3,
            "pctPass": 66.66666666666667
          }
        },
        "poWeights": {
          "3": 8
        }
      }
    },
    {
      "name": "CO exit survey: indirect = ratings >= 4, combined 80/20 (methodology sections 5-6)",
      "course": {
        "credit": 3,
        "cfg": {
          "passMarks": 40,
          "kpiMarks": 50,
          "kpiTarget": 50
        },
        "cos": [
          {
            "id": "c1",
            "code": "CO1",
            "po": {
              "1": 3
            }
          },
          {
            "id": "c2",
            "code": "CO2",
            "po": {
              "1": 1,
              "2": 3
            }
          }
        ],
        "assessments": [
          {
            "id": "final",
            "items": [
              {
                "name": "Q1",
                "coId": "c1",
                "max": 20,
                "mandatory": true
              },
              {
                "name": "Q3a",
                "coId": "c2",
                "max": 10,
                "mandatory": false,
                "group": "Q3"
              },
              {
                "name": "Q3b",
                "coId": "c2",
                "max": 10,
                "mandatory": false,
                "group": "Q3"
              },
              {
                "name": "Q4",
                "coId": "c2",
                "max": 20,
                "mandatory": false
              }
            ]
          }
        ],
        "students": [
          {
            "id": "A"
          },
          {
            "id": "B"
          },
          {
            "id": "C"
          },
          {
            "id": "D"
          }
        ],
        "marks": {
          "A": {
            "final_0": 15,
            "final_1": 8
          },
          "B": {
            "final_0": 10,
            "final_3": 16
          },
          "C": {
            "final_0": 12,
            "final_1": 6,
            "final_2": 7
          },
          "D": {}
        },
        "data": {
          "survey": {
            "tally": {
              "c2": [
                1,
                1,
                2,
                6,
                10
              ]
            }
          }
        }
      },
      "expect": {
        "cos": {
          "c1": {
            "indirectPct": null,
            "combinedPct": 75,
            "combinedAttained": true
          },
          "c2": {
            "indirectPct": 80,
            "combinedPct": 69.33333333333333,
            "combinedAttained": true
          }
        },
        "pos": {
          "1": {
            "indirectPct": 80,
            "combinedPct": 76
          },
          "2": {
            "indirectPct": 80,
            "combinedPct": 69.33333333333333
          }
        }
      }
    },
    {
      "name": "Survey with pass rating 5 and a 50/50 split; combined judged against Target KPI 70",
      "course": {
        "credit": 3,
        "cfg": {
          "passMarks": 40,
          "kpiMarks": 50,
          "kpiTarget": 70,
          "likertPass": 5,
          "wDirect": 50
        },
        "cos": [
          {
            "id": "c1",
            "code": "CO1",
            "po": {
              "1": 3
            }
          },
          {
            "id": "c2",
            "code": "CO2",
            "po": {
              "1": 1,
              "2": 3
            }
          }
        ],
        "assessments": [
          {
            "id": "final",
            "items": [
              {
                "name": "Q1",
                "coId": "c1",
                "max": 20,
                "mandatory": true
              },
              {
                "name": "Q3a",
                "coId": "c2",
                "max": 10,
                "mandatory": false,
                "group": "Q3"
              },
              {
                "name": "Q3b",
                "coId": "c2",
                "max": 10,
                "mandatory": false,
                "group": "Q3"
              },
              {
                "name": "Q4",
                "coId": "c2",
                "max": 20,
                "mandatory": false
              }
            ]
          }
        ],
        "students": [
          {
            "id": "A"
          },
          {
            "id": "B"
          },
          {
            "id": "C"
          },
          {
            "id": "D"
          }
        ],
        "marks": {
          "A": {
            "final_0": 15,
            "final_1": 8
          },
          "B": {
            "final_0": 10,
            "final_3": 16
          },
          "C": {
            "final_0": 12,
            "final_1": 6,
            "final_2": 7
          },
          "D": {}
        },
        "data": {
          "survey": {
            "tally": {
              "c2": [
                1,
                1,
                2,
                6,
                10
              ]
            }
          }
        }
      },
      "expect": {
        "cos": {
          "c2": {
            "indirectPct": 50,
            "combinedPct": 58.333333333333336,
            "combinedAttained": false
          },
          "c1": {
            "combinedPct": 75,
            "combinedAttained": true
          }
        },
        "pos": {
          "2": {
            "indirectPct": 50,
            "combinedPct": 58.333333333333336
          }
        }
      }
    },
    {
      "name": "Assessment-weighted CO basis (quiz 10 marks = 20%, final 200 marks = 80%) with CO-PO strength weighting",
      "course": {
        "credit": 3,
        "cfg": {
          "passMarks": 40,
          "kpiMarks": 60,
          "kpiTarget": 50,
          "coBasis": "weighted",
          "poWeighting": "strength"
        },
        "cos": [
          {
            "id": "co1",
            "code": "CO1",
            "po": {
              "1": 3,
              "2": 1
            }
          },
          {
            "id": "co2",
            "code": "CO2",
            "po": {
              "1": 1,
              "3": 3,
              "4": 2
            }
          }
        ],
        "assessments": [
          {
            "id": "q",
            "name": "Quiz",
            "weightPct": 20,
            "items": [
              {
                "name": "Q1",
                "coId": "co1",
                "max": 10
              }
            ]
          },
          {
            "id": "f",
            "name": "Final",
            "weightPct": 80,
            "items": [
              {
                "name": "Q1",
                "coId": "co1",
                "max": 100
              },
              {
                "name": "Q2",
                "coId": "co2",
                "max": 100
              }
            ]
          }
        ],
        "students": [
          {
            "id": "S1"
          },
          {
            "id": "S2"
          }
        ],
        "marks": {
          "S1": {
            "q_0": 9,
            "f_0": 30,
            "f_1": 70
          },
          "S2": {
            "q_0": 2,
            "f_0": 60,
            "f_1": 10
          }
        }
      },
      "expect": {
        "coBasisApplied": "weighted",
        "students": {
          "S1": {
            "co": {
              "co1": 50,
              "co2": 70
            },
            "po": {
              "1": 55,
              "2": 50,
              "3": 70,
              "4": 70
            }
          },
          "S2": {
            "co": {
              "co1": 46.666666666666664,
              "co2": 10
            },
            "po": {
              "1": 37.5,
              "2": 46.666666666666664,
              "3": 10,
              "4": 10
            }
          }
        },
        "cos": {
          "co1": {
            "nEvaluated": 2,
            "pctPass": 100,
            "avgScore": 48.333333333333336,
            "attained": true
          },
          "co2": {
            "pctPass": 50,
            "pctKpi": 50,
            "attained": true
          }
        },
        "pos": {
          "1": {
            "pctPass": 50,
            "avgScore": 46.25,
            "attained": true
          },
          "2": {
            "pctPass": 100
          }
        },
        "poWeights": {
          "1": 12,
          "2": 3,
          "3": 9,
          "4": 6
        }
      }
    },
    {
      "name": "Weighted basis requested but the quiz has no weight: falls back to raw marks; PO weighting unset stays normalised per CO",
      "course": {
        "credit": 3,
        "cfg": {
          "passMarks": 40,
          "kpiMarks": 50,
          "kpiTarget": 50,
          "coBasis": "weighted"
        },
        "cos": [
          {
            "id": "co1",
            "code": "CO1",
            "po": {
              "1": 3,
              "2": 1
            }
          },
          {
            "id": "co2",
            "code": "CO2",
            "po": {
              "1": 1,
              "3": 3,
              "4": 2
            }
          }
        ],
        "assessments": [
          {
            "id": "q",
            "name": "Quiz",
            "weightPct": "",
            "items": [
              {
                "name": "Q1",
                "coId": "co1",
                "max": 10
              }
            ]
          },
          {
            "id": "f",
            "name": "Final",
            "weightPct": 80,
            "items": [
              {
                "name": "Q1",
                "coId": "co1",
                "max": 100
              },
              {
                "name": "Q2",
                "coId": "co2",
                "max": 100
              }
            ]
          }
        ],
        "students": [
          {
            "id": "S1"
          },
          {
            "id": "S2"
          }
        ],
        "marks": {
          "S1": {
            "q_0": 9,
            "f_0": 30,
            "f_1": 70
          },
          "S2": {
            "q_0": 2,
            "f_0": 60,
            "f_1": 10
          }
        }
      },
      "expect": {
        "coBasisApplied": "raw",
        "students": {
          "S1": {
            "co": {
              "co1": 35.45454545454545,
              "co2": 70
            },
            "po": {
              "1": 41.735537190082646
            }
          }
        },
        "cos": {
          "co1": {
            "pctPass": 50
          }
        }
      }
    },
    {
      "name": "Weighted basis with answer 2 of 3: final full marks = 20 mandatory + 2 x 20 = 60, not 80",
      "course": {
        "credit": 3,
        "cfg": {
          "passMarks": 40,
          "kpiMarks": 50,
          "kpiTarget": 50,
          "coBasis": "weighted"
        },
        "cos": [
          {
            "id": "co1",
            "code": "CO1",
            "po": {
              "1": 2
            }
          },
          {
            "id": "co2",
            "code": "CO2",
            "po": {
              "1": 1
            }
          }
        ],
        "assessments": [
          {
            "id": "q",
            "weightPct": 40,
            "items": [
              {
                "name": "Q1",
                "coId": "co1",
                "max": 10
              }
            ]
          },
          {
            "id": "f",
            "weightPct": 60,
            "chooseK": 2,
            "items": [
              {
                "name": "Q1",
                "coId": "co1",
                "max": 20
              },
              {
                "name": "Q2",
                "coId": "co2",
                "max": 20,
                "mandatory": false
              },
              {
                "name": "Q3",
                "coId": "co2",
                "max": 20,
                "mandatory": false
              },
              {
                "name": "Q4",
                "coId": "co2",
                "max": 20,
                "mandatory": false
              }
            ]
          }
        ],
        "students": [
          {
            "id": "T1"
          }
        ],
        "marks": {
          "T1": {
            "q_0": 8,
            "f_0": 10,
            "f_1": 15
          }
        }
      },
      "expect": {
        "coBasisApplied": "weighted",
        "students": {
          "T1": {
            "co": {
              "co1": 70,
              "co2": 37.5
            },
            "po": {
              "1": 53.75
            }
          }
        }
      }
    }
  ]
}
