Skip to main content
Participant
June 2, 2021
Question

Attempts at multiple click boxes

  • June 2, 2021
  • 2 replies
  • 292 views

How can you prevent a student from making more than three attempts in two click boxes together? It's a machine translation. I am sorry. Thank you

    This topic has been closed for replies.

    2 replies

    Lilybiri
    Legend
    June 2, 2021

    Create a user variable v_counter, with a default value of 0. Group the two click boxes in gr_cb

    You don't tell what exactly has to happen when a click box is clicked, which is a pity. You need an advanced action for each click box if they need to have another command to execute, or one advanced action which can be the same for both click boxes, if there is no extra command necessary. The advanced action will have two decisions:

    1. Decision 'Always', which is not conditional
        Extra command (if necessary)
        Increment v_counter by 1
    2. Decision 'CheckAttempts'  which is conditional
        IF v_counter is equal to 3
         Hide gr_cb

     

    There is no need for an ELSE part in the second decision

    Stagprime2687219
    Legend
    June 2, 2021

    I would accomplish this by tying a variable to both click boxes.

    Each time one of them is clicked it will increment the variable.

    Also have the action perform a conditional check of the variable.

    in a nutshell...

     

    (not actual code to use but a representation)

    ++myVariable;

    if (myVariable==3) {
      cp.disable("clickBox1");

      cp.disable("clickBox2");
    }

     

    After the third click - both buttons should fail to function.

    Hope this helps.

    miguelaarAuthor
    Participant
    June 2, 2021
    Thanks a lot
    I'll try it for sure