version 1.219, 2005/11/08 17:53:20
|
version 1.221, 2005/11/08 21:09:08
|
Line 581 sub handle_save_or_undo {
|
Line 581 sub handle_save_or_undo {
|
|
|
sub analyze_header { |
sub analyze_header { |
my ($request) = @_; |
my ($request) = @_; |
my $bodytag='<body bgcolor="#ffffff">'; |
my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef, |
if ($env{'environment.remote'} eq 'off') { |
($env{'environment.remote'} ne 'off')); |
$bodytag=&Apache::loncommon::bodytag(); |
|
} |
|
my $html=&Apache::lonxml::xmlbegin(); |
my $html=&Apache::lonxml::xmlbegin(); |
my $result.=$html.' |
my $result.=$html.' |
<head><title>'.&mt("Analyzing a problem").'</title></head> |
<head><title>'.&mt("Analyzing a problem").'</title></head> |
Line 659 sub analyze {
|
Line 657 sub analyze {
|
foreach my $part (sort(keys(%allparts))) { |
foreach my $part (sort(keys(%allparts))) { |
if (defined(@{ $overall{$part.'.answer'} })) { |
if (defined(@{ $overall{$part.'.answer'} })) { |
my $num_cols=scalar(@{ $overall{$part.'.answer'}->[0] }); |
my $num_cols=scalar(@{ $overall{$part.'.answer'}->[0] }); |
$request->print('<table border="1"><tr><th colspan="'.($num_cols+1).'">'.&mt('Part').' '.$part.'</th></tr>'); |
$request->print('<table class="thinborder"><tr><th colspan="'.($num_cols+1).'">'.&mt('Part').' '.$part.'</th></tr>'); |
my %frequency; |
my %frequency; |
foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'} })) { |
foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'} })) { |
$frequency{join("\0",@{ $answer })}++; |
$frequency{join("\0",@{ $answer })}++; |
Line 667 sub analyze {
|
Line 665 sub analyze {
|
$request->print('<tr><th colspan="'.($num_cols).'">'.&mt('Answer').'</th><th>'.&mt('Frequency').'<br />(' |
$request->print('<tr><th colspan="'.($num_cols).'">'.&mt('Answer').'</th><th>'.&mt('Frequency').'<br />(' |
.&mt('click for example').')</th></tr>'); |
.&mt('click for example').')</th></tr>'); |
foreach my $answer (sort {(split("\0",$a))[0] <=> (split("\0",$b))[0]} (keys(%frequency))) { |
foreach my $answer (sort {(split("\0",$a))[0] <=> (split("\0",$b))[0]} (keys(%frequency))) { |
$request->print('<tr><td>'. |
$request->print('<tr><td class="center">'. |
join('</td><td>',split("\0",$answer)). |
join('</td><td class="center">',split("\0",$answer)). |
'</td><td><a href="'.$request->uri.'?rndseed='.$seedexample{$answer}.'">'.$frequency{$answer}. |
'</td><td class="center"><a href="'.$request->uri.'?rndseed='.$seedexample{$answer}.'">'.$frequency{$answer}. |
'</a></td></tr>'); |
'</a></td></tr>'); |
} |
} |
$request->print('</table>'); |
$request->print('</table>'); |
Line 717 sub editxmlmode {
|
Line 715 sub editxmlmode {
|
if ($cols > 80) { $cols = 80; } |
if ($cols > 80) { $cols = 80; } |
if ($cols < 70) { $cols = 70; } |
if ($cols < 70) { $cols = 70; } |
if ($rows < 20) { $rows = 20; } |
if ($rows < 20) { $rows = 20; } |
my $bodytag='<body bgcolor="#ffffff">'; |
my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef, |
if ($env{'environment.remote'} eq 'off') { |
($env{'environment.remote'} ne 'off')); |
$bodytag=&Apache::loncommon::bodytag(); |
|
} |
|
my $html=&Apache::lonxml::xmlbegin(); |
my $html=&Apache::lonxml::xmlbegin(); |
$result.=$html.$bodytag. |
$result.=$html.$bodytag. |
&renderpage($request,$file,['no_output_web'],1). |
&renderpage($request,$file,['no_output_web'],1). |