Course creators and deleting courses

Course creators and deleting courses

by Julie Voce -
Number of replies: 5

We've assigned course creators within categories and would like them to be able to delete courses within their categories as well. I've tried modifying the role to add 'delete courses' both within the category and in the global permissions, but there doesn't seem to be an option available to the course creator to delete a course.

How would they delete courses? Am I missing something obvious?

Thanks,
Julie

Average of ratings: -
In reply to Julie Voce

Re: Course creators and deleting courses

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Julie,

As far as I know, course creators can delete courses, though there is no GUI for them to do so. A workaround is to edit a course for deletion's URL i.e. change http://yourmoodlesite.org/course/view.php?id=4 in your browser's address bar to http://yourmoodlesite.org/course/delete.php?id=4.
Average of ratings: Useful (2)
In reply to Helen Foster

Re: Course creators and deleting courses

by Julie Voce -
Thanks Helen!
In reply to Julie Voce

Re: Course creators and deleting courses

by Ray Lawrence -
Just been trying this out. It seems that the person assigned as course creator e.g. globally, must also be assigned as a teacher in the course to be deleted (phew!).
Average of ratings: Useful (1)
In reply to Helen Foster

Re: Course creators and deleting courses

by Jit San Chia -

To create a simple GUI for course creators to delete a course, you may want to try this. It creates a "delete this course" link in the administration block of the course:

In the file block_admin.php under moodle/blocks/admin, add these few lines towards the end of the file (just before the line: "/// Should the following two be in this block?"):

  if (has_capability('moodle/course:create', $context) and has_capability('moodle/course:manageactivities', $context)) {
      $this->content->items[]='<a href="'.$CFG->wwwroot.'/course/delete.php?id='.$course->id.'">'."delete this course".'</a>';
   $this->content->icons[]='<img src="'.$CFG->pixpath.'/i/cross_red_big.gif" class="icon" alt="" />';
  }

In reply to Jit San Chia

Re: Course creators and deleting courses

by Friedi Reisdorf -
Maybe better is "if has_capability('moodle/course:delete', $context)" (not "if (has_capability('moodle/course:create', $context) and has_capability('moodle/course:manageactivities', $context))" ).
And then you can as admin better manage it under Administration > Users > Permissions > Define Roles .. radio button course delete.

Warm greetings.