Upgrading to CAPA 5.1


--------------------------------------------------------------------------------

READ ALL INSTRUCTIONS BEFORE PRECEDING WITH THE INSTALLATION.

Please go to http://capa.msu.edu/mailman and subscribe to the CAPA Announce
email list.  Anyone interested in receiving CAPA updates and announcements
can add himself or herself to the list.  Please notify all instructors and
technical staff that will work with CAPA about adding themselves to the list.

The following installation instructions assume that whoever is upgrading
the CAPA system already has some knowledge of their operating system and
is familiar with Unix commands such as the following: cd, chown, chmod and
setting permissions, compress/uncompress, cp, ln, lpr, ls, mkdir, pwd, rm,
su, tar, and the vi editor.

In order to complete the installation, you will need to have Perl,
Ghostscript, TeTex, and a webserver (e.g. Apache) installed on your machine
(all of which can be obtained for free).  You should know where those
applications are located and where the web server's configuration files are
located (particularly srm.conf).  You should also be familiar with killing
and restarting your web daemon.

You will notice lists of files in these instructions to compare your
permissions with.  Depending on your operating system, many of your file
sizes may differ with the ones given in these instructions.  Please do
not be concerned by this.

--------------------------------------------------------------------------------

SETTING UP THE INSTRUCTOR INTERFACE AND OPTIONAL TELNET STUDENT INTERFACE

You have the option to install the telnet version of the CAPA interface.
It responds much quicker than the web, especially with a slow modem.  If
you decide not to enable this feature then skip steps 5 and 6.

Please note that in the following instructions, it is assumed that the
teacher directory is in /home.  This may not be the case with your machine
(e.g. /usr/users, /home2, etc.).  You may want to make note of this as you
read through these instructions prior to installation.

1.)  Become root and copy or move the DIST51 directory to the teacher home
directory.  Recursively change the ownership of the DIST51 directory to
teacher with group membership cai.

>chown -R teacher:cai DIST51

2.)  We first need to link up the binaries to use the instructor
interface of CAPA.  Login as root.  Change directory to /usr/local/bin
(or /usr/bin, or whatever will be the default in your users "path").
Remove all the old links to the CAPA 5.0 binaries and then symbolically
link the 5.1 binaries contained with the distribution by entering the
following commands:

> cd /usr/local/bin
> ln -s /home/teacher/DIST51/LinkToBin/quizzer .
> ln -s /home/teacher/DIST51/LinkToBin/grader .
> ln -s /home/teacher/DIST51/LinkToBin/manager .
> ln -s /home/teacher/DIST51/LinkToBin/qzparse .
> ln -s /home/teacher/DIST51/LinkToBin/allcapaid .
> ln -s /home/teacher/DIST51/LinkToBin/answers .

3.)  Check that all of the binaries in /home/teacher/DIST51/LinkToBin
have executable permissions as shown below:

>cd /home teacher/DIST51/LinkToBin
>ls -l
-rwxr-xr-x    1 teacher  cai        485095 Jul 17 14:35 allcapaid
-rwxr-xr-x    1 teacher  cai        505454 Jul 17 14:35 answers
-rwxr-xr-x    1 teacher  cai       2126685 Jul 17 14:35 grader
-rwxr-xr-x    1 teacher  cai       2267429 Jul 17 14:35 manager
-rwxr-xr-x    1 teacher  cai       2191991 Jul 17 14:35 quizzer
-rwxr-xr-x    1 teacher  cai        488366 Jul 17 14:35 qzparse

4.)  Now link up the demonstration library in the root directory.  To do this,
login as root, change to the root directory (cd /), remove the old demolibrary
link (rm demolibrary), and enter:

> ln -s /home/teacher/DIST51/demolibrary demolibrary

Check that the demolibrary in the DIST51 folder is owned by "teacher" and
has group membership "cai".

5.)  *SKIP THIS STEP IF YOU ARE NOT ENABLING THE TELNET INTERFACE*
Login as "teacher" and copy the file "capalogin" from the directory
DIST51/PutInCAPA51 into the directory /home/teacher/CAPA51.  Check
to make sure your permissions match the following:

-rwsr-xr-x    1 teacher  cai        585097 Jul 17 15:03 capalogin

