The lang string location is historical. Back in the day of Moodle 1.4 or 1.5, all the questions were part of the quiz module. When they were separated the people doing the work did not bother to move all the language strings. They are only gradually being moved.
However, the rules are that you must not change language strings. This is for two reasons. 1. All versions of Moodle use the same language packs, so you should only add strings for that reason; and also, the translators tools do not tell them when strings are changed, only when there are strings in the english files that are not in their files. So new strings have to be new to get translated.
So
Anyway, thank you for creating the patches. My comments:
1. As the Coding guidelines (http://docs.moodle.org/en/Development:Coding) say, you must indent your code with 4 spaces, not tabs.
2. As above, create a new string notenoughqsandas instead of changing notenoughquestions. Similarly, don't change filloutthreequestions, instead make a new string filloutthreequestionsandtwoanswers in qtype_match.php.
3. I am not sure about your change to the line
if ($trimmedanswer != '' && $trimmedquestion != ''){
I suppose it does not really matter because of the test below
if ($trimmedquestion != '' && $trimmedanswer == ''){
The only thing is, which gives the less confusing display when someone enters questions without answers?
4. We could clean up the code that sets the errors array to reduce the duplication. Something like:
if ($questioncount < 1){
$errors['subquestions[0]'] = get_string('notenoughquestions', 'qtype_match', $numberqanda);
}
if ($questioncount < 2){
$errors['subquestions[1]'] = get_string('notenoughquestions', 'qtype_match', $numberqanda);
}
if ($answercount < 3){
$errors['subanswer[2]'] = get_string('notenoughquestions', 'qtype_match', $numberqanda);
}
Anyway, this is nearly good enough to be committed, so it would be great if you could just make the changes I suggest. Thanks.
Hi, Tim!
I see, this issue is not on you priority list (thought it takes several minutes to fix).
We still badly need such questions right now.
If I make a patch., will you apply it in Moodle codebase for 1.9 and 2.0?