Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC:

Varibles manipulation [score+1] 4 years 4 weeks ago #6973

  • Alexw555
  • Alexw555's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 1
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,
The following user(s) said Thank You: OliverPullout

Please Inloggen or Create an account to join the conversation.

Varibles manipulation [score+1] 4 years 3 weeks ago #6977

  • purpleriver
  • purpleriver's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
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

Please Inloggen or Create an account to join the conversation.

Varibles manipulation [score+1] 4 years 2 weeks ago #6988

  • Fay
  • Fay's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 229
  • Thank you received: 92
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.

Please Inloggen or Create an account to join the conversation.

Varibles manipulation [score+1] 4 years 5 days ago #7051

  • Alexw555
  • Alexw555's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 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?

Please Inloggen or Create an account to join the conversation.

Varibles manipulation [score+1] 3 years 11 months ago #7139

  • piair
  • piair's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 0
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?


File Attachment:

File Name: Variabelen...2-19.zip
File Size:6,075 KB
Attachments:

Please Inloggen or Create an account to join the conversation.

Varibles manipulation [score+1] 3 years 8 months ago #7249

  • OliverPullout
  • OliverPullout's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 1
  • Thank you received: 0

purpleriver wrote: 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

Please Inloggen or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: JohnSmith
Time to create page: 0.079 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search