Fòrums de discussió Fòrums de discussió

Vés enrere

Remembering placement of Drag objects after navigating away from page

Commuta
Hello Smartbuilder,

My users need to resolve a Drag and Drop question in an exam, where they place a number of process steps in the correct order.
So far so good; we can see if they failed or succeeded the assignment etc.

However, during the Review of their exam, they are able to navigate back to the page with the drag and drop assignment to get feedback on their provided answer.
I feel I am overthinking it, as usual, but in the attachment I have placed my current Action canvas.

The thought process would be: "if I save the exact Drop Zone where the Drag Object has been placed in a variable, I can use those to put them back any time I want."
It just turns out that I am probably using some blocks incorrectly.


Note:
I have also used the "Is drag object in dropzone " without an "if X = true" block around it, without any luck.
0 (0 Vots)

RE: Remembering placement of Drag objects after navigating away from page
Resposta
10/10/22 18:48 com a resposta a Daniel de Ridder.
Hi Daniel,
There are 2 ways to do this, I believe.

1. It sounds like they can ONLY proceed when they have the DnD all correct (this is important - let me know if this is not true). If so, then you know when they return the items are going to be correctly placed. So you can just manually set the object to be placed correctly (when in review mode).

2a. If they can place them anywhere (incorrectly) and still submit, and you need to know the exact placement, your overall logic is sound, but there are mistakes in the conditions (see attached image - in example with the arrows, you are looking to see if Drag_ItemList is in DropItemList, and then you save Troublecodes as being placed in Troublecodes, instead of anything to do with the ItemList). Normally, I prefer to store what is in the dropzones in the variable, rather than where the drag items are, but either should work. I would go over these storing conditions carefully, and look in the Debug panel after you store successfully to see if you have everything lined up, and it is storing properly.

2b. There is a way to use tag lists and loops to automate storing of the drag items and then restoring them. If you send us your source file, I can show you how to do that. It takes a little while to set up, and may not be worth the effort for 3 drag items, but overall it's a good approach to this sort of thing.

- Nav
0 (0 Vots)

RE: Remembering placement of Drag objects after navigating away from page
Resposta
11/10/22 08:04 com a resposta a Navdeep Dhillon.
Hello Navdeep,

Thank you for your time on this issue as well.
We are currently working with Scenario #2, where the User can place the Drag objects on any Drop zone before continueing to the next page. 
I am glad my logic is sound, but the problem seems to be in my Action blocks;

No matter how I construct them (even when double-checking the storing conditions that no fields get overwritten ;) ), no variable gets stored.
The variables in the Debug panel stay undefined, even after refreshing, and after trying various methods of wrapping my If statement.

If you have any insights on these action blocks, please share them with me.

Fitxers adjunts:

Fitxer adjunt

0 (0 Vots)

RE: Remembering placement of Drag objects after navigating away from page
Resposta
11/10/22 17:12 com a resposta a Daniel de Ridder.
Hi Daniel,
If the variables are not updating, it's probably that you're leaving the page before this action has a chance to fire. Usually, the order of the actions doesn't matter, but when there are two actions with the same trigger, the "When (x)" with the lower number (further top left) will fire first. When a page change is involved, you must make sure that you don't leave the page before before doing all the things that you want.

Here's a video showing this in action - https://share.smartbuilder.com/public/support/order-of-actions-and-page-change.mp4

- Nav
0 (0 Vots)

RE: Remembering placement of Drag objects after navigating away from page
Resposta
12/10/22 06:55 com a resposta a Navdeep Dhillon.
I cant believe I missed that;
The submit button had to "Onclick" actions listed to it, on two seperate action canvasses.

On the first canvas it took the User to the next page, on the second canvas I was building the Global Variables.
I combined both Actions into one, and now everything works like a charm.

Thank you very much!
0 (0 Vots)