[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Sun, 19 Jan 2003 08:11:38 -0000
albertel Sun Jan 19 03:11:38 2003 EDT
Modified files:
/loncom/homework lonhomework.pm
Log:
- adding load of rankresponse
- addied debugging checks
- made CSTR calls faster
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.105 loncom/homework/lonhomework.pm:1.106
--- loncom/homework/lonhomework.pm:1.105 Wed Dec 11 10:33:55 2002
+++ loncom/homework/lonhomework.pm Sun Jan 19 03:11:38 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.105 2002/12/11 15:33:55 www Exp $
+# $Id: lonhomework.pm,v 1.106 2003/01/19 08:11:38 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,6 +48,7 @@
use Apache::imageresponse();
use Apache::essayresponse();
use Apache::externalresponse();
+use Apache::rankresponse();
use Apache::Constants qw(:common);
use HTML::Entities();
use Apache::loncommon();
@@ -150,6 +151,14 @@
my $temp;
my $type;
my $passed;
+
+ if ($ENV{'request.state'} eq "construct") {
+ &Apache::lonxml::debug("in construction ignoring dates");
+ $status='CAN_ANSWER';
+ $datemsg='is in under construction';
+ return ($status,$datemsg);
+ }
+
&Apache::lonxml::debug("checking for part :$id:");
&Apache::lonxml::debug("time:".time);
foreach $temp ("opendate","duedate","answerdate") {
@@ -216,11 +225,7 @@
$status='CAN_ANSWER';
$datemsg='is closed but you are allowed to view it';
}
- if ($ENV{'request.state'} eq "construct") {
- &Apache::lonxml::debug("in construction ignoring dates");
- $status='CAN_ANSWER';
- $datemsg='is in under construction';
- }
+
return ($status,$datemsg);
}
@@ -230,6 +235,23 @@
return '';
}
+sub showarray {
+ my ($array)=@_;
+ my $string="(";
+ foreach my $elm (@{ $array }) {
+ if (ref($elm)) {
+ if ($elm =~ /ARRAY/ ) {
+ $string.=&showarray($elm);
+ }
+ } else {
+ $string.="$elm,"
+ }
+ }
+ chop($string);
+ $string.=")";
+ return $string;
+}
+
sub showhashsubset {
my ($hash,$keyre) = @_;
my $resultkey;
@@ -237,14 +259,13 @@
if ($resultkey =~ /$keyre/) {
if (ref($$hash{$resultkey})) {
if ($$hash{$resultkey} =~ /ARRAY/ ) {
- my $string="$resultkey ---- (";
- foreach my $elm (@{ $$hash{$resultkey} }) {
- $string.="$elm,";
- }
- chop($string);
- &Apache::lonxml::debug("$string)");
+ &Apache::lonxml::debug("$resultkey ---- ".
+ &showarray($$hash{$resultkey}));
+ } elsif ($$hash{$resultkey} =~ /HASH/ ) {
+ &Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");
+ &showhashsubset($$hash{$resultkey},'.');
} else {
- &Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");
+ &Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");
}
} else {
&Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");