Varibles manipulation [score+1]

Plus d'informations
il y a 5 ans 9 mois #6973 par Alexw555
Varibles manipulation [score+1] a été créé par Alexw555
Hi, I'm trying to mock up a client interview tool in which custom metrics can be used to measure student progress.

As an example, during the quiz they could be asked how they would answer a question and based off their answers a number of barameter variable scores could change. E.g understanding, trust...

As this is currently not possible, it would be nice to change the values of variables live within the flow of the system [understanding + 1] , [trust -1]

This would be especially useful to have during the feedback of quiz answers as the students could see their scores changing based off each answer

cheers,
Les utilisateur(s) suivant ont remercié: OliverPullout

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 ans 9 mois #6977 par purpleriver
Réponse de purpleriver sur le sujet Varibles manipulation [score+1]
I'm having a similar issue.

The quiz I'm building should update a range of invisible params based on the answer that the user gives.I'm not sure if I'm missing something but I can't see a way to do this.

Its quite a common feature in other interactive tools, which are an option but xerte is so well positioned with its integration with the OLE.

An example of what I'm trying to achieve is the user is an adventurer, and meets a wolf. They have the choice to fight the wolf, try and run away or try and befriend it.
Fighting it would reduce health by 2, stamina by 2, increase experience by 2, and loot by 1.
Running away would decrease stamina to 0, and increase experience by 1.
Befriending it would increase experience by 3.

The updating of these variables should happen in the background only updating the user when I want to.

Is this possible in the current system or is it a new feature that would need to be built?

Note: I'm not actually building an adventure game!

Thanks!
PR

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 ans 9 mois #6988 par Fay
Réponse de Fay sur le sujet Varibles manipulation [score+1]
There is an optional property 'Variables' which you can add to your project which lets you create a number of variables based on parameters you set up. This guide explains how you can then use & manipulate these within your project xot.xerte.org.uk/USER-FILES/156-fay-Nott...es_Documentation.pdf

There's currently no in-built way to change the value of variables as a result of answers students give to questions (e.g. health+1 etc) but if you are able to code then you could reasonably easily do this within a project yourself. The variable data is held in an array called x_variables and each variable has a value you could manually change when a particular answer is given. I like the idea of an easier way to manipulate variables according to what answers students give though so I'll have a look into whether anything like this can be done in a future release.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 ans 8 mois #7051 par Alexw555
Réponse de Alexw555 sur le sujet Varibles manipulation [score+1]
Hi Fay,

Thank you so much for your reply.

So what would the code look like in order to increment a variable called counter by one?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 ans 7 mois #7139 par piair
Réponse de piair sur le sujet Varibles manipulation [score+1]
I got intrigued by this question and the suggestion in another topic to use jquery to manipulate the variables, got stuck, didn't want to give up, got it sort of working, but not sure if this really is the best way to do it.

You can download an example that I created. It asks for your name and uses 3 variables: health, stamina, experience.
On each page you get a number of options. You have to select an option first, then hit submit.
The form checks if a value in a variable has changed, so I have a set of input fields in a hidden div (hidden by the css of the page).
Depending on the selection that you make, the input fields get updated with the new values the variables should get (based on the current displayed values).
I tried to combine submit of the form and selection, but that didn't work because the event handler for the submit button always fires first before I can change the value of the input fields.
The css doesn't need to be there for every page, just add it to a stylesheet that you attach to the LO.
The script needs to be set for every page and you need to be comfortable working in the source view.
I don't seem to be able to disable the pop-up message and there is nothing to prevent a user from skipping a step.
Would this be something that could be better realized using a decision tree? Would I still be able to tally choises?


Fichier attaché :

Nom du fichier : Variabelen...2-19.zip
Taille du ficher :6,075 Ko
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 ans 4 mois #7249 par OliverPullout
Réponse de OliverPullout sur le sujet Varibles manipulation [score+1]

purpleriver écrit: I'm having a similar issue.

The quiz I'm building should update a range of invisible params based on the answer that the user gives.I'm not sure if I'm missing something but I can't see a way to do this.

Its quite a common feature in other interactive tools, which are an option but xerte is so well positioned with its integration with the OLE.

An example of what I'm trying to achieve is the user is an adventurer, and meets a wolf. They have the choice to fight the wolf, try and run away or try and befriend it.
Fighting it would reduce health by 2, stamina by 2, increase experience by 2, and loot by 1.
Running away would decrease stamina to 0, and increase experience by 1.
Befriending it would increase experience by 3.

The updating of these variables should happen in the background only updating the user when I want to.

Is this possible in the current system or is it a new feature that would need to be built?

Note: I'm not actually building an adventure game!

Thanks!
PR

I support your opinion

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: JohnSmith
Temps de génération de la page : 0.149 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo