Lesson Answer Alignment

Lesson Answer Alignment

av Asana Draper -
Antall svar: 10

Hope this is the correct forum to post this.

I am having difficulties aligning the answers for Multiple Choice questions in Internet Explorer.  I was finally able to left align the text, but the entire box is 100%.  I would like Internet Explorer to display answers like Firefox does.

I assume this is something in the layout.css that should be added/changed but I can't figure out what!

Here's an illustration of what I am wanting...

answers.gif

Any suggestions would be much appreciated!

Gjennomsnittlig vurdering: -
Som svar til Asana Draper

Re: Lesson Answer Alignment

av ben reynolds -
If I remember rightly, this is because FF (inheriting its tendancy from Netscape) builds tables from right to left, but IE builds from left to right.

I'm not knowledgeable about .css, but wherever the table is designed is where you want to look.
Som svar til Asana Draper

Re: Lesson Answer Alignment

av Kristy Hutapea -
Hey there,

try editing the view.php file in mod/lesson/view.php

approx line 615ish (or look for where theres the case for multiple choice questions).

set a width to the table column that holds the radio button.

Hope that works for you!

case LESSON_MULTICHOICE :

 $i = 0;

 shuffle($answers);

 foreach ($answers as $answer) {

 echo '<tr><td valign="top" width="10px">';

 if ($page->qoption) {

 $checked = '';

 if (isset($USER->modattempts[$lesson->id])) {

 $answerids = explode(",", $attempt->useranswer);

 if (in_array($answer->id, $answerids)) {

 $checked = ' checked="checked"';

  } else {

 $checked = '';

 }

 }


Gjennomsnittlig vurdering:Useful (2)
Som svar til Kristy Hutapea

Re: Lesson Answer Alignment

av Asana Draper -
Thank you so much - this worked! However, I didn't put in pixels, just added this (Line 665 in my view.php page):

case LESSON_MULTICHOICE :
$i = 0;
shuffle($answers);

foreach ($answers as $answer) {
echo '<tr><td valign="top" width="20">';
if ($page->qoption) {
$checked = '';
if (isset($USER->modattempts[$lesson->id])) {
$answerids = explode(",", $attempt->useranswer);
if (in_array($answer->id, $answerids)) {
$checked = ' checked="checked"';
} else {
$checked = '';
}
}

Now I would like table width to be resized according to the length of the answers instead of the full browser/window size. These all look so great in Firefox....Internet Explorer is another story - such a pain!
Som svar til Asana Draper

Re: Lesson Answer Alignment

av Joseph Rézeau -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av Testers Bilde av Translators

Hi Asana,

Which version of Moodle are you using? and which theme? I do not see what you report. For me, the display problem is exactly the same in FireFox (3) and MSIE (8), that is to say there is too much horizontal space wasted to the right of the radio buttons. See attached, using standard theme in moodle 1.9.

Joseph

Vedlegg image00.jpg
Som svar til Joseph Rézeau

Re: Lesson Answer Alignment

av Asana Draper -
I am still having this problem. We are using Moodle 1.9 and the theme is a customized theme using the formal white and then standard theme defaults. I have tried inputing the alignment properties in what I think is the correct <td> in the view.php page where LESSON_MULTICHOICE table is, but nothing changes???

I am stumped and can't believe there aren't more people with this problem!
Som svar til Asana Draper

Re: Lesson Answer Alignment

av Joseph Rézeau -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av Testers Bilde av Translators

Hello Asana,

Here is an all-CSS solution, which I have tested with the formal white theme, a theme commonly used in moodle 1.9. You can add the following rules at the end of one of your current theme's CSS files. I have not tested this extensively with all question types, so please test before using on a moodle production site and report here if any problems occur.

#mod-lesson-view #answerform .box.generalbox.generalboxcontent.boxaligncenter {float:left;}
#mod-lesson-view #answerform .lessonbutton {clear:both;}

If you want to retain the matching question type display centered, add this 3rd line:

#mod-lesson-view #answerform .box.generalbox.generalboxcontent.boxaligncenter select {float:none;}

Joseph

Vedlegg image00.jpg
Som svar til Joseph Rézeau

Re: Lesson Answer Alignment

av Joseph Rézeau -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av Testers Bilde av Translators
Hello Asana,
Did my solution help?
Joseph
Som svar til Joseph Rézeau

Re: Lesson Answer Alignment

av Katie Fraser -

Hi Joseph,

I am using Firefox and IE, Moodle 1.911...

Trying to make the fix you outline above but not sure which CSS style page to open in my theme folder. (FYI:  I'm using the "Anomaly" theme). Could you tell me from screen shot below what page I need to open in order to apply your fix? Thank you-

Katie