version 1.30, 2002/08/15 14:15:20
|
version 1.34, 2002/10/30 18:37:00
|
Line 84 sub InitializeProblemStatistics {
|
Line 84 sub InitializeProblemStatistics {
|
my $lastStatus = (defined($cache{'StatisticsLastStatus'})) ? |
my $lastStatus = (defined($cache{'StatisticsLastStatus'})) ? |
$cache{'StatisticsLastStatus'} : 'Nothing'; |
$cache{'StatisticsLastStatus'} : 'Nothing'; |
my $whichStudents = join(':::',sort(@$students)); |
my $whichStudents = join(':::',sort(@$students)); |
if(!defined($cache{'StatisticsCached'}) || |
if(!defined($cache{'StatisticsCached'}) || |
$lastStatus ne $cache{'Status'} || |
$lastStatus ne $cache{'Status'} || |
$whichStudents ne $cache{'StatisticsWhichStudents'}) { |
$whichStudents ne $cache{'StatisticsWhichStudents'}) { |
$isNotCached = 1; |
$isNotCached = 1; |
Line 109 sub InitializeProblemStatistics {
|
Line 109 sub InitializeProblemStatistics {
|
&Apache::loncoursedata::DownloadStudentCourseDataSeparate($students, |
&Apache::loncoursedata::DownloadStudentCourseDataSeparate($students, |
'true', |
'true', |
$cacheDB, |
$cacheDB, |
'true', |
'true', |
'true', |
'true', |
$courseID, |
$courseID, |
$r, $c); |
$r, $c); |
Line 147 sub InitializeProblemStatistics {
|
Line 147 sub InitializeProblemStatistics {
|
return ('ERROR', undef); |
return ('ERROR', undef); |
} |
} |
|
|
my $orderedProblems = &SortProblems(\%cache, |
my $orderedProblems = &SortProblems(\%cache, |
$cache{'ProblemStatisticsSort'}, |
$cache{'ProblemStatisticsSort'}, |
$cache{'SortProblems'}, |
$cache{'SortProblems'}, |
$cache{'ProblemStatisticsAscend'}); |
$cache{'ProblemStatisticsAscend'}); |
Line 173 sub BuildProblemStatisticsPage {
|
Line 173 sub BuildProblemStatisticsPage {
|
$Ptr .= '<table border="0" cellspacing="5"><tbody>'; |
$Ptr .= '<table border="0" cellspacing="5"><tbody>'; |
$Ptr .= '<tr><td align="right"><b>Select Map</b></td>'."\n"; |
$Ptr .= '<tr><td align="right"><b>Select Map</b></td>'."\n"; |
$Ptr .= '<td align="left">'; |
$Ptr .= '<td align="left">'; |
$Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'ProblemStatistics', |
$Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'Statistics', |
'Statistics'); |
'Statistics'); |
$Ptr .= '</td></tr>'."\n"; |
$Ptr .= '</td></tr>'."\n"; |
$Ptr .= '<tr><td align="right"><b>Sorting Type:</b></td>'."\n"; |
$Ptr .= '<tr><td align="right"><b>Sorting Type:</b></td>'."\n"; |
$Ptr .= '<td align="left">'."\n"; |
$Ptr .= '<td align="left">'."\n"; |
$Ptr .= &Apache::lonhtmlcommon::AscendOrderOptions( |
$Ptr .= &Apache::lonhtmlcommon::AscendOrderOptions( |
$cache{'ProblemStatisticsAscend'}, |
$cache{'ProblemStatisticsAscend'}, |
'ProblemStatistics', |
'ProblemStatistics', |
'Statistics'); |
'Statistics'); |
$Ptr .= '</td></tr>'."\n"; |
$Ptr .= '</td></tr>'."\n"; |
$Ptr .= '<tr><td align="right"><b>Select Sections</b>'; |
$Ptr .= '<tr><td align="right"><b>Select Sections</b>'; |
$Ptr .= '</td>'."\n"; |
$Ptr .= '</td>'."\n"; |
Line 192 sub BuildProblemStatisticsPage {
|
Line 192 sub BuildProblemStatisticsPage {
|
\@sectionsSelected, |
\@sectionsSelected, |
'Statistics'); |
'Statistics'); |
$Ptr .= '</td></tr>'."\n"; |
$Ptr .= '</td></tr>'."\n"; |
$Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'}, |
$Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'}, |
$cache{'DisplayLegend'}, |
$cache{'DisplayLegend'}, |
$cache{'SortProblems'}); |
$cache{'SortProblems'}); |
$Ptr .= '</table>'; |
$Ptr .= '</table>'; |
Line 213 sub BuildProblemStatisticsPage {
|
Line 213 sub BuildProblemStatisticsPage {
|
$r->print('Unable to tie database.6'); |
$r->print('Unable to tie database.6'); |
return; |
return; |
} |
} |
&BuildStatisticsTable(\%cache, $cache{'DisplayFormat'}, |
&BuildStatisticsTable(\%cache, $cache{'DisplayFormat'}, |
$cache{'SortProblems'}, $orderedProblems, |
$cache{'SortProblems'}, $orderedProblems, |
\@Header, $r, $color); |
\@Header, $r, $color); |
untie(%cache); |
untie(%cache); |
|
|
Line 225 sub BuildGraphicChart {
|
Line 225 sub BuildGraphicChart {
|
my ($graph,$cacheDB,$courseDescription,$students,$courseID,$r,$c)=@_; |
my ($graph,$cacheDB,$courseDescription,$students,$courseID,$r,$c)=@_; |
my %cache; |
my %cache; |
my $max = 0; |
my $max = 0; |
|
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { |
|
return 'Unable to tie database.7'; |
|
} |
|
|
|
# my @problems = split(':::', $cache{'problemList'}); |
|
|
|
my $title = ''; |
|
if($graph eq 'DoDiffGraph') { |
|
$title = 'Degree-of-Difficulty'; |
|
} else { |
|
$title = 'Wrong-Percentage'; |
|
} |
|
|
my ($result, undef) = |
|
|
# foreach (@problems) { |
|
# my $data = 0; |
|
# if($graph eq 'DoDiffGraph') { |
|
# $data = sprintf("%.2f", $cache{$_.':degreeOfDifficulty'}), |
|
# } else { |
|
# $data = sprintf("%.1f", $cache{$_.':percentWrong'}), |
|
# } |
|
# if($max < $data) { |
|
# $max = $data; |
|
# } |
|
# push(@values, $data); |
|
# } |
|
|
|
|
|
my $count = 1; |
|
my $currentSequence = -1; |
|
my $sortProblems = 'Sort Within Sequence'; |
|
|
|
my ($result, $orderedProblems) = |
&InitializeProblemStatistics($cacheDB, $students, $courseID, $c, $r); |
&InitializeProblemStatistics($cacheDB, $students, $courseID, $c, $r); |
if($result ne 'OK') { |
if($result ne 'OK') { |
return; |
return; |
} |
} |
|
|
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { |
|
return 'Unable to tie database.7'; |
|
} |
|
|
|
my @problems = split(':::', $cache{'problemList'}); |
|
my @values = (); |
my @values = (); |
foreach (@problems) { |
|
|
foreach(@$orderedProblems) { |
|
my ($sequence,$problem,$part)=split(':', $_); |
|
if($cache{'StatisticsMaps'} ne 'All Maps' && |
|
$cache{'StatisticsMaps'} ne $cache{$sequence.':title'}) { |
|
next; |
|
} |
|
|
|
if($currentSequence == -1 || |
|
($sortProblems eq 'Sort Within Sequence' && |
|
$currentSequence != $sequence)) { |
|
if($currentSequence ne -1) { |
|
#$r->print('<br>finish a graph<br>'); |
|
} |
|
if($sortProblems eq 'Sort Within Sequence') { |
|
$r->print('<b>'.$cache{$sequence.':title'}.'</b>'); |
|
} |
|
|
|
my $sendValues = join(',', @values); |
|
my $sendCount = scalar(@values); |
|
|
|
my @GData = ($courseDescription, 'Problems', |
|
$title, $max, $sendCount, $sendValues); |
|
$r->print('</form>'."\n"); |
|
$r->print('<IMG src="/cgi-bin/graph.gif?'. |
|
(join('&', @GData)).'" border="1" />'); |
|
$r->print('<form>'."\n"); |
|
$currentSequence = $sequence; |
|
@values = (); |
|
|
|
} |
my $data = 0; |
my $data = 0; |
if($graph eq 'DoDiffGraph') { |
if($graph eq 'DoDiffGraph') { |
$data = sprintf("%.2f", $cache{$_.':degreeOfDifficulty'}), |
$data = sprintf("%.2f", $cache{$_.':degreeOfDifficulty'}), |
Line 249 sub BuildGraphicChart {
|
Line 305 sub BuildGraphicChart {
|
$max = $data; |
$max = $data; |
} |
} |
push(@values, $data); |
push(@values, $data); |
} |
|
untie(%cache); |
|
|
|
my $sendValues = join(',', @values); |
|
my $sendCount = scalar(@values); |
|
|
|
my $title = ''; |
|
if($graph eq 'DoDiffGraph') { |
|
$title = 'Degree-of-Difficulty'; |
|
} else { |
|
$title = 'Wrong-Percentage'; |
|
} |
} |
my @GData = ($courseDescription, 'Problems', $title, $max, $sendCount, |
|
$sendValues); |
|
|
|
$r->print('</form>'."\n"); |
#$r->print('<br>'); |
$r->print('<IMG src="/cgi-bin/graph.gif?'.(join('&', @GData)). |
|
'" border="1" />'); |
untie(%cache); |
$r->print('<form>'."\n"); |
|
|
|
return; |
return; |
} |
} |
|
|
|
|
#---- Problem Statistics Web Page --------------------------------------- |
#---- Problem Statistics Web Page --------------------------------------- |
|
|
sub CreateProblemStatisticsTableHeading { |
sub CreateProblemStatisticsTableHeading { |
Line 287 sub CreateProblemStatisticsTableHeading
|
Line 331 sub CreateProblemStatisticsTableHeading
|
$Str .= '&ProblemStatisticsSort='; |
$Str .= '&ProblemStatisticsSort='; |
$Str .= &Apache::lonnet::escape($_).'">'.$_.'</a> </th>'."\n"; |
$Str .= &Apache::lonnet::escape($_).'">'.$_.'</a> </th>'."\n"; |
} |
} |
$Str .= "\n".'</tr>'."\n"; |
$Str .= "\n".'</tr>'."\n"; |
|
|
return $Str; |
return $Str; |
} |
} |
Line 305 sub BuildStatisticsTable {
|
Line 349 sub BuildStatisticsTable {
|
next; |
next; |
} |
} |
|
|
if($currentSequence == -1 || |
if($currentSequence == -1 || |
($sortProblems eq 'Sort Within Sequence' && |
($sortProblems eq 'Sort Within Sequence' && |
$currentSequence != $sequence)) { |
$currentSequence != $sequence)) { |
if($displayFormat ne 'Display CSV Format') { |
if($displayFormat ne 'Display CSV Format') { |
if($currentSequence ne -1) { |
if($currentSequence ne -1) { |
Line 435 sub ProblemStatisticsButtons {
|
Line 479 sub ProblemStatisticsButtons {
|
|
|
my $Ptr = '<tr><td></td><td align="left">'; |
my $Ptr = '<tr><td></td><td align="left">'; |
$Ptr .= '<input type="submit" name="DoDiffGraph" '; |
$Ptr .= '<input type="submit" name="DoDiffGraph" '; |
$Ptr .= 'value="Degree of Difficulty" />'."\n"; |
$Ptr .= 'value="Plot Degree of Difficulty" />'."\n"; |
$Ptr .= '</td><td align="left">'; |
$Ptr .= '</td><td align="left">'; |
$Ptr .= '<input type="submit" name="PercentWrongGraph" '; |
$Ptr .= '<input type="submit" name="PercentWrongGraph" '; |
$Ptr .= 'value="Percent Wrong" />'."\n"; |
$Ptr .= 'value="Plot Percent Wrong" />'."\n"; |
$Ptr .= '</td></tr><tr><td></td><td>'."\n"; |
$Ptr .= '</td></tr><tr><td></td><td>'."\n"; |
$Ptr .= '<input type="submit" name="SortProblems" '; |
$Ptr .= '<input type="submit" name="SortProblems" '; |
if($sortProblems eq 'Sort All Problems') { |
if($sortProblems eq 'Sort All Problems') { |
Line 507 sub ProblemStatisticsLegend {
|
Line 551 sub ProblemStatisticsLegend {
|
$Ptr .= '<b>Dis.F.</b></td>'; |
$Ptr .= '<b>Dis.F.</b></td>'; |
$Ptr .= '<td>Discrimination Factor: A Standard for evaluating the '; |
$Ptr .= '<td>Discrimination Factor: A Standard for evaluating the '; |
$Ptr .= 'problem according to a Criterion<br>'; |
$Ptr .= 'problem according to a Criterion<br>'; |
$Ptr .= '<b>[Applied Criterion in %27 Upper Students - '; |
$Ptr .= '<b>[Criterion to group students into %27 Upper Students - '; |
$Ptr .= 'Applied the same Criterion in %27 Lower Students]</b><br>'; |
$Ptr .= 'and %27 Lower Students]</b><br>'; |
$Ptr .= '<b>1st Criterion</b> for Sorting the Students: '; |
$Ptr .= '<b>1st Criterion</b> for Sorting the Students: '; |
$Ptr .= '<b>Sum of Partial Credit Awarded / Total Number of Tries</b><br>'; |
$Ptr .= '<b>Sum of Partial Credit Awarded / Total Number of Tries</b><br>'; |
$Ptr .= '<b>2nd Criterion</b> for Sorting the Students: '; |
$Ptr .= '<b>2nd Criterion</b> for Sorting the Students: '; |
Line 571 sub ExtractStudentData {
|
Line 615 sub ExtractStudentData {
|
} |
} |
|
|
my $studentTriesJoined = join(':::', @studentTries); |
my $studentTriesJoined = join(':::', @studentTries); |
$problemData{$id.':sequenceTitle'} = |
$problemData{$id.':sequenceTitle'} = |
$cache->{$sequence.':title'}; |
$cache->{$sequence.':title'}; |
$problemData{$id.':studentCount'} = $studentCount; |
$problemData{$id.':studentCount'} = $studentCount; |
$problemData{$id.':totalTries'} = $totalTries; |
$problemData{$id.':totalTries'} = $totalTries; |
Line 623 sub SortDivideByTries {
|
Line 667 sub SortDivideByTries {
|
my @orderedData = sort { ($data->{$a.':totalTries'}) ? |
my @orderedData = sort { ($data->{$a.':totalTries'}) ? |
($data->{$a.$sortOn}/$data->{$a.':totalTries'}):0 |
($data->{$a.$sortOn}/$data->{$a.':totalTries'}):0 |
<=> |
<=> |
($data->{$b.':totalTries'}) ? |
($data->{$b.':totalTries'}) ? |
($data->{$b.$sortOn}/$data->{$b.':totalTries'}):0 |
($data->{$b.$sortOn}/$data->{$b.':totalTries'}):0 |
} @$toSort; |
} @$toSort; |
|
|
Line 811 sub CalculateStatistics {
|
Line 855 sub CalculateStatistics {
|
'___difficulty'}=$data->{$_.':degreeOfDifficulty'}; |
'___difficulty'}=$data->{$_.':degreeOfDifficulty'}; |
$cache->{$sequence.':source'} =~ /^(\w+)\/(\w+)/; |
$cache->{$sequence.':source'} =~ /^(\w+)\/(\w+)/; |
if($data->{$_.':studentCount'}) { |
if($data->{$_.':studentCount'}) { |
&Apache::lonnet::put('resevaldata',\%storestats,$1,$2); |
&Apache::lonnet::put('nohist_resevaldata',\%storestats,$1,$2); |
} |
} |
} |
} |
|
|