How to bring a slider value to a new graph

On my first slide, the student uses a slider to move “a” and “b” for the equation of a line.

I want to bring those values to a fourth slide and square the linear function the student created in the first slide and show its graph.

Struggling how to code that and would love assistance.

You’ll want to name the first graph component g1 and then on the fourth slide you can call the values of a and b from g1 in the CL code using

number("a"): g1.number("a")
number("b"): g1.number("b")

while entering the formula for the function inside the calculator itself. Here’s an example implementation. Square function example • Activity Builder by Desmos

2 Likes

Thank you so much. It was a perfect fix.

This is no longer working as a solution from a graph to a graph. Here’s what I came up with to reference the value as part of content. Not sure if changing the colon to an equal would work within the graph too…?

b1=graphpart3.number(“b_1”)

content: “Your second estimation on the previous slide was ${b1}.”

It looks like you’re trying to define some content. That sink only works in a note component, so adding a note and copying exactly what you have there into the noteShould print the text.

Anyone know if its possible to set the initial value of a slider to a value from another slider in another graph, but still allow it to slide after that?

You can if your new slider is a two-variable slider. For instance, let’s say you have a point … you could make the coordinates (x1 + x01, y1 + y01). You could set x01 and y01 equal to 0 in the graph itself, and you could make x1 and y1 the value or the previous screen using a number sink. That way the user is moving the point from wherever (x1,y1) was set to before.

1 Like