Issue Details (XML | Word | Printable)

Key: MDL-17301
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Olli Savolainen
Reporter: Tim Hunt
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-17284

Can we avoid inline CSS in mod/quiz/edit.php

Created: 19/Nov/08 05:13 PM   Updated: 22/Nov/08 08:30 PM
Return to search
Component/s: Quiz
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Olli Savolainen and Tim Hunt
Security Level: None
Resolved date: 22/Nov/08
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Instead, can we just add, or not add, a class name to some div using PHP, and put the CSS in the theme. I am looking at lines 716 onwards.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Olli Savolainen added a comment - 22/Nov/08 07:17 AM - edited
I did this already, but I hesitate to commit it, since it seems it will be smarter to keep the inline CSS.

The classes I created are non-semantic like bankvisible and quizwhenbankcollapsed - they do not add any semantics since they are bound to the very behaviour of the css properties, so they will just be badly named - keeping the semantics in the HTML and the style in the CSS is the idea of classes, after all. We won't reach there here, just as we do not with the special javascript class added to body (though that one may have technical reasoning).

It does not seem to make any sense to theme that specific CSS, it will just add another reference, making the code harder to read. Where is the benefit?


Tim Hunt added a comment - 22/Nov/08 11:29 AM
To me, the CSS class names seem more semantic than the inline CSS. Wy would it matter? Ah, here is an example. Suppose someone making a theme wanted to do something fancy, for example put rounded corners on the question bank. They would need to know the state of the question bank, because they might need to apply different style rules to the bit that stays visible in the two states.

Tim Hunt added a comment - 22/Nov/08 11:39 AM
Actually, you already have <div class="questionbankwindow sideblock"> which is fairly semantic. Can't you just either add 'collapsed' as a third class name or not, so you either have

<div class="questionbankwindow sideblock">

or

<div class="questionbankwindow sideblock collapsed">


Olli Savolainen added a comment - 22/Nov/08 08:30 PM
Done.