Explore the community Forums Lectora Lectora Questions & Answers How to check for empty drop zone in drag and drop Reply To: How to check for empty drop zone in drag and drop

#377643 Score: 0
Profile photo of Cam Phillips
Cam Phillips
Member
beginner
intermediate
friend finder
wise owl
curious george
contributor
19 pts
@_

Hi SB,

The variable for an empty drag-and-drop question looks like this:

saveVariable for VarQuestion_0003 to [1-(na),2-(na),3-(na),4-(na)]

As the learner drags items into each drop zone, the variable is edited like this:

saveVariable for VarQuestion_0003 to [1-3,2-(na),3-(na),4-(na)]

Until all items have been placed in the drop zones:

saveVariable for VarQuestion_0003 to [1-3,2-1,3-2,4-4]

You can check if any (or all) drop zones are empty by checking if the question variable contains ‘na’ at all. For example, your submit button might look like this:

On Mouse Click
Display Message 'One or more drop zones is empty!'
IF VarQuestion_0003 contains na

Hope this helps!

  • This reply was modified 2 years, 10 months ago by Profile photo of Cam Phillips Cam Phillips.