How to allow only one drop item in a drop zone?

flook
flook Community Member Posts: 3
Hello,



I'm creating a drag and drop question which needs to be very precise and can only work in this way, however I can't find how to allow only one drop item in a drop zone. Here is the basic setup of my page:




DROP ITEM 1 DROP ZONE 1
DROP ZONE 2
DROP ITEM 2 DROP ZONE 3
DROP ZONE 4
DROP ITEM 3 DROP ZONE 5
DROP ZONE 6
[/CODE]

My example, DROP ITEM 1 has 3 correct answers: DROP ZONE 2, DROP ZONE 5, DROP ZONE 6. If a user has already inserted DROP ITEM 1 in DROP ZONE 2, how can I be sure that DROP ZONE 2 [B]can not[/B] be selected again? As it stands, [I]Lectora [/I]is made to allow more than 1 drop item in a drop zone. I can't have this. Is there a [I]script or anything[/I] that will allow me to work around this?

This is what I need it to do: If the user selects a drop zone which has already been selected, the drop item needs to return to its original position. That's it.

I will add my version of Lectora is v11.3.2
Thank you for your time.[CODE]

DROP ITEM 1 DROP ZONE 1

DROP ZONE 2

DROP ITEM 2 DROP ZONE 3

DROP ZONE 4

DROP ITEM 3 DROP ZONE 5

DROP ZONE 6

[/CODE]



My example, DROP ITEM 1 has 3 correct answers: DROP ZONE 2, DROP ZONE 5, DROP ZONE 6. If a user has already inserted DROP ITEM 1 in DROP ZONE 2, how can I be sure that DROP ZONE 2 can not be selected again? As it stands, Lectora is made to allow more than 1 drop item in a drop zone. I can't have this. Is there a script or anything that will allow me to work around this?



This is what I need it to do: If the user selects a drop zone which has already been selected, the drop item needs to return to its original position. That's it.



I will add my version of Lectora is v11.3.2

Thank you for your time.

Comments

  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    It could be possible to add script that hacks into Lectora DnD functionality and achieves what you want but it'd probably be easier to just build the exercise from scratch by adding JQuery UI Draggable() to the page elements. Something like this: http://lectora.com/blog/using-jquery-lectora-customize-e-learning-courses-part-3/
  • benpitman
    benpitman Community Member Posts: 763
    Currently you can't do that. Please send an email to [email protected] and report that. It should be an option on the question. If we can get enough complaints, we can get it changed.
  • flook
    flook Community Member Posts: 3
    Hi Ben,



    I've done as you requested.



    Can you confirm if the workaround suggested above can work using jQuery? Or even JavaScript?



    Thank you.
  • benpitman
    benpitman Community Member Posts: 763
    I am pretty sure it can be done but have never tried. Just not worth the trouble. Here is what I do as a workaround for many of my clients and they are very happy. It also solves the nasty problem of giving meaningful feedback on incorrect answers. I used to put an X next to the wrong one but you can't do that now because there could be a correct one and a wron g one in the same place. So now I create separate D&Ds with just one drag item and one drop zone. The drop zones are transparent rectangles. I take the background drop area where I normally would have the drop zones and put it behind these transparent rectangles. Then the learner can only drag his item to the correct place. Anywhere else and it snaps back. Hope this helps.
  • flook
    flook Community Member Posts: 3
    Although it is a good suggestion, this will not work for me, because the images on the left have more than one possible good answer, and each correct answer has a different feedback.



    Example, if we take drop item 1, the correct answers are drop zones 2, 5, 6.

    The actual 3 drop images on the left are replicated at the moment 6 times, in case the user wants to use drop image 1 as his answer for the 6 questions on the right. There is no way for the user to know that the first image shown is the answer for question 1, 2, 3, 4, 5 or 6. If he takes the image and drags it to drop zone 5, it will be incorrect with your example because you're saying it can only go in one specific area. If I give the 3 areas the drop zone you're suggesting for the 3 correct answers, then I come back to my original problem that the user can actually insert image 1 into the same drop zone area multiple times.



    In theory, I could show just one question at a time, but this is not what has been asked for this project.



    Thank you for your time however, it is appreciated.
  • cmetzler2560
    cmetzler2560 Community Member Posts: 58
    Hi, I also would like to be able to prevent more than 1 drag item to 1 drop zone, has a way been identified yet?

    In the visual I attached I want the user to be able to drag 1 yellow box to any of the 4 drop zones. If a drop zone is already populated by a drag box, the drag box can only be dropped on top of the remaining 3 open drag zones.