Neat CSS trick for any theme to change layout of quiz questions

Neat CSS trick for any theme to change layout of quiz questions

by Chris Kenniburg -
Number of replies: 8
Picture of Particularly helpful Moodlers Picture of Plugin developers

At the Michigan Moodle Moot I was shown a neat CSS trick for the layout of quiz questions.  This CSS trick moves the quiz meta data from the left of the question to above the question.  It is strictly a personal preference but worth a look to see if your teachers prefer the change in layout.

See the attached file for a screenshot of how the CSS moves the information normally positioned to the left of the question and places it above the question.  Some might like the change.  

Here is the CSS which you can simply copy and paste into your theme's Custom CSS box to quickly check it out.  

.que .info {

float: none;

width: auto;

}

.que .info > div {

margin-left: 15px;

margin-right: 15px;

}

.que .info > div {

display: inline;

}

.que .content {

margin: 0 0 0 0;

width: auto;

}

.que .info {

    background-color: #eee;

    border: 1px solid #bce8f1;

    border-radius: 4px;

    margin-bottom: -5px;

    padding: 8px;

}

.que h3.no {

    display: inline;

    font-size: 12px;

    line-height: 1;

    margin-left: 10px;

}


Attachment QuizLayout.png
Average of ratings: Useful (2)
In reply to Chris Kenniburg

Re: Neat CSS trick for any theme to change layout of quiz questions

by Stuart Lamour -
Picture of Plugin developers

Hey Chris, nice - we do a similar layout in the Snap theme which proved much easier to understand for learners we tested with. 

Desktop :




Mobile :




In reply to Stuart Lamour

Re: Neat CSS trick for any theme to change layout of quiz questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

We are thinking of the same for our new OU theme, which is why I posted https://moodle.org/mod/forum/discuss.php?d=325658, which so far only Mary has replied to.

In reply to Tim Hunt

Re: Neat CSS trick for any theme to change layout of quiz questions

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Tim,

I've replied to your post too.

G

Average of ratings: Useful (1)
In reply to Chris Kenniburg

Re: Neat CSS trick for any theme to change layout of quiz questions

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Chris,

That looks like an adaptation of my original code from years ago: https://moodle.org/mod/forum/discuss.php?d=237589

It even has the original 'too many zeros':

margin: 0 0 0 0;

G

Average of ratings: Useful (2)
In reply to Gareth J Barnard

Re: Neat CSS trick for any theme to change layout of quiz questions

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers
The force is strong with the Gareth!  Is there an official Moodle Jedi title? 
In reply to Gareth J Barnard

Re: Neat CSS trick for any theme to change layout of quiz questions

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
In reply to Mary Evans

Re: Neat CSS trick for any theme to change layout of quiz questions

by Derek Chirnside -

Cool.

I think this is a classic example of "Looks like Moodle" vs "Looks like not Moodle".

I won't say which is which.  smile

-Derek