{"id":"code-work-teach-letter-grade-lookup","audience":"teachers","category":"coding","track":"coding","technique":"context","title":"Turn curved final percents into letter grades","free":false,"task":"Write the formula for Gradebook!F2 (filled down) that turns the final percent in E2 into a letter grade. The department approved a curve: add the points in cell $K$1 to E2 before converting. The school scale is already typed on the tab named Scale in A2:B10, lowest score first, so look it up there with approximate match instead of writing nested IFs. Students marked EX (excused) must show EX. One formula in one code block, then under 20 words outside the code.","materialLabel":"Gradebook preview and the school's scale (attached to your prompt automatically)","material":"GRADEBOOK - Ms. Adeyemi, Biology P3 (row 1 is headers)\nA Student | B Labs | C Tests | D Project | E Final % | F Letter\nAmari J. | 92 | 88 | 95 | 90.4 | ?\nBen L. | 75 | 81 | 70 | 77.9 | ?\nCarla M. | 98 | 96 | 99 | 97.2 | ?\nDev P. | -- | -- | -- | EX | ?\nElla R. | 60 | 58 | 72 | 61.5 | ?\nFinn S. | 84 | 79 | 88 | 82.1 | ?\n\nSchool grading scale (from the staff handbook)\nF below 60, D 60-69, C- 70-72, C 73-76, C+ 77-79, B- 80-82, B 83-86, B+ 87-89, A 90 and up\n\nNotes:\n- Report cards print from column F.\n- The department changed A- to A last spring.\n- Labs count 30%, tests 50%, project 20%.\n- Grades are due to the office Friday by noon.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":20}],"mistakes":[{"title":"Not mentioning the Scale tab","why":"The AI writes a long nested IF with typed cutoffs instead of using the scale you already keep.","fix":"Add: \"Look up the score in Scale!$A$2:$B$10 with approximate match.\"","checks":["r0"]},{"title":"Forgetting the curve","why":"The AI can't know about the department's curve, so every grade is a few points low.","fix":"Add: \"Add $K$1 to E2 before converting.\"","checks":["r1"]},{"title":"Forgetting excused students","why":"The AI's formula shows an error for EX.","fix":"Add: \"If E2 is EX, show EX.\"","checks":["r2"]},{"title":"Getting a menu of options","why":"The AI likes to offer two or three versions of the formula, so you're left to pick and test them yourself.","fix":"Add: \"Give one formula only, in one code block, no alternatives.\"","checks":["codeBlocks"]},{"title":"Getting a tutorial","why":"By default the AI explains every part of the code at length, which you then have to scroll past.","fix":"Add: \"After the code, one line under 12 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Points at the Scale tab","patterns":["scale!","scale tab","a2:b10"]},{"label":"Adds the curve","patterns":["curve","k1","add (the )?points"]},{"label":"Handles EX","patterns":["\\bex\\b","excused"]},{"label":"Asks for one answer only","patterns":["\\b(one|single|1)\\s+(formula|code block|block|version)","only one","no (alternatives|options|other versions)"]},{"label":"Limits the explanation","patterns":["\\d+\\s*words","no (explanation|notes|commentary)","one (short )?(line|sentence)","nothing else"]}],"hint":"The AI doesn't know about the curve or where your scale lives. Tell it both, and what to do with excused students.","rubricLabels":["Looks up the score in the locked range Scale!$A$2:$B$10 with approximate match (VLOOKUP with TRUE or 1, or LOOKUP), not a chain of nested IFs with typed cutoffs","Adds the curve in $K$1 to E2 before the lookup (E2+$K$1)","Returns EX when E2 is EX, checked before the lookup"]}