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

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #377635 Score: 0
    Profile photo of SB Chapman
    SB Chapman
    Member
    beginner
    intermediate
    profile
    picture perfect
    wise owl
    friend finder
    contributor
    curious george
    Group Member
    @schapman1885

    I’ve got an interaction set up. I use an action group to provide feedback to the learner. I am building an error message to display as the feedback. I have 4 drop zones.  I need to check to see if each or all drop zone(s) is/are empty, to provide a message.  How do I do this?

    #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, 11 months ago by Profile photo of Cam Phillips Cam Phillips.
    #377712 Score: 0
    Profile photo of SB Chapman
    SB Chapman
    Member
    beginner
    intermediate
    profile
    picture perfect
    wise owl
    friend finder
    contributor
    curious george
    Group Member
    @schapman1885

    Ok, so I don’t check to see if something is in the drop zone, I check to see if one of the Drag Items has been moved. Makes sense!! Thank you!

    #377714 Score: 1
    Profile photo of Jason Dalrymple
    Jason Dalrymple
    Member
    beginner
    intermediate
    profile
    wise owl
    curious george
    contributor
    friend finder
    advanced
    picture perfect
    54 pts
    @JasonADal

    I created a sample that uses straight Lectora actions and the feedback settings on the question. This all depends on whether you have a submit button used for the question.

    It’s setup so that clicking the submit button verifies that the question does not contain “na” OR “is not empty” before processing it. You want to make sure the user doesn’t get the feedback if they haven’t moved any of the drop items.

    In this sample, the Feedback on the question is used to run an action group for both correct/incorrect, since it sounds like you provide the correct/incorrect feedback along with other actions as part of that group. Hope this helps, too!

    This post has received 1 vote up.
    #377908 Score: 0
    Profile photo of SB Chapman
    SB Chapman
    Member
    beginner
    intermediate
    profile
    picture perfect
    wise owl
    friend finder
    contributor
    curious george
    Group Member
    @schapman1885

    Thanks, Jason. I am having to do a lot of non-straight lectora for this particular drag-and-drop. However, between the two responses, I was able to use the information in them to get what I needed.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.