Hello, I have a problem, I want to do an activity like in the picture. The problem here is that I want the student to place the bars according to the layer order. There should be purple at the bottom, green and red above it, blue and orange above it, and yellow at the top. Can this question be done with drag and drop? Or is it possible to do it in a different way? You can find the visual and approj in the attachment. Thank you. @gregs @PhuongThuy_Le
deneme (1).approj (356 KB)
I could use a little more context.
So are you looking to prevent placement in the wrong spots?
Enforce the order of drops?
Are you looking to have some sort of check to verify the right order?
Something else…?
It seems to me that 2 and 3 could be placed in either order without conflict and 4 and 5 in either order without conflict. 1 and 6 must be first and last respectively.
I do think that overlapping drop targets introduces problems but generally speaking, your drag and drop allows me to move the sticks and place them however I wish.
How might you specifically desire to modify what you have going here?
Hi,
Please provide more details so we can understand it better, @emrahdirek
Do you need to drop the colorful bars in the right order or do you want them to look like the image?
Regarding the order checking, will it be checked right after you drop the bar or when you complete and submit the question?
BR,
Hello, I want them to appear in order (leave them in the correct order) as in the picture. I want the order control to be done when I click send. @PhuongThuy_Le
Hello, I want them to appear in order (leave them in the correct order) as in the picture. But some bars are overlapping. Can we solve this problem? I want the order control to be done when I click send. @gregs
Hi @emrahdirek,
Please find the attached file below to see if it meets your needs.
The steps to create it are as follows:
- Add a True/False variable: to determine if the object is dropped in the correct order or not. For example, name it: dragdropCorrectOrder
- Name the drag sources: use a consistent naming format for all drag sources, such as: prefix_orderNumber. For example: drag_1, Drag_2
- Script for the question’s On Change event to ensure that each subsequent object dropped has a higher z-order than the previous one.
- Script at the beginning of the question’s On Correct event: to check if the objects are in the correct order and set the variable created above.
- Show feedback: display feedback based on the variable set in the previous step.
Please note that this is used to check and show feedback only, not affect the result on the Report Slide or LMS.
You can update the variables in the On Correct script if needed:
var dragCount = 6;
var dragNamePrefix = 'drag_';
var correctVarName = 'dragdropCorrectOrder';
var ignoreOrderRanges = [
{from: 2, to: 3},
{from: 4, to: 5}
];
The ignoreOrderRanges variable means that within 1 range, objects can be dropped in any order. For example: From 2 - 3: either object can be drop first.
If you still want to check the order, simply delete it like this:
ignoreOrderRanges = [];
Regards,
deneme (1).approj (408 KB)
Thanks, that’s what I wanted.