Using Cloze questions in tables

Using Cloze questions in tables

by Danny Munro -
Number of replies: 17

Hi

In Moodle 1.9 i was able to make a table and insert cloze questions into cells.

Since using Moodle 2 the cloze questions will not appear in the table when the question is run. Any help gratefully accepted.

Thanks

Average of ratings: -
In reply to Danny Munro

Re: Using Cloze questions in tables

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@ Danny,

  1. Which exact version of Moodle 2 are you using? 2.0, 2.1, 2.2 ?
  2. Are you having this problem with questions you created in 1.9 on a site that you upgraded to Moodle 2? Or do you mean you can no longer create new Cloze questions in tables on your Moodle 2 site? Or both?
  3. Are you trying to insert Cloze questions inside table cells or do you mean you try to format a whole Cloze question as a table, inserting sub-questions (MCQ, Short Answer, etc.) inside the cells?

Remember, the more precise you are when asking questions, the more likely you are to get useful help.wink

Joseph

In reply to Joseph Rézeau

Re: Using Cloze questions in tables

by Danny Munro -

Thanks Joseph

I am using Moodle 2.1

The problem is the same with questions imported from 1.9 or created in 2.1. The questions can be created without problem. It is only when they are previewed that the formatting is messed up.

I am using a table and inserting cloze questions in individual cells.The result when previewed is the response box starts a new line outside the table.

I have attached a screen dump

In reply to Danny Munro

Re: Using Cloze questions in tables

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Danny, this screen shot does not help much. Could you please attach to your next post the complete text of a cloze question, in HTML format, as a text file.

Joseph

In reply to Joseph Rézeau

Re: Using Cloze questions in tables

by Danny Munro -

Thanks again Joseph

Attached is the question as you reqested

In reply to Danny Munro

Re: Using Cloze questions in tables

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Danny,

I used your attached Cloze question text and everything works as expected in my moodle 2.1 test site, using Standard theme. Maybe your problem comes from using a different theme?

Joseph

Attachment 14-12-2011 12-25-49.jpg
In reply to Joseph Rézeau

Re: Using Cloze questions in tables

by Danny Munro -

That seems to be the problem Joseph.

Here is the question on my home moodle with standard theme.

Table in standard theme

And here is the question on my corporate moodle that has a non-standard theme. Unfortunately I am not an administrator.

non standard theme

In reply to Danny Munro

Re: Using Cloze questions in tables

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Danny,

Well, that is a problem with the theme used on your institution's Moodle site, then. You'll have to ask your admin which theme they are actually using, whether it is one of the themes provided with Moodle, customized or not, or a theme created especially for your institution.

Joseph

In reply to Joseph Rézeau

Re: Using Cloze questions in tables

by Brendan Barlow -

Hi Joseph,

The theme used is Formal white with customised css. I did not design this, but can pass on information.

Any thoughts?

Regards

Brendan

In reply to Brendan Barlow

Re: Using Cloze questions in tables

by Itamar Tzadok -

You can add your own css to the question to override the theme's definitions.

<style type="text/css"> ... </style>

You can use firebug to work out what css to override. If that's a big chunk you can put it in a css file and import it into the question by

<style type="text/css">@import url("path-to-your-css-file.css");</style>

hth smile

In reply to Itamar Tzadok

Re: Using Cloze questions in tables

by Brendan Barlow -

from the second row onwards in the HTML they are coming across as individual tables not cells like in the original format.

Any thoughts on this?

In reply to Brendan Barlow

Re: Using Cloze questions in tables

by Itamar Tzadok -

So it's probably not a theme issue but the way the content was constructed in the editor. For instance when copying a cell content and pasting it somewhere else in the table, if you select the cell rather than just its content it will be pasted into an inner table.That's how the editor works. If that could be the issue, try constructing a simpler version of the question without copy/paste and see if it works. smile

In reply to Itamar Tzadok

Re: Using Cloze questions in tables

by Brendan Barlow -

We changed the Filter HTML tidy (at course level) to off and this solved the problem of formatting.

Average of ratings: Useful (2)
In reply to Brendan Barlow

Re: Using Cloze questions in tables

by Przemyslaw Stencel -

Thank you, Brendan! big grin You've made my day! big grin

I've been struggling (MDL-30433) with this sooo long and the solution's turned out to be so simple!

HTML Tidy filter adds unnecessary closing tags for paragraphs, tables and table cells and thus it breaks the cloze questions. I often use cloze in tables, sometimes to the extreme wink With the html tidy those questions were useless.

In reply to Brendan Barlow

Re: Using Cloze questions in tables

by Didier Jodin -

Thank you so much !

This very useful tip has made one of my "update-to-M2 nightmares" disappear...

In reply to Brendan Barlow

Re: Using Cloze questions in tables

by Douglas Broad -

There is also a lot of conflicting style information competing against HTML 4 type specifications for the same cells in the original attached text file.  Best approach would be to prototype this without any style information and then add slowly.   When adding style information, I switch to the plain text area editor which does not strip out the codes and use a single css style block rather than embedding the codes into every  tag.  The trick to making it work is to use a class for the table that is not in the theme or to access a table formatting mode that is already in the theme by using a single <table class="mythemefavorite"> and then letting the built-in themes help you rather than fighting against them.

Here is the same table(see attached text file) without any style codes.  I doubt the information will be presented much differently than you want.

If you can turn off the filtering for a single class, make sure that the instructor knows html and css sufficiently well not to interfere with the themes.

In reply to Itamar Tzadok

Re: Using Cloze questions in tables

by Liz Gilbert -

I'm using Moodle 2.9, in Safari (and Firefox). I'm having the same problem with the cloze blank forcing a new line of text, which means my tables are also broken, and are multiple in-line blanks. I tried changing my theme (3 choices, plus default), which didn't help.  I also tried using the css code mentioned about, and it just caused the text of the question to disappear. I'm not sure what Tidy HTML is to see if that's the issue. I do know that when I asked IT about cloze forcing a new line, I was told to check the forums.

Any other ideas?



In reply to Liz Gilbert

Re: Using Cloze questions in tables

by Curtis Barker -

This may be an old point, but HTML Tidy is a filter, not a course setting (at least in 2.6).  If you go under Course Administration and turn off HTML Tidy, it seemed to clear up my problem.