version 1.111, 2003/02/26 17:52:14
|
version 1.114, 2003/03/10 20:03:55
|
Line 370 sub analyze {
|
Line 370 sub analyze {
|
my %allparts; |
my %allparts; |
my $rndseed=$ENV{'form.rndseed'}; |
my $rndseed=$ENV{'form.rndseed'}; |
&analyze_header($request); |
&analyze_header($request); |
|
my %prog_state= |
|
&Apache::lonhtmlcommon::Create_PrgWin($request,'Analyze Progress', |
|
'Getting Problem Variants', |
|
$ENV{'form.numtoanalyze'}); |
for(my $i=1;$i<$ENV{'form.numtoanalyze'}+1;$i++) { |
for(my $i=1;$i<$ENV{'form.numtoanalyze'}+1;$i++) { |
|
&Apache::lonhtmlcommon::Increment_PrgWin($request,\%prog_state, |
|
'last problem'); |
my $subresult=&Apache::lonnet::ssi($request->uri, |
my $subresult=&Apache::lonnet::ssi($request->uri, |
('grade_target' => 'analyze'), |
('grade_target' => 'analyze'), |
('rndseed' => $i)); |
('rndseed' => $i)); |
&Apache::lonxml::debug(":$subresult:"); |
&Apache::lonxml::debug(":$subresult:"); |
(my $garbage,$subresult)=split(/_HASH_REF__/,$subresult,2); |
(my $garbage,$subresult)=split(/_HASH_REF__/,$subresult,2); |
my %analyze=&Apache::lonnet::str2hash($subresult); |
my %analyze=&Apache::lonnet::str2hash($subresult); |
$Apache::lonxml::debug=1; |
my @parts; |
&Apache::lonhomework::showhash(%analyze); |
if (defined(@{ $analyze{'parts'} })) { |
$Apache::lonxml::debug=0; |
@parts=@{ $analyze{'parts'} }; |
my @parts = @{ $analyze{'parts'} }; |
} |
foreach my $part (@parts) { |
foreach my $part (@parts) { |
if (!exists($allparts{$part})) {$allparts{$part}=1;}; |
if (!exists($allparts{$part})) {$allparts{$part}=1;}; |
if ($analyze{$part.'.type'} eq 'numericalresponse' || |
if ($analyze{$part.'.type'} eq 'numericalresponse' || |
Line 391 sub analyze {
|
Line 397 sub analyze {
|
} |
} |
} |
} |
} |
} |
|
&Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state, |
|
'Analyzing Results'); |
foreach my $part (keys(%allparts)) { |
foreach my $part (keys(%allparts)) { |
if (defined(@{ $overall{$part.'.answer'} })) { |
if (defined(@{ $overall{$part.'.answer'} })) { |
$request->print('<table><tr><td>Part '.$part.'</td></tr>'); |
$request->print('<table><tr><td>Part '.$part.'</td></tr>'); |
Line 404 sub analyze {
|
Line 412 sub analyze {
|
' is not analyzabale at this time</p>'); |
' is not analyzabale at this time</p>'); |
} |
} |
} |
} |
|
&Apache::lonhtmlcommon::Close_PrgWin($request,\%prog_state); |
&analyze_footer($request); |
&analyze_footer($request); |
&Apache::lonhomework::showhash(%overall); |
&Apache::lonhomework::showhash(%overall); |
return $result; |
return $result; |
Line 483 sub renderpage {
|
Line 492 sub renderpage {
|
&Apache::lonxml::debug("Should be parsing now"); |
&Apache::lonxml::debug("Should be parsing now"); |
$result = &Apache::lonxml::xmlparse($request, $target, $problem, |
$result = &Apache::lonxml::xmlparse($request, $target, $problem, |
&setup_vars($target),%mystyle); |
&setup_vars($target),%mystyle); |
|
undef($Apache::lonhomework::parsing_a_problem); |
#$request->print("Result follows:"); |
#$request->print("Result follows:"); |
if ($target eq 'modified') { |
if ($target eq 'modified') { |
&handle_save_or_undo($request,\$problem,\$result); |
&handle_save_or_undo($request,\$problem,\$result); |
Line 498 sub renderpage {
|
Line 507 sub renderpage {
|
#$result.="<br />Spent $td seconds processing target $target\n</body>"; |
#$result.="<br />Spent $td seconds processing target $target\n</body>"; |
#} |
#} |
$request->print($result); |
$request->print($result); |
|
$request->rflush(); |
} |
} |
#$request->print(":Result ends"); |
#$request->print(":Result ends"); |
#my $td=&tv_interval($t0); |
#my $td=&tv_interval($t0); |