Interesting behaviour in Formulas question type

Interesting behaviour in Formulas question type

by Dave Morgan -
Number of replies: 7

I am using the Formulas question type for a question with multiple parts.

I am using Adaptive mode in the Quiz module in Moodle 3.4.2.

When I enter answers out of order (e.g. answer part 2 before part 1) and 'Check' the answer, I get the feedback "Marks for this submission: 1/1" but no green checkmark (or red X). 

If I answer the parts in order, all checkmarks/Xes are displayed.

Is this expected/desired behaviour or could I have setting wrong somewhere?

Also, is it possible to restrict the order in which a student answers question parts?



Average of ratings: -
In reply to Dave Morgan

Re: Interesting behaviour in Formulas question type

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

but no green checkmark (or red X).  Unfortunately, this is how the question behaves.

could I have setting wrong somewhere.  No, this is just a bug (a very inconvenient one).

is it possible to restrict the order in which a student answers question parts?  No.

In reply to Dave Morgan

Re: Interesting behaviour in Formulas question type

by Jean-Michel Védrine -

Hello,

I have trouble understanding the problem. Can you post a step by step procedure to reproduce the problem ?

In reply to Jean-Michel Védrine

Re: Interesting behaviour in Formulas question type

by Jean-Michel Védrine -

Oh yes I see the problem no need to post steps to reproduce.

I think I also see what is the bug: to permit the formulas question to use Tim Hunt's adaptive multipart behaviour  I asked him to add a function to this behaviour : the adjust_display_options_for_part function.

This is what he kindly did and he added a comment in front of that function:

    /**
     * Update some display options to take into account the state of a given part.
     * Since the display options are updated in-place, you probably want to call
     * this on a clone of the real display options.
     *
     * (Note, this method is not used by STACK. If you want to see an example of
     * its use, have a look at qtype_formulas.
     *
     * @param string $index the part index.
     * @param question_display_options some display options. Will be updated in place.
     */

But of course I forgot to carefully read this and I didn't called this function on a clone of my options object !

I don't think this bug was reported (Was it ?) so I never noticed it.

It will be corrected at the next release.

In reply to Jean-Michel Védrine

Re: Interesting behaviour in Formulas question type

by Jean-Michel Védrine -

I am happy to report that this bug is now corrected in the two versions of the formulas question type that are available in the Moodle plugins directory.

Yes there is now 2 versions of the formulas question type

One is for "old" versions of Moodle and PHP. This version is compatible with Moodle versions starting from 2.6 and has been tested with Moodle 2.9. Even if I have not tested it with Moodle versions after 2.9 you should be safe using it if you are running an old version of PHP < 7.x. The important point is in fact that this version is not compatible with PHP recent versions.

The other version of the formulas question type is for people running recent versions of PHP and Moodle. You must use this version if you are using PHP 7.2 and it is advised also to use it if you are running PHP 7.0 or 7.1. This version will not work if your Moodle version is not 3.x. It has been tested with PHP 7.2 and Moodle 3.4.

I am sorry about the fact I was forced to release 2 versions (and it is more work for me) but I wanted to still support older Moodle versions and prepare the future with PHP 7.2 even if  I think not a lot of people use it now.

In reply to Jean-Michel Védrine

Re: Interesting behaviour in Formulas question type

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Jean-Michel,

Great!

---

This bug was troublesome. If I had known that it could have been fixed so quickly, I would have reported it a long time ago.

Unfortunately such reports, questions and suggestions all too often fall into silent nothingness and you end up giving up participating. You find a work-around, no matter how lousy, thinking it is better than nothing. sad I understand that resources are limited because too many programmers stay clear of mathematics. They go where the jobs are: video games, publicity and the like. Nevertheless, it could be a good idea to put in place a system where each new topic in the forums gets acknowledged and considered.

In reply to Dominique Bauer

Re: Interesting behaviour in Formulas question type

by Jean-Michel Védrine -

This bug was troublesome. If I had known that it could have been fixed so quickly, I would have reported it a long time ago.

Unfortunately such reports, questions and suggestions all too often fall into silent nothingness and you end up giving up participating. You find a work-around, no matter how lousy, thinking it is better than nothing. triste I understand that resources are limited because too many programmers stay clear of mathematics. They go where the jobs are: video games, publicity and the like. Nevertheless, it could be a good idea to put in place a system where each new topic in the forums gets acknowledged and considered.

Unfortunately I don't have a good solution to this problem

  • The most obvious answer would be to open a new issue in the Tracker because I automatically get a mail waring me and the issue is here until I close it so it can't be forgotten. But I have found that creating a new tracker issue is not evident and easy for people when it's the first time they do it, so in fact very few tracker issues are created for third party Moodle plugins (If you look at the tracker you will see that most Tracker issues for the formulas question type were in fact created by me !)
  • In the majority of cases the bug is in fact discovered in a forum thread, but the problem is that if I miss the thread I don't see the problem and it is quite time consuming for me to monitor the quiz forum to see if something may be related to one of my contributed plugins. Not to mention it is a lot less fun now to read the Moodle forum given I don't have a Moodle site and can't use my plugins with students since I retired. Also as soon as the weather is fine it is a lot more fun to take my Catrike speed and go to the beach or cycle in the country than sitting in front of my computer big grin .
In reply to Jean-Michel Védrine

Re: Interesting behaviour in Formulas question type

by Dave Morgan -
Excellent. Thank you very much!



On 10 April 2018 at 10:31, Jean-Michel Védrine (via Moodle.org) <