From:['.localtime($ConceptData{'Int.'.$k}).
+ '] To: ['.localtime($ConceptData{'Int.'.($k+1)}-1).
+ "]
$Correct
$Wrong
";
+
$Str .= "\n".'
';
+
$r->print($Str);
- $r->rflush();
+#$Apache::lonxml::debug=1;
+#&Apache::lonhomework::showhash(%ConceptData);
+#$Apache::lonxml::debug=0;
}
-# ------------------------------------------- Prepare Statistics Table
-sub PreStatTable {
- my $CacheDB = "/home/httpd/perl/tmp/$ENV{'user.name'}".
- "_$ENV{'user.domain'}_$cid\_statistics.db";
- my $GraphDB = "/home/httpd/perl/tmp/$ENV{'user.name'}".
- "_$ENV{'user.domain'}_$cid\_graph.db";
- my $CachDisFac = "/home/httpd/perl/tmp/$ENV{'user.name'}".
- "_$ENV{'user.domain'}_$cid\_DiscFactor.db";
- $r->print(' ');
+sub DrawGraph {
+ my ($k,$Src)=@_;
+ my $Max=0;
+ my @data1;
+ my @data2;
+
+ # Adjust Data and find the Max
+ for (my $n=0; $n<=$#Concepts; $n++ ) {
+ my $tmp=$Concepts[$n];
+ $data1[$n]=$ConceptData{"$tmp.$k.true"};
+ $data2[$n]=$ConceptData{"$tmp.$k.false"};
+ my $Sum=$data1[$n]+$data2[$n];
+ if ( $Max<$Sum ) {$Max=$Sum;}
+ }
+ for (my $n=0; $n<=$#Concepts; $n++ ) {
+ if ($data1[$n]+$data2[$n]<$Max) {
+ $data2[$n]+=$Max-($data1[$n]+$data2[$n]);
+ }
+ }
+ my $P_No = $#data1+1;
- my $Ptr = '';
+ if ( $Max > 1 ) {
+ $Max += (10 - $Max % 10);
+ $Max = int($Max);
+ } else { $Max = 1; }
+
+ 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&".
+ (join(',',@data1)).'&'.(join(',',@data2));
- $Ptr .= ' Sorting Type: '."\n".
- ' '."\n";
- $Ptr .= ' ';
- $Ptr .= ''."\n";
- $Ptr .= ' ';
- $Ptr .= ''."\n";
+ $r->print('');
+}
- $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 / #Stdns ] '.
- ' #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'.
- ' still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ] '.
- ' S.D. : Standard Deviation of the tries.'.
- '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'.
- ' where Xi is every student\'s tries ] '.
- ' Skew. : Skewness of the students tries.'.
- ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ] '.
-# ' DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ] '.
- ' DoDiff : Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ] '.
-# ' Dis.F. : Discrimination Factor. [ Sum of Partial Credits Awarded / Total Number of Tries in %27 upper and lower students]'.
- '
Total Number of Students opened the problem.';
+ $Ptr .= '
';
+ $Ptr .= 'Tries:
';
+ $Ptr .= '
Total Number of Tries for solving the problem.';
+ $Ptr .= '
';
+ $Ptr .= 'Mod:
';
+ $Ptr .= '
Maximunm Number of Tries for solving the problem.';
+ $Ptr .= '
';
+ $Ptr .= 'Mean:
';
+ $Ptr .= '
Average Number of the tries. [ Tries / #Stdnts ]';
+ $Ptr .= '
';
+ $Ptr .= '#YES:
';
+ $Ptr .= '
Number of students solved the problem correctly.';
+ $Ptr .= '
';
+ $Ptr .= '#yes:
';
+ $Ptr .= '
Number of students solved the problem by override.';
+ $Ptr .= '
';
+ $Ptr .= '%Wrng:
';
+ $Ptr .= '
Percentage of students tried to solve the problem ';
+ $Ptr .= 'but still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]';
+ $Ptr .= '
';
+# Kashy formula
+# ' DoDiff : Degree of Difficulty of the problem. '.
+# '[ Tries/(#YES+#yes+0.1) ] '.
+ #Gerd formula
+ $Ptr .= 'DoDiff:
';
+ $Ptr .= '
Degree of Difficulty of the problem. ';
+ $Ptr .= '[ 1 - ((#YES+#yes) / Tries) ]';
+ $Ptr .= '
';
+ $Ptr .= 'S.D.:
';
+ $Ptr .= '
Standard Deviation of the tries. ';
+ $Ptr .= '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1) ';
+ $Ptr .= 'where Xi denotes every student\'s tries ]';
+ $Ptr .= '
';
+ $Ptr .= 'Skew.:
';
+ $Ptr .= '
Skewness of the students tries.';
+ $Ptr .= '[(sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3)]';
+ $Ptr .= '
';
+ $Ptr .= 'Dis.F.:
';
+ $Ptr .= '
Discrimination Factor: A Standard for evaluating the ';
+ $Ptr .= 'problem according to a Criterion ';
+ $Ptr .= '[Applied Criterion in %27 Upper Students - ';
+ $Ptr .= 'Applied the same Criterion in %27 Lower Students] ';
+ $Ptr .= '1st Criterion for Sorting the Students: ';
+ $Ptr .= 'Sum of Partial Credit Awarded / Total Number of Tries ';
+ $Ptr .= '2nd Criterion for Sorting the Students: ';
+ $Ptr .= 'Total number of Correct Answers / Total Number of Tries';
+ $Ptr .= '
';
+ $Ptr .= '
Disc.
';
+ $Ptr .= '
Number of Students had at least one discussion.';
+ $Ptr .= '
';
+
+ return $Ptr;
}
+#---- END Problem Statistics Web Page ----------------------------------------
+
+#---- Problem Statistics Graph Web Page --------------------------------------
+
# ------------------------------------------- Prepare data for Graphical chart
sub GetGraphData {
- my $Tag = shift;
+ my $ylab = shift;
my $Col;
my $data='';
my $count = 0;
@@ -749,12 +1262,12 @@ sub GetGraphData {
foreach (keys %GraphDat) {delete $GraphDat{$_};}
if (-e "$GraphDB") {
if (tie(%GraphDat,'GDBM_File',"$GraphDB",&GDBM_READER,0640)) {
- if ( $Tag eq 'DoDiff Graph' ) {
- $Tag = 'Degree-of-Difficulty';
+ if ( $ylab eq 'DoDiff Graph' ) {
+ $ylab = 'Degree-of-Difficulty';
$Col = 0;
}
else {
- $Tag = 'Wrong-Percentage';
+ $ylab = 'Wrong-Percentage';
$Col = 1;
}
foreach (sort NumericSort keys %GraphDat) {
@@ -764,299 +1277,891 @@ sub GetGraphData {
$data .= $inf.',';
$count++;
}
+ if ( $Max > 1 ) {
+ $Max += (10 - $Max % 10);
+ $Max = int($Max);
+ }
+ else { $Max = 1; }
untie(%GraphDat);
my $Course = $ENV{'course.'.$cid.'.description'};
$Course =~ s/\ /"_"/eg;
- $GData=$Course.'&'.$Tag.'&'.$Max.'&'.$count.'&'.$data;
-
+ $GData=$Course.'&'.'Problems'.'&'.$ylab.'&'.$Max.'&'.$count.'&'.$data;
}
else {
$r->print("Unable to tie hash to db file");
}
}
}
+#---- Problem Analysis Web Page ----------------------------------------------
+sub IntervalOptions {
+ my ($cache)=@_;
-sub initial {
-# --------------------------------- Initialize the global varaibles
- undef @students;
- undef @cols;
- undef %maps;
- undef %section;
- undef %StuBox;
- undef @list;
- undef %CachData;
- undef %GraphDat;
- undef %DiscFac;
- undef $CurMap;
- undef $CurSec;
- undef $CurStu;
- undef $p_count;
- undef $Pos;
- undef $GData;
+ my $interval = 1;
+ for(my $n=1; $n<=7; $n++) {
+ if($cache->{'Interval'} == $n) {
+ $interval = $n;
+ }
+ }
+
+ my $Ptr = ' Select number of intervals'."\n".
+ ''."\n";
+
+ return $Ptr;
}
+sub OptionResponseTable {
+ my ($cache)=@_;
+ my $Str = '';
+ $Str .= ' Option Response Problems in this course:'."\n";
+ $Str .= '
'."\n";
+ $Str .= "
\#
Problem Title
";
+ $Str .= '
Resource
Analysis
'."\n";
+
+ my $number=1;
+ foreach (split(':::',$cache->{'OptionResponses'})) {
+ my ($uri,$title,$part,$problem)=split('::',$_);
+ my $Temp = ''.$title.'';
+ $Str .= '
';
+ $Str .= '
'.$number.'
';
+ $Str .= '
'.$Temp.'
';
+ $Str .= '
'.$uri.'
';
+ $Str .= '
'."\n";
+ $number++;
+ }
+ $Str .= '
'."\n";
-sub ClassList {
-
- &GetStatus();
-
- $cid=$ENV{'request.course.id'};
- my $chome=$ENV{'course.'.$cid.'.home'};
- my ($cdom,$cnum)=split(/\_/,$cid);
-# ----------------------- Get first and last resource, see if there is anything
- $firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}};
- $lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}};
- if (($firstres) && ($lastres)) {
-# ----------------------------------------------------------------- Render page
- my $classlst=&Apache::lonnet::reply
- ('dump:'.$cdom.':'.$cnum.':classlist',$chome);
- my $StudNo = 0;
- unless ($classlst=~/^error\:/) {
- foreach (sort split(/\&/,$classlst)) {
- my ($name,$value)=split(/\=/,$_);
- my ($end,$start)=split(/\:/,&Apache::lonnet::unescape($value));
- $name=&Apache::lonnet::unescape($name);
- my ($sname,$sdom)=split(/\:/,$name);
- my $ssec=&Apache::lonnet::usection($sdom,$sname,$cid);
- if ($ssec==-1) {next;}
- $ssec=($ssec) ? $ssec : '(none)';
- #$ssec=(int($ssec)) ? int($ssec) : $ssec;
- #$r->print($sname.'...'.$ssec.' ');
- $section{$ssec}=$ssec;
- if ($CurSec eq 'All Sections' || $ssec eq $CurSec) {
- $students[$StudNo]=$name;
- $StuBox{$sname}=$ssec;
- }
- $StudNo++;
- }
- }
- else {
- $r->print('
Could not access course data
');
- }
- $r->print("Total number of students : ".($#students+1));
- $r->rflush();
-# --------------- Find all assessments and put them into some linear-like order
- &tracetable($firstres,'&'.$lastres.'&');
+ return $Str;
+}
-#my $c=0;
-#foreach(@mapsort) {
-# $c++;
-# $r->print(' '.$mapsort[$c]);
-#}
-#$r->print(' Count = '.$c);
+#---- END Problem Analysis Web Page ------------------------------------------
+#---- Student Assessment Web Page --------------------------------------------
+
+sub MapOptions {
+ my ($cache, $page)=@_;
+ my $Ptr = '
';
+ $Ptr .= '
Select Map
'."\n";
+ $Ptr .= '
'."\n";
+
+ return $Ptr;
+}
+
+sub StudentOptions {
+ my ($students, $selectedName)=@_;
+
+ my $Ptr ='