#!/usr/local/bin/perl # Name: Form.cgi # Author: Dave Doyle # # Version: 1.0 # Last Modified: 8/25/97 # # Purpose: Creates forms for students to be able to evaluate their # instructors # $| = 1; #flush the buffer print "Content-type: text/html\n\n"; &require_supporting_libraries (__FILE__, __LINE__, "./Library/cgi-lib.pl"); ################################################################### # Local Variables # ################################################################### # $start_url = "http://www.cs.umn.edu/\~doyle/8110"; $support_email = "doyle\@cs.umn.edu"; $end_url = "http://www.cs.umn.edu/~doyle/8110/done.html"; $applet_base = "Shoot"; @Fsections = ("Overview","Instructor","Work/Tests","Class","Text"); ################################################################### &ReadParse(*form_data); #print PrintVariables(%form_data); # The next part shouldn't be needed, but in case the front # page is not written correctly, this should fix it. if ($form_data{'menu_choice'} ne "") { $menu_choice = $form_data{'menu_choice'}; } else { $menu_choice = "Overview"; } %Done_Data =(); ################################################################### # # First, check for missing information # All information must be filled in for this to work, but # since most information has no choice but to be filled # in, we only need to check 2 things # # check for missing information if ((($form_data{'class_no'} eq "") && ($form_data{'class_name'} eq "")) || ($form_data{'id_no'} eq "")) { # Make them try again e"neric_header("Error: Missing Data"); print qq~ Please fill in your class number and school ID before continuing.

~; if ($form_data{'id_no'} eq "") { print qq~ This information is completely anonymous, your ID number is required by this program for statistical purposes only. Your information will NEVER be released to the instructor or administration.

\n~; } e"neric_footer; exit; } # # all necessary information here, put it in the correct format else { &fix_data; } # menu choices, states which form to load if ($menu_choice eq "Shoot") { #shooting applet e"t_db_data; &Shoot_form; } elsif ($menu_choice eq "Overview") { #forms e"t_db_data; &overview_form; } elsif ($menu_choice eq "Instructor") { &instructor_form; } elsif ($menu_choice eq "Work/Tests") { &hw_form; } elsif ($menu_choice eq "Class") { &class_form; } elsif ($menu_choice eq "Text") { &text_form; } elsif ($menu_choice eq "Finish") { &end_form; } elsif ($menu_choice eq "Submit Data") { &submit_it; } else { print "Eeeek, you shouldn't be able to see this!!!"; } ####################################################################### # Overview Form # ####################################################################### sub Shoot_form { print qq~ Tell your instructor

Show your instructor how you feel

This applet is designed to give weekly feedback about an instructor. All results due to this are compiled together and will be presented as a sum total of all entries.

Click on "rotten fruit" or "gold star" to show whether you are pleased with your instructor or not. Then, click on the instructor''s photo as many times are you feel you need to. When you are done, click on "done" and your anonymous results will be added to the rest.

To leave more specific information, explaining why you feel the way you do, feel free to click any checkboxes that match your feeling.

~; } ####################################################################### # Overview Form # ####################################################################### # # This first sheet will accomplish 2 things # 1) goes out and grabs information from the database # 2) pushes forth a form to fill out. Should get info behind # scenes but will need to use temp files -- ugh! # sub overview_form { e"neric_header("Overview of $class_name"); print qq~


Overview of $class_name

SELF
What was your ability in the subject before the class?
What was your ability in subject after the course?
How motivated were you to learn?
How much did you learn?
Do you feel you learned as much as you could have?
How much did you enjoy the class?
How much time did you spend on it per week? hours

INSTRUCTOR
Rate the instructor''s overall teaching ability
Rate their knowledge of the subject matter
Given the choice, would you take another class from this instructor?

CLASS
Were the prerequisites for this class important to do well?
Would you suggest that this class be kept/added as a required class?
Rate the room you took the class in.

BOOK
How many textbooks did you have for the class?
What was the overall quality of your textbook?


  
Overview
~; e"neric_footer; } ####################################################################### # Instructor Form # ####################################################################### sub instructor_form { e"neric_header("Information on $prof_name"); print qq~

Information on $prof_name

