Using Drag and Drop to see how people rank items

Hi all,

I've used the drag and drop question type to create an activity where people rank different behaviours. Briefly, the background image is a matrix and the text options are behaviours that might help them achieve some goal. I want to know where they have dropped these text items. For example, behaviour x went into quadrant 1, behaviours y and z are in quadrant 2. I've created different drop zones to delineate the quadrants.

I've placed the activity on my Wordpress site and used H5PxAPIkatchu to see the results:

Object Def. Correct Responses[0]: 0[.]0[,]0[.]1[,]0[.]2[,]0[.]3[,]0[.]4[,]0[.]5[,]0[.]6[,]1[.]0[,]1[.]1[,]1[.]2[,]1[.]3[,]1[.]4[,]1[.]5[,]1[.]6[,]2[.]0[,]2[.]1[,]2[.]2[,]2[.]3[,]2[.]4[,]2[.]5[,]2[.]6[,]3[.]0[,]3[.]1[,]3[.]2[,]3[.]3[,]3[.]4[,]3[.]5[,]3[.]6[,]4[.]0[,]4[.]1[,]4[.]2[,]4[.]3[,]4[.]4[,]4[.]5[,]4[.]6[,]5[.]0[,]5[.]1[,]5[.]2[,]5[.]3[,]5[.]4[,]5[.]5[,]5[.]6 Result Response4[.]0[,]0[.]1[,]2[.]2[,]5[.]3[,]3[.]4[,]4[.]5[,]5[.]6

1. Is there a way to interpret these results to see which item was placed in which drop zone?

2. If not, how would I achieve this?


Looking for help in interpreting drag and drop results
Content types: 
otacke's picture

Hi bmarkides!

I agree, xAPI notation can be confusing. It's not intended to be read by humans, but to be fed into LRSs (or a simple replacement such as H5PxAPIkatchu that explicitly leaves analysis to yourself) where you could build your reports. There's a report class that's implemented for the H5P plugin for moodle and on, but it's not yet included in other plugins like WordPress.

For Drag and Drop, you have a bunch of dropzone-draggable pairs. Something like 0[.]2 would mean draggable #2 on dropzone #0. [,] is just a delimiter for those pairs. So 0[.]1[,]0[.]2 would mean draggable #1 on dropzone #0 and draggable #2 on dropzone #0.

The correct responses property lists all pairs that are correct, the response property lists all pairs that the user has created (all draggables dropped onto dropzones).

If you also need the labels to the ids: The labels of the draggables are to be found in object.definition.source, the labels of the dropzones are to be found in



Super helpful, thank you! I've trialled integrating the activity onto an LMS (Moodle) and see that there is a more human-readable option (but not one that shows it as rankings per se). Now that I know how to decipher the results, I think I should be able to write a little script that prints the rankings prettily. 



Hi Oliver,

Could you give me a little more direction for where to find those labels? I'm using Wordpress.



otacke's picture

Hi Brit!

It doesn't matter if you use WordPress, moodle or your own thing - the content types are always the same, and so are the xAPI statements.

Not sure how much more you need. You obviously have already tracked the xAPI statements (in JSON notation). Each xAPI statement has an object property, and this object property itself has properties. There could be one called definition (we have one here). And all those properties could have their own properties, etc. Some activities could have source or target. As mentioned before, for Drag and Drop, the labels of the draggables are to be found in object.definition.source, the labels of the dropzones are to be found in

Example: 0[.]2

As described before, this means that the draggable with draggable-id 2 is on the dropzone with dropzone-id 0. You will have an array of labels for the draggables in object.definition.source, e.g.

[ {id: "0", description: {en-US: "foo"}},  {id: "1", description: {en-US: "bar"}},  {id: "2", description: {en-US: "batz"}} ]

Then the label of draggable #2 is 'batz'.

You will also have an array of labels for the dropzones in, e.g.

[ {id: "0", description: {en-US: "yada"}} ]


Then the label of dropzone #0 is 'yada'.

So alltogether, 0[.]2 here means that there's a draggable with the label batz on the dropzone with the label yada.