Course Date Manager block

Course Date Manager block

by Brian Koontz -
Number of replies: 46
I've ported my course date management page to a block, for those who might be interested. I've attached the latest version, while I figure out how to use my new contrib/ access. Comments/critiques most welcome.

Prior discussion of this functionality can be found here.

--Brian
Average of ratings: -
In reply to Brian Koontz

Re: Course Date Manager block

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
Hi Brian - the block installed like a dream, but clicking on the 'Modify course dates...' link in the block opened http://extranet.basw.org.uk/blocks/course_datemgr/course_datemgr.php?id=3 with the following error:

Fatal error: Cannot redeclare print_checkbox() (previously declared in /home/basworg/public_html/extranet/blocks/course_datemgr/course_datemgr.php:264) in /home/basworg/public_html/extranet/lib/weblib.php on line 747
In reply to Jon Bolton

Re: Course Date Manager block

by Brian Koontz -
Jon--

What version of Moodle? The error msg indicates a "print_checkbox()" method might exist in weblib.php, but my version (1.5.2+ from CVS) doesn't have one.

Can you tell me what's at line 747 in your weblib.php?

--Brian
In reply to Brian Koontz

Re: Course Date Manager block

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
blush Sorry Brian, I should have included all the information for you! I'm running Moodle 1.5.2 (2005060220).

Weblib.php is $Id: weblib.php,v 1.469.2.16 2005/07/14 22:27:59. Line 747 is
* @param string $value The valus that the checkbox will pass when checked
In reply to Jon Bolton

Re: Course Date Manager block

by Brian Koontz -
Interesting...that's a comment line smile  It appears that there's a conflict with one of the function names I'm using.  I'll clean that mess up and get a new release posted for you to try out.

  --Brian
In reply to Jon Bolton

Re: Course Date Manager block

by Brian Koontz -
Jon--

Please give this version a try and see if it resolves the problem.  Thanks!

  --Brian
In reply to Brian Koontz

Re: Course Date Manager block

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
Many thanks Brian - whatever you did has fixed the problem. It's working fine now!

Thank you so much approve
In reply to Brian Koontz

Re: Course Date Manager block

by Eduardo Hernandez -

Hi

Brian. I really love this block. However, the new window launched with dates is having problems with the special characters from Spanish. Any idea of what could be causing this problem.?

In reply to Eduardo Hernandez

Re: Course Date Manager block

by Brian Koontz -
Eduardo--

Can you give me a screenshot or description of the problem? I'll try enabling Spanish and see if I can reproduce the problem here.

OK, I think I see the problem -- the extended characters aren't being displayed correctly.  I'll have to investigate this further to see what I need to do in the code so these characters are displayed correctly.

--Brian
In reply to Brian Koontz

Re: Course Date Manager block

by Art Lader -
Hi, Brian,

Sounds great.

FYI: On a version 153+ installation, I am getting this:

Warning: Invalid argument supplied for foreach() in /home/aiken/public_html/blocks/course_datemgr/course_datemgr.php on line 228

Warning: array_multisort(): Argument #6 is expected to be an array or a sort flag in /home/aiken/public_html/blocks/course_datemgr/course_datemgr.php on line 234

It seems that view.php may be missing? See screen capture below.

Thanks,
Art


Attachment course_date_manager.jpg
In reply to Art Lader

Re: Course Date Manager block

by Antony OSullivan -

I get the exact error with 1.5.3+... but I think it will only occur at a certain point... because I tested it on a course with dates... and a course that has no dates!

It is the one with NO DATEs that throws up the error... (ie) it must be to do with the fact there are no dates to change... and the situation where "List Of Dates is equal to ZERO" has not be programmed correctly.



Warning: Invalid argument supplied for foreach() in /home/tbshsweb/public_html/moodle/blocks/course_datemgr/course_datemgr.php on line 228

Warning: array_multisort(): Argument #6 is expected to be an array or a sort flag in /home/tbshsweb/public_html/moodle/blocks/course_datemgr/course_datemgr.php on line 234

In reply to Antony OSullivan

Re: Course Date Manager block

by Antony OSullivan -

(ie) A topics format course... does not necessarily have dates on it...

In reply to Antony OSullivan

Re: Course Date Manager block

