Taking Math Courses Online

A Guide by Greg Landweber <greg@kaleidoscope.net>.

This guide is based on my own experiences running the Math 21a web site in the spring of 1999, under the direction of Wilfried Schmid. We distributed all course materials online, ran three computer lab sessions using Mathematica, and offered a series of online quizzes. Please feel free to take any of the materials presented here and use them in your own classes. If you have any questions, don't hesitate to e-mail me.

Table of Contents

Handouts

All of the handouts were distributed on the web, for the students to view or print out at their leisure. Most of these handouts were written using TeX, and needed to be converted to a form that students could use via the web. The two formats we used were "GIF" (Graphics Interchange Format) and "PDF" (Portable Document Format). GIFs are used for images on the web to be displayed on computer screens, while PDF is used to create high resolution images suitable for printing. In some cases, we also distributed handouts as PostScript files.

For displaying TeX files on screen, I recommend using 12 point fonts, and displaying the image at 100 DPI (dots per inch).

Converting TeX (DVI) to GIF

If you have a DVI file that you want to convert to GIF format, follow these instructions. You must do this on the Math department system, not on FAS. For some reason, the convert command does not work correctly on FAS.
  1. Convert the first page of the document from DVI to PostScript:
    dvips -pp 1 -D 300 filename
    The -D 300 parameter tells dvips to produce a PostScript file at 300 DPI (dots per inch) resolution. The normal resolution is 600 DPI, which is much more than is needed to display the file on a computer screen.

  2. Convert the PostScript file into a GIF file:
    convert -density 300x300 -geometry 33.34%x33.34% -gamma 0.7 -colors 10 filename.ps filename1.gif
    This file first renders the image at 300 DPI, but then downsamples it to 100 DPI (1/3 the original resolution) using 10 shades of gray. This is a technique called "anti-aliasing". The -gamma 0.7 setting determines the contrast of the image. Values closer to 1 give a smoother, but lighter image, while lower values give a darker, more blocky image. You should try viewing the image on several different monitors before deciding what gamma setting to use.

  3. Repeat steps (1) and (2) for each page of the document.

  4. String all of these images together in a single html file, using multiple image tags.

Converting TeX (DVI) to PDF

  1. Convert the entire document from DVI to PostScript:
    dvips filename

  2. Convert the PostScript file into a PDF file:
    ps2pdf filename.ps

Smaller GIF images

In some cases, such as for the questions in an online quiz, you will want to create smaller pictures taken from parts of a TeX document instead of converting the entire document into images. To do this, I suggest viewing the TeX file onscreen (at 100 DPI if possible), taking a screen shot, and turning that picture into a GIF file using your favorite GIF-editing application.

On a Mac, I use OzTeX to view the TeX file onscreen, with a PostScript verson of the Computer Modern fonts. For information on OzTeX and these fonts, see Gary L. Gray's Macintosh TeX/LaTeX Software Page. (If you prefer Textures or some other TeX utility, then you can use that instead.) In OzTeX, I set the configuration file to render the DVI onscreen at 100 DPI. With the DVI file showing on the screen, I take a screenshot by pressing <command>-<shift>-4 and dragging a rectangle around the portion of the document I want to convert to an image. This creates a file named "Picture 1" on your main hard disk. Then double-click that file to open it up in SimpleText, choose "Select All" from the "Edit" menu, followed by "Copy" from the "Edit" menu. The image is now on the clipboard. Next open up a GIF-editing application (I use "GifBuilder", which you can find by doing a web search, but any GIF-editing application will do), paste in your image, and save the resulting file as a GIF file. You might also want to set the transparency color of the GIF to white, which will let the web page background show through.

Online Quizzes

One of the major features of our class was a series of online quizzes. These were used to gauge how well the students understood the material and provide an incentive for them to study it. The quizzes were graded mostly based on class participation.

To implement the online quizzes, I wrote a "CGI" (Common Gateway Interface) script using the Perl language. This script handles all aspects of the quiz. It first lets the students register for the quiz, choosing a password. It also gives the online quiz and grades it automatically. Finally, it lets the TFs view the quiz results, either individually or the totals for all the quizzes.

To use this CGI script for your own web site, just download the file and read the detailed instructions at the top of the file (it is a text file). You'll need to modify a few assignments at the beginning of the code to tell it what your class is and where it should find the supporting files it needs. You should not need to modify the Perl code at all, with the possible exception of one or two lines that specify the format of the student database. (This script originally used the student database format produced by the FAS scheduling program in Spring 1999 and earlier, but FAS might be introducing a new scheduling program with a different format in future semesters.) All of this is explained in the instructions.

Here is the online quiz CGI file:

quiz.cgi

If you have any questions, please send me e-mail at <greg@kaleidoscope.net>. Paul Hsu is also familiar with Perl and the inner workings of the quiz script, so he should be able to help you out, too.

Using Mathematica

In the Spring of 1999, we gave our Math 21a students three computer labs using Mathematica. They completed these labs in the Windows computer classroom SC 120, except for one section which did the labs at home. Here is the information we put on our web site about these labs:

Mathematica Labs

If you are not familiar with Mathematica yourself, I recommend you read through this page and try out "Lab 0: Introduction to Mathematica", which is not specific to Math 21a.

Here are some of the things we learned in the process:

Homework

Since we distributed all course materials online, we put the homework assignments on the web site as well. In addition, we scanned in solutions to the homework assignments and posted them on the web site after the problems were due. Paul Hsu wrote a Perl script that automatically updated the homework web pages each day to include links to the solutions. That way, we didn't need to modify the web pages ourselves each time a problem set came due. For more information, contact Paul at <bhsu@fas.harvard.edu>.

One important issue to consider is that you want to make the problem solutions available only to Harvard students, not the general public. There are two reasons for this concern. First, students from colleges around the nation (and world) are quite good at searching the web for solutions to their homework problems. Second, we scanned many of the solutions from the instructor's version of the course textbook, and we cannot distribute those scans outside of Harvard for copyright reasons. Paul's script dealt with this by checking the internet domain each time someone requested the homework page to confirm that they were indeed within the "harvard.edu" domain. However, this caused problems for students who wanted to check their homework when they were out of town on vacations. Also, at one point the FAS server stopped resolving IP addresses into domain names, so this method stopped working. The FAS Instructor's Toolkit does provide a mechanism to restrict certain sections of your web site to the Harvard domain. This would probably be a more robust solution to this problem.