Forum Discussion
Ordering images based on number variables
Hi Richard
thanks for the reply. Yeah that would work if I wasnt making it so complicated!
The first part of the task is going to be more like one of those buzzfeed quizzes, where you are asked a series of questions, then on the back of that you get resources recommended to you. So the answers you give actually determine the 'confidence' the learner has in each topic and assigns a numeric variable.
I've gone down the JS path, using arrays. First time I have done it so there may be shortcuts or changes I could make, but will share below as this is currently working.
In the image of the JS, the RED section is taking the in course variables (Choice1-7) and assigning them to a JS variable. Each Choice variable is a value between 1-5, from low confidence to high confidence.
Next, the BLUE section creates the array. Two things here - it records the name of the task (navigator, compass etc) and links it to the confidence score each task scored. I did this so later on as well as ranking the score from high to low, it also displays the name of the task.
This section also sorts the scores from high to low at the end.
Finally the GREEN section takes the information back across to the player. It assigns the highest scoring vale in the array (and its label) to a new variable. I then use these new variables (First, Second, Third etc) to change the state of a row of buttons on my page. Each of these buttons click through to a resource. By changing the state of them based on the order in the array, they appear on the screen in order of confidence ranking