Skip to main content
Dirlo
Inspiring
September 20, 2019
Question

Multiple TEB with multiple right answers

  • September 20, 2019
  • 3 replies
  • 2067 views

...

Hello Captivaters !...

I just faced a problem... In one of my project, I have a slide with let's say 2 TEB (TEB1 and TEB2) and only one button to validate both of the answers. But there are 2 possible right answers for each of them (let's say A and B for TEB1 and C and D for TEB2)...

So I try to validate the user entry using a conditional action :

If TEB1 = A AND

If TEB1 = B OR

If TEB2 = C AND

If TEB2 = D OR

=> Then it's correct...

But it doesn't work as expected... even if I try to custom the validation (using OR or AND)...

So I create a variable "v_score" and make 2 conditional actions :

1./ If TEB1 = A OR

If TEB1 = B OR

=> increment v_score by 1

2./ If TEB2= C OR

If TEB2 = D OR

=> increment v_score by 1

And I create a final conditional action :

If v_score = 2

=> Then it's correct !...

But I'm wondering if there is a simpler way to do that ???...

(I will try tomorrow - if I find the time - to explain this clearer with an example in the elearning community...)

😉

...

    This topic has been closed for replies.

    3 replies

    Dirlo
    DirloAuthor
    Inspiring
    September 21, 2019

    ...

    Thanks for your answers !...

    (I just posted my project on the elearning community and will add the link to it if it's approved...)

    I agree that JavaScript should be a great solution... But I think I managed to do it with Captivate only !...

    (In fact I have 6 TEBs )

    See this :

    It's a bit more complicated than using JavaScript but it finally works as expected...

    Big thanks for the code anyway !...

    😉

    ...

    Lilybiri
    Brainiac
    September 21, 2019
    Peut-être vous ne m'aviez pas bien compris. Si vous n'avez pas besoin de transférer le résulat au LMS, ceci fonctionne bien. Peut-être je l'aurai fait un peu différent. Certainement j'aurai remplacé les TEB par des interaction 'Scrolling Text'.
    Dirlo
    DirloAuthor
    Inspiring
    September 21, 2019
    http://www.infosemantics.com.au/adobe-captivate-widgets/cpextra

    I can't connect to this adress !!!... (using Firefox)... Same if I make a google research...

     

    Lilybiri
    Brainiac
    September 21, 2019

    Do you need the score to be transferred to a LMS? In that case I would also go to JS as StagPrime (Greg) explains. He will be asotnished.

    Stagprime2687219
    Brainiac
    September 20, 2019

    Can this be done with normal advanced actions - yeah.

    However, I prefer JavaScript - especially when it comes to these sorts of complex things.

    It sounds like you require that both answers be correct.

     

    Here is what I worked up.

    I made two text entry boxes and assigned the variables teb1 and teb2 to each of them respectively.

    I made a check button for the validation.

    I placed a transparent image on the stage with an additional state for yes and an additional state for no.

    I made a score variable.

     

    I can change the field data until I am satisfied and the validation will keep up.

     

    Here is the code I placed on the check button to validate the boxes.

     

    if ((teb1==1) || (teb1=="a")) {
    ++score;
    }

    if ((teb2==2) || (teb2=="b")) {
    ++score;
    }

    if (score==2) {
    cp.changeState("response","yes");
    score=0;
    }

    else {
    cp.changeState("response","no");
    score=0;
    }