UNIX Users and Groups
Create local user accounts for the instructor and TAs for this course.
Create new groups for this course (the exact names are not prescribed):
addgroup <COURSE> addgroup <COURSE>_tas_www
If you plan to retain read-only archives of previous semesters for plagiarism comparison purposes, you may also want to add a group of just those that need access to the archives
Our policy is that all current / recent / future instructors for a course are in the archive group and permissions for all folders and files from old semesters are changed to allow read only access by the archive group. If a head TA will be running plagiarism detection or needs access to old files, the head TA will be added to the archive group for that semester, but by default head TAs are not added to the archive group.
Add the instructors into the course groups:
adduser <INSTRUCTOR> <COURSE> adduser <INSTRUCTOR> <COURSE>_tas_www adduser <INSTRUCTOR> <COURSE>_archive
Add the TAs into the course group:
adduser <TA> <COURSE>_tas_www
Add special users
adduser hwphp <COURSE>_tas_www adduser hwcron <COURSE>_tas_www adduser hwcgi <COURSE>_tas_www
NOTE: After adding the
hwphpuser to a new course group, you’ll need to restart fpm to ensure that the webpage sees the change:
sudo service php7.0-fpm restart
Give permissions to create new users and update apache configurations
Add the instructor (and head TA) to the course_builders group:
adduser <INSTRUCTOR> course_builders
OPTIONAL: Create a private directory/repository for the course to store custom gradeable autograding configurations. For example:
sudo mkdir /var/local/submitty/private_course_repositories/<COURSE_NAME> sudo chown -R <INSTRUCTOR>:<COURSE> /var/local/submitty/private_course_repositories/<COURSE_NAME> sudo chmod -R 770 /var/local/submitty/private_course_repositories/<COURSE_NAME> sudo chmod -R g+s /var/local/submitty/private_course_repositories/<COURSE_NAME>
OPTIONAL: It has been helpful to create a dummy student account for each instructor for testing purposes (e.g.
Prepare the course directory and course database
If the top level
submittydatabase does not exist, that must be created first. For more information: Database Overview
Run the create_course.sh script to create each new course. For example:
sudo /usr/local/submitty/sbin/create_course.sh <SEMESTER> <COURSE> smithj <COURSE>_tas_www
This creates a course for the Fall 2016 semester, with course ID
<COURSE>, head instructor
smithjand TA group
Note: The TA group must contain the head instructor, any other instructors or head TAs who will help with configuration or builds of the homework, and the special users
hwcgi. Also the instructor must be part of the
Note: You will sometimes need to restart PHP-FPM after adding a course.
sudo service php7.0-fpm restart
You can confirm that a directory has been created and populated with initial files in the data directory. For this example (if you chose the default data directory location) the directory files will be here:
The create course script also creates and populates the course database. You can confirm that the database was created and populated by looking at the database
sudo su postgres psql \c submitty_<SEMESTER>_<COURSE> \dt \q
For more information: Database Overview
Add the instructor(s) to both the top level and course database:
sudo /usr/local/submitty/sbin/adduser.py --course <SEMESTER> <COURSE> null <USERNAME>
This script will ask for more information about the user interactively.
Create registration section(s):
sudo su postgres psql -d submitty_<SEMESTER>_<COURSE> -c "insert into sections_registration(sections_registration_id) values(<SECTION>);"
NOTE: Instructors can now add registration sections (and delete registration sections that have no registered students) through the Submitty website.
The instructor can add all other users (students, graders, other instructors) to the course by uploading a csv through the website.
Alternatively, students can be automatically added by connecting to data from the university registrar:
using registration data feed
Clean up Existing Course
If desired, delete course directory:
Note: Course directory can remain, which is useful for archive or plagiarism detection between semesters.
If desired, dump contents of course database as a backup:
FIXME: FILL IN THESE INSTRUCTIONS
Remove course database:
sudo su postgres psql -d postgres -c "DROP DATABASE submitty_<SEMESTER>_<COURSE>;"
It may be necessary to first cleanup connections:
sudo su postgres psql -d postgres -c "SELECT *, pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = 'submitty_<SEMESTER>_<COURSE>';"
Remove the course and the association from all users to the course from the master database:
sudo su postgres psql -d submitty -c "DELETE FROM courses_users WHERE semester='<SEMESTER>' AND course='<COURSE>'; DELETE FROM courses WHERE semester='<SEMESTER>' AND course='<COURSE>';"