#!perl $temp=$ENV{'QUERY_STRING'}; @pairs=split(/&/,$temp); foreach $item(@pairs) { ($key,$content)=split (/=/,$item,2); $content=~tr/+/ /; $content=~ s/%(..)/pack("c",hex($1))/ge; $fields{$key}=$content; } ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $user = $fields{'name'}; if ($user) { &PrintResponsePage; &WriteOut; } else { &NoName; } # subroutines sub PrintResponsePage { print <Music 190W Chapter 5 Quiz Response

Music 190W Chapter 5 Quiz Results

Hi there, $fields{'name'}, whose e-mail address is <$fields{'email'}>.

ENDPRINT $q = 0; # number of questions answered correctly $t = 17; # total number of questions $score = 0; # score on the test to be converted into percent $x = 1; # the question number $a = 0; # the answer number # be sure to update answer key for each new week @ans = ("b","d","c","c","b","d","b","b","c","c","c","b","a","a","b","b","c"); while ($x != 18) { if ($fields{$x} eq @ans[$a]) { print "Question $x is correct.

\n"; ++$q; } else { print "Question $x is incorrect.

\n"; } ++$x; ++$a; } $score = $q / $t; $score = $score * 100; print "Your score on this quiz is $score%.\n"; if ($score != 100) { print <Please review the questions you missed and try this quiz again in order to reach the writing assignment prompts.

Use Netscape's Back button to return to your quiz.

E-mail Prof. Murphy if you have questions

ENDPRINT } else { print < Choose one prompt and write a 1-page essay. Since the quiz is late in appearing on the web, the Monday group may turn in its papers by Wednesday, either in class or in my mailbox. The Wednesday and Friday groups should turn their papers in at their week 6 class meeting. No late papers will be accepted.

  1. Compare the religious music we studied in this chapter with the folk music we studied in chapter 4. How are they similar and different? Use specific references to songs in your answer.

  2. Think about the purpose served by the religious music we've studied. What is it about the music (both words and music) that helps it serve that purpose?

  3. Think about the music we've studied along with the video excerpts I presented in class. What common characteristics can you identify in the examples we saw and heard during week 5? What did you gain in understanding by being able to see videos of religious music in performance?

E-mail Prof. Murphy if you have questions

ENDPRINT } print "\n"; } sub NoName { print <No Name Entered

You can take the quiz as many times as you like.

I do ask, however, that you enter your name at the top of the quiz form.

Netscape's Back button will return you to your quiz.

Prof. Murphy

ENDPRINT print "\n"; } sub WriteOut { $when = localtime(time); open(OUTFILE, ">>$fields{'name'}.wk5log") || die "Sorry, I couldn't open that file for writing\n"; print OUTFILE "$fields{'name'}, whose SSN is $fields{'ssn'}, has taken the chapter 5 quiz at $when.\n"; &PrintOutResponse; close(OUTFILE); open(REPORTFILE,">>quiz5log.txt") || die "Sorry, I couldn't open the log file.\n"; print REPORTFILE "$fields{'name'} | $score% | $when | $ENV{'HTTP_USER_AGENT'}\n"; close REPORTFILE; } sub PrintOutResponse { $q = 0; # number of questions answered correctly $t = 17; # total number of questions $score = 0; # score on the test to be converted into percent $x = 1; # the question number $a = 0; # the answer number @ans = ("b","d","c","c","b","d","b","b","c","c","c","b","a","a","b","b","c"); while ($x != 18) { if ($fields{$x} eq @ans[$a]) { print OUTFILE "Question $x is correct.\n"; ++$q; } else { print OUTFILE "Question $x is incorrect.\n"; } ++$x; ++$a; } $score = $q / $t; $score = $score * 100; print OUTFILE "The score on this quiz is $score%.\n\n"; }