So Your Script Answer Key Went Missing Again

I found myself back in this situation last month. A training department sent over a bundle of automated assessment scripts with a promise that the answer key file was in the same directory. It wasn't. There was a readme that said "see answer key," and the answer key had been accidentally deleted before the zip went out. I've lost count of how many times this has happened to me over the years. The short version is: you figure it out without losing your mind, and there are ways to recover even when the original key is completely gone. The core problem is straightforward. You have a set of grading scripts — Python, JavaScript, shell, whatever — that are supposed to evaluate student or trainee submissions against a known set of correct answers. The script references an external JSON, CSV, or YAML file containing expected outputs, scores, or rubric mappings. That file is nowhere to be found. The repository history might show it existed three weeks ago. Someone moved it. Someone renamed it. Someone never added it to version control in the first place. Here's what I do when this happens. First, stop assuming the key exists somewhere in the obvious place. Check the git history of the parent directory. Run git log --diff-filter=D --name-only -- '*answer*' '*key*' '*rubric*' '*expected*' ' to find deletions. If the project uses GitHub or GitLab, search the issues tab — someone usually reports a missing file before closing the ticket without documenting where it went.

Second, look at the scripts themselves. The grading code references the answer key in import statements, file paths, and environment variable calls. Trace every open(), require(), load_dotenv(), and subprocess call that points to external data. You'll often find hardcoded fallback paths or placeholder filenames that were meant to be swapped before deployment. I once spent forty-five minutes chasing a missing key only to discover it was actually a .env.example file that someone had renamed to answers_backup_2024.json and dumped in a subdirectory nobody checks. The script was looking for answer_key.json in the root. Same data. Wrong filename. When the key is truly unrecoverable from existing artifacts, you reconstruct it. This is the part that surprises people. Most answer keys for programming assessments aren't mystical documents — they're derived directly from the test cases and the reference implementation. Pull the spec sheet. Look at the sample inputs. Run the expected outputs through the same validation logic the grader uses. If your grader checks for exact string matches, rebuild the key from the reference solutions. If it allows fuzzy matching or range-based scoring, you need to define those thresholds explicitly, which means writing down the tolerance parameters the way the original author presumably intended. I work with a lot of courseware that uses hidden test cases. The answer key contains both visible expected outputs and hidden ones. When the visible ones survive but the hidden ones don't, you can still reverse-engineer a working partial key. Create a minimal set of visible cases, verify your grader passes them, then extend the key case-by-case by examining the test runner configuration. The test runner almost always lists the full suite of test names and their weightings. Match those names to the input/output pairs you can derive, and you end up with something that covers about 80 to 90 percent of the original key's coverage. That's enough to unblock grading while you figure out the rest.

One thing that trips people up constantly: the answer key and the grading script are not the same thing, and they should never live in the same commit. I've seen teams treat the key as a static asset bundled with the grader, which means when the key breaks, the entire grading pipeline breaks. The better approach is to keep the key in a separate data store — S3 bucket, dedicated repo branch, or environment-managed config service — and have the script pull it at runtime. This way, a missing key becomes an environment configuration problem, not a code problem. You swap in a backup key, restart the pipeline, and move on. Another counter-intuitive point: sometimes the "missing" key is actually correct and intact, but the grading script is reading from the wrong format. I encountered this with a Ruby-based assessment platform where the key was exported as a nested hash but the grader expected a flat CSV. The file existed. It had all the right data. The grader just couldn't parse it. The fix was a twenty-line conversion script, not a reconstruction of the entire key. Always check the format mismatch before assuming the data is gone. If you're building a new system from scratch and want to avoid this entirely, here's what actually works. Store the answer key as versioned JSON with a schema validation layer. Use a linter that fails the build if the key file is referenced but absent. Add a CI check that verifies the key's checksum matches an expected value stored in your secrets manager. This costs maybe an hour of setup and prevents the entire class of problems that usually show up at 4 PM on a Friday.

Get the Full Details

Case File #5 | Case of the Missing Script | Timeline Activity |Critical Thinking
Case File #5 | Case of the Missing Script | Timeline Activity |Critical Thinking

The real bottleneck with reconstructed keys is confidence. You know the data is approximately right, but you can't prove it matches the original. The standard workaround is to run the reconstructed key against a held-out set of known submissions — examples you kept before the key went missing. If the scores match within a reasonable margin, you're good. If they diverge significantly, you know which cases are wrong and can target your repair effort there instead of rebuilding from scratch again. It's not elegant. It's not ideal. But it's what actually happens when you're dealing with real training infrastructure, and knowing the workarounds saves you days of panic instead of hours.