Finding all drop targets and checking the drag source names

Problem: Would anyone know how to code a javascript function that finds all the dropTarget objects on a slide and checks the name of the drop target against the name of the drag source currently accepted? All of the drop targets have “Drop Target …” in their names. And all the drag sources have “Drag Source …” in their name. For example, I would like to ensure that all “Drop Target 7” objects have a “Drag Source 7” accepted in them.

I am creating a Sudoku exercise for students to use in learning math reasoning skills.

ActivePresenter version: 8.5.3

OS: Win 10

Notes: My apologies, but I am a complete Javascript novice.


You can use Drag-n-Drop questions in ActivePresenter to do that, instead of javascript.
Just select any drag source and drop target, respectively.
Then, navigate to the Properties pane > Interactivity tab > General section and rename them.

Next, specify the accepted values and the correct values in the Accept List dialog:
For example, to make all “Drop Target 7” objects have a “Drag Source 7” accepted in them, just select the “Drop Target 7” object on the Canvas > Accept List dialog > tick the “Drag Source 7” Accept checkbox.

Check out this tutorial to know how to work with Drag-n-Drop question: