Editing Course Administration

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
  +
  +
  +
= Course Administration Manual =
  +
 
This document details how to create and delete courses, import and export course databases, and perform other administrative functions.
 
This document details how to create and delete courses, import and export course databases, and perform other administrative functions.
   
Line 15: Line 19:
 
The easiest way to avoid permissions problems is to execute the command-line utilites as the same user the web server runs as. This is easily accomplised using the <code>su</code> or <code>sudo</code> commands. Assuming the web server runs as: <code>www-data</code>:
 
The easiest way to avoid permissions problems is to execute the command-line utilites as the same user the web server runs as. This is easily accomplised using the <code>su</code> or <code>sudo</code> commands. Assuming the web server runs as: <code>www-data</code>:
   
sudo -u www-data addcourse ...
 
  +
<nowiki>
  +
sudo -u www-data addcourse ...
  +
</nowiki>
   
 
Or, if sudo is not available:
 
Or, if sudo is not available:
   
su www-data -c 'addcourse ...'
 
  +
<nowiki>
  +
su www-data -c 'addcourse ...'
  +
</nowiki>
   
 
If you do not have access to <code>su</code> or <code>sudo</code>, you can run these commands as yourself, as long as you have access to the course files. One way to do this is to make yourself a member of the web server's group. This gives you access to all the same files the web server has access to. You could instead create a new group called <code>wwdata</code>, containing both the WeBWorK administrators and the web server. See the [[Administrator's Guide/Installing WeBWorK|installation manual]] for more information.
 
If you do not have access to <code>su</code> or <code>sudo</code>, you can run these commands as yourself, as long as you have access to the course files. One way to do this is to make yourself a member of the web server's group. This gives you access to all the same files the web server has access to. You could instead create a new group called <code>wwdata</code>, containing both the WeBWorK administrators and the web server. See the [[Administrator's Guide/Installing WeBWorK|installation manual]] for more information.
Line 25: Line 33:
 
If you chose this method, switch to the web server's group (or the <code>wwdata</code> group) and change your file creation mask to allow group writeability before running the command-line utilities:
 
If you chose this method, switch to the web server's group (or the <code>wwdata</code> group) and change your file creation mask to allow group writeability before running the command-line utilities:
   
newgrp www-data
 
  +
<nowiki>
umask 2
 
  +
newgrp www-data
wwdb course1 export ...
 
  +
umask 2
addcourse course2 ...
 
  +
wwdb course1 export ...
wwdb course2 import ...
+
addcourse course2 ...
...
+
wwdb course2 import ...
exit
+
...
  +
exit
  +
</nowiki>
   
 
=== Creating courses on the command-line ===
 
=== Creating courses on the command-line ===
Line 39: Line 47:
 
The simplest form of the command is:
 
The simplest form of the command is:
   
addcourse COURSEID
 
  +
<nowiki>
  +
addcourse COURSEID
  +
</nowiki>
   
 
However, you'll likely need to provide additional options.
 
However, you'll likely need to provide additional options.
Line 55: Line 65:
 
The simplest form of the command is:
 
The simplest form of the command is:
   
delcourse COURSEID
 
  +
<nowiki>
  +
delcourse COURSEID
  +
</nowiki>
   
 
Be very careful with this command: the course will be deleted immediately -- ''no questions asked!''
 
Be very careful with this command: the course will be deleted immediately -- ''no questions asked!''
Line 66: Line 78:
 
The simplest export command is:
 
The simplest export command is:
   
  +
<nowiki>
 
wwdb COURSEID export FILE
 
wwdb COURSEID export FILE
  +
</nowiki>
   
 
where COURSEID is the name of the course to export from, and FILE is the file to export to. If FILE is =-=, the data will be printed on the standard output stream.
 
where COURSEID is the name of the course to export from, and FILE is the file to export to. If FILE is =-=, the data will be printed on the standard output stream.
Line 72: Line 86:
 
You can additionally specify table names after FILE. If you do, only the data in those tables will be exported. For example, to export all user, password, and permission data from the course mth143:
 
You can additionally specify table names after FILE. If you do, only the data in those tables will be exported. For example, to export all user, password, and permission data from the course mth143:
   
wwdb mth143 export mth143-classlist.xml user password permission
 
  +
<nowiki>
  +
wwdb mth143 export mth143-classlist.xml user password permission
  +
</nowiki>
   
 
=== Importing a database on the command-line ===
 
=== Importing a database on the command-line ===
Line 80: Line 96:
 
The simplest import command is:
 
The simplest import command is:
   
wwdb COURSEID import FILE
 
  +
<nowiki>
  +
wwdb COURSEID import FILE
  +
</nowiki>
   
 
where COURSEID is the name of the course to import to, and FILE is the file to import from. If FILE is =-=, the data will be read from the standard input stream.
 
where COURSEID is the name of the course to import to, and FILE is the file to import from. If FILE is =-=, the data will be read from the standard input stream.
Line 86: Line 104:
 
You can additionally specify table names after FILE. If you do, only the data for those tables will be imported. For example, to import all abstract set data to the course calc1:
 
You can additionally specify table names after FILE. If you do, only the data for those tables will be imported. For example, to import all abstract set data to the course calc1:
   
wwdb calc1 import calc1-sets.xml set problem
 
  +
<nowiki>
  +
