version 1.57, 2004/01/19 16:33:16
|
version 1.60, 2004/01/19 21:31:08
|
Line 33 use Apache::lonhtmlcommon();
|
Line 33 use Apache::lonhtmlcommon();
|
use Apache::loncoursedata(); |
use Apache::loncoursedata(); |
use Apache::lonstatistics; |
use Apache::lonstatistics; |
use Apache::lonlocal; |
use Apache::lonlocal; |
|
use Apache::lonstathelpers; |
use HTML::Entities(); |
use HTML::Entities(); |
use Time::Local(); |
use Time::Local(); |
use Spreadsheet::WriteExcel(); |
use Spreadsheet::WriteExcel(); |
Line 58 my @SubmitButtons = ({ name => 'PrevProb
|
Line 59 my @SubmitButtons = ({ name => 'PrevProb
|
{ name => 'ExcelOutput', |
{ name => 'ExcelOutput', |
text => 'Produce Excel Output' }); |
text => 'Produce Excel Output' }); |
|
|
sub render_resource { |
|
my ($resource) = @_; |
|
## |
|
## Render the problem |
|
my $base; |
|
($base,undef) = ($resource->{'src'} =~ m|(.*/)[^/]*$|); |
|
$base = "http://".$ENV{'SERVER_NAME'}.$base; |
|
my $rendered_problem = |
|
&Apache::lonnet::ssi_body($resource->{'src'}); |
|
$rendered_problem =~ s/<\s*form\s*/<nop /g; |
|
$rendered_problem =~ s|(<\s*/form\s*>)|<\/nop>|g; |
|
return '<table bgcolor="ffffff"><tr><td>'. |
|
'<base href="'.$base.'" />'. |
|
$rendered_problem. |
|
'</td></tr></table>'; |
|
} |
|
|
|
sub BuildProblemAnalysisPage { |
sub BuildProblemAnalysisPage { |
my ($r,$c)=@_; |
my ($r,$c)=@_; |
Line 152 sub BuildProblemAnalysisPage {
|
Line 137 sub BuildProblemAnalysisPage {
|
my $resource = $current_problem->{'resource'}; |
my $resource = $current_problem->{'resource'}; |
$r->print('<h1>'.$resource->{'title'}.'</h1>'); |
$r->print('<h1>'.$resource->{'title'}.'</h1>'); |
$r->print('<h3>'.$resource->{'src'}.'</h3>'); |
$r->print('<h3>'.$resource->{'src'}.'</h3>'); |
$r->print(&render_resource($resource)); |
$r->print(&Apache::lonstathelpers::render_resource($resource)); |
$r->rflush(); |
$r->rflush(); |
my %Data = &get_problem_data($resource->{'src'}); |
my %Data = &get_problem_data($resource->{'src'}); |
my $ProblemData = $Data{$current_problem->{'part'}. |
my $ProblemData = $Data{$current_problem->{'part'}. |
Line 898 sub OR_excel_sheet {
|
Line 883 sub OR_excel_sheet {
|
} |
} |
# |
# |
my $result; |
my $result; |
$result = &build_problem_data_worksheet($problem_data_sheet,$format, |
$result = &OR_build_problem_data_worksheet($problem_data_sheet,$format, |
$Concepts,$ORdata); |
$Concepts,$ORdata); |
if ($result ne 'okay') { |
if ($result ne 'okay') { |
# Do something useful |
# Do something useful |
} |
} |
$result = &build_student_data_worksheet($student_data_sheet,$format); |
$result = &OR_build_student_data_worksheet($student_data_sheet,$format); |
if ($result ne 'okay') { |
if ($result ne 'okay') { |
# Do something useful |
# Do something useful |
} |
} |
$result = &build_response_data_worksheet($response_data_sheet,$format, |
$result = &OR_build_response_data_worksheet($response_data_sheet,$format, |
$PerformanceData,$Foils, |
$PerformanceData,$Foils, |
$ORdata); |
$ORdata); |
if ($result ne 'okay') { |
if ($result ne 'okay') { |
Line 1251 sub build_foil_index {
|
Line 1236 sub build_foil_index {
|
my @Foils = sort(keys(%Foildata)); |
my @Foils = sort(keys(%Foildata)); |
my %Concepts; |
my %Concepts; |
foreach my $foilid (@Foils) { |
foreach my $foilid (@Foils) { |
&Apache::lonnet::logthis('foilid = '.$foilid); |
|
&Apache::lonnet::logthis('_Concept = '.$Foildata{$foilid}->{'_Concept'}); |
|
push(@{$Concepts{$Foildata{$foilid}->{'_Concept'}}}, |
push(@{$Concepts{$Foildata{$foilid}->{'_Concept'}}}, |
$foilid); |
$foilid); |
} |
} |
Line 1289 sub build_foil_index {
|
Line 1272 sub build_foil_index {
|
foreach my $concept (sort $sortfunction (keys(%Concepts))) { |
foreach my $concept (sort $sortfunction (keys(%Concepts))) { |
if (! defined($Concepts{$concept})) { |
if (! defined($Concepts{$concept})) { |
$Concepts{$concept}=[]; |
$Concepts{$concept}=[]; |
&Apache::lonnet::logthis('concept error: '.$concept.' does not have a value'); |
|
# next; |
# next; |
} |
} |
push(@Concepts,{ name => $concept, |
push(@Concepts,{ name => $concept, |
Line 1720 sub Process_OR_Row {
|
Line 1702 sub Process_OR_Row {
|
my @Foilsubs = split('&',$submission); |
my @Foilsubs = split('&',$submission); |
for (my $j=0;$j<=$#Foilgrades;$j++) { |
for (my $j=0;$j<=$#Foilgrades;$j++) { |
my ($foilid,$correct) = split('=',$Foilgrades[$j]); |
my ($foilid,$correct) = split('=',$Foilgrades[$j]); |
|
$foilid = &Apache::lonnet::unescape($foilid); |
my (undef,$submission) = split('=',$Foilsubs[$j]); |
my (undef,$submission) = split('=',$Foilsubs[$j]); |
if ($correct) { |
if ($correct) { |
$RowData{$foilid}->{'_correct'}++; |
$RowData{$foilid}->{'_correct'}++; |