How well does $prof_name ...
Show respect and concern for students?
Encourage student feedback/listen?
Pay attention to what helps you learn?
Able to answer the students'' questions?
Provide a good pace for the class?
Flexibile in changing schedule to meet student''s needs?
Able to make material interesting?
Successful in getting you to think?
Organized?
Grade fairly and consistently?
Available to students?
Stay on track/focused class?
Encourage student interactions?
Have appropriate assumptions of your pre-existing knowledge?
Have appropriate expectations?
Let you know his/her expectations?
Have clear verbal presentation?
Have clear handwriting?


  
Instructor
~; e"neric_footer; } ####################################################################### # Handouts/Homework/Tests Form # ####################################################################### sub hw_form { e"neric_header("Handouts, Homework and Tests"); print qq~

Handouts, Homework and Tests

Handouts
Were syllabus and schedule available?
Were they helpful
What was the overall quality/legibility of handouts?
How accessible were they?

Homework
How many assignments were there?
About how much time was spent on them weekly? hours
How relevant were they to lecture?
What was the average difficulty level?
What was the percentage of busy to helpful work?

Tests
How many were there?
How relevant were they to lecture?
How relevant were they to knowledge of subject matter?
What was the average difficulty level?
What was the average length?
What was the level of detail?


  
Work/Tests
~; e"neric_footer; } ####################################################################### # Classroom Form # ####################################################################### sub class_form { e"neric_header("About $class_name"); print qq~

About $class_name

Why did you take this class?
How helpful were the recitation/lab/etc.,
How practical was this class?
How organized did the class itself seem?
Was this a UNITE (televised) class?
Would you recommend this class to another
(independent of instructor)?


  
Class
~; e"neric_footer; } ####################################################################### # Textbook Form # ####################################################################### #add information on books sub text_form { if ($#text_name == 0) { e"neric_header("About \"$text_name[0]\""); } else { e"neric_header("Textbooks for $class_name"); } print qq~

~; $times_thru = 0; for ($i=0; $i<$#text_name+1; $i++) { print qq~

Overview of \"$text_name[$i]\"

Was the book truly helpful? ~; local $x = $i*12+1; print qq~
How well written was it? ~; $x++; print qq~
How correct were the materials and problems? ~; $x++; print qq~
How substantial was this book ~; $x++; print qq~
Rate the clarity of the text ~; $x++; print qq~
How was the structure and organization? ~; $x++; print qq~
Was the speed of the presentation of the materials appropriate? ~; $x++; print qq~
What was the interest/fun level of it
(did you stay awake)?
~; $x++; print qq~
Was the cost appropriate? ~; $x++; print qq~
Was it available when you needed to buy it? ~; $x++; print qq~
Do you plan on keeping this book? ~; $x++; print qq~
Would you recommend this book to another? ~; $x++; print qq~


~; } print qq~

  
Text
~; e"neric_footer; } ####################################################################### # Final Form # ####################################################################### sub end_form { e"neric_header("Submit the Grade"); $calc_total_grade = &calculate_overall_grade; $calc_prof_grade = &calculate_prof_grade; # $calc_total_grade = "A-"; # $calc_prof_grade = "C+"; print qq~

Submit the Grade


    
NOTE:
The information added here will not be sent until you press the "SEND" button at the bottom of this page.


The calculated grade for your professor is (Please change it if it is incorrect).

The calculated overall grade for the class itself is (Please change it if it is incorrect).


    
In addition, please add any comments below on ways to improve this instructor evaluation process. Any comments you make will go solely to the developers of this program, NOT to the instructor.
~; e"neric_footer; } ####################################################################### # Database Connectivity Subroutine # ####################################################################### # # This function is used to get the name of the professor, the # classroom, and the book titles and publishers from the database # based upon the class submitted. It mostly involves database # calls and modification of data. # sub get_db_data { # # this stuff will be gotten from the database $prof_name = "Joe Schmoe"; $prof_pic_name = "bamshad2.jpg"; @text_name = ("This is the text", "and another"); $class_name = "CSci 4-205"; } ####################################################################### # Submit It Subroutine # ####################################################################### sub submit_it { #this will contain the calls to send the information to the database, # it will check for duplicate entries and update, or add new # based on the school, it may check grades, and separate it immediately # # NOTE: Info from the final form will be put into a separate db for the # maintainers (us). A new script should be given that mails it to us # after the first quarter, or so. # # it will also have to push a page forth that thanks them print qq~ Thanks for your submission Thanks for your submission. Your data will be added to the database at the end of the term. Any information you submitted can be changed until that point. However, at the start of the next term, the data will be unchangeable.

Please send email to $support_email with any problems, corrections or questions you may have.

~; } ####################################################################### # Generic Header # ####################################################################### sub generic_header { local ($title) = @_; print qq~ $title

