Display Week numbers in Weekly Outline

Display Week numbers in Weekly Outline

by Mark Pearson -
Number of replies: 5
A trivial question for which there should be a straightforward solution, though I can't put my finger on it ...

In most, if not all, themes a course in topic format displays the topic number in td.left side but changing the course to weekly format removes the week number. If you have 16 weeks displayed as many of my faculty do, it's hard to figure out the week number.

I don't think that this is a style setting, at least I haven't found a style for class .left side so I'm flummoxed as to how I can turn on the display of the week number.

Cheers

Mark
Average of ratings: -
In reply to Mark Pearson

Re: Display Week numbers in Weekly Outline

by Chardelle Busch -
Picture of Core developers
Look in the fonts.css.  I believe it is:

#course-view .section .left {
  font-weight:bold;
}
In reply to Mark Pearson

Re: Display Week numbers in Weekly Outline

by Gustav W Delius -
This is not a theme problem. Rather someone took out the code that used to print that week number. I will try to find out why this happened and if it was a mistake I will put it back in.
In reply to Gustav W Delius

Re: Display Week numbers in Weekly Outline

by Alick Brown -
Any answer?
I'd like to avoid having to add a label to each week....
Thanks
Alick
In reply to Alick Brown

Re: Display Week numbers in Weekly Outline

by Steve Power -

Alick

If you are up to editing php code it is quite easy to put the week numbers back in although it potentially creates an ongoing maintenance issue when upgrading. In our installation (1.63+) I have created two extra course formats, weeks with numbers and topics without which I have called weekswn and topicsnn. Beware the limitation on the length of folder names for formats 9 or 10 if I remember correctly.

Anyway what I did was copy the weeks folder within moodle/course/format to a new name and then edit the format.php file in this new folder. The line that needed changing was around 173

echo '<td class="left side">&nbsp;</td>';

to

echo '<td class="left side">'.$section.';</td>';

I then added text strings in my local language files (moodle.php) for my new format weekswn as follows:

$string['formatweekswn'] = 'Weekly format - with numbers';
$string['nameweekswn'] = 'week';

Of course if you are changing the standard rather than adding an extra then this is not necessary.

Hope this helps
Steve

In reply to Steve Power

Re: Display Week numbers in Weekly Outline

by A. T. Wyatt -
Thank you for this! I am bookmarking it, as I think it is a very good idea.

atw