How do you use MC inputs to turn on specific data in a graph?

I am attempting to streamline an old task now that I feel more comfortable with CL.

This task is about having students see that the constant of proportionality is different depending on which data you choose for the dependent and independent variable. This will lead into a discussion of the meaning of slope.

Anyway, I have three categories of related data. I want students to choose an independent variable and then a dependent variable from these possibilities using Multiple Choice questions on one page and then I want to use their choices to graph their chosen data on the next screen. I created variables in the graph for each possibility (a total of 6 options), but I am having trouble figuring out the CL to connect two different answers from the MC questions to the graph.

I have included a link to the task. Basically I want to replace slides 6 & 8 with a more coherent option (5 to 7 to 9). Any help would be appreciated.

You’ll probably find the hidden sink most useful. You can conditionally hide/show components using that sink. For example, if you want another note or component hidden until they submit their explanation in Slide 5:

hidden: not(mc1.submitted)

I personally feel like there’s a lot of text going on, and combining them might make things too cluttered. Occasionally, when I have consecutive slides that look nearly identical, I move my image/table to the other side, so students don’t accidentally skip over it.

Also, for your explainPrompt sink in Slide 5, the when-otherwise was unnecessary since you want the same question regardless of choice:

explainPrompt: "How do you think you might answer this question?"

Hello Daniel_Grubbs,

Thank you for your response. I agree with your comments about slide 5. I initially wrote this activity a few years ago, so I was still learning about the CL process. I will clean this up.

I also think your comment about moving text around is well taken.

I am still wondering about how I deal with the different data sets on slide 9. I would like to only show the data based on the conditional response from the previous MC questions (MC2 & MC3) found on slide 7. I tried to use a Hidden CL on slide 9, but it didn’t like it. Basically I created the variables in graph associated with the conditions from slide 7, but I am unsure how to only show those data when students get to the graph. Maybe I am missing something here. Any additional help you could provide would be appreciated.


Here’s what I’d do. Your data sets on slide 9 are a,b,c,d,f,g, which correlate to your MCs. In your graph CL set a number, n, conditionally to match the choices for the data sets:

number(`n`): when MC2.isSelected(3) and MC3.isSelected(2) 1 #selections for a
             when MC2.isSelected(3) and MC3.isSelected(1) 2 #selections for b
             otherwise 0

Then in the point sets you defined in your graph for a, b, etc. add a restriction for the corresponding value of n.

a=(x_{data}, y_{time} {n=1})
b=(x_{data}, y_{songs} {n=2})

Basically, (a for example) the y coordinate is y_{time} if n=1, but is undefined if not, and won’t display.

Thank you - that did the trick!