%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% exerqz.4ht                           2000-04-12-13:50 %
% Copyright (C) 1999--2000                         %
%                     Donald P. Story & Eitan M. Gurari %
%                                                       %
% This program can redistributed and/or modified under  %
% the terms of the LaTeX Project Public License         %
% Distributed from CTAN archives in directory           %
% macros/latex/base/lppl.txt; either version 1 of the   %
% License, or (at your option) any later version.       %
%                                                       %
% However, you are allowed to modify this program       %
% without changing its name, if you modify its          %
% signature. Changes to the signature can be introduced %
% with a directive of the form                          %
%            \message{signature}                        %
%                                                       %
%                             gurari@cis.ohio-state.edu %
%                 http://www.cis.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version 2000-04-12-13:50}

\def\eqXInitQuizMsg{\hbox{%
   \let\noexpand\string
   \csname eq@InitQuizMsg\endcsname}}
\expandafter\ifx \csname eq@InitQuizMsg\endcsname\relax
    \expandafter\def\csname eq@InitQuizMsg\endcsname{
        "You must initialize the Quiz! Click on "+bqlabel}
\fi
\def\eqXQuizTotalMsg{\hbox{%
   \let\noexpand\string
   \def\thequestionno{"+thequestionno+"}%
   \csname eq@QuizTotalMsg\endcsname}}
\expandafter\ifx \csname eq@QuizTotalMsg\endcsname\relax
    \expandafter\def\csname eq@QuizTotalMsg\endcsname{"Score: '
         +Score +' out of '+thequestionno+'"}
\fi
\def\eqXMadeChoice{\hbox{%
   \let\noexpand\string
   \csname eq@MadeChoice\endcsname}}
\expandafter\ifx \csname eq@MadeChoice\endcsname\relax
    \expandafter\def\csname eq@MadeChoice\endcsname{
            "You have already made a choice. Your choice was ("
            +Responses[probno]+")."
            +" Do you want to change it?"}
\fi
\expandafter\ifx \csname eqScore\endcsname\relax
    \def\eqScore{Score:}
\fi

\JavaScript-$
var QuizInitialized;
var EndQuizPushed;
var CurrentQuizNo;
var Responses;
var ResponsesAddr;
var Cor;
var CorAddr;
var qthis;
var prev_notify;
function InitializeQuiz(qtfield,mark,quizN,ansN,lbrc,rbrc) {
  Score=0;
  QuizInitialized=1;
  CurrentQuizNo=quizN;
  eval( 'document.form'+qtfield+'.'+qtfield+'.value="$eqScore";' )
  RightWrong=new Array();
  for(var i in Responses){
  if (prev_notify == 0 ) {
    ResponsesAddr[i].value=Responses[i];
  } else {
    ResponsesAddr[i].value="("+Responses[i]+")";
} }

  Responses=new Array();
  ResponsesAddr=new Array();
  for(var i in Cor){
  CorAddr[i].value=Cor[i];
}

  Cor=new Array();
  CorAddr=new Array();
  EndQuizPushed=0;
  for(var i=1; i<=ansN; i++){
     RightWrong[i]=0;
  }
}
\EndJavaScript
\JavaScript
function href(addr) { top.location.href=addr; }
\EndJavaScript
\JavaScript
function Corrections(lbl1,lbl2,quizN) {
  if ( (EndQuizPushed == 1) && ( CurrentQuizNo == quizN ) ){
    for(var i in RightWrong){
      if( (RightWrong[i]==0) ){
        var k=Cor.length;
eval('Cor[k]=thisform'+quizN+'.ans'+quizN+'x'+i+'.value');
eval('CorAddr[k]=thisform'+quizN+'.ans'+quizN+'x'+i);

        eval('thisform'+quizN+'.ans'+quizN+'x'+i+'.value= "*"');
  } }
} }
\EndJavaScript
\JavaScript
function LinkTo(addr) {
}
\EndJavaScript
\JavaScript-$
function QuizEnd(bqlabel,thequestionno,quiztotal,quizN){
  if ((QuizInitialized !=1) || ( CurrentQuizNo!= quizN )){
     alert($eqXInitQuizMsg,3);
  } else {
     eval( 'document.form'+quiztotal+'.'+quiztotal+
       '.value=$eqXQuizTotalMsg');
         QuizInitialized=-1;
         EndQuizPushed=1;
} }
\EndJavaScript

\JavaScript-$
function  ProcessQuestion
  (key,letterresp,probno,notify,bqlabel,quizN) {
    if ((QuizInitialized !=1) || ( CurrentQuizNo!= quizN )){
      alert($eqXInitQuizMsg,3);
    } else {
      if (Responses[probno] == null) {
   if (key==1) {
      Score++;
      RightWrong[probno]=1;
   }
   else
      RightWrong[probno]=0;
   if( ResponsesAddr[probno] != null ){
  if (notify == 0 ) {
    ResponsesAddr[probno].value=Responses[probno];
  } else {
    ResponsesAddr[probno].value="("+Responses[probno]+")";
} }
qthis.value = "#";  ResponsesAddr[probno]=qthis;

   Responses[probno]=letterresp;
}
else {
   if (notify==0)
      User=true;
   else
      User=confirm($eqXMadeChoice);
   if (User) {
      if (RightWrong[probno]==1) {
          if (key==0) {
            Score -= 1;
            RightWrong[probno]=0;
            if( ResponsesAddr[probno] != null ){
  if (notify == 0 ) {
    ResponsesAddr[probno].value=Responses[probno];
  } else {
    ResponsesAddr[probno].value="("+Responses[probno]+")";
} }
qthis.value = "#";  ResponsesAddr[probno]=qthis;

            Responses[probno]=letterresp;
         }
      }
      else {
          if (key==1) {
            Score++;
            RightWrong[probno]=1;
            if( ResponsesAddr[probno] != null ){
  if (notify == 0 ) {
    ResponsesAddr[probno].value=Responses[probno];
  } else {
    ResponsesAddr[probno].value="("+Responses[probno]+")";
} }
qthis.value = "#";  ResponsesAddr[probno]=qthis;

            Responses[probno]=letterresp;
         }
         else {
            RightWrong[probno]=0;
            if( ResponsesAddr[probno] != null ){
  if (notify == 0 ) {
    ResponsesAddr[probno].value=Responses[probno];
  } else {
    ResponsesAddr[probno].value="("+Responses[probno]+")";
} }
qthis.value = "#";  ResponsesAddr[probno]=qthis;

            Responses[probno]=letterresp;
         }
      }
   }
}

      prev_notify = notify;
}   }
\EndJavaScript