Make certain that capalogin is set UID mode (there is an "s" instead
of an "x" in the user's permissions).  If not enter the following:

> chmod u+s capalogin

6.)  *SKIP THIS STEP IF YOU ARE NOT ENABLING THE TELNET INTERFACE*
For each class that telnet is enabled for, it is added as a user
to the system without a password.  The security of the system is
maintained by using capalogin as the login shell.  To set up the
demonstration class, become root then use the adduser utility to create the
user "nsc131s0".  Enter the group id the same as the instructor (cai), the
home directory to be /home/teacher/CAPA51/nsc131s0, and the login shell
to be /home/teacher/CAPA51/capalogin.  When you are prompted to
enter an initial password, hit return.  You then need to edit the
/etc/passwd file with the vipw command to remove the "Nologin" field.
(You may also need to edit the file /etc/shadow if your system uses
shadow passwords.)

For Linux systems, you will need to create the user, edit /etc/passwd
to remove the password field, change the group id number, change the home
directory and change the login shell.  You will not be prompted for these
within the utility.  Make certain the group id number is the same as the
instructor account.  Editing the passwd file is done by becoming root
using the vipw command.  (You may also need to edit the file /etc/shadow
if your system uses shadow passwords.)  Finally, you must delete the
directory created by the adduser utility, for example:

>rm -rf /home/nsc131s0

Depending on your system, you may not be allowed to add a user without a
password using the adduser utility.  If this is the case, you will need
to manually add the user with the vipw command.

Repeat the steps above for qns131s0 and xpc131s0 (do not add xns131s0 as
a user).

The correct class entries in /etc/passwd are given below: (The paths to the
home directory and login shell may differ for your system.)

nsc131s0::1004:103:Demonstration Class - Homework:/home/teacher/CAPA51/nsc131s0:
/home/teacher/CAPA51/capalogin
qns131s0::1005:103:Demonstration Class - Quizzes:/home/teacher/CAPA51/qsc131s0:/
home/teacher/CAPA51/capalogin
xpc131s0::1006:103:Demonstration Class - Exam Partial Credit:/home/teacher/CAPA5
1/xpc131s0:/home/teacher/CAPA51/capalogin

7.)  Login as teacher and create the class called nsc131s0 in teacher's
CAPA51 directory by copying this directory from DIST51/PutInCAPA51

> cd CAPA51
> cp -R /home/teacher/DIST51/PutInCAPA51/nsc131s0 nsc131s0

Then, check to be certain the owner of the nsc131s0 directory is "teacher"
with group membership "cai".

Repeat this step using the qns131s0, xns131s0, and xpc131s0 directories.

8.)  Make certain a directory named "records" exists in each of the class
directories (e.g. /home/teacher/CAPA51/nsc131s0/records). Also, make certain the
ownership of all sub-directories and files is "teacher" with group membership
"cai".  It is a good idea to check your permission with the ones below.

