--- loncom/interface/lonstatistics.pm 2002/05/19 15:44:40 1.20 +++ loncom/interface/lonstatistics.pm 2002/05/27 00:24:05 1.21 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonstatistics.pm,v 1.20 2002/05/19 15:44:40 minaeibi Exp $ +# $Id: lonstatistics.pm,v 1.21 2002/05/27 00:24:05 minaeibi Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,7 @@ # 11/1,11/4,11/16,12/14,12/16,12/18,12/20,12/31 Behrouz Minaei # YEAR=2002 # 1/22,2/1,2/6,2/25,3/2,3/6,3/17,3/21,3/22,3/26,4/7,5/6 Behrouz Minaei -# 5/12,5/14,5/15,5/19 Behrouz Minaei +# 5/12,5/14,5/15,5/19,5/26 Behrouz Minaei # ### @@ -86,6 +86,51 @@ my %Header = (0,"Homework Sets Order",1, 9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd"); my %Answer = (); + +sub unescape { + my $str=shift; + $str =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; + return $str; +} + +sub Activity { + my $file="/home/minaeibi/minaei"; + my $userid='billskat'; + $r->print("
Using $file"); + $r->rflush(); + open(FILEID, "<$file"); + my $line; + my @allaccess; + while ($line=) { + my ($time,$machine,$what)=split(':',$line); + #$r->print("time=$time machine=$machine:-> $what\n"); + #$r->rflush(); + $what=&unescape($what); + my @accesses=split('&',$what); + foreach my $access (@accesses) { + my ($date,$resource,$who,$domain,$post,@posts)=split(':',$access); + if ($who ne $userid) { next; } + #if (!$resource) { next; } + push (@allaccess,unescape($access)); + #print $machine; + } + } + @allaccess=sort(@allaccess); + my $Count=0; + foreach my $access (@allaccess) { + my ($date,$resource,$who,$domain,$post,@posts)=split(':',$access); + $Count++; +# $r->print("$Count ".localtime($date)." $who $resource\n"); + $r->print("
$Count) $date: $who --> $resource"); + $r->rflush(); + if ($post) { + $r->print("
Sent data ".join(':',unescape(@posts)).''); + } + } +} + + + sub InitAnalysis { my ($rid, $student)=@_; my ($uname,$udom)=split(/\:/,$student); @@ -279,7 +324,7 @@ sub AnalyzeProblem { my $OpSel=''; my $CurInt = $ENV{'form.interval'}; if ($CurInt eq '') {$CurMap = '1';} - my $Ptr = 'Select number of intervals'."\n". + my $Ptr = '
Select number of intervals'."\n". ''; $Ptr .= ''; + #$Ptr .= ''; + #$Ptr .= ''; $r->print( $Ptr ); } else { @@ -1488,7 +1536,10 @@ sub Menu { # $Apache::lonxml::debug=0; &Title(); my $InpStr = $ENV{'form.sort'}; - if ($InpStr=~/^Analyze\_/) { + if ($InpStr eq 'Activity Log') { + &Activity(); + } + elsif ($InpStr=~/^Analyze\_/) { &ClassList(); &ShowOpGraph($InpStr,$ENV{'form.interval'}); } @@ -1505,6 +1556,7 @@ sub Menu { $r->rflush(); } + sub StudentOptions { my $OpSel5=''; $CurStu = $ENV{'form.student'};