Drag & Drop: New text elements cannot be marked as correct

serettig's picture


The most recent version of Drag & Drop that is on the Hub (Drag and Drop 1.13.14 and Drag Question Editor 1.10.16) has a serious bug that was reported by a user of Lumi at our issue tracker. I'm pasting his report here as it must be fixed in H5P. I've reproduced the bug in Drupal 7 as well, so it's not an issue with Lumi's implementation:

Text elements added to drop zones are not recognised as correct. An analysis of the content.json in comparison to the same task generated through [an older version] shows that elements marked in the drop zone are not being correctly marked as "correctElements":["0"] but as "correctElements":[], causing them to be interpreted as incorrect answers . Manually adding ["0"] to a drop zone in content.json solves the problem. The issue is generated regardless of whether the image drag and drop task is created as a standalone or within a nested element such as a course presentation.

Drop zone code generated by [new version]:

{"x":16.948711700726808,"y":30.897249033711034,"width":1.5,"height":1.5,"correctElements":[],"showLabel":false,"backgroundOpacity":0,"tipsAndFeedback":{"tip":""},"single":false,"autoAlign":true,"type":{"library":"H5P.DragQuestionDropzone 0.1"},"label":"<div>1</div>\n"},

Drop zone code with 'correct item' marked:

{"x":16.948711700726808,"y":30.897249033711034,"width":1.5,"height":1.5,"correctElements":["0"],"showLabel":false,"backgroundOpacity":0,"tipsAndFeedback":{"tip":""},"single":false,"autoAlign":true,"type":{"library":"H5P.DragQuestionDropzone 0.1"},"label":"<div>1</div>\n"},


Original report: https://github.com/Lumieducation/Lumi/issues/1945

It looks like this issue mostly happens when you create new Drag & Drop content. If you edit existing content, it is sometimes possible to save  text items marked as correct.


Content types: 
BV52's picture

Hi Sebastian,

Thank you for reporting this, I created a bug report for this issue.


Hello !

I agree, I have exactly the same problem using Lumi or Logiquiz. Same issue with dragging image. I could fixed the issue by editing the h5p file in h5p.org.

fnoks's picture

This bug is fixed and released, ref https://h5p.org/post-hub-releases.

Thank you for reporting!