WeBWorK Main Forum

Error message when deleting course with more than one contact in admin course

Error message when deleting course with more than one contact in admin course

by Andras Balogh -
Number of replies: 1

Fresh v. 2.19 installation. 

Deleting a course seems to leave the instructor in the user list of the admin course. Then, when I add a new course with the same name but a different instructor, a second instructor is recorded for the same course.  Finally, when I delete the course again, an error message is generated complaining about incorrect number of contacts. The course seems to get deleted correctly, and I can manually delete the contacts in the admin course.

Error messages

Incorrect number of contacts for the course tmp_course: contact1_tmp contact2_tmp at /app/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm line 893.

Context

  • 888: 	} else {
  • 889: 		# Mark the contact person in the admin course as dropped.
  • 890: 		# Find the contact person for the course by searching the admin classlist.
  • 891: 		my @contacts = grep {/_$delete_courseID$/} $db->listUsers;
  • 892: 		if (@contacts) {
  • 893: 			die "Incorrect number of contacts for the course $delete_courseID: " . join(' ', @contacts)
  • 894: 				if @contacts != 1;
  • 895: 
  • 896: 			# Mark the contact person as dropped.
  • 897: 			my $User = $db->getUser($contacts[0]);
  • 898: 			$User->status(($ce->status_name_to_abbrevs('Drop'))[0]);

In reply to Andras Balogh

Re: Error message when deleting course with more than one contact in admin course

by Glenn Rice -

This is probably a rather old bug.  That code hasn't changed in a long time (since 2006).

 Although it will not happen with the next release of WeBWorK.  That code has been entirely removed.  As of the next release, users will no longer be created in the admin course when a course is created, and of course, that means users will not be dropped when a course is deleted.  There is no reason for those users.