Limit access to a week in a course

Limit access to a week in a course

از Matt Stocum در
Number of replies: 9
Is there a way to have Moodle block access to a week in a course until that week opens?

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
میانگین امتیازات: -
In reply to Matt Stocum

Re: Limit access to a week in a course

از Art Lader در

Hi, Matt,

You could hide whatever you don't want the students to see. Turn on editing and click on the eye icon to hide a resource or a section.

Hope this helps,
Art

In reply to Matt Stocum

Re: Limit access to a week in a course

از Bernard Boucher در
Hi Matt and Art,

                       if you want to automate that process then Michael and his group has developped a block to do that here.

I hope it may help,

Bernard

In reply to Bernard Boucher

Re: Limit access to a week in a course

از Matt Stocum در
Awesome.  I think that is exactly what I need.  Thank you.
In reply to Matt Stocum

Re: Limit access to a week in a course

از Chardelle Busch در
تصویر Core developers

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

In reply to Chardelle Busch

Re: Limit access to a week in a course

از Timothy Takemoto در

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

In reply to Chardelle Busch

Re: Limit access to a week in a course

از Michael Penney در
We plan to find a way to make the eye work normally in a course with the course program block installed. Right now it disables the eye tool, however we'd like to get it working so that clicking the eye would reset the hide or show time for the topic/week or item.

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 anywaythoughtful.
In reply to Chardelle Busch

Re: Limit access to a week in a course

از Bernard Boucher در
Bonjour Chardelle, Timothy, Michael et les autres,

Michael block and activities linking share 2 files:

moodle/course/format/weeks/format.php

moodle/course/format/topics/format.php

I didn't try itblush but if you replace print_section by print_section_link in Michael files then it should works.

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

In reply to Bernard Boucher

Re: Limit access to a week in a course

از Chardelle Busch در
تصویر Core developers

Thanks for the replies guys, you are so greatkiss.

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