Why don't I have a response box instead of undercores?

Why don't I have a response box instead of undercores?

by Saeed Amiri -
Number of replies: 8

Hello

I'm trying to use the short answer question type with lesson activity. I know I have to add 5 or more underscores instead of a blank in my question to be changed to a response box after it is parsed by Moodle, but, for whatever reason, I do not have it. Instead I have my own underscores in the question. Of course, this is not true with the short answer question type in the question bank. I mean, it works as expected there creating the required response box instead of the underscores.

Does any one have the same experience as me? Is that a bug or am I mistaking something? 

By the way, I am using Moodle version 2.7.

Regards

Average of ratings: -
In reply to Saeed Amiri

Re: Why don't I have a response box instead of undercores?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The underscores trick only works in the Quiz, not the Lesson.

In reply to Tim Hunt

Re: Why don't I have a response box instead of undercores?

by Saeed Amiri -

@Tim Hunt. Hi. Thanks for responding. Any particular reasons why we could not have that feature for short answer question types in lessons as well?

In reply to Saeed Amiri

Re: Why don't I have a response box instead of undercores?

by Jean-Michel Védrine -

Hello Saeed,

This should be doable, one would have to modify the definition function in the lesson_display_answer_form_shortanswer class in mod/lesson/pagetyes/shortanswer.php.

Please can you create an issue in the tracker so that this feature is not lost.

Unfortunately I don't think I will be able to work on it in the near future giving my workload and all the major bugs I want to solve in the lesson activity first.

But of course if you or any other lesson's user knowing php wants to work on it, I can give some guidance and help to integrate it once the patch is working.

The code in question/type/shortanswer/renderer.php can be of some help but you would have to adapt it because lesson code is just a basic Moodle form and the question engine is a lot more sophisticated.


In reply to Jean-Michel Védrine

Re: Why don't I have a response box instead of undercores?

by Jean-Michel Védrine -

I have created MDL-48473 to take care of this issue when I find some time.

This is not very complicated and it's not a big change (only a few lines) I think it would be useful.

Also this discussion makes me realize that currently all "fill in the blank" imported questions are not displayed correctly in lesson.

In reply to Jean-Michel Védrine

Re: Why don't I have a response box instead of undercores?

by Saeed Amiri -

Hello Jean-Michel

Thanks a lot for responding and creating the tracker. Unfortunately, I myself am not much advanced in php programming ( actually, I have started the basics recently പുഞ്ചിരി), or I could help with that. 

I am glad to find out that there is the possibility of such a change being incorporated into Moodle lessons anyways.

Thanks again.

Regards

In reply to Saeed Amiri

Re: Why don't I have a response box instead of undercores?

by Jean-Michel Védrine -

Hello,

I am happy to report that this feature is now part of Moodle 2.9dev so it will be available in a few months when Moodle 2.9 will be released.


In reply to Tim Hunt

Re: Why don't I have a response box instead of undercores?

by Kevin Barhydt -

Hi,

I'm wondering, can I use multiple underscores in a short answer quiz question? I am trying (Moodle 2.8) but it only creates one text box for the first underscore. (see example and screenshot below)

Is this a bug?

Hope you can help.

Thank you,

Kevin 

Question:  The European leaders who turned against Wilson in Paris and pushed for tougher treaties were ____________________ of Britain, ____________________ of France, and ____________________ of Italy.

In reply to Kevin Barhydt

Re: Why don't I have a response box instead of undercores?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Shortanswer questions only have one answer box. This is not a bug.