Vous n'êtes pas identifié(e). Pour pouvoir écrire ou répondre à un message, vous devez vous connecter ou vous créer un compte sur JAWA.
Hi,
Sorry me again!
I want to do something I am just wondering if it ridiculously complicated or not...
What I want to happen, during the game if the player clicks on their name (in the game) they will be shown their current grade on screen.
The grades will be stored somewhere else (an excel sheet, a google sheet, a website, it doesn't matter where) but the information will need to be pulled from the external place as the information changes periodically.
Does that make sense? Is that even possible?
Thanks so much
Hors ligne
Hello
yes it's possible to gather information from an extrernal site and use it in JAWA but a bit complicated, as you may need to develop a little script on the site/tool (which stores the changing data) and that will dynamically set JAWA variables by callin javascript functions.
If you can do that, on your game interaction you have 2 possibilities :
- you can load the distant script with a plugin effect,
plugin:https://mysite.com/my_script_that_exposesthedata.py (or php or any website server language)
and in your script generate javascript calls based on the jawa API, like
<script>
parent.jawaSetVariable("MYVJAWAVARIABLE","<value from stour website>");
parent.jawaClosePlugin(); // to close the jawa plugion box immedialtely
</script>
See more about jawa's JS api here : [url]https://jawa.fr/index.php?action=lireKiwi&doc=2&idp=4&nocontext#title_4[/url]
- You can use the advanced "call" effect
call:https://mysite.com/my_script_that_exposesthedata.py (or php or any website server language)
In that case the javascript to set the JAWA variables code will just be :
<script>variable_MYVJAWAVARIABLE="<value from your website>";</script>
Of course you can set several variables in one call.
Please note that in both cases, the connexion must be available and if your game is hosted on a https website, the distant script must be also hsoetd on a trusted https site.
I have tagged an evolution in the jawa roadmap to gather more easly external data to set up jawa variables
Otherwise, you can import data from a csv file to a jawa array varaible using scenarioStudio but it won't update automatically.
Z
Sorry I only just saw your response!
I might give this a try when I am not so busy ha ha
Thanks anyway!
Hors ligne
I tried to use this in a small test:
plugin : h5p.org/node/1073494 :1:100:100
and got popup telling me:
"Oups...
404 - cette page n'existe pas / this page doesn't exists"
yet when I try the url in a browser it works great.
Hors ligne
Hello Martijn
Nice to hear from you!
Surely it's possible to embed a quiz from another website (or made with another tool and hosted inside JAWA within a plug-in)
The 404 error indicates that the link is broken and because it's the jawa 404 error page, it's probably because the URL does not start with the Https:// or http:// prefix
Does it help ?
Ps : please open a new topic rather than adding a question on a solved topic it's more efficient if you want a quick answer!