Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi language compatible #16

Open
ndalpe opened this issue Apr 30, 2017 · 1 comment
Open

Multi language compatible #16

ndalpe opened this issue Apr 30, 2017 · 1 comment

Comments

@ndalpe
Copy link

ndalpe commented Apr 30, 2017

Hi Guys,
Thank you for this plugin. I am trying to add multiple language to my Moodle and there was an issue with the rendering and the processing of the "Select the missing word" question type.

I am using multi-lang v2 for my multi-language filter. Maybe the solution works with the v1 too.

Here are the changes I made:

/question/type/gapselect/rendererbase.php
Line 99
$choice->text) . ']';
and change it to:
format_string($choice->text)) . ']';

/question/type/gapselect/renderer.php
Line 60
$selectoptions[$orderedchoicevalue] = $orderedchoice->text;
and change it to:
$selectoptions[$orderedchoicevalue] = format_string($orderedchoice->text);

/question/type/gapselect/renderertypebase.php
Line 158
$bits = preg_split('/[[(\d+)]]/', $question->questiontext, null, PREG_SPLIT_DELIM_CAPTURE);
and change it to:
$formatedQuestionText = format_string($question->questiontext);
$bits = preg_split('/[[(\d+)]]/', $formatedQuestionText, null, PREG_SPLIT_DELIM_CAPTURE);

Any suggestion to better the code?

Thank you to Iñaki Arenaza for fixing the rendering. See comments section of https://moodle.org/plugins/filter_multilang2

I hope this helps

Keep the good work!

Thank you

@lucaboesch
Copy link

If Iñaki were to implement your proposed change it would work with the 'classical' multilang filter too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants