#!/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==1){ $section1=2; $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{'facts'}"; if ($section>2){ $section=2; print "

Your Casebook $level Ideas.

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 ideas."; exit; } if($section==1){ open(F, ">>$group.txt")||print "Could not open '$group.txt' for writing"; flock(F, 2); print F "$level$section\n"; print F "Level $level Facts\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 for writing. Please try again."; flock(G,2); @file=; print G "$group Facts\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=2; 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==2){ $head= < Virtual Sherlock: PBL Board

You have successfully posted your facts. Please move on to ideas and hypotheses.


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, think of the facts you have collected and generate ideas and hypothesesbased on these facts that could help you solve the case.

Facts
Ideas/Hypotheses
Ideas/Hypotheses
Ideas/Hypotheses
Learning Issues
Learning Issues
Learning Issues
Ideas/Hypotheses
Action Plan
Action Plan
Self-Directed Learning
Self-Directed Learning
"; print "
Post your Ideas here. Be careful, you won't be able to go back!
"; print ""; print "

"; print "
"; $search= <

Search the Web From the Pblboard.....

Search for:

Select search engines:

Infoseek Excite Yahoo HotBot Mamma Magellan

EOT print "

"; 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;