Ie, say there are 3 weeks
Week 1 runs from Feb 1 - Feb 7
Week 2 runs from Feb 8 - Feb 14
Week 3 runs from Feb 14 - Feb 21
On Feb 9th I want the students to be able to see everything from Week 1 and 2, but not anything in Week 3. Is this possible?
Thanks
Bonjour Bernard,
Ca va? I have a question for you. Michael's code looks like something I would really like to have, but, he says it makes the "eye" ineffective. So, does that mean I wouldn't be able to use it in a course with your activity linking (since, of course, your code uses the eye to hide the linked activity)? Have you tried his code?
Merci,
Chardelle
Bonjour Chardelle
If Michael's wonderful block does interfere with activity linking, and you only want to display up to the current week, rather than for any time period as is made possible by that block, then
then try changing the line
while ($weekdate < $course->enddate) {
to
while (($weekdate < $course->enddate) && (($weekdate <= $timenow) or isadmin())) {
if you want administrators, but not teachers not to be able to see the end of the course, or
while (($weekdate < $course->enddate) && (($weekdate <= $timenow) or isteacher($course->id))) {
if you want teachers but not students to be able to see to the end of the course.
in /course/format/weeks/format.php
The line seems to be on line 129 these days.
Original forum disucssion, to which you contributed and Michael announced his module:
http://moodle.org/mod/forum/discuss.php?d=11380
Please hack with caution.
Timothy
I'm not sure how it would work with activity linking--trying to think how a course would work with both gets me a bit confused anyway

Michael block and activities linking share 2 files:
moodle/course/format/weeks/format.php
moodle/course/format/topics/format.php
I didn't try it

The use of the eye is not supposed to affect activities linking if it is done at the topic or week level: currently if you hide an entire section or week you should not loose your activities linking.
For those, like you Chardelle, who use activities linking, you have an other option to block access to a week in a course until that week opens:
the last version of activities linking incorporate regulate rights which do exactly that using Jon calendar instead of a new block. You even have control at the group level and at the minute precision if you desire!
I hope it may help,
Bernard
Thanks for the replies guys, you are so great.
I think I'll hold off on experimenting until 1.5 beta, then I'm planning on doing a lot of testing of old code hacks, etc. When you post your updated block for 1.5, I'd love to try it out, Michael. Then, maybe we can see if we can get it to work with Bernard's activity linking.
Chardelle