Gapfill V2.0 Single Use options

Gapfill V2.0 Single Use options

by Marcus Green -
Number of replies: 21
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I have been working on Version 2.0 of the Gapfill question type and the headline feature is single use draggables, i.e. options are removed from the list once they have been used. 

You can test the code for this from the master branch on github from

https://github.com/marcusgreen/moodle-qtype_gapfill

Draggables removed from options once dropped into gap

Average of ratings: Useful (4)
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by Matthias Giger -
Picture of Particularly helpful Moodlers
My students will love that new feature. Thanks a lot for your ongoing contributions to Moodle Quiz.
Average of ratings: Useful (1)
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Marcus and thanks for that new feature!
Just downloaded GapFill 2.03 2020082901 to test it. The Single use draggables option works as expected. Just one remark: When enabled, it makes the No Duplicates option superfluous. You might consider "hiding" that No Duplicates option when the Single use draggables option box is checked in the Edit Question interface. I think this can easily be achieved with the $mform->hideIf() function.
Joseph [in nit-picking mode]
Average of ratings: Useful (2)
In reply to Joseph Rézeau

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thank you for your feedback. I have tweeted about it and included an animation which is too big for the forum file limit here.
https://twitter.com/marcusavgreen/status/1300009712990257152

I don't think your point is nitpicking as I have started to add some logic to the question editing form as as follows

if gapfill, disable (optionsaftertext, singleuse)
if dropdown, disable (optionsaftertext,singleuse,fixedgapsize)

I have an idea to extend that logic but I was cautious about disabling a permutation that people might actually use.

I had better get on with updating the documentation.



Average of ratings: Useful (1)
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by Mrs. Summers -

This new update is now breaking some of my quizzes. I have some quizzes that allow duplicates. I make sure to "uncheck" single draggables, but it seems to ignore it and remove the item. So now I don't have duplicates to use. How can I enable that feature back? 

Average of ratings: Useful (1)
In reply to Mrs. Summers

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi Mrs Summers
Could you post all the details of your setup, e.g. the version of Moodle and the version of gapfill. You can post here or you can create an 'issue' here https://github.com/marcusgreen/moodle-qtype_gapfill/issues
You can also email me directly at marcusgreen@mailbox.org.
It would also be useful if you could export an example question in xml format.
If any of that is not clear either email me or post here again and I will guide you.
I have just done a test and it seems to work for me.
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Mrs Summers got back to me in a DM and I think I have found the bug. For devs I was passing in string zero "0" to amd javascript which did not see it as false. Have cast it to Boolean in the PHP call and that seems to fix it, like this.
$question->initjs((Boolean) $question->singleuse);

if  Joseph or Matthias could confirm the bug exists for them (single use is always on) and update their copy of this file
https://github.com/marcusgreen/moodle-qtype_gapfill/blob/master/renderer.php
And confirm it makes the issue go away....
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by Matthias Giger -
Picture of Particularly helpful Moodlers
I will have a look at it this afternoon (in a few hours).
Average of ratings: Useful (1)
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by Matthias Giger -
Picture of Particularly helpful Moodlers
Dear Marcus

I've just had a look at the issue and can confirm it:
  • When you create a new question, the "single use draggable" mode is always on, no matter what the actual settings are.
  • Old questions are not affected unless you switch the "single use draggable" mode on, once you have done so, you can't undo the setting.

And yes, your code change fixes the problem.

Thanks a lot for your great work and to Mrs Summers who spotted the issue.

Average of ratings: Useful (1)
In reply to Matthias Giger

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks Matthias, I will do some more testing before pushing to the plugins database. Mrs Summers, I have mentioned you and Mattias in the release notes if that is OK. You can see them here.
https://github.com/marcusgreen/moodle-qtype_gapfill/blob/master/changelog.md
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The updated version (2.09) is now available from the plugins database.
https://moodle.org/plugins/qtype_gapfill
Average of ratings: Useful (1)
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by Mrs. Summers -
Thank you so much Marcus! Really appreciate you fixing this!
Average of ratings: Useful (1)
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by P H -

