Center "Summary of your previous attempts"?

Center "Summary of your previous attempts"?

by Jeff P -
Number of replies: 9

I just installed Moodle a few days ago. (Version 2.0.2). I was wondering - is there any way to center the "Summary of your previous attempts" that appears after submitting an exam? It's currently left justified and it looks a bit awkward. Thanks!

Summary of your previous attempts

Average of ratings: -
In reply to Jeff P

Re: Center "Summary of your previous attempts"?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Jeff,

That text is centered. See attached screenshot, using standard theme.

This is probably a theme issue. Which theme are you using? straight from install or customized? Which brower, which version?

Please attach full screenshot.

Joseph

Attachment 16-03-2011 18-01-11.jpg
In reply to Joseph Rézeau

Re: Center "Summary of your previous attempts"?

by Jeff P -

I'm using the Fusion theme that came with my installation (unmodified). I've tried it on Firefox 3.6 and Chrome with the same result. I use Windows 7. I've attached the screenshot below. Is there maybe a file I can edit to center the box?

Attachment moodle.png
In reply to Jeff P

Re: Center "Summary of your previous attempts"?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Which element is it exactly that you want to center? From your original post and the attached label I thought it was the "Summary of your previous attempts" label.

In reply to Joseph Rézeau

Re: Center "Summary of your previous attempts"?

by Jeff P -

I want to center the table displayed below the "Summary of your previous attempts"

In reply to Jeff P

Re: Center "Summary of your previous attempts"?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Jeff If you had clearly said so in your original post it would have saved us time.wink

@ Tim this is not a theme issue, that table is left-aligned in all themes in Moodle 2.0.

I am personally very much against centered elements, of which there are too many to my taste in Moodle. It lends certain pages a jagged "Christmas tree" appearance. Apart from what are obviously "title" elements, everything should be left-aligned (or right-aligned for RTL languages, of course).

However, for the sake of those "center-aligned elements" fans, including the OP, here is a CSS rule to add to your current theme which will do the trick. Please carefully copy, minding the exact blanks.

#page-mod-quiz-view .generaltable.quizattemptsummary {margin-left:auto;margin-right:auto;}

attached screenshots (using the Fusion theme) (1) before applying CSS rule (2) after applying it (table is centered)

Joseph

Attachment 17-03-2011 09-56-30.jpg
In reply to Joseph Rézeau

Re: Center "Summary of your previous attempts"?

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

To have everything on the page centred, except for one table, is clearly a theme bug! We may think that left-aligned is better than centre-aligned, but inconsistent alignment is far worse than both. If it affects all themes, then the problem is probably in the canvas base theme, not in a more specific theme. Anyway, please can we have a tracker issue.

In reply to Joseph Rézeau

Re: Center "Summary of your previous attempts"?

by Jeff P -

Thanks! That worked perfectly!

In reply to Jeff P

Re: Center "Summary of your previous attempts"?

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

You need to use Firebug, or whatever the equivalent tool in Chrome is, to inspect the layout of the page. You should find that there are enough class names on ids on that table that you can add a rule like:

... something ... { margin-left: auto; margin-right: auto; }

in the theme/fusion/styles/quiz.css file.

Acutally, I would say that this is a bug with the Fusion theme, so you should report it in the Tracker (before or after you work out the fix yourself.)