wwdb calc1 export calc1-sets.xml set problem
  +
</nowiki>
   
 
The <code>-f</code> switch allows <code>wwdb</code> to overwrite records already in the database with the versions in the XML file. If this switch is not given, duplicate records are skipped.
 
The <code>-f</code> switch allows <code>wwdb</code> to overwrite records already in the database with the versions in the XML file. If this switch is not given, duplicate records are skipped.
Line 92: Line 112:
 
== The web interface ==
 
== The web interface ==
   
The web interface provides a user-friendly way to adminstrate courses. It also allows people who do not have accounts on the WeBWorK server to administrate. Because all actions are performed by the web server, there is no concern about [[#Permissions_issues|permissions problems]] as there is with the command-line utilities.
+
The web interface provides a user-friendly way to adminsitrate courses. It also allows people who do not have accounts on the WeBWorK server to administrate. Because all actions are performed by the web server, there is no concern about [[#Permissions_issues|permissions problems]] as there is with the command-line utilities.
   
 
=== The 'admin' course ===
 
=== The 'admin' course ===
   
Access to the web-based course administration tools is controlled by a special course named <code>admin</code>. The instructors in this course are permitted to perform administrative functions. If the <code>admin</code> course exists, a '''Course Administration''' link will appear on the WeBWorK home page (usually <code>http://your.server.edu/webwork2</code>).
+
Access to the web-based course administration tools is controlled by a special course named <code>admin</code>. The instructors in this course are permittied to perform administrative functions. If the <code>admin</code> course exists, a '''Course Administration''' link will appear on the WeBWorK home page (usually <code>http://your.server.edu/webwork2</code>).
   
 
Create the admin course using the command-line <code>addcourse</code> tool. The file <code>adminClasslist.lst</code> contains a single user, <code>admin</code>, with password <code>admin</code>.
 
Create the admin course using the command-line <code>addcourse</code> tool. The file <code>adminClasslist.lst</code> contains a single user, <code>admin</code>, with password <code>admin</code>.
   
 
If you are using WeBWorK 2.1 or later, we suggest you use the <code>sql_single</code> database layout (if you are using WeBWorK 2.2 or later, only <code>sql_single</code> is supported):
 
If you are using WeBWorK 2.1 or later, we suggest you use the <code>sql_single</code> database layout (if you are using WeBWorK 2.2 or later, only <code>sql_single</code> is supported):
 
  +
<nowiki>
cd /opt/webwork2/courses
+
cd /opt/webwork2/courses
addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admin
+
addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admin
  +
</nowiki>
   
 
After you create the course, visit the WeBWorK home page on your server, usually located at http://your.server.edu/webwork2. Click on the '''Course Administration''' link. You can also access the <code>admin</code> course directly, at http://your.server.edu/webwork2/admin.
 
After you create the course, visit the WeBWorK home page on your server, usually located at http://your.server.edu/webwork2. Click on the '''Course Administration''' link. You can also access the <code>admin</code> course directly, at http://your.server.edu/webwork2/admin.
Line 153: Line 173:
 
To convert a course database:
 
To convert a course database:
   
sql2sql_single course_name webwork root SeCrEt
 
  +
<nowiki>
  +
sql2sql_single course_name webwork root SeCrEt
  +
</nowiki>
   
 
Where <code>course_name</code> is the name of an <code>sql</code> course to convert, <code>webwork</code> is the name of the <code>sql_single</code> database, and <code>root</code> and <code>SeCrEt</code> are respecively the username and password of the SQL admin account.
 
Where <code>course_name</code> is the name of an <code>sql</code> course to convert, <code>webwork</code> is the name of the <code>sql_single</code> database, and <code>root</code> and <code>SeCrEt</code> are respecively the username and password of the SQL admin account.
Line 161: Line 183:
 
In <code>course.conf</code>, there should be lines like:
 
In <code>course.conf</code>, there should be lines like:
   
$dbLayoutName = 'sql';
 
  +
<nowiki>
*dbLayout = $dbLayouts{$dbLayoutName};
 
  +
$dbLayoutName = 'sql';
  +
*dbLayout = $dbLayouts{$dbLayoutName};
  +
</nowiki>
   
 
You must change these lines to:
 
You must change these lines to:
   
$dbLayoutName = 'sql_single';
 
  +
<nowiki>
*dbLayout = $dbLayouts{$dbLayoutName};
 
  +
$dbLayoutName = 'sql_single';
  +
*dbLayout = $dbLayouts{$dbLayoutName};
  +
</nowiki>
   
 
The following sed(1) command may be of use:
 
The following sed(1) command may be of use:
   
sed 's/sql/sql_single/' < course.conf > course.conf.new
 
  +
<nowiki>
mv course.conf course.conf.old
+
sed 's/sql/sql_single/' < course.conf > course.conf.new
mv course.conf.new course.conf
+
mv course.conf course.conf.old
  +
mv course.conf.new course.conf
  +
</nowiki>
   
 
=== Adding indexing to an existing course ===
 
=== Adding indexing to an existing course ===
Line 185: Line 211:
 
To add indices:
 
To add indices:
   
wwaddindexing course_name
 
  +
<nowiki>
 
  +
wwaddindexing course_name
[[Category:Administrators]]
 
  +
</nowiki>

Please note that all contributions to WeBWorK_wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see The WeBWorK Project wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)