Left alignment of Quiz questions

Left alignment of Quiz questions

by Manuel Saint-Victor -
Number of replies: 4
Can someone please let me know how I would change the multiple choice quiz template so that the answers appear left aligned but slightly indented compared the the question?

Thanks in advance,

Manuel
Average of ratings: -
In reply to Manuel Saint-Victor

Re: Left alignment of Quiz questions

by Manuel Saint-Victor -
Clarification-

I'm sorry upon rereading -I think my question may have been a bit vague.  I have been able to understand the majority of the PHP for he quiz module.  I was looking through the attempt.php page and From what I am deducing -the  function quiz_print_quiz_question is responsible for printing the multiple choice question and it's answers. 

I am assuming that by using the array it determines which version of the method is invoked.  Where I am stuck is on where the different versions of the method are actually defined.  I am not sure whether to search for classs definitions for the different question types or what and would like maybe a short hint on how to best approach this.

Thanks again- and my apologies for the vague phrasing.

Mani
In reply to Manuel Saint-Victor

Re: Left alignment of Quiz questions

by Urs Hunkler -
Picture of Core developers

Hi,

you can left align the whole answer + questions block by CSS. The second block is necessary because MSIE does not understand the CSS 2.1 attribute selectors. I use this CSS code for my theme.

.mod-quiz .generalboxcontent table[align=right],
.mod-quiz .generalboxcontent p[align=right] {
  float:left
}
* html .mod-quiz .generalboxcontent table,
* html .mod-quiz .generalboxcontent p {
  float:left
}

Put it in styles_layout of your theme and add the line padding-left:1em; (not tried).

Does it work for you?
Urs

In reply to Urs Hunkler

Re: Left alignment of Quiz questions

by Manuel Saint-Victor -
I pasted the code above in my theme file but I was not sure where to put the last bit you said to use to customize it.    Does it go in that same stylesheet or somewheere in the attempt.php file or in the locallib.php file?

In reply to Manuel Saint-Victor

Re: Left alignment of Quiz questions

by Urs Hunkler -
Picture of Core developers

Hi Manuel,

add it to the CSS and it will be:

.mod-quiz .generalboxcontent table[align=right],
.mod-quiz .generalboxcontent p[align=right] {
  float:left;
  padding-left:1em;
}
* html .mod-quiz .generalboxcontent table,
* html .mod-quiz .generalboxcontent p {
  float:left;
  padding-left:1em;
}

Did it work for you?
Urs