This is very welcome. However, it seems to result in a problem:

If two blanks have the same answer, only one instance will show among the options, and when it is moved to one of the blanks, it is removed from the list of options and therefore there is no way the other blank could be filled, unless you type the answer in, which would be confusing.

Attachment gapfill-bug-01.png
In reply to P H

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Thank you for your feedback, it is really interesting to see how my question types are used. One solution may be to turn of the Single Use Draggables option.

Attachment Editing_Gap_Fill.png
Attachment Preview_question__dupe.png
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by P H -
Thank you very much for the prompt reply. I was aware of this, but I do want to use single-use draggables! I want the choices to be removed from the list as students drag and drop them. That's very convenient and much more user-friendly.

So does this mean that we cannot use single-use draggables if there are two instances of the same answer?

Would it be possible - in a future version - to either have two instances (under,at,on,on,in) or -ideally - a single instance that remains on the list because it is still needed for another blank?
In reply to P H

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
'I want the choices to be removed from the list as students drag and drop them. That's very convenient and much more user-friendly.'
Yes, this was an early request from when the question type first came out, and I was quite pleased to be able to deliver it.

'So does this mean that we cannot use single-use draggables if there are two instances of the same answer?'

[update to be more concise] Yes, you cannot use single-use draggables if there are two instances of the same answer [/update to be more concise]

There was an assumption in the question design that each gap would be unique when using draggable.
This is partly because it is possible to add Correct/Incorrect feeback on a per gap basis, but the gaps are identified purely on the text content, so it cannot distinguish between the same word used in different context. Yes that is a bit arcane, but it is a price of adding more features to something that was originally going to be quite simple. Probably a good problem to have.

Anyway that does produce a constraint on the flexibility of question type overall, though I try to cater for the greatest ease of use for the largest percentage of users. I was slightly concerned about delivering that most recent change as I suspect very few people use the [thisword|thatword] structure.

It would be hard to have some options as single use and some multi use, but it is something I will think about. You would encourage me in this effort if you were willing to supply a bank of your finest questions in this style in XML format that I could freely distribute and could be freely reused with the question type. It currently ships with around 600 English language questions and more would be good.

But I am going to think about it anyway .....

Screen shot of questions that currently ship with question but the location of which is not very obvious

Attachment englang_questions.png
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by P H -
I was quite pleased to be able to deliver it.

And we all do appreciate it a lot! smile

I suspect very few people use the [thisword|thatword] structure.

I think [thisword|thatword] is an essential option. I use it very frequently with gapfill questions (as opposed to dropdown/dragdrop). I would say it is probably more common than one might think (but no data to back up my haunch).

You would encourage me in this effort if you were willing to supply a bank of your finest questions...

Added to my already totally and disastrously overwhelming to-do list... sad

Average of ratings: Useful (1)
In reply to P H

Re: Gapfill V2.0 Single Use options

by P H -
Hunch! Not my day...
In reply to P H

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hmm, I am starting to want some kind of metrics/telemetry on what features people use....., obviously something people can opt in and out of but ...
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by P H -
A quick and dirty solution could be a "feedback" Moodle activity. Set it up, paste the link on the Moodle plugin page, and ask visiting teachers/webmasters to kindly provide you with some feedback. You could even add an open "wish list" question at the end. (You already know mine...)
In reply to P H

Re: Gapfill V2.0 Single Use options

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hmm, since I posted that I was imagining spending lots of time developing a telemetry component and then having extended conversations about privacy, and needing to maintaining the db that received the telemetry etc etc etc. Your idea looks much less painful.
In reply to Marcus Green

Re: Gapfill V2.0 Single Use options

by P H -

Hello again Marcus!

You see... you made the fatal mistake of replying to me in another discussion and now I am again on your back! wink 

Any developments regarding the following?

Would it be possible - in a future version - to either have two instances on the list of options (under,at,on,on,in) or - ideally - a single instance that remains on the list after being dragged onto a blank because it is still needed for another blank?

Average of ratings: Useful (1)