#!/usr/bin/perl &parse_form; my($facts, $line, $count); my(@file); use CGI; use CGI::Carp qw(fatalsToBrowser); $query= new CGI; my($group, $level, $section, $section1); my($head, $footer); ## Get cookies first $group = $query->cookie('group'); $level = $query->cookie('level'); $section = $query->cookie('section'); if ($section==4){ $section1=5; $cookie1 = $query->cookie(-name=>'section', -value=>"$section1"); print $query->header(-cookie=>$cookie1); }else{ print "Content-type:text/html\n\n"; } my($error); $error= <

Sherlock Error

Sorry.

There appears to be an error in your login id or password. Please check them and try again. If you are still unsuccessful, please contact the SiteMage.

EOT if($group eq ""){ print "$error"; exit; } if($level>3){ print "$error"; exit; } ($second, $minute, $hour, $dayofmonth, $month, $year, $weekday, $dayofyear, $isdst)=localtime(time); $realmonth=$month+1; $year=2000; $facts="$FORM{'action'}"; if ($section>5.5){ $section=5; print "

Your Casebook $level Self-Directed Learning.

You may not change them once posted.

"; print ""; print "
"; open(g, "$group.txt"); flock(g,2); @file=; flock(g,8); close(g); $line=""; until($line eq "$level$section"){ $line=shift(@file); chomp($line); } $line=shift(@file); chomp($line); until($line eq "EOF"){ print "$line
"; $line=shift(@file); chomp($line); } print "

Please close this window when you are done viewing your Self-Directed Learning."; exit; } if($section==4){ open(F, ">>$group.txt")||print "Could not open '$group.txt' for writing"; flock(F,2); print F "$level$section\n"; print F "Level $level Action Plan\n"; print F "$facts\n"; print F "Posted at $hour:$minute $realmonth/$dayofmonth/$year\n"; print F " \n"; print F "
\n"; print F "EOF\n"; flock(F,8); close(F); open(G, ">>$level$section.txt")||print "Could not open '$level$section.txt' for writing"; flock(G,2); @file=; print G "$group Action Plan\n"; print G "$facts\n"; print G "Posted at $hour:$minute $realmonth/$dayofmonth/$year\n"; print G " \n"; print G "
\n"; print G "EOF\n"; flock(G,8); close(G); ##increment section to current! $section=5; open(H, "log.txt"); flock(H,2); @file=; flock(H,8); close(H); open(I, ">log.txt"); flock(I, 2); foreach $line (@file){ chomp($line); ($groupname, $grouppass, $grouplevel, $groupsection)= split(/ /, $line); if ($groupname eq "$group"){ $groupsection=$section; print I "$groupname $grouppass $grouplevel $groupsection\n"; }else{ print I "$groupname $grouppass $grouplevel $groupsection\n"; } } flock(I, 8); close(I); } if($section<5){ print "

Please complete the other PBL steps before your self-directed learning posts.

"; } if($section>=5){ $head= < Virtual Sherlock: PBL Board

You have successfully posted your learning issues. Please Log out and research before you post your self-directed learning.


PBL Steps Review Casebook EOT print "$head"; ##This is the interactive html print ""; print ""; print ""; print ""; if ($section>2){ print ""; }else{ if ($section==2){ print ""; }else{ print ""; }} if ($section>3){ print ""; }else{ if ($section==3){ print ""; }else{ print ""; }} if ($section>4){ print ""; }else{ if ($section==4){ print ""; }else{ print ""; }} if ($section==5){ print ""; }else{ print ""; } print "
The PBL Process
"; print "
 
 
 
 

Now that you have listed the topics or questions that you need to learn about in order to fulfill your goals, it is time to visit the library. Useful resources can be found in the Chemistry Library or by visiting the Virtual Sherlock Resources page. You may find it useful to consult textbooks, journal articles, reliable internet sites and/or experts..

Facts
Ideas/Hypotheses
Ideas/Hypotheses
Ideas/Hypotheses
Learning Issues
Learning Issues
Learning Issues
Action Plan
Action Plan
Action Plan
Self-Directed Learning
Self-Directed Learning
"; print "
Print out the Self Study Log and use it to keep track of your searches. When you are satisfied you have learned about the topics, post the information here in a timely manner ."; print "
Post your Self-Directed Research here. You must logout and log in to post.This is the final step. Feel free to exit the browser and come back later!"; if($section!=5.5){ print "

"; print ""; print "

Great Job! Now Logoff and look all this stuff up, then come back and post your findings.

"; print "

Please print your learning issues before heading to the library.

"; print "

Logout Here Now

"; } if($section==5.5){ print "
"; print "You may now enter your self-directed learning research.
"; print "
"; print "
"; print "

"; } $search= <

Search the Web From the Pblboard.....

Search for:

Select search engines:

Infoseek Excite Yahoo HotBot Mamma Magellan

EOT print "$search"; print "

Resources   Goals  Casebook   PBL Board    Discussion Post Review

"; print ""; } ####################### # Parse Form Subroutine sub parse_form { local($name,$value); # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Remove any NULL characters, Server Side Includes $value =~ s/\0//g; $value =~ s///g; if ($allow_html != 1) { $value =~ s/<([^>]|\n)*>//g; } else { unless ($name eq 'body') { $value =~ s/<([^>]|\n)*>//g; } } $FORM{$name} = $value; } # Make sure that message fields do not exceed allowed value if ($enforce_max_len) { foreach $name (keys %max_len) { if (length($FORM{$name}) > $max_len{$name}) { if ($enforce_max_len == 2) { &error('field_size'); } else { $FORM{$name} = sprintf("%.$max_len{$name}s",$FORM{$name}); } } } } } exit;