Drag and Drop
Submitted by cbuckner@spence... on Thu, 12/29/2016 - 23:18
Forums:
I'd like for students to be able to correct their wrong choices. When they go to redo, all of the answers reset, even the correct ones. Is there a way to make it so that only the wrong ones reset and they can fix just those?
Here is an example of one that is difficult for students to have to redo the whole thing.
Summary:
Continue after "Check"
Content types:
Issue Status:
tomaj
Fri, 12/30/2016 - 08:43
Permalink
Thanks for the suggestion
Hi,
Thanks for the great feature request. I can see where it would be useful for many authors.
- Tom
papi Jo
Fri, 12/30/2016 - 17:14
Permalink
This feature is quite easy to
This feature is quite easy to achieve. Here is the code:
//Reset position and feedback.
this.draggables.forEach(function (draggable) {
result = draggable.results(true, this.correctDZs[draggable.id]);
if (result == -1) {
draggable.resetPosition();
}
});
However, it should probably be made a behaviour option of the Drag & Drop activity. I will include it in my own "enhanced" version of Drag & Drop soon to be viewable on my test site. I'll keep you posted!
otacke
Sun, 01/01/2017 - 02:06
Permalink
Thumbs up for your effort!
Thumbs up for your effort!
papi Jo
Sun, 01/01/2017 - 11:03
Permalink
Thanks!
You can preview the "keep correct answers" feature (along with many other new features) on my garden site quizzes page here:
http://www.rezeau.org/wp-garden/en/category/about/quizzes/
Drag & Drop activities: Label the plants in the North Border and Plant families. Enjoy!
cbuckner@spence...
Sun, 01/01/2017 - 16:00
Permalink
This is exactly what I want!
This is exactly what I want! Where do I put that code that you put in the previous comment??
tomaj
Mon, 01/02/2017 - 07:56
Permalink
+1
You're awesome Papi Jo!
papi Jo
Mon, 01/02/2017 - 09:46
Permalink
Update to the "keep correct answers" feature
For cbuckner@spence, here is my provisional solution for the "keep correct answers" feature. This is the difference output by WinMerge between the official drag & drop dragquestion.js file and my hacks, where > means "line added" and < means "line deleted":
8a9,11
> window.my_globals = {
> correctDZs : 0
> };
76c79
<
---
> correctDZs = this.correctDZs;
686c689,692
< draggable.resetPosition();
---
> result = draggable.results(true, correctDZs[draggable.id]);
> if (result < 0) {
> draggable.resetPosition();
> }
I am also attaching the modified dragquestion.js file. Usual warnings: test on a test site before using on a production site, and beware of official upgrades. Use at own risk! Before use, rename file dragquestion.txt to dragquestion.js. And empty the cachedassets directory.
papi Jo
Sat, 01/14/2017 - 12:15
Permalink
New feature submitted
Pull request submitted on h5p github here: https://github.com/h5p/h5p-drag-question/pull/15/files
icc
Mon, 01/16/2017 - 09:42
Permalink
Thanks for sharing! We'll
Thanks for sharing! We'll review you pull request and consider merging it in real soon.