Distribute random integers from interval across class

I have been looking at the Random Number generator tool on the CL and was hoping to use it in a specific way. Is it possible to distribute the integers 1 - 24 to a class of 24 randomly so that each student has a unique value?

This would open the door to a lot of opportunities in my stats class of assigning a specific number of treatment types across the class.

I know, in a graph (which you could hide), you can take a list (1-24) and shuffle it. L=shuffle([1,2...24])
Then, (I’m not certain), have an action button for students to click (it can be any button that may also have another use on the same or previous slide). Make a list that aggregates any number (so you could use a button that aggregates something else and use that list). Also, have the button capture the length of the aggregated list. Then use that as the index for the shuffled list. They should each get a different length (the order in which students pressed the button), but I don’t know if some lag might give students the same value. You’ll also want to disable the button once it’s pressed.

Hi! Curious about if there is a resolution to this, or if the advice definitely works. I couldn’t quite replicate what was shared or get it to work, but also understand why it MIGHT be impossible for x users to have unique values from a list of y unique values (especially if x is greater than y).

This wouldn’t have been (reliably) possible at the time, but here’s a way to achieve this. It’s not 100% reliable because the random float could possibly duplicate, but it’s unlikely.

Essentially students are being assigned a random value which aggregates when they go to the screen, so it can almost all be in any component. There’s no shuffle function in CL, so that’s being done in the graph, but can be part of any graph. Then the value at the same index as the student’s “ID” is their assigned value. Barring the unlikely duplicate float, each student will have a unique value.