';
- $r->print(' '.$ptr.' ');
+# $GData=$Titr.'&Concepts'.'&'.'Answers'.'&'.$Max.'&'.$P_No.'&'.$data1.'&'.$data2;
+ $GData="$Titr&Concepts&Answers&$Max&$P_No&".
+ (join(',',@data1)).'&'.(join(',',@data2));
+
+ $r->print(' ');
}
@@ -354,47 +308,32 @@ sub OpStatus {
my @True = ();
my @False = ();
my $flag=0;
- @shown=();
if ($reshash{'version'}) {
+ my $tries=0;
+ &Apache::lonhomework::showhash(%Answer);
for (my $version=1;$version<=$reshash{'version'};$version++) {
my $time=$reshash{"$version:timestamp"};
- foreach (sort(split(/\:/,$reshash{$version.':keys'}))) {
- if (($_=~/\.(\w+)\.(\w+)\.submission$/)) {
- #my $Id1=$1; my $Id2=$2;
- my $Resp = $reshash{$_};
+
+ foreach my $key (sort(split(/\:/,$reshash{$version.':keys'}))) {
+ if (($key=~/\.(\w+)\.(\w+)\.submission$/)) {
+ my $Id1 = $1; my $Id2 = $2;
+ #check if this is a repeat submission, if so skip it
+ if ($reshash{"$version:resource.$Id1.previous"}) { next; }
+ #if no solved this wasn't a real submission, ignore it
+ if (!defined($reshash{"$version:resource.$Id1.solved"})) {
+ &Apache::lonxml::debug("skipping ");
+ next;
+ }
+ my $Resp = $reshash{"$version:$key"};
my %submission=&Apache::lonnet::str2hash($Resp);
foreach (keys %submission) {
- my $Ansr = $ConceptData{"$_"};
- #my $Ansr = $Answer{"$Id1.$Id2.foil.value.$_"};
- #$r->print(" shown: ".join(',',@shown)." size=$#shown");
+ my $Ansr = $Answer{"$Id1.$Id2.foil.value.$_"};
if ($submission{$_}) {
- #if($#shown==-1){
- #my @str=split(/\&/,$Resp);
- #my $garb;
- #for(my $j=0;$j<=$#str;$j++){
- # ($shown[$j],$garb)=split(/\=/,$str[$j]);
- #}
- ##$r->print(" shown: ".join(',',@shown)." size=$#shown");
- #}
if ($submission{$_} eq $Ansr) {
&Decide("true",$_,$time );
}
else {&Decide("false",$_,$time );}
}
- #else {
- # if ($#shown==-1 && $flag==0) {
- # $flag++;
- # &InitAnalysis($rid,$student);
- # }
- # my @erl=split(/\:/,$_);
- # for (my $i=0;$i<=$#shown; $i++){
- # my $Ans=$Answer{"$Id1.$Id2.foil.value.$shown[$i]"};
- # if ($erl[$i] eq $Ans) {
- # &Decide("true",$shown[$i],$time);
- # }
- # else {&Decide("false",$shown[$i],$time);}
- # }
- #}
}
}
}
@@ -598,11 +537,17 @@ sub StudentReport {
}
sub CreateTable {
+ my ($Hd, $Hid)=@_;
+ if ($ENV{'form.showcsv'}) {
+ if ( $Hd == 1 ) {
+ $r->print(' "'.$hash{'title_'.$Hid}.'","'.$hash{'src_'.$Hid}.'"');
+ }
+ return;
+ }
my $ColNo=0;
foreach (keys(%Header)){
$ColNo++;
}
- my ($Hd, $Hid)=@_;
if ( $Hd == 1 ) {
$r->print(' '.$hash{'title_'.$Hid}.'');
@@ -619,6 +564,9 @@ sub CreateTable {
}
sub CloseTable {
+ if ($ENV{'form.showcsv'}) {
+ return;
+ }
$r->print("\n".''."\n");
$r->rflush();
}
@@ -657,8 +605,8 @@ sub PreStatTable {
$Ptr .= '
'.
' #Stdnts: Total Number of Students opened the problem. '.
' Tries : Total Number of Tries for solving the problem. '.
- ' Mod : Maximunm Number of Tries for solving the problem. '.
- ' Mean : Average Number of the tries. [ Tries / #Stdnts ] '.
+ ' Max : Maximunm Number of Tries for solving the problem. '.
+ ' Avg. : Average Number of the tries. [ Tries / #Stdnts ] '.
' #YES : Number of students solved the problem correctly. '.
' #yes : Number of students solved the problem by override. '.
' %Wrng : Percentage of students tried to solve the problem but'.
@@ -666,10 +614,10 @@ sub PreStatTable {
# ' DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ] '. Kashy formula
' DoDiff : Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ] '. #Gerd formula
' S.D. : Standard Deviation of the tries.'.
- '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'.
+ '[ sqrt(sum((Xi - Avg.)^2)) / (#Stdnts-1)'.
' where Xi denotes every student\'s tries ] '.
' Skew. : Skewness of the students tries.'.
- ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ] '.
+ ' [ (sqrt( sum((Xi - Avg.)^3) / #Stdnts)) / (S.D.^3) ] '.
' Dis.F. : Discrimination Factor: A Standard for '.
'evaluating the problem according to a Criterion '.
' [Applied Criterion in %27 Upper Students - '.
@@ -681,6 +629,11 @@ sub PreStatTable {
'
';
$r->print($Ptr);
+
+ $r->print('Output CSV format: print(' checked'); }
+ $r->print('>');
+
$r->rflush();
if ((-e "$CacheDB")&&($ENV{'form.sort'} ne 'Recalculate Statistics')) {
@@ -1230,7 +1183,28 @@ sub TableRow {
my ($Str,$Idx,$RealIdx)=@_;
my($PrOrd,$Temp,$StdNo,$TotalTries,$MxTries,$Avg,$YES,$Override,
$Wrng,$DoD,$SD,$Sk,$_D1,$_D2,$Prob)=split(/\&/,$Str);
- my $Ptr = "\n".'