Controlled Randomness needed
I put this
function ggbOnInit() {
ggbApplet.eval("SetSeed(33)");
}
In a ggb containing just one slider and thick "random" for it. Every time I load this simplest ggb
the slider comes up with a different value. I do not like this!
If you have a ggb activity with self grading and use it as a test this is nice and can limit cheating.
Nevertheless it is quite common to survey the SAME activity BEFORE the test. In this case you might want the students to follow your survey having all the same exercise on their device before
starting (a randomized and new) test. This is quite easy to obtain if SetSeed can seed ALL RANDOM GENERATORS in Geogebra. The K.I.S.S. solution being to develop a separate SURVEY activity by adding the above code to an existing randomized anti cheating test activity.
Is there something I am missing or this centralized seeding is missing? I guess it is quite easy to implement and could be incredibly useful.
Cheers.
Franco
Tatsächlich, danke.
Indeed, thank you.
Please say what you are trying to do exactly (with a concrete example)
First of, I think
will not do anything because it's not a valid command. (GeoGebra just doesn't give an error unfortunately.) It should rather be
That said, the change won't solve the problem. As far as I understand, the init script runs after the construction is complete (otherwise it wouldn't have access to the variables), but at this point the slider value is already set, so SetSeed won't have an affect on it.
No idea if there is a way to start GeoGebra with a predefined Seed (which is what you want I guess), but you could also just reset the needed values from the init script (after SetSeed of course) via RandomUniform or RandomBetween or whatever you need.
Thanks for your prompt replies! The code was calling the correct function evalCommand but every time you load this ggb the slider
is different. I expect to have always the same value if the seed has to be considered valid for all the randomness going on in GGB.
In my first mail I devised a real-class situation where you might want this. Furthermore, using existing ggb activities, I expect this to work without big modifications to the code. Just that line in the ggbInit function. May be I will have to take a look in the code. Does not sound too difficult to fix.
You have a wrong idea about SetSeed(<number>).
SetSeed() tries (without guarantee) to make the coming random numbers more random. So rather the opposite of what you (probably) want to achieve. Exaggeratedly formulated: SetSeed() does nothing (recognizable).
What you really want to achieve is not clear to me, respectively I can only assume. Maybe you can describe not how but what you want to achieve more precisely, without abbreviations and with an example.
maybe that's what you're looking for.
Thanks all for your interest. I will take a look at all the ggbs attached. In the meanwhile let me recall the original problem.
This is centered on the following scenario that should be very common.
A teacher is collecting various ggbs from the net. These ggbs implements a self evaluation using Moodle.
That teacher is not the author of these ggbs and have no idea of the code in it.
Since they are used for self evaluation they implement some anti-cheating by using randomized objects (points and numbers) to deliver to each student connected to Moodle a slightly different version of the same exercise.
This thing about Moodle is not so important. In general imagine that a ggb is available for download by students and every time they open it they see a slightly different activity.
I want to have a simple way to control this randomness by SetSeed.
In programming experience a random number generator with a seed gives always the same random sequence when seeded with the same seed.
The point is that in GGB you can define objects to be random (e.g. a slider) and yet there is no way to seed them.
I ask (or I will try to patch the code) to get ALL random objects in GGB seeded by a SetSeed.
In this way a small javascript SetSeed addition in initGgb() can help the teacher to control the class.
If all the students download a copy of some activity (in Moodle or not) and get a different version of the activity
TRAINING FOR THE TEST is going to be a mess. The teacher is going to explain how to cope with the test to a class where every student see a slightly different version of the test.
If all the students download a copy of some activity (in Moodle or not) and get the same version of the activity THE TEST is going to be a cheating session.So during training the ggb must be seeded by the SAME seed for all the students and during the test the seed itsself must be randomized.
I think that making SetSeed a seed for all random objects can help teacher to take somebody else ggb and align the code for this scenario without rewriting all the code.
Actually is rather surprising that this has not been addressed so far.
Can someone please point me some docs about forking in github to develop a patch for it or how to request a feature
and see the development assigned to the asker?
Cheers
Franco
Well, I think I have settled this problem. The problem is that some ggb activities (of unknown author and structure) uses
random generation. Therefore if pick a ggb activity from the repo and distribute it to the class, each and every student, upon loading the ggb, gets a different exercise. You might not want this.
To circumvent this situation you can add a RESET button to the activity code (you don't know much about).
Your RESET must simply issue a SetSeed(42) (42 or whatever) followed by pressing F9 or by an UpdateConstruction(). Indeed, after seeding with 42, all the random generators in GGB follow the same pattern. An example is provided.
Load the included ggb and press repeatedly F9. You will get random values. Pressing SET SEED followed by F9 you always get the same sequence of values from various random generators in Geogebra.
So you just have to tell the students to press RESET and F9 e.g. three times and all the class will have the same activity on each device. Nice designed randomness in GGB!
@Artydent thank for your comment! Putting SetSeed in Javascript init gets too late since the construction must already be there. Thinking twice to your insight I imagined that SetSeed followed by UpdateConstruction(). should do the job.
The best way to do this is to use the randomSeed parameter if possible https://wiki.geogebra.org/e...
Comments have been locked on this page!