--- loncom/cgi/graph.png 2003/10/09 22:04:37 1.24 +++ loncom/cgi/graph.png 2003/10/29 14:47:43 1.30 @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# $Id: graph.png,v 1.24 2003/10/09 22:04:37 matthew Exp $ +# $Id: graph.png,v 1.30 2003/10/29 14:47:43 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -57,6 +57,7 @@ escape( value ) means the values must be use strict; use lib '/home/httpd/lib/perl'; use GD::Graph::bars; +use GD::Graph::lines; use GD::Graph::colour; use GD::Graph::Data; use LONCAPA::loncgi(); @@ -67,6 +68,35 @@ sub unescape { return $str; } +sub error { + my ($error) = @_; + my $Str = <<"END"; +Content-type: text/html + + +
+There was an error producing the graph you requested. +
+$error +
+ + +END + return $Str; +} + +my $id = $ENV{'QUERY_STRING'}; + +# +# &get_env($name,$default) +sub get_env { + my $key = 'cgi.'.$id.'.'.(shift()); + return shift if (! exists($ENV{$key})); + return $ENV{$key}; +} + if (! &LONCAPA::loncgi::check_cookie_and_load_env()) { print <