by Brian Koontz -
Art--

The second part of your bug report concerning view.php is a known bug -- the "breadcrumb" trail at the top of the course_datemgr page isn't configured correctly.  You can simply close the course_datemgr window when finished.  I'm debating whether to even have the breadcrumb trail there, because it doesn't make much sense in a new window -- you simply end up with two windows, both containing the same view of the same course!

With respect to the errors you and Antony report, I can't seem to reproduce them, even after setting up a course with topics.  Can one of you e-mail me a course module that exhibits this behavior? 

  --Brian
In reply to Brian Koontz

Re: Course Date Manager block

by James Robertson -

Sounds cool, but what is the course date management page & where do I access it?

Jim.

In reply to James Robertson

Re: Course Date Manager block

by Brian Koontz -
Jim--

The course date mgmt. block allows you to edit the dates for all course activities in one page, rather than having to access each individual activity. At the moment, it's available from this thread (look up-topic for the latest version)...at some point down the road I hope to have access to the contrib/ directory and place it there.

You'll need to unzip the file in your blocks/ directory.  There are a couple of language files that need to be copied to your lang/en/ directory; this is detailed in the INSTALL file after you unzip.

There is also a link in my parent post that points to quite a bit of discussion about why a course date mgmt. page is necessary, along with a couple of screenshots.

  --Brian
In reply to Brian Koontz

Re: Course Date Manager block

by James Robertson -

Having read the page discussion, I see you've added a "must-have" feature.  If I understand correctly, the block version supercedes the page version, and the latest is the Aug 6 version a few posts above.  Is that right?

Thanks,

Jim.

In reply to James Robertson

Re: Course Date Manager block

by Brian Koontz -
I certainly think it's a "must-have" feature smile  Yes, the August 6 version is the latest version.

  --Brian
In reply to Brian Koontz

Re: Course Date Manager block

by Dan Eliot -

Are there any known conflicts with the Course Date Manager block?  I installed as per instructions (twice).  The management page came up without error, but every time I "checked" a box (or all boxes) and said (for example) foward the date 364 days, nothing would happen.  I even went back to the original (pre-block) version and installed it... nothing worked.  I also tried just setting things a day or two ahead.

Every time I clicked, the page would reload with no changes to any date.

I have a Moodle 1.5.2+ installation using CVS.  I tried both Internet Explorer and Firefox (latest).  File permissions seemed good, etc.

I eventually gave up and did it via MySQL.  I would rather have used this cool interface.

Dan

In reply to Dan Eliot

Re: Course Date Manager block

by Timothy Takemoto -
I had no problems with the block at all. And this version is Japanese (unicode) compatible.

Superb, must-have block. Thank you Brian!

I attach a loose ja_utf8 translation.

I found what may be a minor bug in the breadcumbs; perhaps line ~269 should be (with the change in red)
print_header("$course->shortname: ".get_string("datesshortname","course_datemgr"), "$course->fullname", "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>","");

Tim
In reply to Timothy Takemoto

Re: Course Date Manager block

by Timothy Takemoto -
Hmm...With regard to "no problems" I spoke too soon. I am able to move the dates relative to the current date, but the absolute date setting option had no effect.
In reply to Timothy Takemoto

Re: Course Date Manager block

by Anil Sharma -

This block is important for most admins. I tried it and it does have a date problem, if the date is selected for future, it doesnt get stored. Maybe someone can fix it ?

In reply to Anil Sharma

Re: Course Date Manager block

by Timothy Takemoto -
I have just been selecting some dates in the future and it is working.

Some suggestions to further improve the functioning of this superb block

1)  Change between  relative and absolute automatically depending what the user changes.
I think that one of the problems encouraging people to think that this block does not work MAY be (in my case) that I forget to set the radio button at the top, from relative to absolute. Often, in many similar user interfaces (such as the micro soft office print window), as soon as one changes one or the other of the settings, then that setting becomes "live" as it were.

E.g. if for instance one opens up the Microsoft Word print screen, and inserts a page number into print page box, then microsoft word will actomatically print only that page, rather than require the user to also set a "use page numbers" radio  button.

So it would be great if changing any of the dates/times in the absolute date mode also made that second radio button be selected.

