• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Attempts at multiple click boxes

New Here ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

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

Views

214

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

LATEST
Thanks a lot
I'll try it for sure

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources