Moodle 1.8.2
We're doing our first pilot course to see the feasibility of using Moodle for a full-scall online LMS.
So far, it's been pretty interesting.
Quick question about creating a multiple choice quiz:
How do i prevent the answers to be labeled with letters (a, b, c ..etc)?
Or is this on because I have the "sort" feature enabled to randomize the questions?
Thanks for your help.
jeremy
Hi Jeremy,
Its actually very easy. Go to the
moodle/question/type/multichoice/questiontype.php file
and on lines 319/320 replace:
$a->text = '<span class="anun">' . $qnumchar .
'<span class="anumsep">.</span></span> ' .
format_text($answer->answer, FORMAT_MOODLE, $formatoptions, $cmoptions->course);
with
$a->text = '<span class="anumsep"></span></span> ' .
format_text($answer->answer, FORMAT_MOODLE, $formatoptions, $cmoptions->course);
That is remove the '<span class="anun">' . $qnumchar .
Good luck,
Mike
Another way to do this is to add:
.multichoice .anun { display: none; }
To your theme.
I even replaced my backed up version of config file, and I can no longer log in to moodle .. the URL is no longer resolving .. ideas?
@ Mike: i did not see the text in the "questiontype.php" file that you mentioned. I'm on moodle 1.8.2 .. is it possilbe that has changed in this version?
At this point, it looks like I might have to reinstall moodle from scratch .. which i'm not too crazy about, since I've already spent several hours building my quizes and configuring the system .. not to mention adding all my students ..
i appreciate your help ..
how do i get my moodle back on line?
cheers,
-jeremy
@ Tim: I'm back online by removing that line (I thought i had, but obviously not)
So, i've replaced the original config.php, and it's working now ..
i'm obviously not adding the
.multichoice .anun { display: none; }
line correctly ..
i guess i need a bit more hand holding here .. can you please let me know how i should be updating my theme to take this change?
thanks again ..
cheers,
-jeremy
Re: How do I disable letter labels for Quiz Answers?
Jeremy,
You rarely need to modify the config.php in your moodle theme. What Tim meant is: add
.multichoice .anun { display: none; }
to the end of any of your theme's *.css files.
Joseph
Re: How do I disable letter labels for Quiz Answers?
thanks for the reply.
I am using the standardwhite template.
I opened the gradients.css file and added that line to the end.
My multiple choice quizes still have a., b., c., etc. prior to every answer.
here's what my gradients.css style sheet looks like. is there a syntax error preventing this from working?:
-------------------
/**
* Adds all the nice finish to the standard theme
*
*/
th.header,
td.header,
h1.header,
h2.header,
h3.header,
div.header {
background-image:url(gradient.jpg);
background-position:top;
background-repeat:repeat-x;
}
.navbar {
background-image:url(gradient.jpg);
background-position:top;
background-repeat:repeat-x;
}
.multichoice .anun { display: none; }
-----------------
thanks,
-jeremy
I have just tried the line of code I gave (in Moodle 1.8.2), and it definitely works. I can think of two possible explanations why it is not working for you.
One possibility is that sometimes web browsers cache stylesheets rather than re-fetching them from the web server each time. So you edit the stylesheet, and nothing appears to happen. Normally, you can fix things by holding down CTRL+SHIFT then clicking on the reload button.
The other possibility is that that for some reason, the gradients.css is not actually being used by your theme. If there are other .css files in your theme, try moving the line of code there instead.
I'm really scratching my head now then.
I tried Ctrl+Shift reload, and I can confirm that updates my themes and styles properly.
And, the gradient.css is being used because it controls the title bar at the top.
It's also the only .css file in there.
I have attached a screen shot of my result.
call me stumped.
cheers,
-jeremy
Re: How do I disable letter labels for Quiz Answers?
Jeremy,
It does work for me. I have added .multichoice .anun { display: none; } to the end of file moodle/theme/standardwhite/gradients.css. My gradients.css file looks exactly the same as yours. I have refreshed my browser, and the abc letters have disappeared (see attached screenshots). Using Moodle 1.8.2 on Windows XP, Firefox 2 and MSIE 7.
Are you positive that you have not made any customization to the standard or the standardwhite themes? Have you refreshed your browser? Which platform are you using? Which browser? which version? Is this a local site (an Apache server on your computer) or a network or a web provider?
If you put the following line in your moodle/theme/standardwhite/gradients.css file, do you get the background all green?
body {background-color:#00CC00;}
If not, then it means that your moodle course is not reading your gradients.css file for some reason.
Joseph
Re: How do I disable letter labels for Quiz Answers?
I will move this question to the themes forum, as my problem seems to be unrelated to the quiz module. Thanks for your time.
-jeremy
Hi Mike
I ahve also tried removing the lines you mention and I am left with a fullstop beside each answer (as shown within the image). I know it is trivial and probably easy but I am not a PHP Programmer.
Any help much appreciated.
Cheers,
Ali.
Hi Ali
To do that you have to remove the separator as well, so remove all of the red code from lines 319/320:
$a->text = '<span class="anun">' . $qnumchar .
'<span class="anumsep">.</span></span> ' .
format_text($answer->answer, FORMAT_MOODLE, $formatoptions, $cmoptions->course);
so it becomes:
$a->text = format_text($answer->answer, FORMAT_MOODLE, $formatoptions, $cmoptions->course);
I have a related problem in that questions with more than 26 options start getting prefixed with {, |, } etc. as you go through the ANSI codes. In fact I would consider that a bug - on my way to Tracker now!Steve
Hi Steve,
Yup! that worked thanks for that.
Yes!!! > 26 options!? Can I ask why 26 options? Don't your students get frustated with all of these options? I remember being a student myself and getting frustrated with just the questions!!
Thanks again,
Ali.