\documentclass{pracjourn}
\usepackage{graphicx}

% from ltugboat

\def\thinskip{\hskip 0.16667em\relax}
\def\endash{--}
\def\emdash{\endash-}
\def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
\def\dash{\d@sh\nobreak\endash}
\def\Dash{\d@sh\nobreak\emdash}
\def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}}
\def\rdash{\d@sh\nobreak\endash}
\def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}}
\def\Rdash{\d@sh\nobreak\emdash}

\newcommand\acro[1]{{\small #1}\@}

\def\tubreflect#1{%
    \ifdim \fontdimen1\font>0pt
      \raise 1.75ex \hbox{\kern.1em\rotatebox{180}{#1}}\kern-.1em
    \else
      \reflectbox{#1}%
    \fi
}
\def\tubhideheight#1{\setbox0=\hbox{#1}\ht0=0pt \dp0=0pt \box0 }
\def\XeTeX{\leavevmode
  \tubhideheight{\hbox{X%
    \lower.5ex \hbox{\kern-.125em\tubreflect{E}}%
    \kern-.1667em \TeX}}}
\def\xelatex{\leavevmode
  \tubhideheight{\hbox{X%
    \lower.5ex \hbox{\kern-.125em\tubreflect{E}}%
    \kern-.1667em \LaTeX}}}
% \newcommand{\xelatex}{X\lower.5ex\hbox{\kern-.125em\tubreflect{E}}\LaTeX}

\begin{document}
\title{\LaTeX\ goes with the flow}
\author{Jim Hef{}feron}
\TPJrevision{2008}{03}{14} % The editors ask you to update this for each revision submitted
%\TPJcopyright{ } % May be used if you want a copyright notice at the bottom right of the first page
\abstract{%
One advantage of \TeX\ and friends is that they fit naturally into a
work flow where there are many tools, each good at its own job.
This paper gives an example involving
a system for doing class evaluations online.\vspace{1cm}}

\maketitle


My college gives students in every class a chance to provide feedback
on that class.
We now use a paper-based form but are looking toward
online evaluations.

Some advantages of an online system
would be: 
timeliness (reports for a class would be available immediately
after the feedback period instead of six months later),
flexibility (for instance, data could easily be tracked over time),
and customizability (more on this below).
So for the institution, all of the bullet points lead
in the same direction.

We've had no luck finding a vendor.
As one approach, I wrote some scripts.
In my system, called Sphyg, part of the job involved moving the data from
the database to the summary documents.
For that, the right tool was \LaTeX.



\section{Sketch of the system}

To understand how \LaTeX\ fits into its flow, 
we must first understand the evaluation system.
 

\subsection{Customizing the data in}
Each semester's process starts with an email to
the academic Vice President and to the Department Chairs.
This mail has a link to an online form.

For instance, the VP's form allows the input of questions that will
eventually appear on each evaluation seen by each student in each class
in the college.
These questions will appear either at 
the top of those evaluations or at the bottom.
Similarly, each Chair can enter questions for the
courses in their department. 
These questions appear either at the top of the forms, below the VP's
questions, or at the bottom above the VP's.

Each administrator's form 
comes up already filled out with last semester's questions. 
Thus
if the administrator does not respond, or makes no changes, 
then last semester's questions will
just be reused\Dash this is what will typically happen.

If they do edit the form then
for each question
there is a place to write the text of the question, such as
``I learned a great deal in this course.''
They also select among question types, 
including choose types such as choose-one-to-five, 
paragraph answer types, and many others (adding new types is easy).
For choose types they also insert a space for students to make a brief
comment.

Next, each instructor gets an email.
It has links to a page where the instructor can
add questions to the forms for their classes.
One link allows them to 
put in questions on each form for any of their students.
Other links go to different pages for each 
section that the instructor is teaching.
That is, evaluation forms can be customized not only 
by college, by department, and by instructor, 
but also by section. 
As with the administrators, if an instructor does not respond then Sphyg uses 
the questions asked last semester by this instructor on all forms. 

Now, with the forms made up, 
each student gets an email. 
It links to a page listing the student's
classes and linking to the evaluations for those classes.
Of course, students can submit at most one evaluation per section.

When the period for evaluations closes, Sphyg generates the 
reports.
Each instructor gets a summary of all responses,
for all questions, from students in each of their sections.
That summary preserves the students's anonymity.



\subsection{Customizing the data out}

As described above, the system allows extensive customization of the
input.
But the output is customized as well.

Administrators do not get the same reports as instructors.
The Vice President's report shows only the 
summaries for institution-wide questions.
And, each Department Chair's report summarizes only the questions
for the institution or for the department.
This allows the instructor to ask developmental questions
such as ``What could I have done better?''
that would not fit 
in an evaluative context.

However, this customization adds complexity to the production of 
the reports since they cannot just be forms into which the
data is inserted. 




\section{The \LaTeX\ generation}

There are many ways to get data out of a database 
and into a report.
Just to name one, the programming language Perl makes generating plain text 
reports straightforward.
But plain text has shortcomings, such as
a lack of graphics capability and colors, and
character encodings can be awkward.

I wanted the reports to be nicer than that, 
for instance to show bar charts for choice-type questions. 
That, and also that everyone can read it,
means that the natural format for the report
is \acro{PDF}.
Since direct production of \acro{PDF} would be very hard,
generating the reports using \LaTeX\ makes the most sense.

So Sphyg's document work flow is:
a Python script takes the data from the database and
outputs \LaTeX\ source files.
These are turned into a report by running them through \xelatex.
The variant \xelatex\ was chosen because it makes convenient
the use of a wider character set.

I wrote a custom \verb!.sty! file for the reports.
That means that 
less of the \LaTeX\ code is mixed in with the Python. 

Here is an example showing
part of a page, using some of the sample data.
\begin{center}
  \includegraphics[scale=.50]{Screenshot.png}
\end{center}
A number of things appear in this sample.
For instance, \LaTeX\ generates page headers that change depending on the
class section.
Also notice that the mean and standard deviation 
summary information about responses 
are given for this single section, across the department, and 
across the college.
Finally, notice the optional comment shown with the question summary
(here there is just one comment but had there been more they would have
been listed in alternate shadings).

An advantage of using \LaTeX\ in this work flow is that
some of its features make easy 
things that might otherwise be quite hard.

One example is that the document style 
uses the graphicx package to make a macro to 
draw the bar charts, as shown in the screenshot above.

Another example of leveraging \LaTeX\ 
is that the report style uses the longtable package to 
alternatively shade adjacent comments, and to  
automatically insert
``\textit{(continued on next page)}'' where appropriate.

Still another 
example is that the hyperref package makes document navigation easy.
For instance, administrative reports have a table of contents with 
a link from the 
instructor's name to the first page of the summary for that instructor.
There is also an index with a link to the summary for each section of each
course.
Those links are created automatically, obviously. 

The final aspect of the reports to note is that they
can be quite long.
The Vice President's report has a summary of
all of the college-wide questions, including students's optional comments,
for each instructor.
In the tests using dummy data this report was over a thousand pages.
While that length would  be a cause for worry with some
document-handling programs, \LaTeX\ has no trouble.
Further, compilation of the
document takes less than a minute. 





\section{Status}
Sphyg's \LaTeX\ subsystem performed flawlessly.
In particular, for the characters encountered in testing 
(only Latin-1 characters), 
\xelatex\ had no trouble at all.

The main challenge with the larger project of online evaluations is
that students do not fill them out\Dash in one of my  
experiments the most common return rate was $0\%$.
A person can reflect on the desirability of collecting 
responses that users seem not keen on giving, 
but at my college there is a mandate to be proactive
about feedback.
So we need an incentive.
One is to only allow students to see their grades 
online after they have filled out the evaluation.
That is why in the system described above students are sent to a 
page filled with links: once 
they have filled out the evaluation then in the place of the link
appears their grade.
For this incentive we must temporarily 
suppress access to the mechanism that ordinarily
allows students to see their transcript online.
At the moment the online evaluation 
initiative is stalled at this point
(our online-transcript vendor wants a great deal of money).
In short, whether Sphyg will ever get running is unclear. 

What is clear, however,
is that \LaTeX\ fits well into this kind of flow.
For example, 
if I had instead tried writing the \acro{PDF} directly from the
database then graphics and pagination would be quite a problem.
Instead, with \TeX\ and friends, it was a solved problem.
\end{document}