~; foreach $key (sort keys %Done_Data) { print qq~ \n~; } } ####################################################################### # Generic Footer # ####################################################################### sub generic_footer { print qq~
~; } ####################################################################### # Fix Data # ####################################################################### # # The purpose of this is to check hidden data needed on # every form and to turn it into the correct format. sub fix_data { if ($form_data{'class_name'} eq "") { #create format for classname if ($form_data{'ext'} ne "") { $class_name="$form_data{'dept'} $form_data{'class_no'}-Ext"; } else { $class_name= "$form_data{'dept'} $form_data{'class_no'}"; } } else { $class_name = $form_data{'class_name'}; } $id_no = $form_data{'id_no'}; #comes from front-end if ($prof_name eq "") { $prof_name = $form_data{'prof_name'}; } if (@text_name eq "") { @text_name = $form_data{'text_name'}; } if ($curr_choice eq "") { $curr_choice = $form_data{'curr_choice'}; } for ($i=0; $i<$#Fsections; $i++) { local $fs = $Fsections[$i]; if ($form_data{$fs} ne "") { $Done_Data{$fs} = $form_data{$fs}; } } # # Now, convert the data that was given and attach it to the # forms... each form that's filled out will be carried over # to the others, and eventually all will be submitted. # # NOTE: Any change in the number of questions will affect this # if ($curr_choice ne "") { if ($curr_choice eq "Overview") { for ($j = 1; $j<=15; $j++) { $x = "o[$j]"; $y = $form_data{$x}; if ($y eq "") { $y = "-"; } push @temp_data, $y; } } elsif ($curr_choice eq "Instructor") { for ($j = 1; $j<=18; $j++) { $x = "i[$j]"; $y = $form_data{$x}; if ($y eq "") { $y = "-"; } push @temp_data, $y; } } elsif ($curr_choice eq "Work/Tests") { for ($j = 1; $j<=15; $j++) { $x = "h[$j]"; $y = $form_data{$x}; if ($y eq "") { $y = "-"; } push @temp_data, $y; } } elsif ($curr_choice eq "Class") { for ($j = 1; $j<=6; $j++) { $x = "c[$j]"; $y = $form_data{$x}; if ($y eq "") { $y = "-"; } push @temp_data, $y; } } elsif ($curr_choice eq "Text") { for ($j = 1; $j<=(12 * ($#text_name + 1)); $j++) { $x = "t[$j]"; $y = $form_data{$x}; if ($y eq "") { $y = "-"; } push @temp_data, $y; } } elsif ($curr_choice eq "Final") { for ($j = 1; $j<=3; $j++) { $x = "f[$j]"; $y = $form_data{$x}; if ($y eq "") { $y = "-"; } push @temp_data, $y; } } else #final area, data sent. { } $summary = join(' ', @temp_data); @temp_data = (); $Done_Data{$curr_choice} = $summary; } } ####################################################################### # Calculate Grade for the Professor # ####################################################################### # # Due to the fact that many questions may go unanswered, the # instructor's grade is based upon questions only found in the # overview. All questions are currently given even weight, but # as a trend is found, they may be adjusted # sub calculate_prof_grade { @queues = split(' ', $form_data{'Overview'}); local @pert_queues = ($queues[7], $queues[8], $queues[9]); local $total = 0; local $num_answered = 0; foreach $pert_queue (@pert_queues) { if ( $pert_queue =~ /\d/ ) { $total += $pert_queue; #give equal weight $num_answered++; } } $total /= $num_answered; #divide by # answered if ($total > 4.95) { $calc_prof_grade = "A+"; } elsif ($total > 4.6) { $calc_prof_grade = "A"; } elsif ($total > 4.3) { $calc_prof_grade = "A-"; } elsif ($total > 4.0) { $calc_prof_grade = "B+"; } elsif ($total > 3.6) { $calc_prof_grade = "B"; } elsif ($total > 3.3) { $calc_prof_grade = "B-"; } elsif ($total > 3.0) { $calc_prof_grade = "C+"; } elsif ($total > 2.6) { $calc_prof_grade = "C"; } elsif ($total > 2.3) { $calc_prof_grade = "C-"; } elsif ($total > 2.0) { $calc_prof_grade = "D+"; } elsif ($total > 1.6) { $calc_prof_grade = "D"; } elsif ($total > 1.3) { $calc_prof_grade = "D-"; } else { $calc_prof_grade = "F"; } return ($calc_prof_grade); } ####################################################################### # Calculate Overall Grade # ####################################################################### # # Due to the fact that many questions may go unanswered, the # overall grade is based upon questions only found in the # overview. All questions are currently given even weight, but # as a trend is found, they may be adjusted # sub calculate_overall_grade { @queues = split(' ', $form_data{'Overview'}); local @pert_queues = ($queues[2], $queues[3], $queues[4],$queues[5], $queues[7], $queues[8],$queues[9], $queues[12], $queues[14]); local $total = 0; local $num_answered = 0; foreach $pert_queue (@pert_queues) { if ( $pert_queue =~ /\d/ ) { $total += $pert_queue; #give equal weight $num_answered++; } } $total /= $num_answered; #divide by # answered if ($total > 4.95) { $calc_total_grade = "A+"; } elsif ($total > 4.6) { $calc_total_grade = "A"; } elsif ($total > 4.3) { $calc_total_grade = "A-"; } elsif ($total > 4.0) { $calc_total_grade = "B+"; } elsif ($total > 3.6) { $calc_total_grade = "B"; } elsif ($total > 3.3) { $calc_total_grade = "B-"; } elsif ($total > 3.0) { $calc_total_grade = "C+"; } elsif ($total > 2.6) { $calc_total_grade = "C"; } elsif ($total > 2.3) { $calc_total_grade = "C-"; } elsif ($total > 2.0) { $calc_total_grade = "D+"; } elsif ($total > 1.6) { $calc_total_grade = "D"; } elsif ($total > 1.3) { $calc_total_grade = "D-"; } else { $calc_total_grade = "F"; } return $calc_total_grade; } ####################################################################### # Require Supporting Libraries. # ####################################################################### # require_supporting_libraries is used to read in some of # the supporting files that this script will take # advantage of. # # require_supporting_libraries takes a list of arguments # beginning with the current filename, the current line # number and continuing with the list of files which must # be required using the following syntax: # # &require_supporting_libraries (__FILE__, __LINE__, # "file1", "file2", # "file3"...); # # Note: __FILE__ and __LINE__ are special Perl variables # which contain the current filename and line number # respectively. We'll continually use these two variables # throughout the rest of this script in order to generate # useful error messages. sub require_supporting_libraries { # The incoming file and line arguments are split into # the local variables $file and $line while the file list # is assigned to the local list array @require_files. # # $require_file which will just be a temporary holder # variable for our foreach processing is also defined as a # local variable. local ($file, $line, @require_files) = @_; local ($require_file); # Next, the script checks to see if every file in the # @require_files list array exists (-e) and is readable by # it (-r). If so, the script goes ahead and requires it. foreach $require_file (@require_files) { if (-e "$require_file" && -r "$require_file") { require "$require_file"; } # If not, the scripts sends back an error message that # will help the admin isolate the problem with the script. else { print "Content-type: text/html\n\n"; print "I am sorry but I was unable to require $require_file at line $line in $file. Would you please make sure that you have the path correct and that the permissions are set so that I have read access? Thank you."; exit; } } # End of foreach $require_file (@require_files) } # End of sub require_supporting_libraries ################################################################# # get_date Subroutine # ################################################################# # get_date is used to get the current date and time and # format it into a readable form. The subroutine takes no # arguments and is called with the following syntax: # # $date = e"t_date; # # It will return the value of the current date, so you # must assign it to a variable in the calling routine if # you are going to use the value. sub get_date { # The subroutine begins by defining some local working # variables local ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst,$date); local (@days, @months); @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday', 'Friday','Saturday'); @months = ('January','February','March','April','May','June','July', 'August','September','October','November','December'); # Next, it uses the localtime command to get the current # time, from the value returned by the time # command, splitting it into variables. ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); # Then the script formats the variables and assign them to # the final $date variable. Note that $sc_current_century # is defined in web_store.setup. Since the 20th centruy # is really 1900-1999, we'll need to subtract 1 from this # value in order to format the year correctly. if ($hour < 10) { $hour = "0$hour"; } if ($min < 10) { $min = "0$min"; } if ($sec < 10) { $sec = "0$sec"; } $mon++; $year = ($current_century-1) . "$year"; $date = "$mon/$mday/$year at $hour\:$min\:$sec"; return $date; }