sub printAllResponses{ print <<"HTML"; HTML while ($i <= $#matchQuestionsAndAnswers){ if ($matchQuestionsAndAnswers[$i]{'datatype'} eq '1'){ print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } if ($matchQuestionsAndAnswers[$i]{'datatype'} eq '2'){ print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } $i++; } print <<"HTML";

Notes for $call{'user'} on the $call{'database'} Database


\n"; print "\n"; print "Keywords Edit Entry
\n"; foreach $kywrd (@kywrds){ $j += 1; print "$kywrd
\n"; } $j = 0; print "
\n"; print "
   \n"; print "Q: $matchQuestionsAndAnswers[$i]{'question'}

\n"; $i++; print "A: $matchQuestionsAndAnswers[$i]{'question'}\n"; print "

\n"; print "\n"; print "Keywords Edit Entry
\n"; foreach $kywrd (@kywrds){ $j += 1; print "$kywrd
\n"; } $j = 0; print "
\n"; print "
   \n"; print "Note: $matchQuestionsAndAnswers[$i]{'question'}

\n"; print "

No more notes found for user $call{'user'}
HTML } sub printSortedArray{ $keywordcount = ($#formkeys + 1); print "
\n"; print "\n"; print "\n"; print "\n"; # parsedata.pl getQuestionsForLocation print "\n"; print "\n"; print "\n"; print "\n\n
\n"; print "\n\n"; # @parsekeywords = split(/:/, $matchQuestionsAndAnswers[$i]{'keywords'}); print "$call{'user'}, your location is:
\n"; while ($i <= $#formkeys){ $j = ($i + 1); print "\n"; $formkeys[$i] =~ s/=/ = /g; print "$formkeys[$i]
\n"; $formkeys[$i] =~ s/ = /=/g; $i++; } $j = 0; $i = 0; print "


\n"; print "\n\n"; # print the array while ($i <= $#matchQuestionsAndAnswers){ # print "matchQuestionsAndAnswers $i
\n"; # print "ID: $matchQuestionsAndAnswers[$i]{'ID'}
\n"; # print "datatype: $matchQuestionsAndAnswers[$i]{'datatype'}
\n"; # print "user: $matchQuestionsAndAnswers[$i]{'user'}
\n"; # print "linkid: $matchQuestionsAndAnswers[$i]{'linkid'}
\n"; # print "$matchQuestionsAndAnswers[$i]{'question'}

\n"; if ($matchQuestionsAndAnswers[$i]{'datatype'} eq '1'){ if ($call{'user'} eq $hash{'1'}){ $k += 1; print "Question:


\n"; print "\n"; print "\n"; } else { print "Question: $matchQuestionsAndAnswers[$i]{'question'}

\n"; } #$questions--; #$ques = ($questions +1); $j = ($j + 1); if ($matchQuestionsAndAnswers[$i+1]{'datatype'} eq '3'){ print "Answer:

\n"; print "\n"; print "\n"; print "
\n"; } else { print "Answer:

\n"; print "\n"; print "\n"; print "
\n"; } $i++; } elsif ($matchQuestionsAndAnswers[$i]{'datatype'} eq '2'){ $yeah = 'yeah'; $notelocation = $i; $i++; } else { $i++; } } $i = 0; $j = 0; $k = 0; print "\n\n"; # Now we print the wildcard q's the array is full of Q's and A's in no order while ($i <= $#wildcards){ if ($wildcards[$i]{'datatype'} eq '1'){ $k += 1; if ($call{'user'} eq $hash{'1'}){ print "Question:


\n"; print "\n"; print "\n"; } else { print "Question: $wildcards[$i]{'question'}

\n"; print "\n"; } #loop through the array again, looking for the answer # if no answer, print empty answer field while ($j <= $#wildcards){ $jid = $wildcards[$j]{'linkid'}; $jid =~ s/w//; #print "jid: $jid
\n"; if (( $jid eq $wildcards[$i]{'ID'}) && ($wildcards[$j]{'datatype'} eq '3')){ print "Answer:

\n"; print "\n"; print "\n"; print "
\n"; $j = $#wildcards; $yeah2 = 'yeah'; } $j++; } $j = 0; if ($yeah2 ne 'yeah'){ print "Answer:

\n"; print "\n"; print "\n"; print "
\n"; } } $i++; } print "\n\n"; # Time to print the notes... if ($yeah ne 'yeah'){ print "
Your notes on this location:

\n"; print "\n"; } elsif ($yeah eq 'yeah'){ print "
Your notes on this location:

\n"; print "\n"; } print "\n"; print "\n"; print "
"; $j = 0; $i = 0; } sub printAddQuestionSummary{ # displays the html when a question was added. print "

$call{'user'}, The question $call{'question'} was added to the database. We also added the following keywords to the database.

\n"; print "
    \n"; while ($i <= $#formkeys){ # while looking at all the keywords $d = ($i + 1); print "\n"; print "
  1. $formkeys[$i]\n"; $i++; } print "
\n"; } sub printFinalizeAddForm{ print "

$call{'user'}, Please verify that the information you entered is correct. If it is not, use your browser's back button to fix the error

\n"; print "\n\n
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "

Question:

$call{'question'}\n"; $i = 0; print "

Keywords

\n"; print "
    \n"; while ($i <= $#formkeys){ # while looking at all the keywords $d = ($i + 1); print "\n"; print "
  1. $formkeys[$i]\n"; $i++; } print "
\n"; $i = 0; if ($keywordsfound == '1'){ print "

Other questions with the same keywords were found. Please set the order of the following questions to control how they appear together

\n"; &printSetOrderOfQuestions; # print "Hey There I am $keywordsfound"; } print "
\n"; print "
\n"; print "
\n\n\n"; } sub printSetOrderOfQuestions { # evaluates if there are any location matches in @matches and prints # form syntax to the finalize window if (@matches != ''){ &openDBhash; $i = 1; while ($i <= $#matches){ # open database back up and parse the questions that # are in matches $hashloc = $matches[$i]; $val = $hash{$hashloc}; parseDatabaseString($val); # print radio buttons to set order for each of the questions # that matched the location. $j = 1; # print the radio button for how many matches there are + current while ($j <= ($#matches + 1)){ print "$j: \n"; $j++; } print "
$parsedinfo[4]

\n"; $i++; } # print the new question and radio buttons to set order $k = ($#matches + 1); $j = 1; while ($j <= ($#matches + 1)){ print "$j: \n"; $j++; } print "
$call{'question'}

\n"; print "\n"; print "\n"; $i = 0; &closeDBhash; } } sub printHtmlHeader{ print "\n"; print "\n"; print "\n"; print "Notebook\n"; print "\n"; print "\n"; print "
\n"; } sub printHtmlFooter{ print "
\n"; print "\n"; print "\n"; } 1;