#!/usr/local/bin/perl require "cgi-lib.pl"; sub CgiDie { &CgiError(@_); exit 1; } sub ptext { local ($key, $size) = @_; return "\n"; } sub pradio { local ($key, $value) = @_; $c = ($data{$key} eq $value) ? "CHECKED" : ""; return ""; } sub pselect { local ($key, @options) = @_; local ($retval); $retval = ""; return $retval; } sub pcbox { local ($key) = @_; $c = ($data{$key} eq "on") ? "CHECKED" : ""; return ""; } @seniorCourses = ("CS 401: Senior Independent Work", "CS 410: Advanced Software Systems", "CS 420: Introduction to Parallel Computing", "CS 440: Nonnumeric Computation", "CS 450: Computer Architecture I", "CS 480: Introduction to Computer Graphics", "CS 491/2: Directed Study", "CS 511: Software Engineering", "CS 512: Parallel Algorithms and Programs", "CS 520: Programming Languages", "CS 525: Compiler Design Theory", "CS 530: Analysis of Algorithms", "CS 535: Complexity Theory", "CS 537: Probability in Computing", "CS 538: Cryptography and Cryptanalysis", "CS 540: Artificial Intelligence", "CS 542: Logic Programming", "CS 545: Natural Language Processing", "CS 550: Computer Architecture II", "CS 552: Introduction to Operating Systems", "CS 555: Data Communications", "CS 560: Introduction to Database Systems", "CS 591: Topics in Computer Science"); sub writeform { local(*data) = @_; print "\n"; print "\n"; print "CLA Computer Science Concentration Checklist\n"; print "\n"; print "\n"; print "

\n"; print "

College Program for Liberal Arts

\n"; print "

with Concentration in Computer Science

\n"; print "
For Students Entering CLA before September 1995
\n"; print "
\n"; print "

\n"; print "
\n"; print "Student: ",&ptext("student-name", 26),"\n"; print "Advisor: ",&ptext("advisor-name", 26),"\n"; $tmp = $data{"login-id"}; print "
Login ID: ",&ptext("login-id", 26),"
\n"; print "

    \n"; print "
  1. Languages and Mathematics: (a), (b), and (c):\n"; print "

    \n"; print "

      \n"; print "
    1. English:\n"; print "
      \n"; print &pradio("EN-req", "EN104"), "EN 104
      or
      \n"; print &pradio("EN-req", "Exemption"), "Exemption (SAT Verbal > 600, or AP 4 or 5)

      \n"; print "

    2. Foreign Language:
      \n"; print &pradio("FL-req", "Coursework"),"\n"; print "212 level (4 courses):
      \n"; print &ptext("FL-course-1", 20); print &ptext("FL-course-2", 20); print &ptext("FL-course-3", 20); print &ptext("FL-course-4", 20); print "
      or
      \n"; print &pradio("FL-req", "Exemption"), "Exemption (Language Achievement Test > 530)\n"; print "

    3. Mathematics:
      \n"; print &pradio("MA-req", "Exemption"); print "SAT > 560 Quantitative
      or
      \n"; print &pradio("MA-req", "MA-110"); print "CLA MA 110 or above

    \n"; print "
  2. General Education: (a) or (b):
    \n"; print "I'm fulfilling General Ed. using:\n"; print &pselect("general-ed", "Haven't Decided Yet", "Divisional Studies", "Core Curriculum"); print "

      \n"; print "

    1. Core Curriculum:
      \n"; print "CLA CC 101 & 103", &pcbox("CC-101-103"), "
      "; print "CLA CC 102 & 104", &pcbox("CC-102-104"), "
      "; print "CLA CC 201 & 203", &pcbox("CC-201-203"), "
      "; print "CLA CC 202 & 204", &pcbox("CC-202-204"), "

      "; print "

    2. Divisional Studies: 6 Courses:
      \n"; print "Humanities (HU):\n"; print &ptext("HU-course-1", 20), &ptext("HU-course-2", 20), "\n"; print "
      \n"; print "Social Sciences (SS):\n"; print &ptext("SS-course-1", 20), &ptext("SS-course-2", 20), "\n"; print "
      \n"; print "SS or HU :\n"; print &ptext("SS-HU-course-1", 20), &ptext("SS-HU-course-2", 20), "\n"; print "
      \n"; print "

    \n"; print "

  3. Concentration in Computer Science: (a), (b), (c), and (d):

    \n"; print "

      \n"; print "
    1. Lower Division Prerequisites:
      \n"; print "MA 123 or equivalent:\n"; print &pcbox("MA-123"), "
      \n"; print "CLA CS 111 or equivalent:", &pcbox("CS-111"), "

      \n"; print "

    2. Lower Division Requirements:
      \n"; print "CLA CS 112 or 113", &pcbox("CS-112-113"), "
      \n"; print "CLA CS 210", &pcbox("CS-210"),"
      \n"; print "CLA MA 242", &pcbox("MA-242"),"
      \n"; print "CLA MA 293", &pcbox("MA-293"),"
      \n"; print "CLA MA 294", &pcbox("MA-294"),"
      \n"; print "

    3. Upper Division Requirements:
      \n"; print "CLA CS 305",&pcbox("CS-305"),"
      \n"; print "CLA CS 320",&pcbox("CS-320"),"
      \n"; print "CLA CS 330",&pcbox("CS-330"),"
      \n"; print "CLA CS 332",&pcbox("CS-332"),"\n"; print "

    4. 4 CS Courses, 400 Level or Higher:

      \n"; print &pselect("Course 1", "Not Done Yet", @seniorCourses), "
      \n"; print &pselect("Course 2", "Not Done Yet", @seniorCourses), "
      \n"; print &pselect("Course 3", "Not Done Yet", @seniorCourses), "
      \n"; print &pselect("Course 4", "Not Done Yet", @seniorCourses), "
      \n"; print "