2) Warn if No Activities Selected.
I think that another reason why I have thought that this block does not work is because I may also have forgotten to select any activities to be changed. So if the user does not select any activities to be changed, a warning would be nice.

3) Add section numbers.
I have a long long rown of tests. To help me find them it would be nice if the section number were included in the display.

Anyway, it is a great block.

Thanks
In reply to Timothy Takemoto

Re: Course Date Manager block

by Chardelle Busch -
Picture of Core developers
I just wanted to point out a fantastic block developed by Michael Penney et al. at Humboldt.  It allows you to change all activity/resource dates by section from one page.  It also has a feature where you can choose when to have them visible.

It is called the Course_Program block and you can download it here.
In reply to Brian Koontz

Re: Course Date Manager block

by Timothy Takemoto -
I wonder if Brian's Course Date Manager Block is 1.6 compatible. It is almost essential for course management.

Tim
In reply to Timothy Takemoto

Re: Course Date Manager block

by Timothy Takemoto -
What would be absolutely great would be a function to "arrange all assigments to being at X pm on Yth day of the week, and end at Apm on the Bth day of the Nth Week after."

In my case X=6, Y=1, and A=12, B=1 and N=1

(The assigments all start at 6pm on the day of the class and end at 12 noon on the day of the next class on the next week).

Then once the weeks are all in the right places (taking into account public holidays and the like) I could arrange all the start and stop times with the click of a button.

Oh how nice that would be!

Do you, Brian, do php programming for money?
In reply to Timothy Takemoto

Re: Course Date Manager block

by Brian Koontz -
Probably not at this point, as I've yet to test it against 1.6.  I'll put it on my list of things to do.

I see the Humboldt crew now have an activity/resources app.  Anybody actually running with this?  Is there still a need for a separate course date manager block?

  --Brian
In reply to Brian Koontz

Re: Course Date Manager block

by Timothy Takemoto -

I have not tried the Humboldt application. Perhaps I should look into that. I think that it uses the calendar though, so I don't think that it is an en masse activity date changer like yours.

I wish that mod/quiz/index.php had an "Turning Editing On" button and one were able to edit start and stop dates from there. But a block would be okay too.

Alas, however, it seems that there is not a great deal of interest.

Tim

In reply to Brian Koontz

Re: Course Date Manager block

by Timothy Takemoto -

Dear Brian Koontz

Yours was my favourite block that saved me hours of work. It does not seem to be recognised as  block these days, I think.

Tim

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Timothy Takemoto -

I tried to get this working as a block in 1.6 and above again but my administration page kept disappearing, so I have patched it for release as a hack of the quiz module and tested on 1.7.

To use Brian's date manager, which allows you to change the dates of all the homework at once, using absolue and relative settings then

1) Add the following to mod/quiz/index.php
on about line 42, just before "// Get all the appropriate data"

if (isadmin()) { echo "<br /><center><a href=\"dates.php?id=".$course->id."\">Edit Dates</a></center><br />"; }

This calls Brian's date manager from the quiz index page and not from a block. At the moment only the administrator can use it. If you want teachers to use the date manager then the following should work instead.

if (isteacher()) { echo "<br /><center><a href=\"dates.php?id=".$course->id."\">Edit Dates</a></center><br />"; }

Then put the two files, attached, into the same folder mod/quiz and it is done.

I have added
1) Minor changes to get it to work with 1.7 (and probably 1.6)
2) Minor changes to get the datemanger to work in the quiz folder
3) Radio buttons to choose between absolute and relative date changing because I used to make mistakes.
4) An input field for weeks.
5) Addition of code that hopes to prevent time outs when changing the dates of many things at once.

Wish list
1) Rather than being ordered by date it would be nice if it were ordered like the quiz index.php in the order that the activities are on the course page. I may try and do this.
2) Integration into Moodle, not as a block but as a activities index or quiz index feature.

At each new term, resetting the dates for the next term can take a long time. Thanks again to Brian for creating this functionality.

Hack with care

Timothy

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Timothy Takemoto -
Course Date Manager REborn does not work when the site language is English. I am using this again to redate quizzes for the new term. I have 100 per course and at least four courses so I am very happy to be able to manage dates from one page.

The biggest problem is that it is sorted by date not section. As one changes dates therefore the positions  in the table  of the things that one has just changed changes.

