New version of Gapfill question type available (V1.7)

New version of Gapfill question type available (V1.7)

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

A new version of the Gapfill question type (version 1.7) is now available from Github. This release is primarily to ensure the drag and drop functionality works with Moodle 2.9. It also addresses some minor bugs particularly with handling languages with accents. 

The code is here

https://github.com/marcusgreen/moodle-qtype_gapfill/tree/gapfill_1.7

I would greatly appreciate feedback on this release. 

The release notes are here

https://github.com/marcusgreen/moodle-qtype_gapfill/blob/gapfill_1.7/releasenotes17.txt



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

Re: New version of Gapfill question type available (V1.7)

by Ellen Spertus -

Thank you for creating Gapfill.  I use it heavily.

I have a reproducible but with Gapfill 1.7 on Moodle 2.9.1+ (Build 20150716) with no filters enabled. If I preview the 2-question quiz in the attached backup file and xml, do not answer any questions, and click on "Finish attempt..." -> "Submit all and finish" -> "Submit all and finish", I get the below errors.   This happens under both Firefox 39.0 and Chrome 44.0.2403.130.

Thank you.  Let me know if any other information would be helpful.

Ellen


Notice: Undefined index: p1 in /home2/millscso/public_html/question/type/gapfill/question.php on line 246

Notice: Undefined index: p2 in /home2/millscso/public_html/question/type/gapfill/question.php on line 246

Notice: Undefined index: p3 in /home2/millscso/public_html/question/type/gapfill/question.php on line 246

Notice: Undefined index: p4 in /home2/millscso/public_html/question/type/gapfill/question.php on line 246

Notice: Undefined index: p5 in /home2/millscso/public_html/question/type/gapfill/question.php on line 246

Notice: Undefined index: p6 in /home2/millscso/public_html/question/type/gapfill/question.php on line 246

In reply to Ellen Spertus

Re: New version of Gapfill question type available (V1.7)

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I see the same Notices using your questions and quiz, as well as when I use my own questions with Gapfill 1.7 on Moodle 2.9.1+.

It seems that the first question does not generate any notices, but each question after that generates a notice for each answer gap in the question.

In reply to AL Rachels

Re: New version of Gapfill question type available (V1.7)

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

Ellen and Al can you confirm the other details of your quzzes, i.e. question behaviour, review options etc. Thanks for the course backup Ellen, I have installed it on a local copy last night but was not able to reproduce the symptoms. If I can reproduce them I am likely to be able to fix them. I am going to have another go with them now to try to reproduce the symptoms.

Just tried it with with deferred Feedback but no luck. As an aside Ellen, I first got into Moodle for delivering Java programming related questions and the code was tweaked to ensure it could deliver most likely questions such as yours. My apologies that it is doing this and I will work hard on finding the problem. If I can reproduce it I am likely to be able to fix it.

I have a very good idea what will fix it, but it's hard to know until I can reproduce it.

In reply to Marcus Green

Re: New version of Gapfill question type available (V1.7)

by Ellen Spertus -

Thanks for the quick reply.  There's nothing interesting in my settings, afaict.  I tried attaching a pdf, but it was too big. 

I invited you as a non-editing teacher. Let me know if you need anything else.

Thanks.

Ellen

In reply to Ellen Spertus

Re: New version of Gapfill question type available (V1.7)

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

Can you confirm the version of PHP you are running, you can find this from your site at 

admin/phpinfo.php

I don't think this is the issue, but just for complete information. Where/How did you invite me?

In reply to Marcus Green

Re: New version of Gapfill question type available (V1.7)

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Marcus,

I have the quiz question behaviour set as:

  • Shuffle within questions - Yes
  • How questions behave - Immediate feedback

Review options:

  • During the attempt - only The attempt is checked and it is grayed out.
  • Immediately, Later, and After - all three have everything checked.

Basically, I just have everything set to whatever the default is when the quiz is created.

Environment details:

  • PHP version is 5.4.16
  • Running on an up-to-date Centos Version 7
  • Apache 2.4.6
  • MySQL 5.6.26

If you would like admin access, let me know via email. My profile is set to allow everyone to see my email address. This is not a production server or Moodle.

In reply to AL Rachels

Re: New version of Gapfill question type available (V1.7)

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

While testing for something else I reproduced this bug once but have not been able to do again, how very frustrating. However I have strong feeling that the following code might fix it if you add it to the appropriate place in question.php. Search for get_num_parts_right and then add the last three lines that start with if.   I have logged into Ellens course but have not reproduced the symptoms yet but I will have another go.

  /**

     *

     * @param array $response Passed in from the submitted form

     * @return array

     *

     * Find count of correct answers, used for displaying marks

     * for question. Compares answergiven with right/correct answer

     */

    public function get_num_parts_right(array $response) {

        $numright = 0;

        foreach ($this->places as $place => $notused) {

            $rightanswer = $this->get_right_choice_for($place);

            if(!isset($response[$this->field($place)])){

                 continue;

            }

In reply to Marcus Green

Re: New version of Gapfill question type available (V1.7)

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Unfortunately, when I change the code as suggested, I then start getting undefined index errors from line 97 of renderer.php

In reply to AL Rachels

Re: New version of Gapfill question type available (V1.7)

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

I have definitely got a fix for that, but not until I get to my machine at home in about 9 hours.  It is some similar code to my previous post and I will post it when I get access.

Thanks for the feedback on this Al and Ellen, it is very helpful.


In reply to AL Rachels

Re: New version of Gapfill question type available (V1.7)

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

I have definitely got a fix for that, but not until I get to my machine at home in about 9 hours.  It is some similar code to my previous post and I will post it when I get access.

Thanks for the feedback on this Al and Ellen, it is very helpful.


In reply to Marcus Green

Re: New version of Gapfill question type available (V1.7)

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

OK, change line 96 which currently reads

if (($options->correctness) or ( $options->numpartscorrect)) {

to read

if ((($options->correctness) or ( $options->numpartscorrect)) && isset($markedgaps['p' . $place]))  {




In reply to Marcus Green

Re: New version of Gapfill question type available (V1.7)

by Ellen Spertus -

Wow!  Thanks for the fast turnaround.

Unfortunately, I made the change to line 96 of gapfill/renderer.php but still get the same error.  Should I have made it elsewhere?

In reply to Ellen Spertus

Re: New version of Gapfill question type available (V1.7)

by Ellen Spertus -
Marcus has been helping me offline and sent me a fix that solved the problem.  He plans to release an update soon.


I can't  think of when I've gotten such a helpful response for paid software, much less free software. Marcus is amazing!

Average of ratings: Useful (2)