WeBWorK Main Forum

deleting old courses

deleting old courses

by Clinton Ferreira -
Number of replies: 2
I've just taken over maintaining Webwork for my department and I'd like to tidy it up a little by deleting some of the older courses that were created for testing and are no longer being used.

The problem is that, despite having Administrator access, I don't have access to those courses specifically and no one here remembers the log on details to give me that access so when I try to delete the old courses, Webwork gets rid of some of the content but not all of it, saying 'Permission denied'. So, when I log in as Admin, Webwork lists the course as deleted but it's still actually there.

Is there anything you can suggest to get rid of these old courses?

Thanks in advance.
In reply to Clinton Ferreira

Re: deleting old courses

by Gavin LaRose -
Hi Clinton,

It sounds to me as if some of the old courses were created by copying files into the course directories rather than working exclusively through the WeBWorK GUI. If that's correct, then from within WeBWorK you won't (barring finding a permission-escalating exploit in WeBWorK or apache) be able to clear out the courses. However, your system administrator (or someone who has root access to the server) can help resolve it. I don't remember if the system first deletes files or database entries; the safest way to try and delete the courses that you've already had errors on is probably to have your system administrator reset the permissions on all files in the course directory so that they're owned by the user that the webserver runs as, and then to try to delete them from within WeBWorK again.

On most systems, the course directory is probably /opt/www/webwork/courses or /var/www/webwork/courses, and the webserver probably runs as "apache" or "http", so that running the command

chown -R apache /opt/www/webwork/courses

(or the equivalent) should make it so that the WeBWorK administrator can clear out courses from within WeBWorK.

I hope that helps,
Gavin
In reply to Clinton Ferreira

Re: deleting old courses

by Michael Gage -
I'll echo Gavin's comments. I'm pretty sure that what has happened in your case is that the mysql database data for the course has been removed, but not the actual directories.

The cleanest workaround is to change permissions on the directories as Gavin describes and then delete the course again from the web interface.

-- Mike