As I mention above, I wish that the datemanager looked just like quiz index.php, or perhaps my extendend version of quiz/index.php

I try to amalgamate the two (index.php and dates.php) but I am not good enough at php. I append an amalgamation - an unsorted dates.php containing an extended index.php on top.  It is getting there very slowly.
In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Timothy Takemoto -

The attached looks like it is going to work, with checkboxes per section as opposed to per same-time group, but the section checkboxes do not do anything.

This is slow. Perhaps I could have changed all the dates one by one. But all the same it was a great feeling using it just now. I changed the dates of 10 quizzes just like that.  It would have taken a lot of clicks (and mistakes, and...).

It still has the "super index.php" at the bottom for information.

The enclosed zip contains
(quiz)index.php with the link
dates.php
dates.html

Timothy

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Timothy Takemoto -

I forgot to attach the files.
quiz/index.php the only change is the link
and Brians'
dates.php
dates.html
with modification to look like...(but as I say above the "select groups" only looks like it is going to work, it does not)
dates

It should have some extra group check boxes for the start dates and end dates within each section. I have indicated this in the above with the "Here" in red, but I put it on the wrong row, I should have been one above.

Moodle 1.7 has Ajax, LAMS, roles, and an xml editor, but there is no way of changing course activity dates, so that we can use our courses again the next term.

Timothy

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Wen Hao Chuang -
Just curious, what's the current status of the "Course Date Manager REborn" ?? Is someone still maintaining it? I checked with the "Moodle modules and plugins" but couldn't find any entry about this. Did this get committed into CONTRIB at all? Thanks!
In reply to Wen Hao Chuang

Re: Course Date Manager REborn

by Timothy Takemoto -

The "Course Date Manager REborn" I am using appended above is very buggy and not in contrib but it is still essential to me.

The check boxes to check a lot of boxes in the first two columns no longer work, so I have to check all the individual module boxes for which I want to change the date, which can take ages!

But it is still a lot faster than changing all the quiz boxes at once. I suggest you use Audun Hauge's version where the first two columns of check boxes still do work. I stopped using that because Audun's version orders the modules in date order rather than in course-week order so that as one changes the dates the order of the modules change, and I found that difficult to keep track of.

While in my version the modules are displayed in course week order, I failed to get the course week date to be displayed alongside the respective week. It would be very helpful if it were. This is because my workflow at the beginning of each term is

1) Backup previous course without users.
2) Restore a new empty course.
3) Create a blank holiday-less course with the 14 weeks in succession (removing the blank weeks in the previous terms course that had been added to allow for bank-holidays and other mid term holidays)
4) Add in the blank holiday weeks into the main course page appropriate to the new term. (E.g. in the current term the are three holiday weeks over Christmas and the new year between the 12th and the 14th week of the course.)
5) Make all module open close dates match the weeks that they are in.

If on the course date changer the week dates were displayed it would be a simple matter to change the open close dates to match them.

It should also be possible to do this automatically, with a "make open close dates match the week in which the modules are in so that they open at the start of the week and close at the end of it" or perhaps "make open close date match the week in which the modules are in so that they open at the start of the week and close at the start of the next week which contains course modules" (that would allow automatic adjustment over holdays too).

I am not sure how other people manage without this block. Now that moodle has been around for a while, there must be many people with a lot of content and a lot of course reuse. Reuse is good, it is one of the great advantages of CAL. When you resuse at different times of the year this means that there is a lot of date shifting. If there are no holidays during term time then you can use the database (still not all that friendly) to add X days to all the start stop dates but if there are a few "bank holidays" sprinkled in term time then a more complex mass date changer seems to be well...essential. With a couple of hundred modules in each of at least three courses it would take me days if this block did not exist.

Tim 

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Timothy Takemoto -

Is there anything to replace "Course Date Manager (REborn)" yet?

I am still could not do my job without it but it still has bugs with the checkboxes and it is still for an old version of Moodle.

By the way, someone told me a javascript bookmarklet to toggle all checkboxes on a page

