I am working on this quiz and am using the random number generator to differentiate the quizzes more. On Slide 2 (Question 1), the correctness check is only working some of the time. It works fine for “nice” slopes, but if the slope yields a messy answer, it’s marking it wrong. Any suggestions on how to fix this? Here is the activity.
1 Like
xyLine with some rounding calculations might be your friend:
#student line
sLine= xyLine(this.latex)
#slope of student line rounded to 5 (as is your slope in the sketch)
sSlope= numericValue(`\round(${sLine.slope},5)`)
correct = sSlope=m
If you want some more reliable function comparisons in general without using xyLine, check this out:
(If you go this route, you may want to remove the rounding of the slopes in your sketch)
I think that fixed it! Thank you!!
1 Like