The answer selection in the quiz is default to right aligned. This does not look so good when viewed on a widescreen monitor with the browser set to full screen (tends to disassociate short questions from the answers). A colleague changed it to left aligned for our site.
So, for those who wish to change the right alignment of the answers in your quiz...
Each Question type has a folder and in it is the file 'questiontype.php'... this is the file that needs to be changed.
The location for a multiple choice for example, would be
'mod/quiz/questiontype/multichoice/questiontype.php'
In all of these files you should find the code that outputs the main table.. the easiest way to find this would be to do a search for the word 'right' and then obviously change it as required, then test.
A general knowledge of HTML will show how the php spits out the HTML that we see. This then would be the code to manipulate for any other alterations.
For further info, 2 folders up is a file called 'locallib.php' that controls the overal look of each table.
Hope this is useful!
Thanks very much Harry Smith,
I was just looking through the forum to see if anyone was having the same problem as me, and found not only the problem but the solution.
At the same time, I hope this is not disrespectful but, does it really require that we change the php file, and not something in the style sheet? If we need to change the php file then this is a bug I guess. Should I post to the bug tracker?
I append a .jpg with the multiple choice answers aligned right, and thus beginning higgledy piggledy at the right side of the screen.
I don't seem to be getting there. I tried changing align="top" to align="left" but still no joy.
This from ~293 in multichoice/questiontype.php
// Print the text by the control highlighting if correct responses
// should be shown and the current answer is the correct answer in
// the single selection case or has a positive score in the multiple
// selection case
if ($options->readonly && $options->correct_responses &&
in_array($aid, $correctanswers)) {
echo '<td valign="left" class="highlight"><label for="'.$id.'">'.
format_text("$qnumchar. $answer->answer", FORMAT_MOODLE ,
$formatoptions) . '</label></td>';
} else {
echo '<td valign="left"><label for="'.$id.'">'.
format_text("$qnumchar. $answer->answer", FORMAT_MOODLE,
$formatoptions) . '</label></td>';
}
Timothy
I posted a bug here. Please vote for it.
http://moodle.org/bugs/bug.php?op=show&bugid=4162&pos=3
Timothy
As far as I know those should be left as "top".
I haven't actually looked at the files in detail as I got a colleague to fix it up so that the answers start left aligned as per below.
We have only modified matching, muli choice, true false and short answer so far as that's all we've used. I've attached a zip file with the relevant modified and original php files in it if you want to just upload and overwrite for those question types. If there are any other types you need to change let me know and I'll get a better explanation on Monday.
As for being a bug or being able to change it in the CSS I'm not too sure!
Regards
Harry
Thanks a lot Harry,
I see that they are nicely placed on the left hand side of the screen too.
I will plop them in. Ach...I have no idea why but it does not seem to be working. Please see attached. I guess there is a style sheet interaction.
I like the way that the answers are brought toward the left, but the question and the answers are centered rather than being at the left.
Timothy
Just got your message and did a quick trial (see below). I changed my theme to Ocean Blue as that's what your theme is based on and I couldn't recreate the issue you are having. I'll have a look into it further some time today and get back to you.
Regards
H
PS I'm actually using Formal White and have only changed logos.
I am the collaeuge Harry was refering to in previous posts. I have had a look at your posts and the php files that we have changed and I cant seem to find a solution to your problem. The code that you are changing outputs straight HTML (as you can probably tell) and does not directly refer to and CSS, although the problem may have to do with a theme in yours or our site that influences all html outputted.
Anyway all I can really tell you is what is on our php files which is...
- valign is always top
- table align is left
that seems to make it work for us.
Sorry we couldnt be of more help.
Good Luck
I am using your questiontype.php and the theme that Harry tested so it is pretty strange.
But you have done far more than I could expect. Thank you very much indeed.
Timothy
Sorry we couldn't pinpoint the issue for you. I only discovered Moodle a couple of months back and Simon (the guy who replied above) only got involved a few weeks back. Neither of us have any previous php experience (Simon is a bit of a Flash and xml guru) but can't see why it wouldn't work.
Only thing I can think of is that the issues you face running Moodle in Japanese may somehow affect it.
Hopefully someone with some expertise will be able to help.
Good luck.
Harry
Charles Libby
Timothy, are you still following this thread?
Please look in MoodleDocs in the Theme Scrapbook. There you find a CSS solution I wrote to left align questions and answers. Please give your feedback if it works for your Moodle installation too.
I hope this helps.
Urs
Dear Urs, Harry
As Harry guess it was partly a browser problem as I realised later. When I viewed the quizes in firefox, they were displayed as Harry said they would be, but when I viewed them in IE, they were not. So the problem was not solved.
However, shortly afterwords, I moved to a new theme which supports IE on Mac (since I had a problem with some students using IE on Mac), which is called standard_hsu_ForMac and is highly recommended, and in that theme the problem by chance happend to disppear in both browsers.
I have another installation where I have not installed the new theme. I will try and do your CSS fix before I change to the new theme.
Thanks again to Harry and you URS.
Tim
You (and CSS) rock! Thank you. Those few lines solved the issue with aligning the answers. Simple and beautiful.
I really want to make the feedback print below ALL the answers, but I'm not sure how to edit the code to make that happen. Attached is part of the file I believe holds the key; can anyone see what I would have to change?
(mod/quiz/questiontypes/multichoice/questiontype.php)
If anyone can help, I'd sure appreciate it!
Dan
While changing, isn't the caption "Answer" somewhat redundant and takes up real estate unnecessarily? If removed, the check buttons, etc., still signify that answers follow.
I totally agree with you that the prompt "Answer" is redundant, and takes up valuable real estate. Things are worse in Moodle 1.6 where now the prompt has been made longer : "Choose one answer".
Do we think our students are so dumb that when they are confronted with a question and a set of choices they will not understand that they have to tick a choice?
Joseph
So I like to include plenty of explaination if someone feels the need.
The methods I've used are:
- title attributes on various things (links, form elements, or whole groups of things with a label). (Unfortunately, in spite of hundreds of votes and several years, the Mozilla browzers display titles poorly, truncated, no linebreaks). Therefore an even better alternative is an OverLib popup (such as is used for the feedback in CLOZE questions). Is there any way to use the OverLib at will in Moodle? They work well in FF, and are highly formattable.
- expanded text blocks that kan be displayed/hidden with JavaScript connected to a link/button/mouse event. I'm not sure which types of pages allow JavaScript written in the page editor, but I believe I found that it couldn't be done in quiz. (Or is that an Adm setting?)
- (?) linked to a page in new window explaining how that question type functions.
Hi Jeff!, thanks for taking the time for a detailed response to my rant about "overexplaining" in quiz directions!
Normally I quite agree that one never explains too much, and I also spend a lot of time making sure that everything is clear in my instructions to the students.
I use a lot the "title" attribute and, like you, I lament its poor implementation in Mozilla (truncated, no line break, etc.). I agree that it would be nice to be able to use a more elaborate pop-up system, like the OverLib popup. Unfortunately, because main-core Moodle stubbornly refuses teachers the right to use Javascript in our courses, we can't use OverLib.
Finally I have found a work-around - as you suggest - for hiding unwanted "prompt" in quiz questions, but only in forthcoming version 1.6. But more of that when 1.6 becomes the standard version.
Joseph
Simply add to one of your current theme's CSS files:
display:none;
}
Because everyone has different requirements the questions in Moodle 1.6 are using templates, simple html files that determine the layout. The one for the multiple choice questions is in question/type/multichoice/display.html. To get rid of the answer prompt you just have to delete the lines
<div class="prompt">
<?php echo $answerprompt; ?>
</div>
Dear Gustav,
1- It is unfortunately difficult to get things right for all audiences.
How true, and you are making a very good job of this impossible task, as regards the Quiz module, Gustav!
2- The reason Moodle 1.6 says "Choose one answer" or "Choose at least one answer" is that this was a feature request by someone who was concerned that students would not know the difference between checkboxes and radio buttons and would need this extra hint to know when they could choose more than one answer.
Well, an easy answer for that would be for that teacher to introduce her quiz with an explanatory screen making this difference clear.
3- Because everyone has different requirements the questions in Moodle 1.6
are using templates, simple html files that determine the layout.To get rid of the answer prompt you just have to delete the lines etc.
That is excellent. However, we must never forget that some of us are teaching in huge institutions (where I work we have 20,000 students) where the Moodle site is in the hands of admin, and making such a "simple" change to our installed Moodle php code is quite out of question for two reasons: a) admin (especially computer people) are very much against hacking anything if they can avoid it and b) such a change would affect all courses site-wide and would require agreement of a majority of users (a nightmare...).
Once more may I say that what is needed in Moodle is to have more control over such things at teacher level, not at admin level. I have pointed this out many times in my posts, but I must be one of a tiny fraction of Moodle users wanting this, so...
All the best,
Joseph
PS As I said in my previous post, I have found a workaround to get rid of unwanted prompt, using the CSS in a theme (for version 1.6). I'm waiting for 1.6 to stabilize before posting the workaround (if anyone wants it).
Au contraire, Joseph! Almost *everyone* agrees with you that control should be pushed down to teachers and then to students as much as possible and as often as appropriate. It is simply the exhausted resources of a handful of programmers, who usually are volunteering their time, that limits this possibility.
So, like three did teachers at our school did, recruit a programmer, or get funding to make these changes, and they will eventually get into the releases. Or change your school policies to give teachers more say in admin. Or best of all, give a donation to version 1.7, where *flexible, definable roles* are scheduled to be included--which allow you to create broader permissions for teachers, or give students teacher-rights at the course or activity level.
Gustav:
2- The
reason Moodle 1.6 says "Choose one answer" or "Choose at least one
answer" is that this was a feature request by someone who was concerned
that students would not know the difference between checkboxes and
radio buttons and would need this extra hint to know when they could
choose more than one answer.
Joseph:
Well,
an easy answer for that would be for that teacher to introduce her quiz
with an explanatory screen making this difference clear.
~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~
I agree with Joseph on this... Instructions in in the introductory text or even embedded in the question itself is the way to go.
What's going to happen when moodle 1.6 automatically states "Choose one answer" or "Choose at least one answer" when the student must select TWO or more items from a list in order to get a correct answer?
What's going to happen when the student is faced with text in a question that states: "From the following list, select the item(s) that are correct" and moodle 1.6 automatically states: "Choose one answer"? But, to get a correct answer, the student must select 2 items from a list of 6?
The statement "Choose one answer" or "Choose at least one answer" seems to be restrictive and dangerously misleading for the student. At the most, just a simple "Answer(s):" would be sufficient.
Regards, Klaus
BUT
whenever a software is created for public, any standard notification is usually very broad in its sense so as to apply to the maximum number of people.
Therefore
If we change it now to anything, you will find people clamouring for the older string or even a newer one.
OPTIONS:
Simply hack the file and change the string in YOUR version. I don;t know how to hack. Ask Tim or Chris
Option2: Just add 'Click all that apply' in the instructions for the quiz. Students are not that dumb and we are not fighting a legal battle with them for accuracy of the sentence. I use moodle mainly for quizzes and I feel it's OK to say click at least one coz I write instructions at the beginning of quiz.
option #3 : hide the superfluous prompt message (see this post) and replace it with clear instructions at the start of the quiz...
Joseph
Because everyone has different requirements the questions in Moodle 1.6 are using templates, simple html files that determine the layout. The one for the multiple choice questions is in question/type/multichoice/display.html. To get rid of the answer prompt you just have to delete the lines
<div class="prompt">
<?php echo $answerprompt; ?>
</div>
I'm trying to get rid of the answer prompt as wel. I have deleted the lines from the file as mentioned above. No result. Whatever I change in this file, nothing will change on the screen. When I rename the file, the question disappears from the screen. When I delete all the code in the file, the screen remains the same. This is driving me crazy. Can anybody point me in the right direction? I'm using the latest Moodle version 1.9.
Bert