[LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm
minaeibi
lon-capa-cvs@mail.lon-capa.org
Fri, 31 May 2002 16:02:11 -0000
minaeibi Fri May 31 12:02:11 2002 EDT
Modified files:
/loncom/interface lonstatistics.pm
Log:
Worked on Activity log for PHY 183
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.25 loncom/interface/lonstatistics.pm:1.26
--- loncom/interface/lonstatistics.pm:1.25 Fri May 31 09:47:01 2002
+++ loncom/interface/lonstatistics.pm Fri May 31 12:02:11 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: lonstatistics.pm,v 1.25 2002/05/31 13:47:01 minaeibi Exp $
+# $Id: lonstatistics.pm,v 1.26 2002/05/31 16:02:11 minaeibi Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -89,8 +89,8 @@
sub Activity {
- my $file="/home/minaeibi/minaei";
- my $userid='billskat';
+ my $file="/home/minaeibi/activity.log";
+ my $userid='adamsde1';
$r->print("<br>Using $file");
$r->rflush();
open(FILEID, "<$file");
@@ -106,21 +106,16 @@
if ($who ne $userid) { next; }
if (!$resource) { next; }
my $res=&Apache::lonnet::unescape($resource);
- #if (($key=~/\.(\w+)\.(\w+)\.submission$/)) {
- #if ($meta=~/\.(problem|exam|quiz|assess|survey|form)$/) {
- # foreach my $Key(split(/\,/,&Apache::lonnet::metadata($meta,'keys'))) {
- # if ($Key=~/^stores\_(\w+)\_tries$/) {
-
- # if (($res =~ /^\/res\/adm/)) {
+ if (($res =~ /\.(problem|htm|html)/)) {
$Count++;
- $r->print("<br>$Count) $date: $who --> $res");
- if ($post) {
- $Count++;
- $r->print("<br><b>$Count) Sent data ".join(':',
- &Apache::lonnet::unescape(@posts)).'</b>');
- }
+ $r->print("<br>$Count) ".localtime($date).": $who --> $res");
+# if ($post) {
+# $Count++;
+# $r->print("<br><b>$Count) Sent data ".join(':',
+# &Apache::lonnet::unescape(@posts)).'</b>');
+# }
$r->rflush();
- # }
+ }
## push (@allaccess,unescape($access));
#print $machine;
}
@@ -1406,8 +1401,6 @@
}
}
-
-
# my $CacheDB = "/home/httpd/perl/tmp/$ENV{'user.name'}".
# "_$ENV{'user.domain'}_$cid\_classlist.db";
# if (-e "$CacheDB") {
@@ -1438,27 +1431,16 @@
$firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}};
$lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}};
if (($firstres) && ($lastres)) {
-# my %students = &Apache::lonnet::dump('classlist',$cdom,$cnum);
-# $Apache::lonxml::debug=1;
-# &Apache::lonhomework::showhash(%students);
-# $Apache::lonxml::debug=0;
-# my $StudNo = 0;
-# my $now=time;
-# my ($temp)=keys(%students);
-# unless ($temp=~/^error\:/) {
-# foreach my $KeyPoint(sort keys(%students)) {
-
my $StudNo = 0;
my $now=time;
-
my %classlist=&Apache::lonnet::dump('classlist',$cdom,$cnum);
my ($checkForError)=keys(%classlist);
if($checkForError=~/^(con_lost|error|no_such_host)/i) {
$r->print('<h1>Could not access course data</h1>');
} else {
- foreach my $name (keys (%classlist)) {
+ foreach my $name (sort keys (%classlist)) {
my $value=$classlist{$name};
my ($end,$start)=split(/\:/,$value);
my $active=1;
@@ -1560,9 +1542,13 @@
sub Menu {
&initial();
+# my $fn=$ENV{'request.course.fn'};
+# $r->print( '<br>'.$fn.'<br>' );
+
# $Apache::lonxml::debug=1;
# &Apache::lonhomework::showhash(%ENV);
# $Apache::lonxml::debug=0;
+
&Title();
my $InpStr = $ENV{'form.sort'};
if ($InpStr eq 'Activity Log') {