Explore the community Forums Lectora Lectora Questions & Answers Drag and drop question: snap back if incorrect

Tagged: 

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #391283 Score: 0
    Profile photo of Lisa Hinterweger
    Lisa Hinterweger
    Member
    beginner
    intermediate
    friend finder
    curious george
    picture perfect
    wise owl
    @lhinterweger2536

    I have been researching this question as well.  Is it possible to use this method with one drop zone and several drag items?  I would like immediate feedback for each incorrect response, preferably snap back.  I would appreciate any tips.  Thank You!

    #393468 Score: 0
    Profile photo of Lisa Hinterweger
    Lisa Hinterweger
    Member
    beginner
    intermediate
    friend finder
    curious george
    picture perfect
    wise owl
    @lhinterweger2536

    Tim,

    Your posts have been very helpful.  I am trying to create a drag and drop question with one drop zone but several correct drag items.  I would like incorrect items to snap back.  I followed your instructions and script, but I have one question.  Since I only have one drop zone, how should I populate the JavaScript box for the incorrect answers so they will snap  back.  In other words, On Mouse Click Run JavaScript dragItemDrop(?);   Do I need to change something in the HTML Extension code?  I would appreciate any help you can provide.  Thank You!

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

    Hi Lisa,

    here’s a sample of a DND question with 1 dropzone and 2 correct items. I’ve simplified the code a little:

    dragMgr.arrDragItems[3-1].restoreInit(Update_qu484);

    This code resets the 3rd item from the 1st dropzone. If you wanted to reset the 2nd item you’d have to change it to [2-1]. You may also have to update “qu484” with the actual html name of your question.

     

    #393863 Score: 0
    Profile photo of Lisa Hinterweger
    Lisa Hinterweger
    Member
    beginner
    intermediate
    friend finder
    curious george
    picture perfect
    wise owl
    @lhinterweger2536

    Tim,

    Thank you so much for your help.  I have attached an example of the type of drag and drop questions I am working on.  I have one drop zone.  Each question has 5 drag items.  Depending on the question, there may be 1-5 correct drag items. (The example question has 3 correct answers).  I would like to set it up so each time they drag an item it will either stick or snap back depending on whether it is correct or not.  If I understand the code you just sent me, I can only have one drag item snap back?  Let me know if I am not understanding correctly. I am not great at code.  Thanks again!!

    Lisa

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

    The code can be used to reset any item you like. I’ve attached your sample. Each of the incorrect items has an action to reset itself when clicked, i.e. when dropped.

    But you could also reset item 2 when item 3 is dropped or reset items 1 and 4 when item 5 is dropped, etc.

    #394044 Score: 0
    Profile photo of Lisa Hinterweger
    Lisa Hinterweger
    Member
    beginner
    intermediate
    friend finder
    curious george
    picture perfect
    wise owl
    @lhinterweger2536

    Thank you so much, Tim.  I was able to fix my problem and everything is working the way I want it to.  I really appreciate your help!!

    Lisa

Viewing 6 posts - 16 through 21 (of 21 total)

You must be logged in to reply to this topic.