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

Drag-drop redraggable - adv action fires on click

Engaged ,
Jun 27, 2017 Jun 27, 2017

I'm creating a drag - drop with an advanced action (object action) counting dropped items that fires when an item is dropped. I also want users to be able to re-drag a mistakenly dropped item to its correct drop zone without sending it back to origin with Undo. My AA calls a javascript that determines correct drops and scoring according to a set of rules. All works fine except that my AA is triggered by simply clicking a dropped item once it is in a drop zone - it does not have to be dragged anywhere. This allows users to run up the counter by repeatedly (and infinitely) clicking one correctly dropped item.

Is there any way to limit firing of the AA to actually dropping an item into a drop zone when redrag is enabled?

The javascript is irrelevant to this issue - just an AA that increments a counter has the same problem.

Thanks for your help.

CP9.0.2.437

193
Translate
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

correct answers 1 Correct answer

Community Expert , Jun 27, 2017 Jun 27, 2017

You should have posted the advanced action. Avoiding this can be done by not using a unique counter that is incremented, but a different variable for each correct drag action that is toggled from 0 to 1. Once the variable is set to 1, it cannot be incremented. The real counter can always be calculated by summing up the boolean variables, or you can rethink the conditional action.

Translate
Community Expert ,
Jun 27, 2017 Jun 27, 2017

You should have posted the advanced action. Avoiding this can be done by not using a unique counter that is incremented, but a different variable for each correct drag action that is toggled from 0 to 1. Once the variable is set to 1, it cannot be incremented. The real counter can always be calculated by summing up the boolean variables, or you can rethink the conditional action.

Translate
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
Engaged ,
Jun 28, 2017 Jun 28, 2017
LATEST

Thank you for the suggestion of using booleans - that does the trick. Only a few more variables to add to the system and a condition to do nothing if an item is already in the same drop zone as it was before and everything works like a charm.

You're the best!

PS - I didn't post the AA because it's trivial, but here it is anyway.

The javascript hits a clickbox that then totals everything up, shows warnings, etc. Now it looks like the following:

Translate
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