Something’s not working the way it seems like it should.
When I use the random function with a seed I expect the same sequence to appear regardless of when and where the function is used because it is defined to be based on a pseudo random number generator.
I saw in an activity I was developing that that didn’t happen. A workaround (this unexpected behavior) has been used to achieve the desired outcome but constrains the resulting code.
Here’s the link to the initial question I posted, which includes a link to the activity:
I’m told this is a known issue, but doesn’t seem to have been flagged as a ‘bug’ before.
It’s not a bug, as there are more variables that go into the seed than just the value entered, such as the user, the session, etc. I am told that for Challenge Creator screens, however, students trying another student’s creation will show the same seed.
It is consistent for an individual student. If, for example, you wanted to cycle through displaying 5 values, you can use a mod function on the button’s pressCount and students would be able to return to the initial value, since it’s returning to the initial seed = 0.
Honestly, when I was teaching, it was my preference to give students different values to reduce cheating, so this works in the way I’d personally expect and desire. (They were often surprised when I allowed them to help each other because they’d have to teach the process instead of being able to share answers.)
Again, if you want students to have the same values then randomizing is fairly irrelevant and should be a fixed list. Related, shuffle() can also take a seed, and I don’t see it being useful unless it were different for each student. Not invalidating your opinion, but the decision, as was explained to me, was thoughtful and intentional.