Essay question type: add optional min/max word count limits

Essay question type: add optional min/max word count limits

by Richard Samson -
Number of replies: 2

This is very recently  (January) fixed in MDL-68597 for version 3.11 and master.

(By the way, thanks and congratulations to all that have worked on this great asked-for improvement.)

We are using version 3.10.1+.

Is there a recommended procedure for being able to "backport" (is that the right expression?) this feature? If so, what is it?

Should we drop https://github.com/moodle/moodle/tree/master/mod/quiz into our 3.10.1+ instance and see what happens?

Or do we have to wait till June for 3.11 to come out?

Thanks in advance.

Average of ratings: -
In reply to Richard Samson

Re: Essay question type: add optional min/max word count limits

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you use git to manage you Moodle install (https://docs.moodle.org/310/en/Git_for_Administrators), and if the change is sufficiently self-contained, then back-porting can be easy.

First you need to fetch all the latest version history: I am going to assume here that you just cloned the Moodle repo, so that is 'origin'. (If you don't know what that last sentence means, then the assumption is probably safe wink

git fetch origin

The output for that should show you that a bunch of branches have been updated, including origin/MOODLE_311_STABLE

Then you need to find the commits that implement this feature:

git log --grep MDL-68597 origin/MOODLE_311_STABLE

Then, you need to apply those changes to your Moodle code, which requires knowing that git log shows them in reverse order. So, one at a time, execute

git cherry-pick 9b7439c3a8c17e9fe363da6c9784f0752dffa2f5
git cherry-pick 48e0b24587518064d5d47d5ca370e00a8d37e158
git cherry-pick 8d7b3b3fe72532c74a284d6e3dba3e9d444a8406
git cherry-pick 8306fc3f3e28936c87443fae6435efb0e35be474

If any of those give a merge conflict, then it is no simple. (I suspect that there may be merge conflicts in the qusetion/type/essay/version.php file, but hopefully only there.

Also, once you have done this, upgrading to the next stable release (e.g. 3.10.2) may not go smoothly. This is the biggest risk in doing this.

I think git cherry-pick is safer than copying the whole plugin folder from a different release. However, the key folder here is not mod/quiz, but question/type/essay.

Whatever you do, test it on a copy of your site before you do it for real.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Essay question type: add optional min/max word count limits

by Richard Samson -
Thanks for your know-how, Tim. I'll take a look at this.