Posts made by David Scotson

The headers already sent thing is a common problem. There should be an explanation if you click on the highlighted text in your, or this, forum post. If, as I think you suggest, you've already ruled this out, then there was fix put into CVS recently that fixed a cookie problem with the Login Block, maybe that is the cause.

My answer to your original question is the same as Howard's i.e. don't do that. But I think Howard got the idea that you were running two instances on the same machine (a perfectly normal thing to do, though most people give them different URLs). In fact, it seem that you are running them on two different machines. The question then is why you don't give the two machines different names e.g. www.yourmoodle.com and test.yourmoodle.com and leave both on port 80.

Hope that helps, at least a little bit.

One more inconsistency I'll mention, as it's quite subtle until you actually look for it, and I thought I was going mad for a while when my theme design wasn't working as it should have:

The three column layout on the front page of your Moodle site and the front page of each course are different. The most obvious difference is the distance between the blocks and the edge of the 'page'. I have a sneaking suspicion that the blocks are slightly thinner too but that might be an optical illusion.

Yes, I should have been clearer that having the common code is only half the battle, and that Moodle already has a lot of this stuff ready to be used. The headline/title example was just something that had been vaguely bugging me for a while, but not enough for me to actually look at the code, so I was going purely by my principle that externally-visible inconsistancy probably means there's something needing looked at internally.

I also forgot to specifically mention Blocks as an area I've actually looked at the code, and that implements this idea really well. It abstracts out the common code/behaviour and makes it pretty clear where Block developers need to insert their customisations. It offers the best of both worlds as you can get standard behaviour without even really knowing what you're doing, but allows experts to re-write each section as and when the need arises.

By the way, is the natty cvs auto-linking a new thing?

cvs:/moodle/lib/weblib.php

Moodle in English -> General developer forum -> Consistancy and Usability

by David Scotson -

There was some discussion recently about 'usability' (though some of the discussion was about whether that word was the right one). I've not had a chance to go back and read all of it but wanted to add my tuppence worth about consistency.

My own personal theory of usability comes in two parts:

  1. The application should offer a consistent experience to the user. This means that things that are the same, should look, act and feel the same. Conversely, things that are different should look, act and feel different.

  2. That this consistancy should be enforced at the code level, by using the same code to implement similar features. Apple gets a lot of praise for their UI and their Human Interface Guidelines, but it's not often mentioned that with just three lines of code you can create a Mac OS X web browser that implements 80% of what it means to be Mac native app. This is because all these common functions are provided in code libraries, and Apple goes out of it's way to ensure you don't have to reinvent any square wheels.

So I was hoping to spark some comments about where people think Moodle is inconsistent (I'll create a wiki page if there's enough feedback).

So here's my starter: Page Titles/Headlines

Some pages in Moodle have a headline, a title placed directly underneath the breadcrumb trail, often bold, sometimes in large type, almost always repeating the last entry on the breadcrumb trail above it.

In an ideal world, these would all be the same, perhaps looking like this:

<h1 class="pagetitle">Your Page Title</h1>

created by some central PHP code like:

pageTitle("Your Page Title")

I'm not sure about the classname (title means something specific in HTML) but hopefully you get the idea. The genius of the CSS is that if people prefer smaller, larger, left-aligned or even no headline at all that can all be achieved in one line of CSS.

I assume from the current inconsistancy that everyone writing a module or page has written their own version of this (admittedly very simple) code, though in fact, in some cases they've not added this code at all. And that if I did want to add that classname, or change it later, I'd have to spend time locating a large number of slightly different lines of code. Note that just changing them all to use the same but duplicated code is not really a solution, as any future change needs to be made in multiple places.

Does anyone else have a pet inconsistancy? Note that it really doesn't matter how small the inconsistancy is, it probably reveals duplicated code.I think that paying attention to this has two big benefits: it makes Moodle easier to learn and use, and it provides a half-built template for future additions, allowing them to be created quickly and consistently.

Average of ratings: -