Explore the community Forums Lectora Lectora Questions & Answers Adding value to a variable on drop

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #321172 Score: 0
    Profile photo of vimal kumar
    vimal kumar
    Member
    beginner
    intermediate
    contributor
    wise owl
    curious george
    @vkumar9136

    Hi everyone,

    I have created a slide with a question type drag and drop. And in that question there is one drop place and I have to add a certain value to a variable on drop of every object(like total value).

    Remember each object has it’s own value.

    Please suggest if any solution is out there.

    Thanks.

    #321176 Score: 2
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    354 pts
    @timk

    Hi,

    you can add an action to the drag item:

    On: Click
    Action: Modify variable
    Target: Your_variable
    Value: Your_value
    Delay: 0.5 sec

    The action is run on release of the mouse button. The delay is needed to ensure that the dragitem is in place on the dropzone, it make take a short while until the item is “snapped” to the dropzone, if the user drops it near the edge of the zone. The delay should be longer if your dropzone is bigger, it may be shorter for smaller dropzones or if you have “Snap Drag Items to Center of Drop Zones” unchecked.

    Add a condition to ensure the user hasn’t dropped the item outside the dropzone or just clicks on an item at its starting position:

    Only if “Question_0001” (your question variable) “Does not contain” “1-(na)” for the first drag item “2-(na)” for the second, etc. Before the condition can be true, the drag item must be in place on the drop zone, so again: the delay is important.

    Tim

    This post has received 2 votes up.
    #321247 Score: 0
    Profile photo of vimal kumar
    vimal kumar
    Member
    beginner
    intermediate
    contributor
    wise owl
    curious george
    @vkumar9136

    Thanks Tim. It works fine. 🙂

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

You must be logged in to reply to this topic.