version 1.22, 2002/05/29 17:58:45
|
version 1.26, 2002/05/31 16:02:11
|
Line 78 my $lastres;
|
Line 78 my $lastres;
|
my $DiscFlag; |
my $DiscFlag; |
my $HWN; |
my $HWN; |
my $P_Order; |
my $P_Order; |
|
my %color; |
my %foil_to_concept; |
my %foil_to_concept; |
my @Concepts; |
my @Concepts; |
my %ConceptData; |
my %ConceptData; |
Line 87 my %Header = (0,"Homework Sets Order",1,
|
Line 88 my %Header = (0,"Homework Sets Order",1,
|
my %Answer = (); |
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 { |
sub Activity { |
my $file="/home/minaeibi/minaei"; |
my $file="/home/minaeibi/activity.log"; |
my $userid='billskat'; |
my $userid='adamsde1'; |
$r->print("<br>Using $file"); |
$r->print("<br>Using $file"); |
$r->rflush(); |
$r->rflush(); |
open(FILEID, "<$file"); |
open(FILEID, "<$file"); |
my $line; |
my $line; |
my @allaccess; |
my @allaccess; |
|
my $Count=0; |
while ($line=<FILEID>) { |
while ($line=<FILEID>) { |
my ($time,$machine,$what)=split(':',$line); |
my ($time,$machine,$what)=split(':',$line); |
#$r->print("time=$time machine=$machine:-> $what\n"); |
$what=&Apache::lonnet::unescape($what); |
#$r->rflush(); |
|
$what=&unescape($what); |
|
my @accesses=split('&',$what); |
my @accesses=split('&',$what); |
foreach my $access (@accesses) { |
foreach my $access (@accesses) { |
my ($date,$resource,$who,$domain,$post,@posts)=split(':',$access); |
my ($date,$resource,$who,$domain,$post,@posts)=split(':',$access); |
if ($who ne $userid) { next; } |
if ($who ne $userid) { next; } |
#if (!$resource) { next; } |
if (!$resource) { next; } |
push (@allaccess,unescape($access)); |
my $res=&Apache::lonnet::unescape($resource); |
|
if (($res =~ /\.(problem|htm|html)/)) { |
|
$Count++; |
|
$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; |
#print $machine; |
} |
} |
} |
} |
@allaccess=sort(@allaccess); |
# @allaccess=sort(@allaccess); |
my $Count=0; |
# $Count=0; |
foreach my $access (@allaccess) { |
# foreach my $access (@allaccess) { |
my ($date,$resource,$who,$domain,$post,@posts)=split(':',$access); |
# my ($date,$resource,$who,$domain,$post,@posts)=split(':',$access); |
$Count++; |
# $Count++; |
# $r->print("$Count ".localtime($date)." $who $resource\n"); |
# $r->print("<br>$Count) $date: $who --> $resource"); |
$r->print("<br>$Count) $date: $who --> $resource"); |
# $r->rflush(); |
$r->rflush(); |
# if ($post) { |
if ($post) { |
# $r->print("<br><b>Sent data ".join(':',unescape(@posts)).'</b>'); |
$r->print("<br><b>Sent data ".join(':',unescape(@posts)).'</b>'); |
# } |
} |
# } |
} |
|
} |
} |
|
|
|
|
Line 265 sub DrawTable {
|
Line 269 sub DrawTable {
|
for (my $n=0; $n<=$#Concepts; $n++ ) { |
for (my $n=0; $n<=$#Concepts; $n++ ) { |
$Str .= "\n"."<tr>". |
$Str .= "\n"."<tr>". |
"\n"."<td>".($n+1)."</td>". |
"\n"."<td>".($n+1)."</td>". |
"\n"."<td bgcolor=#FFFFDD> ".$Concepts[$n]." </td>". |
"\n".'<td bgcolor='.$color{"yellow"}.'> '.$Concepts[$n]." </td>". |
"\n"."<td bgcolor=#DDFFDD> ".$data1[$n]." </td>". |
"\n".'<td bgcolor='.$color{"green"}.'> '.$data1[$n]." </td>". |
"\n"."<td bgcolor=#FFDDDD> ".$data2[$n]." </td>". |
"\n".'<td bgcolor='.$color{"red"}.'> '.$data2[$n]." </td>". |
"\n"."</tr>"; |
"\n"."</tr>"; |
} |
} |
$Str.='<td></td><td><b>From:['.localtime($ConceptData{'Int.'.$k}). |
$Str.='<td></td><td><b>From:['.localtime($ConceptData{'Int.'.$k}). |
Line 309 sub DrawGraph {
|
Line 313 sub DrawGraph {
|
$Max = int($Max); |
$Max = int($Max); |
} else { $Max = 1; } |
} else { $Max = 1; } |
|
|
|
|
my $Titr=($ConceptData{'Interval'}>1) ? $Src.'_interval_'.($k+1) : $Src; |
my $Titr=($ConceptData{'Interval'}>1) ? $Src.'_interval_'.($k+1) : $Src; |
# $GData=$Titr.'&Concepts'.'&'.'Answers'.'&'.$Max.'&'.$P_No.'&'.$data1.'&'.$data2; |
# $GData=$Titr.'&Concepts'.'&'.'Answers'.'&'.$Max.'&'.$P_No.'&'.$data1.'&'.$data2; |
$GData="$Titr&Concepts&Answers&$Max&$P_No&". |
$GData="$Titr&Concepts&Answers&$Max&$P_No&". |
Line 351 sub AnalyzeProblem {
|
Line 354 sub AnalyzeProblem {
|
'" target="_blank">'.$hash{'title_'.$rid}.'</a>'; |
'" target="_blank">'.$hash{'title_'.$rid}.'</a>'; |
$Str .= "\n"."<tr>". |
$Str .= "\n"."<tr>". |
"\n"."<td> $P_No </td>". |
"\n"."<td> $P_No </td>". |
"\n"."<td bgcolor=#DDFFDD> ".$Temp." </td>". |
"\n"."<td bgcolor=".$color{"green"}."> ".$Temp." </td>". |
"\n"."<td bgcolor=#EEFFCC> ".$hash{'src_'.$rid}." </td>". |
"\n"."<td bgcolor=".$color{"yellow"}."> ".$hash{'src_'.$rid}." </td>". |
"\n"."<td> ".'<input type="submit" name="sort" value="'.'Analyze_'.$rid.'" />'.'</td>'. |
"\n"."<td> ".'<input type="submit" name="sort" value="'.'Analyze_'.$rid.'" />'.'</td>'. |
"\n"."</tr>"; |
"\n"."</tr>"; |
$P_No++; |
$P_No++; |
Line 523 sub StudentReport {
|
Line 526 sub StudentReport {
|
"\n".'<th> Tries </th>'. |
"\n".'<th> Tries </th>'. |
"\n".'</tr>'; |
"\n".'</tr>'; |
my ($temp)=keys(%result); |
my ($temp)=keys(%result); |
unless ($temp=~/^error\:/) { |
unless ($temp=~/^(con_lost|error|no_such_host)/i) { |
foreach my $CurCol (@cols) { |
foreach my $CurCol (@cols) { |
if (!$CurCol){ |
if (!$CurCol){ |
my $Set=&Apache::lonnet::declutter($hash{'map_id_'.$1}); |
my $Set=&Apache::lonnet::declutter($hash{'map_id_'.$1}); |
Line 751 sub usection {
|
Line 754 sub usection {
|
$courseid=~s/^(\w)/\/$1/; |
$courseid=~s/^(\w)/\/$1/; |
|
|
my %result=&Apache::lonnet::dump('roles',$udom,$unam); |
my %result=&Apache::lonnet::dump('roles',$udom,$unam); |
|
my ($checkForResult)=keys(%result); |
|
if ($checkForResult=~/^(con_lost|error|no_such_host)/i) { |
|
return -1; |
|
} |
foreach my $key (keys (%result)) { |
foreach my $key (keys (%result)) { |
my $value=$result{$key}; |
my $value=$result{$key}; |
if ($key=~/^$courseid(?:\/)*(\w+)*\_st$/) { |
if ($key=~/^$courseid(?:\/)*(\w+)*\_st$/) { |
Line 803 sub ExtractStudentData {
|
Line 810 sub ExtractStudentData {
|
my $SecLimit; |
my $SecLimit; |
my $MapLimit; |
my $MapLimit; |
my ($temp)=keys(%result); |
my ($temp)=keys(%result); |
unless ($temp=~/^error\:/) { |
unless ($temp=~/^(con_lost|error|no_such_host)/i) { |
foreach my $CurCol(@cols) { |
foreach my $CurCol(@cols) { |
($PrOrd,$ResId)=split(/\:/,$CurCol); |
($PrOrd,$ResId)=split(/\:/,$CurCol); |
if ( !$CurCol ) { next; } |
if ( !$CurCol ) { next; } |
Line 1287 sub TableRow {
|
Line 1294 sub TableRow {
|
"\n".'<td>'.($RealIdx+1).'</td>'. |
"\n".'<td>'.($RealIdx+1).'</td>'. |
# "\n".'<td>'.$PrOrd.$Temp.'</td>'. |
# "\n".'<td>'.$PrOrd.$Temp.'</td>'. |
"\n".'<td>'.$Temp.'</td>'. |
"\n".'<td>'.$Temp.'</td>'. |
"\n".'<td bgcolor="#EEFFCC"> '.$StdNo.'</td>'. |
"\n".'<td bgcolor='.$color{"yellow"}.'> '.$StdNo.'</td>'. |
"\n".'<td bgcolor="#EEFFCC">'.$TotalTries.'</td>'. |
"\n".'<td bgcolor='.$color{"yellow"}.'>'.$TotalTries.'</td>'. |
"\n".'<td bgcolor="#EEFFCC">'.$MxTries.'</td>'. |
"\n".'<td bgcolor='.$color{"yellow"}.'>'.$MxTries.'</td>'. |
"\n".'<td bgcolor="#DDFFFF">'.$Avg.'</td>'. |
"\n".'<td bgcolor='.$color{"gb"}.'>'.$Avg.'</td>'. |
"\n".'<td bgcolor="#DDFFFF"> '.$YES.'</td>'. |
"\n".'<td bgcolor='.$color{"gb"}.'> '.$YES.'</td>'. |
"\n".'<td bgcolor="#DDFFFF"> '.$Override.'</td>'. |
"\n".'<td bgcolor='.$color{"gb"}.'> '.$Override.'</td>'. |
"\n".'<td bgcolor="#FFDDDD"> '.$Wrng.'</td>'. |
"\n".'<td bgcolor='.$color{"red"}.'> '.$Wrng.'</td>'. |
"\n".'<td bgcolor="#FFDDDD">'.$DoD.'</td>'. |
"\n".'<td bgcolor='.$color{"red"}.'> '.$DoD.'</td>'. |
"\n".'<td bgcolor="#DDFFDD"> '.$SD.'</td>'. |
"\n".'<td bgcolor='.$color{"green"}.'> '.$SD.'</td>'. |
"\n".'<td bgcolor="#DDFFDD"> '.$Sk.'</td>'. |
"\n".'<td bgcolor='.$color{"green"}.'> '.$Sk.'</td>'. |
"\n".'<td bgcolor="#FFDDFF"> '.$_D1.'</td>'. |
"\n".'<td bgcolor='.$color{"purple"}.'> '.$_D1.'</td>'. |
"\n".'<td bgcolor="#FFDDFF"> '.$_D2.'</td>'; |
"\n".'<td bgcolor='.$color{"purple"}.'> '.$_D2.'</td>'; |
$r->print("\n".$Ptr.'</tr>' ); |
$r->print("\n".$Ptr.'</tr>' ); |
} |
} |
$GraphDat{$RealIdx}=$DoD.':'.$Wrng; |
$GraphDat{$RealIdx}=$DoD.':'.$Wrng; |
Line 1352 sub GetGraphData {
|
Line 1359 sub GetGraphData {
|
|
|
sub initial { |
sub initial { |
# --------------------------------- Initialize the global varaibles |
# --------------------------------- Initialize the global varaibles |
undef @students; |
undef @students; |
undef @cols; |
undef @cols; |
undef %maps; |
undef %maps; |
undef %section; |
undef %section; |
undef %StuBox; |
undef %StuBox; |
undef @list; |
undef @list; |
undef %CachData; |
undef %CachData; |
undef %GraphDat; |
undef %GraphDat; |
undef %DiscFac; |
undef %DiscFac; |
undef %OpResp; |
undef %OpResp; |
undef %ConceptData; |
undef %ConceptData; |
undef $CurMap; |
undef $CurMap; |
undef $CurSec; |
undef $CurSec; |
undef $CurStu; |
undef $CurStu; |
undef $p_count; |
undef $p_count; |
undef $Pos; |
undef $Pos; |
undef $GData; |
undef $GData; |
$DiscFlag=0; |
$DiscFlag=0; |
$P_Order=100000; |
$P_Order=100000; |
$HWN=$P_Order; |
$HWN=$P_Order; |
|
&setbgcolor(0); |
|
} |
|
|
|
# For loading the colored table for display or un-colored for print |
|
sub setbgcolor { |
|
my $PrintTable=shift; |
|
undef %color; |
|
if ($PrintTable){ |
|
$color{"gb"}="#FFFFFF"; |
|
$color{"red"}="#FFFFFF"; |
|
$color{"yellow"}="#FFFFFF"; |
|
$color{"green"}="#FFFFFF"; |
|
$color{"purple"}="#FFFFFF"; |
|
} else { |
|
$color{"gb"}="#DDFFFF"; |
|
$color{"red"}="#FFDDDD"; |
|
$color{"yellow"}="#EEFFCC"; |
|
$color{"green"}="#DDFFDD"; |
|
$color{"purple"}="#FFDDFF"; |
|
} |
} |
} |
|
|
# my $CacheDB = "/home/httpd/perl/tmp/$ENV{'user.name'}". |
# my $CacheDB = "/home/httpd/perl/tmp/$ENV{'user.name'}". |
Line 1394 sub initial {
|
Line 1421 sub initial {
|
# } |
# } |
# untie(%students); |
# untie(%students); |
|
|
|
|
sub ClassList { |
sub ClassList { |
|
|
&GetStatus(); |
&GetStatus(); |
Line 1405 sub ClassList {
|
Line 1431 sub ClassList {
|
$firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}}; |
$firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}}; |
$lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}}; |
$lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}}; |
if (($firstres) && ($lastres)) { |
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 %classlist=&Apache::lonnet::dump('classlist',$cdom,$cnum); |
|
|
|
my $StudNo = 0; |
my $StudNo = 0; |
my $now=time; |
my $now=time; |
foreach my $name (keys (%classlist)) { |
my %classlist=&Apache::lonnet::dump('classlist',$cdom,$cnum); |
my $value=$classlist{$name}; |
|
my ($end,$start)=split(/\:/,$value); |
my ($checkForError)=keys(%classlist); |
my $active=1; |
if($checkForError=~/^(con_lost|error|no_such_host)/i) { |
my $Status=$ENV{'form.status'}; |
$r->print('<h1>Could not access course data</h1>'); |
$Status = ($Status) ? $Status : 'Active'; |
} else { |
if ( ( ($end) && $now > $end ) && |
foreach my $name (sort keys (%classlist)) { |
( ($Status eq 'Active') ) ) { $active=0; } |
my $value=$classlist{$name}; |
if ( ($Status eq 'Expired') && |
my ($end,$start)=split(/\:/,$value); |
($end == 0 || $now < $end) ) { $active=0; } |
my $active=1; |
if ($active) { |
my $Status=$ENV{'form.status'}; |
my $thisindex=$#students+1; |
$Status = ($Status) ? $Status : 'Active'; |
$students[$thisindex]=$name; |
if ( ( ($end) && $now > $end ) && |
my ($sname,$sdom)=split(/\:/,$name); |
( ($Status eq 'Active') ) ) { $active=0; } |
my $ssec=&usection($sdom,$sname,$cid,$Status); |
if ( ($Status eq 'Expired') && |
if ($ssec==-1 || $ssec eq 'adm' ) {next;} |
($end == 0 || $now < $end) ) { $active=0; } |
$ssec=($ssec) ? $ssec : '(none)'; |
if ($active) { |
#$ssec=(int($ssec)) ? int($ssec) : $ssec; |
my $thisindex=$#students+1; |
$section{$ssec}=$ssec; |
$students[$thisindex]=$name; |
if ($CurSec eq 'All Sections' || $ssec eq $CurSec) { |
my ($sname,$sdom)=split(/\:/,$name); |
$students[$StudNo]=$name; |
my $ssec=&usection($sdom,$sname,$cid,$Status); |
$StuBox{$sname}=$sdom; |
if ($ssec==-1 || $ssec eq 'adm' ) {next;} |
|
$ssec=($ssec) ? $ssec : '(none)'; |
|
#$ssec=(int($ssec)) ? int($ssec) : $ssec; |
|
$section{$ssec}=$ssec; |
|
if ($CurSec eq 'All Sections' || $ssec eq $CurSec) { |
|
$students[$StudNo]=$name; |
|
$StuBox{$sname}=$sdom; |
|
} |
|
$StudNo++; |
} |
} |
$StudNo++; |
|
} |
} |
} |
} |
|
|
Line 1498 sub CreateForm {
|
Line 1519 sub CreateForm {
|
$Ptr .= '<input type=submit name=sort value="Student Assessment"/>'; |
$Ptr .= '<input type=submit name=sort value="Student Assessment"/>'; |
$Ptr .= '</h3>'; |
$Ptr .= '</h3>'; |
#$Ptr .= '<input type=submit name=sort value="Activity Log"/>'; |
#$Ptr .= '<input type=submit name=sort value="Activity Log"/>'; |
#$Ptr .= '</h3>'; |
|
$r->print( $Ptr ); |
$r->print( $Ptr ); |
} |
} |
else { |
else { |
Line 1522 sub CreateForm {
|
Line 1542 sub CreateForm {
|
|
|
sub Menu { |
sub Menu { |
&initial(); |
&initial(); |
|
# my $fn=$ENV{'request.course.fn'}; |
|
# $r->print( '<br>'.$fn.'<br>' ); |
|
|
# $Apache::lonxml::debug=1; |
# $Apache::lonxml::debug=1; |
# &Apache::lonhomework::showhash(%ENV); |
# &Apache::lonhomework::showhash(%ENV); |
# $Apache::lonxml::debug=0; |
# $Apache::lonxml::debug=0; |
|
|
&Title(); |
&Title(); |
my $InpStr = $ENV{'form.sort'}; |
my $InpStr = $ENV{'form.sort'}; |
if ($InpStr eq 'Activity Log') { |
if ($InpStr eq 'Activity Log') { |