Series of Question - no duplication of answers

Oct 11, 2022

HI

here is the following scenario

In my eLearning the learner needs to test a 3-phase circuit, made from 5 cables (P1, P2, P3 N and E -- P1 gives value 1 to variable A_1, P2 gives value 2 to variable A_2, ...)

He/she has to select always a pair, random order but the pair is not supposed to be selected more than 1x, otherwise there should be a message saying he already has done that

I have created 5 rings to symbolize the cables and 10 sets of ring pairs for the possible combinations (e.g., P1P2, P1P3, ....)

I also create variable corresponding to the selected ring P1, if selected the status changes to a ring with tick

once 2 selections are made (counter) a java script runs to concatenate the 5 possible selections

============ JAVA ============

var player = GetPlayer();
var A_1 = player.GetVar("A_1");
var A_2 = player.GetVar("A_2");
var A_3 = player.GetVar("A_3");
var A_4 = player.GetVar("A_4");
var A_5 = player.GetVar("A_5");
var Answer1= A_1 + A_2 + A_3 + A_4 + A_5;
player.SetVar("Answer1",Answer1);

=============================================

based on the answer, which could be P1P2, the according ring pair should light up

that works so far, but when I go to the 2nd question and I get the same answer, it should show incorrect layer

if answer 2 = answer1

 

the problem is that it always shows the layer incorrect, even if Answer 2 is not same as answer 1

and I cannot find the error

I never move on to question 3, unless I put a trigger that when all combinations are completed go to next slide

the learner will get stuck if he keeps repeating the same combination over and over without being told (or looking ) that he/she already did the combination

 

1 Reply