# The LearningOnline Network with CAPA # # $Id: lonproblemanalysis.pm,v 1.43 2003/10/20 20:42:39 matthew Exp $ # # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # # LON-CAPA is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # LON-CAPA is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with LON-CAPA; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # /home/httpd/html/adm/gpl.txt # # http://www.lon-capa.org/ # package Apache::lonproblemanalysis; use strict; use Apache::lonnet(); use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::loncoursedata(); use Apache::lonstatistics; use Apache::lonlocal; use HTML::Entities(); use Time::Local(); use Spreadsheet::WriteExcel(); my $plotcolors = ['#33ff00', '#0033cc', '#990000', '#aaaa66', '#663399', '#ff9933', '#66ccff', '#ff9999', '#cccc33', '#660000', '#33cc66', ]; sub BuildProblemAnalysisPage { my ($r,$c)=@_; $r->print('
'.
' |
'.&mt('Concept Number').' | '. ''.&mt('Concept').' | '. ''.&mt('Foil Number').' | '. ''.&mt('Foil Name').' | '. ''.&mt('Foil Text').' | '. ''.&mt('Correct Value').' | '. "
---|---|---|---|---|---|
'.&mt('Foil Number').' | '. ''.&mt('Foil Name').' | '. ''.&mt('Foil Text').' | '. ''.&mt('Correct Value').' | '. "||
'.$conceptindex.' | '. ''.$concept->{'name'}.' | '. ''.$foilindex++.' | '. ''.$Foildata{$firstfoil}->{'name'}.' | '. ''.$Foildata{$firstfoil}->{'text'}.' | '. ''.$Foildata{$firstfoil}->{'value'}.' | '. "
'.$foilindex++.' | '. ''.$Foildata{$firstfoil}->{'name'}.' | '. ''.$Foildata{$firstfoil}->{'text'}.' | '. ''.$Foildata{$firstfoil}->{'value'}.' | '. "||
'. ' | '. ' | '.$foilindex.' | '. ''.$Foildata{$foilid}->{'name'}.' | '. ''.$Foildata{$foilid}->{'text'}.' | '. ''.$Foildata{$foilid}->{'value'}.' | '. "
'.$foilindex.' | '. ''.$Foildata{$foilid}->{'name'}.' | '. ''.$Foildata{$foilid}->{'text'}.' | '. ''.$Foildata{$foilid}->{'value'}.' | '. "
'. (' 'x4).' | '. ''.$option.' | '. "
'.$correctgraph.' | '; ## ## for (my $i=0; $i< scalar(@{$Datasets[0]});$i++) { $Datasets[0]->[$i]=0; } $count = $ResponseData{'_total'}->[$i]-$ResponseData{'_correct'}->[$i]; if ($count == 0) { $count = 'no submissions'; } elsif ($count == 1) { $count = '1 submission'; } else { $count = $count.' submissions'; } $title = 'Attempt '.$i.', '.$count; my $incorrectgraph = &Apache::loncommon::DrawGraph ($title,'Foil Number','% Option Chosen Incorrectly', 100,$plotcolors,@Datasets); $analysis_html.= ''.$incorrectgraph.' | '; $analysis_html.= ''.$foilkey." |
'.$graphlink." |
'.$correctplot.' | '. ''.$incorrectplot.' | '. ''.$foilkey.' | '."|
'.
'Start Time:'.
' '.$interval->{'startdateform'}.' '. 'End Time : '. ' '.$interval->{'enddateform'}.' '. # 'Plot Title :'. # (" "x3).$interval->{'titleform'}. ' | '.
"|||
'.$correctplot.' | '. ''.
'Start Time: '.$interval->{'startdateform'}.' '. 'End Time : '. ' '.$interval->{'enddateform'}.' '. # 'Plot Title :'.(" "x3). # $interval->{'titleform'}. ' | '.
"
'.&mt('Sections').' | '; $Str .= ''.&mt('Enrollment Status').' | '; # $Str .= ''.&mt('Sequences and Folders').' | '; $Str .= ''; $Str .= ' |
'."\n"; $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); $Str .= ' | '; # $Str .= ''; $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); $Str .= ' | '; # # $Str .= ''; my $only_seq_with_assessments = sub { my $s=shift; if ($s->{'num_assess'} < 1) { return 0; } else { return 1; } }; &Apache::lonstatistics::MapSelect('Maps','multiple,all',5, $only_seq_with_assessments); ## ## $Str .= ' | ';
{ # These braces are here to organize the code, not scope it.
{
$Str .= ' '; } { $Str .= ' '; } { $Str .= ' | ';
##
##
$Str .= '
'. ''. ' | '. ''.$res->{'title'}.' '; if ($partdata->{'option'} > 1) { $seq_str .= &mt('response').' '.$respid; } $seq_str .= " |
  | '.$seq->{'title'}.' | '. "