Code Defense Lab mark
Code Defense Lab

Statistics and Data Science Education / Scatterplot Regression Defense

Recognize the same mental model in damaged form, then make the smallest fix that restores reliable behavior.

Step 5 of 5 100% Complete

Checkpoint 5

Scatterplot Regression Defense: Repair Mode

Repair is the strongest authenticity check in the student flow. Instead of writing fresh code, the learner must diagnose a broken version of the regression workflow and make one precise correction.

By this point the student has already explained the modeling pattern, traced state changes, and adapted the data contract. Repair asks whether they can recognize the same mental model when it appears in damaged form.

terminal

Repair Prompt

A buggy version of your regression workflow is shown below. It flips the predictor and outcome in the formula and plot mapping, leading to an invalid interpretation. Fix the logic.

errorPotential: invalid slope and misleading plot
infoDetected in: regression formula and scatterplot mapping

Repair logic

Diagnose the smallest broken modeling line, then restore the intended behavior without rewriting the whole approach.

Student Repair Note

Responses save automatically

Hint ladder

No hints opened yet
scatterplot_regression_defense_repair.R
L: 14 C: 22
Formula / plot mismatch detected