Xjavascriptsadfunction(){%20function%20toggle(box){%20temp=box.onchange;%20box.onchange=null;%20box.checked=!box.checked;%20box.onchange=temp;%20}%20var%20x,k,f,j;%20x=document.forms;%20for%20(k=0;%20k<x.length;%20++k)%20{%20f=x[k];%20for%20(j=0;j<f.length;++j)%20if%20(f[j].type.toLowerCase()%20==%20"checkbox")%20toggle(f[j]);%20}%20})();

but I think in fact the first column of checkboxes does in fact work in REborn, it is the second colum, that checks groups (weeks) of modules that does not.

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Brian Koontz -
I'm almost embarrassed to ask this question, but here goes: Does anyone have the latest code for this module? I'm the original author, moved away from Moodle for a couple of years, and have now found myself back in the driver's seat on a new Moodle installation for my school district! I found some links in another thread, but they point to a website that requires authentication.
In reply to Brian Koontz

Re: Course Date Manager REborn

by Brian Koontz -
In response to my own question: I've tracked down the maintainer, and he's made the module (at least the 1.8 version) available at this link:

ftp://hobbes.dcccd.edu/pub/
Average of ratings: Useful (1)
In reply to Brian Koontz

Re: Course Date Manager REborn

by Marc Hermon -

This block is almost exactly what I needed but it's missing one thing for me. I need to be able to enable/disable the date also. This is because for most of the time I need a date on the assignments so that they display on the MyMoodle page but then I disable the date so that the stragglers can still work on them at my course page but for those that finished on time the assignments won't clutter their MyMoodle page. It's a pain to go back and disable the date for each assignment just like it used to be a pain to go back and change the due date if I wanted to push it back.  Maybe there is another way to do this but I thought I would throw this out there if anyone in Moodle Land can help me. Thanks,

Marc

In reply to Brian Koontz

Re: Course Date Manager REborn

by Michael McCoy -

Brian,

The link above appears to be broken, do you have the code available for this feature?  Or have you been able to update it for 2.0 at all?  Thanks!

Michael

In reply to Michael McCoy

Re: Course Date Manager REborn

by Timothy Takemoto -

Dear Michael McCoy

The Course Date Manager block is only available for up to 1.9.

I have a copy of the 1.9 version sent to me by  George Driscoll, who took it over from the originator, Brian above. I am asking George Driscol if he will allow me to put it on my server.

Tim
http://nihonbunka.com

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Daniel Scheidegger -

Hello Timothy

i have this Block working with Moodle 2.0 - 2.2, but only for changing Start- and Endtime of Quizzes. Interested?

In reply to Daniel Scheidegger

Re: Course Date Manager REborn

by Timothy Takemoto -

Dear Daniel,

I am a couple of months late, but yes I am interested!  I generally only
need to change the time of quizes, because Moodle is my quiz machine.

My old (1.6x) moodles are working okay, just (there are problems with drop down menus in non-compatibility mode IE9)
but the writing is on the wall, and I will have to upgrade one day.

I will try and send you an email or a pm.

Thank you.

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Timothy Takemoto -

By the way, Daniel did offer to allow me to use his block for a certain amount of money but it was beyond my budget, so I have still not upgraded!

I don't think it would be a good idea to upgrade until functionality such as this is included in the main code. Is it?

In reply to Timothy Takemoto

Re: Course Date Manager REborn

by Timothy Takemoto -

George Driscoll said it would be okay to distribute the course date manager with the proviso that it is NOT SUPPORTED. So here is the old course date manager for Moodle versions 1.8 (I think. I am using it on a very old moodle)
http://nihonbunka.com/docs/course_datemgr.zip

Oops, yes, i see that it is available from George Driscoll's institutional site above, as tracked down by Brian, the original creator.

Hi Brian, I second the question, are you making it available for 2.0?!

Glad to see you back in moodle since this module is a lifesaver for me.

And I am going to have to update one day.

Tim

In reply to Brian Koontz

Re: Course Date Manager REborn

by Jaswant Tak -
big grin big grin big grin big grin Brian you rock man,

I liked the way u said "Does anyone have the latest code for this module? I'm the original author"

Its really funny, that author is asking for updated code after 4 years smile

Cheers.
In reply to Jaswant Tak

Re: Course Date Manager REborn

by Jared Chapman -

Wow, I can't believe this is not in the core! Is there an update on this project for 2.2? This would solve a huge headache for me.