Is classroom compatible with ggbOnInit()?

ptrivino shared this problem 2 months ago
Not a Problem

I use ggbOnInit () to generate random exercises, but when loading a student's exercise in classroom it starts again.


Do you have any solution?

Comments (6)

photo
1

ggbOnInit () to generate random exercises

Why? What's wrong with the built-in commands like Random()?

photo
1

asunto aparte

çvoy a empezar a usar GGclassroom y me gustaría saber si es incompatible para no usarlo nunca

photo
1

OK, so the question is: if you have something like this to initialise the applet


function ggbOnInit() {
ggbApplet.setValue("paso",1);
ggbApplet.setValue("yo",0);
ggbApplet.setCoords("MiObjeto",0,0);
ggbApplet.setValue("grade",-1);
}

then will it work when the teacher loads the student's work?


So the answer is no, and (sorry) but I think it's unlikely we'll add an option for this very specific example

photo
1

Ok.

Wouldn't it be possible that the function ggbOnInit() didn't run in the teacher's environment when viewing the students' work?

photo
1

Sorry, that might then break other files (eg if they have a method defined there which is called from a button)


Edit: or as mathmagic says it might be needed to register listeners (which is what it's there for :) )

photo
photo
1

yo me refería especialmente al uso de listeners y ejecucion de scripts de GG por medio de los listeners

© 2020 International GeoGebra Institute