Grade support for new school
authorTim Pope <code@tpope.net>
Wed, 6 Jul 2005 02:02:13 +0000 (02:02 +0000)
committerTim Pope <code@tpope.net>
Wed, 6 Jul 2005 02:02:13 +0000 (02:02 +0000)
perl/sctweb

index a673d8b57938b43c78014efd868e7e918421eecf..614d63e9bd6272d17407458e0f9753ab319eb17f 100755 (executable)
@@ -188,7 +188,7 @@ sub off_for_exams {
 }
 
 sub capitalize {
-    local $_ = shift;
+    local $_ = shift || "";
     s/ +$//;
     s/\b([A-Z])([A-Z]*)\b/$1\L$2/g;
     s/\b(I)(i*)\b/$1\U$2/g;
@@ -559,6 +559,7 @@ sub do_html_schedule {
 
 sub do_html_grades {
     my @readheaders = ("Section ID", "Course Title", "Grade", "Earned  Hours", "Quality  Hours", "Quality  Points", "GPA");
+    @readheaders = ("Section", "Course Title", "FinalGrade", "Earned Hours", "Quality Hours", "Quality Points", "GPA") if($opts{'school'} eq 'tamuk');
     my @showheaders = ("Section ID", "Course Title", "Grade", "Earned<br />Hours", "Quality<br />Hours", "Quality<br />Points");
     my ($row, $lastrow);
     my $te = new HTML::TableExtract( headers => [ @readheaders ] );
@@ -567,7 +568,7 @@ sub do_html_grades {
     #my @terms = reverse grep {s/^<option value="([^"]*)">.*/$1/} (split( /\r\n/, $response->content));
     my @terms = ();
     my $year = Date::Calc->localtime->year;
-    for(my $y=$year-4;$y<=$year;$y++) { push @terms, ($y.2,$y.3,$y.4,$y.1); }
+    for(my $y=$year-4;$y<=$year;$y++) { push @terms, ($y.2,$y."F",$y.3,$y.4,$y.1,$y."S"); }
     foreach(@_ ? @_ : @terms) {
        $response = $ua->get("$url&tserve_tip_write=||WID|SID|PIN|Term&tserve_trans_config=rgrades.cfg&Term=".($_) );
        die $response->status_line unless $response->is_success;