Match questiontype - possible to incorporate html editor for question and answers?

Match questiontype - possible to incorporate html editor for question and answers?

by Cathy Macdonald -
Number of replies: 10

Hi there

We're wondering whether it is possible to design/edit the Match questiontype so that questions and answers can be placed in tables? (This is to control on-screen display for different screen formats.)

For example, could something like this (modified from edit_multichoice_form.php):

"$mform->addElement('htmleditor', $feedbackname, get_string($feedbackname, 'qtype_match')"

be safely incorporated into the function "definition_inner(&$mform)" in edit_match_form.php?

I'm not a php programmer, so any advice much appreciated.

Many thanks smile
Cathy





Average of ratings: -
In reply to Cathy Macdonald

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There is no point using the HTML editor for the match answers. HTML dropdown menus (<select>s) can only contain plain text.

Actually, I don't understand what you want to do exactly.
In reply to Tim Hunt

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Cathy Macdonald -

Hi Tim

The problem we're having is that on a landscape format screen the question and drop-down menus are spaced far too much apart.

Is there a way to control the layout arrangement between question and menus so that they sit more compactly together? For example, could they be constrained within an area defined by a table or other means of controlling the lateral separation?

Thanks smile
Cathy

In reply to Cathy Macdonald

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Can you attach a screen-shot?
In reply to Tim Hunt

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Cathy Macdonald -

Hi Tim

Screenshot attached.

Attachment matchgrab.png
In reply to Cathy Macdonald

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Frank Ralf -
Hi Cathy,

You should come quite far by using only CSS, e.g. using "padding" and "margin". CSS FAQ and Themes FAQ are good starting points for learning more about CSS and theming.

hth
Frank
In reply to Frank Ralf

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Cathy Macdonald -

Hi Frank

I'm thinking if I perhaps use the .que { div (or something like) it will affect all the question types.

Is it possible to just target a specific question type?

Thanks smile

Cathy

In reply to Cathy Macdonald

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
All questions get the question type as a class name too, so you can do

.que.match { ... } to change just matching questions.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Cathy Macdonald -

Hi Tim & Frank

That worked perfectly!

Many thanks guys big grin!

Cathy

In reply to Cathy Macdonald

Re: Match questiontype - possible to incorporate html editor for question and answers?

by Frank Ralf -
The questions are actually already put in a table. For a quick hack you could just set the width of the table (see screenshot).

Or try switching this setting from "width" to "max-width".

hth
Frank
Attachment Positioning_quiz_questions.png