\n"; print "Comments:
\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "
\n"; print "

\n"; print "Mark Crovella\n"; print "
\n"; print "\n"; } # modifiable parameters $fpath = "/home/crovella/student-files/"; $ci = "/home/crovella/bin/ci"; $co = "/home/crovella/bin/co"; # start by parsing input into array "input" if (! &ReadParse(*input)) { &CgiError("No input"); exit 1; } # some simple error checking @required = ("login-id"); undef $errmsg; $errmsg[0] = "Error: required field(s) not filled in"; foreach $field (@required) { if ($input{$field} eq '') { @errmsg = (@errmsg, "The $field field was empty."); } } &CgiDie(@errmsg) if ($#errmsg != 0); # now check in a new copy of the file record $fname = $fpath . $input{'login-id'}; $rcsname = $fpath . "RCS/" . $input{'login-id'} . ",v"; # if file exists, check it out if (-r $rcsname) { $retval = system("$co -u $fname"); $retval /= 256; &CgiDie("File checkout failed with status $retval") if ($retval != 0); } else # file doesn't exist; create it { open (DATAFILE,"> $fname") || &CgiDie("Can't create file $fname"); print DATAFILE "login-id\`$input{'login-id'}\|\n"; close DATAFILE; $retval = system("$ci -t-StudentRecordFile -u $fname"); $retval /= 256; &CgiDie("File creation failed with status $retval") if ($retval != 0); } open (DATAFILE, $fname) || &CgiDie("Can't open file $file"); # need to fix this to handle newlines in the "Comments" field $input = ; @items = split(/\|/,$input); print &PrintHeader; foreach $f (0..$#items) { ($label, $contents) = split(/\`/, $items[$f]); $data{$label} = $contents; } # fix newlines in Comments if (defined ($data{"Comments"})) { $data{"Comments"} =~ s/%NL%/\n/; $data{"Comments"} =~ s/%CR%/\r/; } &writeform(*data); # exit 0;