Non-core contributed modules

A script that does 3 main things: Creates tutor/tutee links, Creates metacourse links and imports attendance data

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.1
  • Fix Version/s: None
  • Component/s: Add a project here
  • Labels:
    None
  • Environment:
    Currently only works with MySQL
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

This is a script designed to be run in addition to the built in cron.php (athough there is no reason it cannot be appended to the existing one), once a day should be plenty.

It takes 3 csv files (currently need to be called /home/moodledata/mikecsv/attendance.txt meta.txt and tutor.txt) which are in the following format without header rows:

=metacourse links=

coursecode of course,classcode of class

=Tutor/student links=

idnumber of tutor,idnumber of student

=Attendance=

coursecode of course,idnumber of student,YYYY MM DD HH MM,mark

It then:

Makes the tutor the mentor of each student as listed in tutor.txt
Links the courses (moodle metacourses) with the classes (moodle courses) and deletes courses for which there is only a single class
Imports the attendance data, creating attendanceactivities and sessions where required.

It requires a tutor role and an attendance user (with permission to take attendance) to be created before running the script

There are a few issues with it that need addressing though- the DB credentials are currently stored in this file rather than being pulled in from config.php, configuration for user details and translating the attendance codes are hardcoded and difficult to find if not familiar with the code, and it directly uses MySQL rather than going through moodle are the 3 main ones I know of

  1. cron.php
    07/Jan/09 12:04 AM
    8 kB
    Mike Worth
  2. cron.php
    19/Aug/08 4:34 PM
    12 kB
    Mike Worth

Issue Links

Activity

Hide
Mike Worth added a comment -

Oops- I've just realised this was supposed to go in the CONTRIB section but I've mistakenly put it here. Sorry

Show
Mike Worth added a comment - Oops- I've just realised this was supposed to go in the CONTRIB section but I've mistakenly put it here. Sorry
Hide
Mike Worth added a comment -

Fixed the credentials issue- I now have a copy that imports them from config.php (as long as it can be found at /usr/share/moodle/config.php) I'll wait until this has been put in contrib before I start plastering code everywhere though

Mike

Show
Mike Worth added a comment - Fixed the credentials issue- I now have a copy that imports them from config.php (as long as it can be found at /usr/share/moodle/config.php) I'll wait until this has been put in contrib before I start plastering code everywhere though Mike
Hide
Tim Hunt added a comment -

Moving to contrib, as per comment.

Show
Tim Hunt added a comment - Moving to contrib, as per comment.
Hide
Mike Worth added a comment -

I've started work on separating these 3 scripts and integrating them into moodle.

This cron.php file is to go in blocks/mrbs, then by adding " $this->cron=300;" to the blocks init() and the function " function cron(){ global $CFG; include($CFG->dirroot.'/blocks/mrbs/cron.php'); }" to the mrbs_block class it is run by moodle's cronjob.

I've also added "$settings->add(new admin_setting_configtext('cronfile', get_string('cronfile', 'block_mrbs'),get_string('cronfiledesc', 'block_mrbs'), NULL, PARAM_TEXT));
$settings->settings->cronfile->plugin='block/mrbs';" to the bottom of mrbs/settings.php so that the location of the csv file can be specified.

Show
Mike Worth added a comment - I've started work on separating these 3 scripts and integrating them into moodle. This cron.php file is to go in blocks/mrbs, then by adding " $this->cron=300;" to the blocks init() and the function " function cron(){ global $CFG; include($CFG->dirroot.'/blocks/mrbs/cron.php'); }" to the mrbs_block class it is run by moodle's cronjob. I've also added "$settings->add(new admin_setting_configtext('cronfile', get_string('cronfile', 'block_mrbs'),get_string('cronfiledesc', 'block_mrbs'), NULL, PARAM_TEXT)); $settings->settings->cronfile->plugin='block/mrbs';" to the bottom of mrbs/settings.php so that the location of the csv file can be specified.
Hide
Mike Worth added a comment -

CONTRIB-1025 is a re-write of the tutor link functionality of this script. It has to have the csv manually uploaded, but adding a cronjob to that to check for files and process them is both fairly easy and a lot cleaner than this script.

Show
Mike Worth added a comment - CONTRIB-1025 is a re-write of the tutor link functionality of this script. It has to have the csv manually uploaded, but adding a cronjob to that to check for files and process them is both fairly easy and a lot cleaner than this script.
Hide
Anthony Borrow added a comment -

Mike - I think I like the block approach better. What would you like me to do with this cron.php file? Peace - Anthony

Show
Anthony Borrow added a comment - Mike - I think I like the block approach better. What would you like me to do with this cron.php file? Peace - Anthony
Hide
Mike Worth added a comment -

Re-doing the other functions of this script into nicer blocks is on my todo list; at a guess if it's left open then once I re-do it it can be marked as resolved by that. I don't have much experience with trackers so feel free to do something else if I've misunderstood how this whole thing works.

Show
Mike Worth added a comment - Re-doing the other functions of this script into nicer blocks is on my todo list; at a guess if it's left open then once I re-do it it can be marked as resolved by that. I don't have much experience with trackers so feel free to do something else if I've misunderstood how this whole thing works.
Hide
Anthony Borrow added a comment -

There are several options, you can create a couple sub-tasks and work on those until this is resolvable, or you can just consider that work part of resolving it. In either case, I'm just going to assign this issue to you to work on and then when you have code that is ready you can let me know and we will handle it from there. I'm trying to work through the issues that have been assigned to me. Peace - Anthony

Show
Anthony Borrow added a comment - There are several options, you can create a couple sub-tasks and work on those until this is resolvable, or you can just consider that work part of resolving it. In either case, I'm just going to assign this issue to you to work on and then when you have code that is ready you can let me know and we will handle it from there. I'm trying to work through the issues that have been assigned to me. Peace - Anthony
Hide
Anthony Borrow added a comment -

as for not having much experience with tracker issues feel free to play around with this one. Let me know if you have any questions. Peace - Anthony

Show
Anthony Borrow added a comment - as for not having much experience with tracker issues feel free to play around with this one. Let me know if you have any questions. Peace - Anthony
Hide
Anthony Borrow added a comment -

re-assigning to you

Show
Anthony Borrow added a comment - re-assigning to you
Hide
Mike Worth added a comment -

Metacourse linking feature (although not removal of redundant metacourses) has been re-written into a separate block

Show
Mike Worth added a comment - Metacourse linking feature (although not removal of redundant metacourses) has been re-written into a separate block
Hide
Mike Worth added a comment - - edited

I've written the mrbs, tutor link and metalink functionality into other blocks. The attendance needs redoing to work with the new attendance module anyway. I won't have time to do that before my contract finishes; Mark Johnson, my replacement, will probably do that this summer.

Show
Mike Worth added a comment - - edited I've written the mrbs, tutor link and metalink functionality into other blocks. The attendance needs redoing to work with the new attendance module anyway. I won't have time to do that before my contract finishes; Mark Johnson, my replacement, will probably do that this summer.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: