version 1.304, 2009/03/04 16:00:14
|
version 1.308, 2009/03/26 18:21:24
|
Line 173 sub setup_vars {
|
Line 173 sub setup_vars {
|
sub createmenu { |
sub createmenu { |
my ($which,$request)=@_; |
my ($which,$request)=@_; |
if ($which eq 'grade') { |
if ($which eq 'grade') { |
$request->print('<script language="JavaScript"> |
$request->print('<script type="text/javascript" language="JavaScript"> |
hwkmenu=window.open("/res/adm/pages/homeworkmenu.html","homeworkremote", |
hwkmenu=window.open("/res/adm/pages/homeworkmenu.html","homeworkremote", |
"height=350,width=150,menubar=no"); |
"height=350,width=150,menubar=no"); |
</script>'); |
</script>'); |
Line 777 sub analyze {
|
Line 777 sub analyze {
|
} |
} |
&Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state, |
&Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state, |
&mt('Analyzing Results')); |
&mt('Analyzing Results')); |
$request->print('<hr class="LC_edit_problem_divide" />'.&mt('List of possible answers').': '); |
$request->print('<hr class="LC_edit_problem_divide" />' |
|
.'<h3>' |
|
.&mt('List of possible answers') |
|
.'</h3>' |
|
); |
foreach my $part (sort(keys(%allparts))) { |
foreach my $part (sort(keys(%allparts))) { |
if (defined(@{ $overall{$part.'.answer'} })) { |
if (defined(@{ $overall{$part.'.answer'} })) { |
for (my $i=0;$i<scalar(@{ $overall{$part.'.answer'} });$i++) { |
for (my $i=0;$i<scalar(@{ $overall{$part.'.answer'} });$i++) { |
my $num_cols=scalar(@{ $overall{$part.'.answer'}[$i][0] }); |
my $num_cols=scalar(@{ $overall{$part.'.answer'}[$i][0] }); |
$request->print('<table class="thinborder"><tr><th colspan="'.($num_cols+1).'">'.&mt('Part').' '.$part); |
$request->print(&Apache::loncommon::start_data_table() |
|
.&Apache::loncommon::start_data_table_header_row() |
|
.'<th colspan="'.($num_cols+1).'">' |
|
.&mt('Part').' '.$part |
|
); |
if (scalar(@{ $overall{$part.'.answer'} }) > 1) { |
if (scalar(@{ $overall{$part.'.answer'} }) > 1) { |
$request->print(&mt(' Answer [_1]',$i+1)); |
$request->print(' '.&mt('Answer [_1]',$i+1)); |
} |
} |
$request->print('</th></tr>'); |
$request->print('</th>' |
|
.&Apache::loncommon::end_data_table_header_row() |
|
); |
my %frequency; |
my %frequency; |
foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'}[$i] })) { |
foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'}[$i] })) { |
$frequency{join("\0",@{ $answer })}++; |
$frequency{join("\0",@{ $answer })}++; |
} |
} |
$request->print('<tr><th colspan="'.($num_cols).'">'.&mt('Answer').'</th><th>'.&mt('Frequency').'<br />(' |
$request->print(&Apache::loncommon::start_data_table_header_row() |
.&mt('click for example').')</th></tr>'); |
.'<th colspan="'.($num_cols).'">'.&mt('Answer').'</th>' |
|
.'<th>'.&mt('Frequency').'<br />' |
|
.'('.&mt('click for example').')</th>' |
|
.&Apache::loncommon::end_data_table_header_row() |
|
); |
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 class="center">'. |
$request->print(&Apache::loncommon::start_data_table_row() |
join('</td><td class="center">',split("\0",$answer)). |
.'<td>' |
'</td><td class="center"><a href="'.$request->uri.'?rndseed='.$seedexample{join("\0",$part,$i,$answer)}.'">'.$frequency{$answer}. |
.join('</td><td>',split("\0",$answer)) |
'</a></td></tr>'); |
.'</td>' |
|
.'<td>' |
|
.'<a href="'.$request->uri.'?rndseed='.$seedexample{join("\0",$part,$i,$answer)}.'">'.$frequency{$answer}.'</a>' |
|
.'</td>' |
|
.&Apache::loncommon::end_data_table_row() |
|
); |
} |
} |
$request->print('</table>'); |
$request->print(&Apache::loncommon::end_data_table()); |
} |
} |
} else { |
} else { |
$request->print('<p>'.&mt('Response').' '.$part.' '. |
$request->print('<p class="LC_warning">' |
&mt('is not analyzable at this time').'</p>'); |
.&mt('Response [_1] is not analyzable at this time.',$part) |
|
.'</p>' |
|
); |
} |
} |
} |
} |
if (scalar(keys(%allparts)) == 0 ) { |
if (scalar(keys(%allparts)) == 0 ) { |
$request->print('<p>'.&mt('Found no analyzable responses in this problem, currently only Numerical, Formula and String response styles are supported.').'</p>'); |
$request->print('<p class="LC_warning">' |
|
.&mt('Found no analyzable responses in this problem.' |
|
.' Currently only Numerical, Formula and String response styles are supported.') |
|
.'</p>' |
|
); |
} |
} |
&Apache::lonhtmlcommon::Close_PrgWin($request,\%prog_state); |
&Apache::lonhtmlcommon::Close_PrgWin($request,\%prog_state); |
&analyze_footer($request); |
&analyze_footer($request); |
Line 855 sub editxmlmode {
|
Line 880 sub editxmlmode {
|
my $result; |
my $result; |
my $problem=&Apache::lonnet::getfile($file); |
my $problem=&Apache::lonnet::getfile($file); |
if ($problem eq -1) { |
if ($problem eq -1) { |
&Apache::lonxml::error("<b> ".&mt('Unable to find'). |
&Apache::lonxml::error( |
" <i>$file</i></b>"); |
'<b> ' |
|
.&mt('Unable to find [_1]', |
|
'<span class="LC_filename">'.$file.'</span>') |
|
.'</b>'); |
|
|
$problem=''; |
$problem=''; |
} |
} |
if (defined($env{'form.editxmltext'}) || defined($env{'form.Undo'})) { |
if (defined($env{'form.editxmltext'}) || defined($env{'form.Undo'})) { |
Line 963 sub renderpage {
|
Line 992 sub renderpage {
|
my $filename=(split('/',$file))[-1]; |
my $filename=(split('/',$file))[-1]; |
my $error = |
my $error = |
"<b> ".&mt('Unable to find [_1]', |
"<b> ".&mt('Unable to find [_1]', |
' <span class="LC_filename">'.$filename.'</span>') |
'<span class="LC_filename">'.$filename.'</span>') |
."</b>"; |
."</b>"; |
$result.= |
$result.= |
&Apache::loncommon::simple_error_page($request,'Not available', |
&Apache::loncommon::simple_error_page($request,'Not available', |
Line 1109 $start_page
|
Line 1138 $start_page
|
<h1>".&mt("Creating a new $extension resource.")."</h1> |
<h1>".&mt("Creating a new $extension resource.")."</h1> |
$errormsg |
$errormsg |
".&mt("The requested file [_1] currently does not exist.", |
".&mt("The requested file [_1] currently does not exist.", |
"<tt>$shownurl</tt>")." |
'<span class="LC_filename">'.$shownurl.'</span>')." |
<p> |
<p> |
<b> |
<b> |
".&mt("To create a new $extension, select a template from the". |
".&mt("To create a new $extension, select a template from the". |