I am having my struggling remote students write the equation of a linear equation from a graph in slope intercept form using a table.
So the fill the the table with the y-intercept, the slope, then finally they write the equation
I made it self checking, so I want it to accept equations that look like y=x+3 and y=1x+3. I can’t seem to figure out how to put in two correct answers for a table. Right now I have this:
cellContent(1,3): when table1.cellContent(1,2)=
1“” otherwise “”
cellContent(2,3): when table1.cellContent(2,2)=
-2“” otherwise “”
cellContent(3,3): when table1.cellContent(3,2)=
y=1x-2“” otherwise “”
Better to use evaluations than latex matching. You can also use “this” to refer to the current component, and making variables for answer checks makes using correctness in multiple places a little cleaner:
#a function from student input
#this evaluates the function at a few values
#meaning the form the equation was written is irrelevant
check3= f.evaluateAt(0)=-2 and f.evaluateAt(2)=2
cellContent(1,3): when check1 “” otherwise “”
cellContent(2,3): when check2 “” otherwise “”
cellContent(3,3): when check3 “” otherwise “”
correct: check1 and check2 and check3
Awesome, thank you so much, that makes so much more sense and will help in a lot of my other activities
Also, I didn’t explain… simpleFunction creates a function from input that is in either function notation or “y=”, or an expression, so it won’t accept any form (e.g. standard form of a line).
I typically use
initialLatex: `y=` as the input prompt when I’m going to use simpleFunction, less errors from students not writing it in that form.