> cd nsc131s0
> ls -lag
total 94
drwxr-x--x    3 teacher  cai          1024 Jul 17 15:37 .
drwxr-xr-x    9 teacher  cai          1024 Jul 17 15:37 ..
-rw-r--r--    1 teacher  cai           969 Jul 17 15:37 HWTop
-rw-r--r--    1 teacher  cai          1326 Jul 17 15:37 QuizTop
-rw-r--r--    1 teacher  cai            15 Jul 17 15:37 TeXfooter
-rw-r--r--    1 teacher  cai           777 Jul 17 15:37 TeXheader
-rw-r--r--    1 teacher  cai         11418 Jul 17 15:37 capa.config
-rw-r--r--    1 teacher  cai          1388 Jul 17 15:37 classl
-rw-r--r--    1 teacher  cai            68 Jul 17 15:37 goodbye.msg
-rw-r--r--    1 teacher  cai           720 Jul 17 15:37 help.msg
-rw-r--r--    1 teacher  cai           447 Jul 17 15:37 mail.txt
-rw-r--r--    1 teacher  cai          1529 Jul 17 15:37 managermail.txt
drwxr-xr-x    2 teacher  cai          1024 Jul 17 15:37 records
-rw-r--r--    1 teacher  cai           356 Jul 17 15:37 second-login.msg
-rwxr--r--    1 teacher  cai          4870 Jul 17 15:37 set1.qz
-rw-r--r--    1 teacher  cai          2808 Jul 17 15:37 set10.qz
-rw-r--r--    1 teacher  cai          1933 Jul 17 15:37 set11.qz
-rw-r--r--    1 teacher  cai          1824 Jul 17 15:37 set12.qz
-rw-r--r--    1 teacher  cai         10114 Jul 17 15:37 set13.qz
-rw-r--r--    1 teacher  cai          3969 Jul 17 15:37 set14.qz
-rw-r--r--    1 teacher  cai          3684 Jul 17 15:37 set15.qz
-rw-r--r--    1 teacher  cai          1935 Jul 17 15:37 set16.qz
-rw-r--r--    1 teacher  cai          1454 Jul 17 15:37 set17.qz
-rw-r--r--    1 teacher  cai          1551 Jul 17 15:37 set2.qz
-rw-r--r--    1 teacher  cai          7138 Jul 17 15:37 set3.qz
-rw-r--r--    1 teacher  cai          2561 Jul 17 15:37 set4.qz
-rw-r--r--    1 teacher  cai          2106 Jul 17 15:37 set5.qz
-rw-r--r--    1 teacher  cai          2826 Jul 17 15:37 set6.qz
-rw-r--r--    1 teacher  cai          1617 Jul 17 15:37 set7.qz
-rw-r--r--    1 teacher  cai          6197 Jul 17 15:37 set8.qz
-rw-r--r--    1 teacher  cai          2751 Jul 17 15:37 11:05 set9.qz
-rw-r--r--    1 teacher  cai           293 Jul 17 15:37 third-login.msg
-rw-r--r--    1 teacher  cai           151 Jul 17 15:37 welcome.msg
>cd records
>ls -lag
total 36
drwxr-xr-x    2 teacher  cai          1024 Jul 17 15:37 .
drwxr-x--x    3 teacher  cai          1024 Jul 17 15:37 ..
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date1.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date10.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date11.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date12.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date13.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date14.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date15.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date16.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date17.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date2.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date3.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date4.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date5.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date6.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date7.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date8.db
-rw-r--r--    1 teacher  cai            74 Jul 17 15:37 date9.db
-rw-r--r--    1 teacher  cai            51 Jul 17 15:37 set1.db
-rw-r--r--    1 teacher  cai            25 Jul 17 15:37 set10.db
-rw-r--r--    1 teacher  cai            14 Jul 17 15:37 set11.db
-rw-r--r--    1 teacher  cai             8 Jul 17 15:37 set12.db
-rw-r--r--    1 teacher  cai           119 Jul 17 15:37 set13.db
-rw-r--r--    1 teacher  cai            39 Jul 17 15:37 set14.db
-rw-r--r--    1 teacher  cai            39 Jul 17 15:37 set15.db
-rw-r--r--    1 teacher  cai             8 Jul 17 15:37 set16.db
-rw-r--r--    1 teacher  cai             6 Jul 17 15:37 set17.db
-rw-r--r--    1 teacher  cai            10 Jul 17 15:37 set2.db
-rw-r--r--    1 teacher  cai             6 Jul 17 15:37 set3.db
-rw-r--r--    1 teacher  cai            12 Jul 17 15:37 set4.db
-rw-r--r--    1 teacher  cai            16 Jul 17 15:37 set5.db
-rw-r--r--    1 teacher  cai            22 Jul 17 15:37 set6.db
-rw-r--r--    1 teacher  cai             8 Jul 17 15:37 set7.db
-rw-r--r--    1 teacher  cai            77 Jul 17 15:37 set8.db
-rw-r--r--    1 teacher  cai             8 Jul 17 15:37 set9.db

9.)  The CAPA system needs to access the files just installed in the teacher
home directory.  Make sure this directory has both group and world r-x
privledges.

drwxr-xr-x    6 teacher  cai          1024 Jul 17 13:43 teacher



You will have similar files in the qns131s0, xns131s0, and xpc131s0 directories
with the same permissions.  Check those also.

The utilities for running CAPA with telnet sessions are now completely
installed.

--------------------------------------------------------------------------------
SETTING UP THE WEB VERSION OF THE CAPA INTERFACE


1.)  It is recommended that you make a backup of the teacher/PublicWeb
directory and all of it's subdirectories and files before making the
changes below.

2.)  Login in as teacher.  Remember, it is assumed that the teacher
directory is in /home which may not be the case for your machine.

3.)  Update your /home/teacher/PublicWeb/CAPA directory with the files from
DIST51/CopyToPublicWeb/CAPA directory.

Go to /home/teacher/PublicWeb/CAPA and copy ExmPanel.class, ExpPanel.class,
GLabel.class, TScore.class, help.html from the distribution.  Make sure the old
files for Glabel.class and help.html are replaced (they will have today's date
when you check permissions).  Make sure all files in this directory are owned by
teacher and have group membership cai.

> cd /home/teacher/PublicWeb/CAPA
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/ExmPanel.class .
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/ExpPanel.class .
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/GLabel.class .
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/TScore.class .
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/help.html .

4.)  Update your /home/teacher/PublicWeb/CAPA/capa-bin directory with the files
from DIST51/CopyToPublicWeb/CAPA/capa-bin directory.  Particularly, you will need
to update web.settings, capadiscuss_html, capahtml, and webpage.

