changed mysql queries to moodle data manipulation functions, took away 'week based' file as it is no longer required