"lock" randomized values for snapshots?

Learning so much about CL! I have the following screen in an activity:

I am using random values in the graph to generate the x and y intercepts, just for a little bit of added pizazz. :sunglasses: :grin:

I am brand new to AB so I did a bit of test-running today. When I took some snapshots, all looked fine from the dashboard:

But when I actually “present”, the graph is showing the default (?) values, not the randomized values, for the points. :confused: Any fix for this? In this particular activity, it isn’t really crucial that I randomize those values, but in some other context I might not want to give that up.

For some reason, when you use random in a graph, it only does it once and then it never randomizes again. Try using the CL for your randoms instead. Something like:

r = randomGenerator(expInput2.submitCount)
number("a"): r.int(-4,4)

I’m using the submitCount to seed the generator, so that, again, it doesn’t calculate just once.

1 Like

Thanks for the help! I actually had to remove the submitCount, as I don’t want it to re-calculate the points, I want to compute the points once per student but randomly across students. With that in the random generator, it was re-computing the random points when the student clicked “submit”, which resulted in the correct answer now being wrong… lol!

It’s working perfectly now, and the randomly selected points are “sticking” for the snapshots! Thanks so much!! :grin:

1 Like