[npl] / trunk / NationalProblemLibrary / Rochester / instructiveProblems / Questionnaire1.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/Rochester/instructiveProblems/Questionnaire1.pg

Fri Jun 18 02:17:13 2010 UTC (2 years, 11 months ago) by gage
File size: 5802 byte(s)
Adding missing files that were in the CVS version of NPL


    1 ##DESCRIPTION
2 ##KEYWORDS()
3 ##  This is a questionaire regarding TA's directed to students
4 ##  who have taken a class using WeBWorK
5
6 ##ENDDESCRIPTION
7
8 DOCUMENT();
9
11 "PG.pl",
12 "PGbasicmacros.pl",
13 "PGchoicemacros.pl",
15 "PGtextevaluators.pl",
16 );
17
18 ## the following are useful short cuts which are used a lot in the TEXT section below
19 $BL2H = MODES( Latex2HTML =>"\begin{rawhtml}", HTML => '', TeX => ''); 20$EL2H = MODES( Latex2HTML =>"\end{rawhtml}", HTML => '', TeX => '');
21 @button_string = ('%0' =>0,1=>1,2=>2,3=>3,4=>4,5=>5);
22
23 $recordSubmittedAnswers =0; ## do not record answers - this is an anonymous survey 24 25 TEXT($BL2H,$EL2H); 26 27 TEXT($BEGIN_ONE_COLUMN);
28
29 TEXT(&beginproblem);
30
31 $questionnaire_text = EV3(<<'END_TEXT'); 32$BR
33 Dear Students,
34 $BR$BR
35 We would like to know how this course is going for you and what we can do to improve it.
36 The survey results are emailed to us from the address webwork~~@math.rochester.edu, so the results are completely anonymous.
37 $PAR 38 Thank you. Scott Bailey and Paul Pearson. 39$PAR
40
41 \{ $qn = 1; ''\} 42 43 44$BL2H
45 <h2>A.  Who is your professor?</h2>
46 $EL2H 47 \{ANS( anstext('A') ) ; 48 OL( 49 ans_radio_buttons( 50 1 => 'Professor Pearson (MW 3:25-4:50pm)', 51 2 => 'Professor Bailey (MWF 10-11am)', 52 ) ); 53 \} 54 55 56$HR
57 $BL2H 58 <h2>B. Who is your teaching assistant?</h2> 59$EL2H
60 \{ANS( anstext('B') ) ;
61   OL(
63   1 =>    'Alisa Thavikulwat (MW 3:25-4:50pm)',
64   2 =>    'Diana Ladkany (MWF 10-11am)',
65   ) );
66 \}
67
68
69
70 $HR 71$BL2H <h2> Please evaluate your TA each of the following: </h2> $EL2H 72$PAR
73 $BL2H 74 <TABLE BORDER CELLSPACING=1 CELLPADDING=4 WIDTH=600> 75 <TR><TD COLSPAN="2" VALIGN="TOP" >Scale: 0 no answer, 1 very poor, 2 poor, 3 OK, 4 good, 5 excellent</TD> 76 </TR> 77 78 79 <TR><TD WIDTH= "55%" VALIGN="TOP" > 80$EL2H \{ ANS( anstext(1) ); ans_radio_buttons(@button_string) \}
81   $BL2H </TD> 82 <TD WIDTH= "45%" VALIGN="TOP"> 83 1. Teaching ability 84 </TD></TR> 85 86 <TR><TD WIDTH= "55%" VALIGN="TOP" > 87$EL2H \{ ANS(anstext(2) ); ans_radio_buttons( @button_string) \} $BL2H </TD> 88 <TD WIDTH="45%" VALIGN="TOP" > 89 2. Speaking ability 90 </TD> 91 </TR> 92 <TR><TD WIDTH= "55%" VALIGN="TOP" > 93$EL2H \{ ANS(anstext(3) ); ans_radio_buttons( @button_string) \} $BL2H </TD> 94 <TD WIDTH= "45%" VALIGN="TOP"> 95 3. Accessibility during class 96 </TD> 97 </TR> 98 99 <TR><TD WIDTH= "55%" VALIGN="TOP" > 100$EL2H \{ ANS(anstext(4) ); ans_radio_buttons( @button_string) \} $BL2H </TD> 101 <TD WIDTH= "45%" VALIGN="TOP"> 102 4. Availability outside of class 103 </TD> 104 </TR> 105 106 <TR><TD WIDTH= "55%" VALIGN="TOP" > 107$EL2H \{ ANS(anstext(5) ); ans_radio_buttons( @button_string) \} $BL2H </TD> 108 <TD WIDTH= "45%" VALIGN="TOP"> 109 5. Overall evaluation 110 </TD> 111 </TR> 112 113 114 115 116 </TABLE> 117$EL2H
118 $PAR 119$PAR
120
121 $BL2H 122 <h2> 6. Please comment on your TA's teaching ability or any other subject you think appropiate.</h2> 123$EL2H
124 \{ANS(anstext(6)); ans_box( 10,80) \}
125
126
127 $PAR 128 129 Thank you very much. 130 131 132 133 END_TEXT 134 135 TEXT(MODES( HTML =>$questionnaire_text,
136             Latex2HTML => $questionnaire_text, 137 TeX => "Please answer the questionnaire on-line. Thank you." 138 )); 139 TEXT($END_ONE_COLUMN);
141   my $rh_evaluated_answers = shift; 142 my$rh_problem_state = shift;
143   my %form_options = @_;
144   my %evaluated_answers = %{$rh_evaluated_answers}; 145 my %problem_state = %$rh_problem_state;
146
147
148   # %form_options might include
149   # The user login name
150   # The permission level of the user
151   # The studentLogin name for this psvn.
152   # Whether the form is asking for a refresh or is submitting a new answer.
153
154   # initial setup of the answer
155   my %problem_result = ( score        => 0,
156                errors         => '',
158                msg          => '',
159              );
160   # Checks
161
162   my $ansCount = keys %evaluated_answers; # get the number of answers 163 unless ($ansCount > 0 ) {
164     $problem_result{msg} = "This problem did not ask any questions."; 165 return(~~%problem_result,~~%problem_state); 166 } 167 168 169 my$allAnswersCorrectQ=1;
170   my $number_of_answers =0; 171 foreach my$ans_name (keys %evaluated_answers) {
172   # I'm not sure if this check is really useful.
173       if (ref($evaluated_answers{$ans_name} ) eq 'AnswerHash' ) { # changed HASH to AnswerHash  dme 10/31/2000
174         $allAnswersCorrectQ = 0 unless( 1 ==$evaluated_answers{$ans_name}->{score} ); 175$number_of_answers++ if $evaluated_answers{$ans_name}->{student_ans};
176       } else {
177         die "Error: Answer |$ans_name| is not a hash reference\n". 178$evaluated_answers{$ans_name} . 179 "This probably means that the answer evaluator for this answer\n" . 180 "is not working correctly."; 181$problem_result{error} = "Error: Answer $ans_name is not a hash:$evaluated_answers{$ans_name}"; 182 } 183 } 184 # report the results 185$problem_result{msg} ='';
186   $problem_result{score} = 1; 187 188 # I don't like to put in this bit of code. 189 # It makes it hard to construct error free problem graders 190 # I would prefer to know that the problem score was numeric. 191 unless ($problem_state{recorded_score} =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ) { 192$problem_state{recorded_score} = 0;  # This gets rid of non-numeric scores
193     }
194     #
195   if ($allAnswersCorrectQ == 1 or$problem_state{recorded_score} == 1) {
196     $problem_state{recorded_score} = 1; 197 } else { 198$problem_state{recorded_score} = 0;
199   }
200   if ($number_of_answers > 0) { 201 mail_answers_to2('pearson@math.rochester.edu', 202 'Fall 2008 Student Survey'); 203 } 204 # !!!!!!!! You also have to modify the webworkCourse.ph file adding a line sililar to 205 #$PG_environment{'ALLOW_MAIL_TO'} = ['pearson@math.rochester.edu'];
206 # to enable email
207
208   $problem_state{num_of_correct_ans}++ if$allAnswersCorrectQ == 1;
209   $problem_state{num_of_incorrect_ans}++ if$allAnswersCorrectQ == 0;
210   (~~%problem_result, ~~%problem_state);
211 }
212