Forum archive 2000-2006

christelle scharff - webwork 2 - create and delete course

christelle scharff - webwork 2 - create and delete course

by Arnold Pizer -
Number of replies: 0
inactiveTopicwebwork 2 - create and delete course topic started 12/31/2005; 3:32:51 PM
last post 1/3/2006; 3:41:21 PM
userchristelle scharff - webwork 2 - create and delete course  blueArrow
12/31/2005; 3:32:51 PM (reads: 507, responses: 2)
Hi,

I am not sure where this error comes from and need your help...

I created a course without admin. How can I add an admin to this course after it is created?

I wanted then to delete this course but got the following error message:

An error occured while deleting the course WeBWorK_Test_Course: sql_single: failed to execute SQL statement 'DROP TABLE `WeBWorK_Test_Course_problem_user`;': Unknown table 'WeBWorK_Test_Course_problem_user'

DBD::mysql::db do failed: Unknown table 'WeBWorK_Test_Course_problem_user' at /opt/webwork/lib/WeBWorK/Utils/CourseManagement/sql_single.pm line 410.

Thanks in advance,

Christelle

<| Post or View Comments |>


userSam Hathaway - Re: webwork 2 - create and delete course  blueArrow
1/3/2006; 2:13:18 PM (reads: 650, responses: 0)
Hi,

I'm assuming that you created the course without adding/specifying instructors for it. In other words, if you were using the web interface, you didn't select the "Add WeBWorK administrators to new course" option or fill in the user information "To add an additional instructor to the new course", and if you were using the command-line utility, you didn't specify the --professors option. Is this correct?

There is no easy way to add an instructor to a webwork course once it's been created except though the Classlist Editor, which requires instructor access. If you have expertise in editing MySQL databases directly, you could change the permission level of an existing user in the WeBWorK_Test_Course_permission table to 10.

You can also just remove the course directory and database tables and try again. Drop the following database tables, if they exist:

 

  • WeBWorK_Test_Course_user
  • WeBWorK_Test_Course_password
  • WeBWorK_Test_Course_permission
  • WeBWorK_Test_Course_key
  • WeBWorK_Test_Course_set
  • WeBWorK_Test_Course_problem
  • WeBWorK_Test_Course_set_user
  • WeBWorK_Test_Course_problem_user

Anyway...

This looks like it could be a bug in WeBWorK, or at least a failure to deal with some kind of error condition, but I need more information from you to figure it out.

What method did you use to create the course? Did you use the "Course Administration" web interface, or the addcourse command-line utility?

When creating the course, did you select sql_single as the database layout, or some other layout?

Did you get any errors or warnings while creating the course?

Do any of the above-listed WeBWorK_Test_Course_ tables actually exist in your webwork database?

Is the error replicable? If you create another course with no instructors, does the same thing happen? How about a course with instructors?

It would also help if I could see a copy of your system's global.conf file and the course.conf file for WeBWorK_Test_Course.

Thanks.
-sam

<| Post or View Comments |>


userMichael Gage - Re: webwork 2 - create and delete course  blueArrow
1/3/2006; 3:41:21 PM (reads: 623, responses: 0)
It's also possible that the database for the course wasn't created, even though the directory for the course was created. That's not supposed to happen anymore, if one of these can't be created then the other is not supposed to be created either, but it's possible that we missed a case. Which version of the software are you using? Is it up-to-date with the CVS, say within a few months?

With direct access to the server, there is another way to add an instructor that might be useful:

I have a file, called addAdmin with the contents:

 

##################################




$db->addUser($db->newUser(user_id=>"admin", first_name=>"Foo",
last_name=>"Bar",email_address=>"bar\@my.univ.edu",
student_id=>"admin", status=>"C",section=>"",
recitation=>"",comment=>"administrator"));



$db->addPassword($db->newPassword(user_id=>"admin",
password=>crypt("foobar", "dc")));



$db->addPermissionLevel($db->newPermissionLevel(user_id=>"admin",
permission=>"10"));




exit;
#####################################



In .../webwork2/bin there is a script: wwsh



which brings up a shell for accessing the webwork database.



I use the command:



wwsh myCourse <addAdmin



to add myself to courses which I need to fix on my server but which, for one reason or another, I'm not a member. You will need to customize the file to your user id and password.

 

Obviously this is a bit technically complicated, but it may get you out of your situation and you might find it useful in the future if you are running a lot of courses on a server.

Accessing the database directly, perhaps using something like phpMyAdmin is another option as Sam has described above.

Hope this helps.

-- Mike

<| Post or View Comments |>