Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support drag-and-drop feature #122

Open
IPECORE opened this issue Aug 19, 2020 · 7 comments
Open

Support drag-and-drop feature #122

IPECORE opened this issue Aug 19, 2020 · 7 comments

Comments

@IPECORE
Copy link

IPECORE commented Aug 19, 2020

drag and drop does not work in this task (Topic 9, Unit 1)
Topic 9 - Unit 1 - drag and drop

@rgaudin
Copy link
Member

rgaudin commented Aug 19, 2020

I see Sorry, you cannot drag and drop item or check answers offline so this is not supported.

@kelson42 kelson42 added the bug label Aug 22, 2020
@kelson42
Copy link
Contributor

@rgaudin This is a bug we can? should fix?

@dattaz
Copy link
Collaborator

dattaz commented Aug 22, 2020

Not a bug. We cannot support user uploading data (except if the process is done in JS, which is not the case with drag and drop xblock if I remember)

@kelson42
Copy link
Contributor

Should we close the ticket than if thi sis not fixable?

@satyamtg
Copy link
Contributor

satyamtg commented Aug 22, 2020

I think drag and drop can be implemented, but requires a bit of work. In drag and drop, what happens is there's some items which can be dragged, and some zones on which they can be dropped upon. Each of these items have a value and each of these zones have a value attribute.

The whole process of dragging and dropping an item is controlled by a JavaScript file and the process flow is as follows -

  1. As soon as an item is picked and dragged, POST requests are continuously sent to the server holding the information that it is being dragged. However, I think that these POST requests are of no use to us as the server always returns the same response which is success to all these requests.
  2. As soon as the item is dropped on to a zone, another type of post request to the path drop_item is sent with the payload containing the value of the value attribute of both the item and the zone and this time the server responds with the payload containing two things -
  • correct - A boolean which is true if the zone on which an item is dropped is correct and false if it is wrong
  • message - The message to display to the user
  1. Checking the response of the aforementioned POST request, the JS either puts the dragged item on the zone or back into the item list.

Also, drag_and_drop_v2 xblock seems to have 2 modes -

  1. assessment mode - The dropped item in not put back even if the answer is wrong before explicitely submitting the answers
  2. standard mode - The dropped item is immediately put back if dropped on wrong zone

So, what I think is we can support this xblock in the following way -

  1. Modify the drag and drop JavaScript to not send any data to the server and instead look into a JSON file on the ZIM for answers
  2. The aforementioned JSON file would be prepared at the time of scraping by doing POST requests for each Item in each zone at the scraping time (similarly to what we do for problem xblock since we can not do POST requests correctly), and recording the response
  3. Changing the classes and IDs of the items and zones to prevent the scraped JS file to work on them

In this way at least we can support the standard mode and the constraints on requests would be as follows -

  • One request would be required for each combination of a zone and an item
  • Say if there are 10 zones and 5 items, we would require 5 * 10 = 50 requests

I think the assessments mode support cannot be there as that would also require that we consider all combinations of the aforementioned requests and that would mean insanely large number of POST requests.

So to answer your question @kelson42 , I think this ticket shall be kept alive with enhancement lable instead of the bug label.
Also what do you think @rgaudin @dattaz ?

@satyamtg satyamtg added enhancement and removed bug labels Aug 23, 2020
@rgaudin
Copy link
Member

rgaudin commented Aug 24, 2020

Agrees, would be a nice addition.

@rgaudin rgaudin changed the title drag and drop Support drag-and-drop feature Aug 24, 2020
@stale
Copy link

stale bot commented Oct 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants