Explore the community Forums Lectora Lectora Questions & Answers Drag and Drop – check each drop as it happens

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #386168 Score: 0
    Profile photo of Jana Boardman
    Jana Boardman
    Member
    beginner
    intermediate
    LUC16 Attendee
    wise owl
    contributor
    LUC17 Attendee
    LUC17 Attendee
    picture perfect
    curious george
    @jboardman

    I am trying to create a drag and drop question that has 15 items, all to be matched.

    What I need it to do is give correct/incorrect feedback when each item is dropped rather than after all the pairs have been made. And then return the incorrect item back to its starting place.

    I haven’t been able to figure out a way to do this. Does anyone have an example or instructions?

    Thanks!

    #386193 Score: 0
    Profile photo of Stan Miller
    Stan Miller
    Member
    beginner
    intermediate
    LUC16 Attendee
    wise owl
    contributor
    curious george
    friend finder
    LUC17 Attendee
    40 pts
    @smiller7502

    I’m struggling with the same thing. As far as I can figure, the only way to do this with the built-in functions is to have 15 separate questions, and that presents some significant challenges I haven’t yet overcome. The questions can all be on the same page so that it looks like one question to the learner, but:

    1. Each question must have it own drop zones, and if they overlap the learner can only drop in the front-most question.
    2. The on-click action fires on mouse up, not mouse down, so I cannot control which question’s drop zones are visible based on which item the learner drags.

    I could require the learner to drag the items in a predefined order, but that’s not especially friendly design, and it would defeat the purpose of a drag-and-drop question asking the learner to put things in order.

    There may be a javascript way to do this, but I’m not even sure where to start.

     

    #386217 Score: 0
    Profile photo of Jana Boardman
    Jana Boardman
    Member
    beginner
    intermediate
    LUC16 Attendee
    wise owl
    contributor
    LUC17 Attendee
    LUC17 Attendee
    picture perfect
    curious george
    @jboardman

    That’s exactly what I’m running into. And I’m not a javascript programmer, either :-/

    #386232 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    I do think there is an alternate solution. Posted a similar solution recently. Will check it later today, but basically its using immediate feedback, and then both correct and incorrect feedback trigger an Actiongroup that checks result(s) of the drop and change variables accordingly. The dropzones can be solved too..not sure how i did it..will check it later…

    Using Javascript to complete build a drag and drop:
    Here is an old solution i made in V11. Works, but a lot in it can be improved.
    https://community.trivantis.com/wp-content/uploads/lectora-published/303972/303970/index.html

    #386239 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Do think im gonna mockup both a pure Lectora multiple drop solution and a Javascript based one.

    #386243 Score: 0
    Profile photo of Jana Boardman
    Jana Boardman
    Member
    beginner
    intermediate
    LUC16 Attendee
    wise owl
    contributor
    LUC17 Attendee
    LUC17 Attendee
    picture perfect
    curious george
    @jboardman

    That doesn’t give feedback when each item is dropped, only after all the matches are made. I’m looking for something that can give feedback when you drop an item, not after all have been done.

    #386251 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Easy to add. In the actiongroup based upon any result you can add whatever feedback you want.

    Cleaned a very old drag and drop… Couldnot upload the Lectora file because it was too big. Will clean it later and add it.

    Drag drop multiple elements

    Kind regards,

    Math

    #386257 Score: 0
    Profile photo of Jana Boardman
    Jana Boardman
    Member
    beginner
    intermediate
    LUC16 Attendee
    wise owl
    contributor
    LUC17 Attendee
    LUC17 Attendee
    picture perfect
    curious george
    @jboardman

    Thanks for that, but it still doesn’t give a result for each separate drop when it is made.

    #386261 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
    355 pts
    @timk
    #386364 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Based on Tim’s link to <span class=”bbp-user-nicename”><span class=”handle-sign”>@</span>pjackson2462</span> solution for this i mocked up a partially working sample. Biggest thing to solve yet is the checks for proper condition if a given answer is correct or not. Especially with 15 or more dropitems, you have quite a few variables to doublecheck… writing this down gives me an idea how to properly solve this though…

    Well here is a partial solution for it, giving anyone something to continue on.

    Doing this without the use of Javascript does work after the initial 3 choices of a drag and drop. The first 3 it wont react upon if you remove the JS. After that it does work…have to dive into how Lectora creates a default draganddrop to figure out why.

    Regards,
    Math

    #386367 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    For the first 2 dragitems this setup works. Gives feedback when dropping correctly or incorrectly. Although it will be a hell of a job to get 15 or more elements setup properly. Lots of actiongroups and lots of conditions needed to get all working as needed. So i do think for this to work properly we need to add a Javascript check upon the drop. Checking whether the VarQuestion contains a correct answer for any given situation and returning something to Lectora to act upon that. Gonna work on that tomorrow…

    #386370 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Basically this function is needed for a check how many choices are incorrect.

    function count(main_str, sub_str)
    {
    main_str += ”;
    sub_str += ”;if (sub_str.length <= 0)
    {
    return main_str.length + 1;
    }subStr = sub_str.replace(/[.*+?^${}()|[\]\\]/g, ‘\\$&’);
    return (main_str.match(new RegExp(subStr, ‘gi’)) || []).length;
    }
    console.log(count(“1-1,2-(na),3-(na),4-(na),5-(na),6-(na),7-(na),8-(na),9-(na)”, ‘(na)’));

    Gonna add that tonight…

    #386432 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Alright here is a complete working version. The script mentioned above wasnot needed afterall because Peter Jackson code already had that functionality in it. Only thing that needed to be done , is sending a variable back to Lectora so it knows how many drops are correct. Offcourse you can enhance this by adding specific feedback for any choice you make.

     

    #386829 Score: 0
    Profile photo of Jana Boardman
    Jana Boardman
    Member
    beginner
    intermediate
    LUC16 Attendee
    wise owl
    contributor
    LUC17 Attendee
    LUC17 Attendee
    picture perfect
    curious george
    @jboardman

    Thanks – yes that works, but it doesn’t give a response, it just snaps back. Is this as close as I can get?

    #386831 Score: 0
    Profile photo of Jana Boardman
    Jana Boardman
    Member
    beginner
    intermediate
    LUC16 Attendee
    wise owl
    contributor
    LUC17 Attendee
    LUC17 Attendee
    picture perfect
    curious george
    @jboardman

    Thanks! I’ll give this a try. You’re a gem!

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.