Dictionaries · AI Suggestion Evaluation

Judge — analyse and evaluate L6 Evaluation Macro Structure ~4 min

Is this stock total correct?

Requirement: total_stock(stock) returns the total number of items in stock, where stock maps product names to counts (for example {'apples': 5, 'pears': 2} gives 7). An AI generated the function below. Accept or reject it, then justify your decision by checking it against the example.

AI suggestion
def total_stock(stock):
    return sum(stock.values())

Your decision

Why this activity was chosen
  • Bloom level: L6 Evaluation: Accept or reject a generated line, with a reason.
  • Block Model level: Macro Structure (step 4 of 4): the purpose of the whole program: the problem it solves and the goal it serves.
  • Misconception targeted: shown after you answer, so it does not give the answer away.

The pedagogically interesting moment is not generating code but deciding whether to trust it. Students practise evaluation: correctness, fit to the requirement, and a stated justification.

AI’s role here: The platform presents a supposed AI suggestion. A live model must not quietly correct the suggestion or complete the function for the student.