> cd capa-bin
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/capa-bin/web.settings .
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/capa-bin/capadiscuss_html .
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/capa-bin/capahtml .
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/capa-bin/webpage .

5.)  Check permissions in the capa-bin directory.  Your permissions for the files
in PublicWeb/CAPA/capa-bin should like the following:

> cd capa-bin
> ls -l
-rw-r--r--    1 teacher  cai         33363 Jul 17 15:51 capadiscuss_html
-rws--x--x    1 teacher  cai        519680 Jul 17 15:51 capahtml
-rw-r--r--    1 teacher  cai           223 Jul 17 15:51 class.conf
lrwxrwxrwx    1 teacher  cai             7 Jul 17 15:51 class.html -> webpage
lrwxrwxrwx    1 teacher  cai             7 Jul 17 15:51 email.html -> webpage
lrwxrwxrwx    1 teacher  cai             7 Jul 17 15:51 getid.html -> webpage
drwxr-xr-x    2 teacher  cai          1024 Jul 17 15:51 teacher
-rw-r--r--    1 teacher  cai          4460 Jul 17 15:51 web.settings
-rws--x--x    1 teacher  cai       1141535 Jul 17 15:51 webpage

If your permissions do not match the ones above, change them so they do.

> chmod u+s capahtml
> chmod u+s webpage

You may also see files called web_access.log and ids.log in the capa-bin
directory.  These files are automatically generated by the CAPA software.

6.) The system links to the webpage program should still be there from the
previous CAPA installation.  If they do not exist, enter the following:

> ln -s webpage class.html
> ln -s webpage emailid.html
> ln -s webpage getid.html

7.)  Edit /home/teacher/PublicWeb/CAPA/capa-bin/web.settings
Change the first line:
     set machine capa2.nscl.msu.edu
To read:
     set machine your.machine.name

8.)  Edit /home/teacher/PublicWeb/CAPA/capa-bin/class.conf by adding
the following lines (note that you may have different paths than
/home/teacher):

nsc131s0         /home/teacher/CAPA51       teacher {class emailid}
qns131s0         /home/teacher/CAPA51       teacher {class}
xpc131s0         /home/teacher/CAPA51       teacher {class}

9.)  Update your /home/teacher/PublicWeb/CAPA/capa-bin/teacher directory with the
files from DIST51/CopyToPublicWeb/CAPA/capa-bin/teacher directory.  Copy the files
capasbin and capadiscuss to this directory from distribution.

> cd teacher
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/capa-bin/teacher/capasbin .
> cp /home/teacher/DIST51/CopyToPublicWeb/CAPA/capa-bin/teacher/capadiscuss .

Check that both these files are owned by teacher and have group membership cai.
These files should also have executable permission and capasbin should be set
UID (there is an "s" instead of an "x" in the owner's permissions).  If not,
enter the following:

> chmod u+s capasbin

10.)  Make the changes that you made above for the teacher directory to all
other instructor directories.  Make sure they are owned by the appropriate
instructor and have the appropriate group membership.

11.)  Go to /home/teacher/Public/demolibrary and make sure Graphics and Links
point to /demolibrary/Graphics and /demolibrary/Links.  If they point to the old
demolibrary, make changes by removing the links and adding the new ones.

> ln -s /demolibrary/Graphics Graphics
> ln -s /demolibrary/Links Links

12.)  Restart your webserver.


--------------------------------------------------------------------------------

FINAL INSTRUCTIONS

1.)  Modify /demolibrary/Tools/StdMacros

Replace the line
/LET machine_name="capa2.nscl.msu.edu"  // needed for labeling tools
With
/LET machine_name="your.machine.name"  // needed for labeling tools

2.)  Double check to be certain the ownership and group membership
for each of the files and subdirectories under the teacher account
consistently have "teacher" as owner and "cai" as group.  Also double
check that the demolibrary directory in /home/teacher/DIST51 is owned
by "teacher" and has group membership "cai".  (Note that your instructor
directories under PublicWeb/CAPA/capa-bin will be owned my the appropriate
instructory).

3.)  Make sure that the user teacher, the owner of the webserver, and
root have the commands allcapaid, perl and gs (ghostscript command) in
their path.  You can check this by using the which command.  If it is
in the user's path, you will then be shown where the directory for the
command is located.
For example:

> which perl
/usr/bin/perl

4.)  If teacher is somewhere other than /home, then you need to edit the
capa.config files in the nsc131s0, qns131s0, xns131s0, and xpc131s0 directories.
Change the following lines to refer to the correct path:

quiz_path       = /home/teacher/CAPA51/qns131s0
exam_path       = /home/teacher/CAPA51/xns131s0
supp_path       = /home/teacher/CAPA51/xpc131s0