I am working on an AB where the students are seeing how close to the sqrt(2) they can get by entering a fraction. I want to display how they are doing to the rest of the students in the class. I’m stuck. Ideas? TY
Hi Jeff! I’ve been able to get this kind of functionality using the aggregate function in CL which puts all student answers into a single list. One caveat with this is that it can be a little slow to update (so two students may see themselves in first place for a little until it updates), but I don’t think there’s another feature that will get you this kind of functionality otherwise.
Here’s a prototype activity that does ranking for fraction estimates of \sqrt{2}, hope it helps!
Good solution. Pretty much where I would’ve gone. One thing that can slow things down is the list updating as students are making entries. To mitigate this, you can buffer it a little by requiring students to submit their answer. So I’d add a boolean for when it’s submitted…
isSubmitted = this.timeSinceSubmit() > 0
… and then edit a few lines:
my_answer = when isSubmitted this.numericValue otherwise 9473
...
class_answers = aggregate(this.numericValue).filter((el) => not(el = 9473))
Until my_answer changes from the default 9473 (a random choice) by submitting, the aggregate list won’t update.
Additionally, I’d use the errorMessage sink in the input instead of using the note. This will have the added benefit of disabling the submit button until there’s a valid entry:
errorMessage:
when is_fraction ""
otherwise "Make sure your answer is fraction with a whole number in the numerator and denominator"
Side note: You may notice I’ve used this instead of the input’s name, resp. You can always use this to reference the component the code is written. Means less editing if you change the component’s name, or want to copy it elsewhere and change its name.
Thanks Daniel! I’ve added those changes to the activity linked above.