Is there any way for an applet to tell if it is run online or offline?

Javier Cayetano Rodríguez shared this question 5 years ago
Answered

I would like to program some things to happen only when using the applet online, that is when my students use the applet, and not offline, that is when I am developing/changing the applet).


The possibility of distinguising whether it is online or not would be helpful for me.


Thank you.

Comments (5)

photo
1

If I want to make big changes on a file, I work on the local file that I saved on my computer and afterwards I replace the online applet by the new version. If it's just a detail that takes a few minutes I edit it online with the edit option in the online platform. In both cases there's never a problem with students. So maybe you think of something else. Please tell if it's the case.

chris

photo
1

Why not just have a boolean

debug=true
which you can set to false when you're ready?

photo
1

Thank you for your answers.

Using the boolean "debug" suits me perfect. Thank you Michael.

[*] Chris, what I actually want to do is use the "zoomin" function to lock the screen, so to prevent students from zooming applets in and out using the scroll of the mouse or using their fingers on their tactile screen (online).

But just in case I want to change anything, I do not want the screen to resize when I activate algebra view (offline) -things tend to misplace when that happens-

Thus, the "debug boolean" solution sounds perfect to me.

Thank you again.

photo
1

Another tip: put controls in Graphics View 2, then close it before upload :)

photo
1

Thank you for your help.


Recently, I have discovered how to solve the problem of zooming.

It is curious, but when I upload new material, by default it is possible to drag and zoom the screen.


But if I click on edit properties, the correspondent check box is then unchecked, and so, just by saving the applet it is now not allowed to zoom in or drag the screen.


[*] Taking a look at the last applets people are uploading, I have guess not everybody knows this simple trick.

© 2023 International GeoGebra Institute