Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview of the solved questions #31

Open
pcsiba opened this issue Dec 6, 2021 · 8 comments
Open

Preview of the solved questions #31

pcsiba opened this issue Dec 6, 2021 · 8 comments

Comments

@pcsiba
Copy link

pcsiba commented Dec 6, 2021

Sorry for my question, I tried to found a solution of our problem on web, especially on the help pages of GeoGebra, but without succes...
We make randomized GeoGebra exercises in a Moodle with this qtype_geogebra plugin.
In the applets, the randomization of the variables is was made with Geogebra (slider, RandomPoint, PointOnObject...) and the evaluation is done with the logical variable of GeoGebra.
The applets works, but after submitting of questions in Moodle, displays whether is correct the solution and gives a score, but in the preview of the student solution the variables are randomized again, the applet reloads and displays the data corresponding to the reloaded, newly randomized data.
We tried all Moodle and plugin settings, options but unfortunately without success.
To illustrate, I am sending two screenshots (a very simple exercise on triangle inequality): the first is before the exercise was submitted, the second is after submission. (Sorry, the questions are in hungarian language) On first picture the 3. side of triangle (c) is between 2 and 10, when other sides a=6 and b=4. There is a shown the correct answer. On the second picture is visible, that the answer is already correct, but the applet variables (a and b) was newly randomized again - so the question is different.

1
2

We tried to randomize variables of applet with the the Moodle (via applet parameters), but there was no effect, difference.
On the other hand, based on the plugin's hint, I am afraid that it would not be able to handle RandomPoint, Point on Object and similar types of randomized elements...

So what we want is that after submitting the applet, the student should be presented with the same applet or picture he/she has worked with, with that data. It is a possible?

I hope I managed to put our problem/question succinctly but clearly.
And I also hope that You can help us with this. Thank You!

@PM84
Copy link
Collaborator

PM84 commented Dec 6, 2021

Thank you for reporting the problem. I will look into it as soon as possible.

@murkle
Copy link
Contributor

murkle commented Dec 7, 2021

From the GeoGebra side there are two issues here

  1. all random objects need to be defined in their own named variables in the .ggb file
  2. use the randomSeed parameter to reload the random numbers with the same values
    https://wiki.geogebra.org/en/Reference:GeoGebra_App_Parameters

Not sure how that works from the Moodle side though

If you post a link to your file I can check (1)

@pcsiba
Copy link
Author

pcsiba commented Dec 7, 2021

Thank You for You anwers!
In the meantime we have tried to parameterize some tasks with sliders or cmd RandomBetween, and in some cases you can set them in the moodle plugin to work.
But there are unfortunately cases where this is not feasible: for example, there is an applet for the perimeter of a triangle where the sides are natural numbers (see here: https://www.geogebra.org/m/wqdxwqpq ) and two sides are chosen freely, but the third side must satisfy the triangle inequality and therefore the minimum and maximum of this slider are a function of the other two sides. This is not accepted by the plugin.
We also have some applets where I can't really imagine how I could parameterize the data with sliders only (e.g. PointonObject, where the object is a trapezoid)...
Of course, any good ideas are welcome, especially if they can be handled by a plugin and we don't have to completely rewrite our 200 or so tasks.
RandomSeed might be a good idea, we'll try it, and I'll report back when we've got something with it.

@PM84
Copy link
Collaborator

PM84 commented Dec 8, 2021

From the plugin side, I can say with great certainty that there is no problem in this regard.

In particular, the problem seems to be

  1. only occurs with the task preview.
  2. only with the ggb file you provided. With my rebuild of the task I could not recreate the problems.

What I investigated in detail:

  • Are the variables of a trial stored in the database? -> Yes they are.
  • Do the variables change when the task is called multiple times in the database? -> No, they remain unchanged over the entire trial.
  • Are there other ways to influence, or other places that could be responsible for the variables being re-randomized? -> I could not find any evidence that this is the case.

Please check if the problem is not within your ggb file.

Best regards
Peter

@pcsiba
Copy link
Author

pcsiba commented Dec 14, 2021

Dear Peter,

thank you for your understanding and for checking.
We have started to rework the GeoGebra files. You either need to apply appropriately specified sliders, or slightly reformat the files, see below. I'm also writing this down because it's possible that others may also need this...

Dear Michael!
RandomSeed turned out to be a good idea. Starting from that solved the problem in a few steps (thanks to my colleague László Végh):

  1. Make a hidden slider randomSeed (min:0, max: 100000, inc: 1, hidden), On Update script (GeoGebra Script):
    SetSeed(randomSeed);
    UpdateConstruction(2);

  2. A new button: refreshButton (40x40px, refresh icon, visible) - On Click (JavaScript):
    location.reload();

  3. Add this 3 lines to Global JavaScript ggbOnInit:
    function ggbOnInit() {
    ggbApplet.evalCommand("RunUpdateScript(randomSeed)");
    ggbApplet.showResetIcon(false);
    ggbApplet.evalCommand("SetCoords(refreshButton, x(Corner(5))-50, 10)")
    }

  4. In the Moodle plugin, we need to specify a single slider ( randomSeed).

Maybe not the most elegant way, but it works.

Best regards
Peter

@murkle
Copy link
Contributor

murkle commented Jan 4, 2022

That sounds very hacky, and also inefficient if you have to do it in every .ggb file

Using the randomSeed parameter properly would be much better I think :)
https://wiki.geogebra.org/en/Reference:GeoGebra_App_Parameters

@pcsiba
Copy link
Author

pcsiba commented Feb 10, 2022

Dear Michael!

We used randomSeed in point 1.
The others (the second half of point 1 and points 2 and 3) was needed because the original refresh button of the ggb applet prescribe the defined value of this slider. That's why we have prepared new refresh button.

Peter

@murkle
Copy link
Contributor

murkle commented Feb 10, 2022

OK, please make sure you use "showResetIcon":false to hide the reset icon
https://wiki.geogebra.org/en/Reference:GeoGebra_App_Parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants