Checking Line of Best Fit Help

I am working to try and get this activity to give the check mark when students have the line of best fit within 2.5% of the actual y-intercept. This that I am sharing is my problem solving.

When I move the green points in top graph and then click graph the line of best fit button, it does collect both the slope and y-intercept of the graph.

The bottom graph is showing the actual line of best fit and when I click the exact line of best fit of the button, I know it is collecting the slope and y-intercept. However, it will not give me a check mark until I move one of the purple dots on the graph. I can’t figure out why that is.

Any help would be appreciated.

I don’t know if it’s a glitch or by design, but correct: conditions attached to graphs do not seem to update until something is adjusted on the graph itself - like moving the purple points, for example, as you spotted.

Your two options to fix this seem to be either to use saveOnChange in the graph CL, with anything that changes - eg. saveOnChange: "${bf}" - or to make graphans readonly and put the correct: condition in the multiple choice component.

Thanks! I changed the correct condition to the multiple choice component and it does what I want.

There’s actually a new (somewhat secret) sink “hasResponse” that you can use here. You can use it to mark a graph’s correctness without directly interacting or unmark correctness for graphs with number sinks that haven’t been interacted with.

1 Like

Which component would I use the hasResponse sink? I tried looking it up but was unable to locate the sink.


Along with this, I am trying to create a master that will create the line of best fit answer key for any set of data I put in for the table. I got it to work for the first data that I put in the table. However, when I copy this slide and switch the data. It no longer computes the slope of the line of best fit to check.

There is a lot going on in this one slide, and I feel I sometimes find ways to check values, but I do not think they are always the most efficient method in coding.

Essentially on this slide I am trying to do the following:

  1. Be able to input data into the hidden slide.
  2. The hidden graph finds the accurate line of best fit.
  3. Students then need to identify type(s) of association.
  4. Students then graph their line and develop equation.
  5. Slide then checks accuracy (within an error range) of what students put and gives feedback.

The challenge is when I put in different data, the coding is not checking accuracy of students answers.


Yeah, it’s not fully released yet so it won’t be autocompleted and documented. Use it in the graph and assign it a Boolean value.

I think I figured it out for the 5 things I was trying to do. Thanks for the help. I had an inequality statement that would never be true!!