Forum archive 2000-2006

Michael Gage - Creating a new (mysql) course in WeBWorK2.0

Michael Gage - Creating a new (mysql) course in WeBWorK2.0

by Arnold Pizer -
Number of replies: 0
inactiveTopicCreating a new (mysql) course in WeBWorK2.0 topic started 6/26/2003; 1:33:23 PM
last post 6/26/2003; 1:33:23 PM
userMichael Gage - Creating a new (mysql) course in WeBWorK2.0  blueArrow
6/26/2003; 1:33:23 PM (reads: 724, responses: 0)

Notes on creating a new mysql course

June 26, 2003

This assumes that mysql is already set up along with WeBWorK2.0 and that they are talking to each other.

In addition this a record of what I'm doing (minus some mistakes and backtracks) and as such is only a rough guide to how things will work on another machine. This is definitely not a tutorial

Create a course directory where ever courses are stored
mkdir /webwork/shared-courses/daemon_course
Create html, template and tmp directories
cd daemon_course
mkdir html
chmod 755 html
mkdir templates
chmod 775 templates (webserver must create directories in templates
cd html (tmp directory goes inside html)
mkdir tmp
chmod 777 tmp
Grab a copy of course.conf.dist and make a local copy (I had to grab the copy from rochester_problib -- we'll put one in conf eventually.)
cp ??/conf/course.conf.dist course.conf
Make a direct link to the daemon_course/html directory
from shared-course-links type
ln -s ../shared-courses/daemon_course/html daemon_course
Test the course
http://webwork3.math.rochester.edu:11002/webwork2/daemon_course/
Should get an error message
error instantiating DB schema WeBWorK::DB::Schema::SQL for table problem: etc. etc.
Create a table in the mysql database
from webwork-modperl/doc/devel directory
Create a copy of new-DB-sql with !!COURSENAME!! replaced by your couse name (e.g. daemon_course)
cat new-DB-sql | sed 's/!!COURSENAME!!/daemon_course/' ( this will be piped to the terminal so you can check the result)
cat new-DB-sql | sed 's/!!COURSENAME!!/daemon_course/' | sudo -H mysql (puts the table in the database
Test the data base
sudo -H mysql
show databases;
webwork_daemon_course is listed
use webwork_daemon_course;
						+---------------------------------+
| Tables_in_webwork_daemon_course |
+---------------------------------+
| key_not_a_keyword |
| password |
| permission |
| problem |
| problem_user |
| set_not_a_keyword |
| set_user |
| user |
+---------------------------------+
Create a user (yourself) for this course
wwdb daemon_course addUser '{user_id="gage" last_name="Gage" first_name="Michael" }'
Create a password
suppose the password you want to use is "foobar" (without the quotes). You first need to create an encrypted version of this password. Use the following command
perl -e 'print crypt( "foobar", "a5"), "\n";'
which calls on perl to encrypt your password. The two letter salt (a5) can be any two alphanumeric characters
the response will be something like : a5l15e5d4wxj.
wwdb daemon_course addPassword '{user_id="gage" password="a5l15e5d4wxj." }'
Set professor level permissions
wwdb daemon_course addPermissionLevel '{user_id="gage" permission="10" }'
If you make a mistake use 'put' instead of 'add' to change one of these values
Now try to login in to the course again
http://webwork3.math.rochester.edu:11002/webwork2/daemon_course/
You should be able to enter your user ID and password, but there will of course not be any sets built.
Build the 0 set
Click on instructor on the left hand side
Click on "problem sets" in the main page
fill in new set name as 'set0" and click create
Click on "set0" in the list of created sets
Set due date time and answer date time far in the future
Click on "save set"
click on "edit problems for set"
Choose set0 from the list and click open/add
Choose problems (other than CVS, paperHeader, and screenHeader) using shift select and drag -- then click on open/add. Note this won't work for prob4 which is a directory containing additional files. You will have to add it separately.

<| Post or View Comments |>