version 1.543, 2008/10/02 17:12:18
|
version 1.545.2.2, 2008/12/21 16:29:56
|
Line 1281 sub recently_generated {
|
Line 1281 sub recently_generated {
|
$cuid,$cgid,$crdev,$csize, |
$cuid,$cgid,$crdev,$csize, |
$catime,$cmtime,$cctime, |
$catime,$cmtime,$cctime, |
$cblksize,$cblocks)=stat($prtspool.'/'.$filename); |
$cblksize,$cblocks)=stat($prtspool.'/'.$filename); |
my $result="<a href='/prtspool/$filename'>". |
my $ext_text = 'pdf' ? &mt('PDF File'):&mt('Zip File'); |
&mt('Generated [_1] ([_2] bytes)', |
my $result=&Apache::loncommon::start_data_table_row() |
&Apache::lonlocal::locallocaltime($cctime),$csize). |
.'<td>' |
'</a><br />'; |
.'<a href="/prtspool/'.$filename.'">'.$ext_text.'</a>' |
|
.'</td>' |
|
.'<td>'.&Apache::lonlocal::locallocaltime($cctime).'</td>' |
|
.'<td align="right">'.$csize.'</td>' |
|
.&Apache::loncommon::end_data_table_row(); |
if ($ext eq 'pdf') { $pdf_result .= $result; } |
if ($ext eq 'pdf') { $pdf_result .= $result; } |
if ($ext eq 'zip') { $zip_result .= $result; } |
if ($ext eq 'zip') { $zip_result .= $result; } |
} |
} |
|
if ($zip_result || $pdf_result) { |
|
$r->print('<hr />'); |
|
} |
if ($zip_result) { |
if ($zip_result) { |
$r->print('<h4>'.&mt('Recently generated printout zip files')."</h4>\n" |
$r->print('<h3>'.&mt('Recently generated printout zip files')."</h3>\n" |
.$zip_result); |
.&Apache::loncommon::start_data_table() |
|
.&Apache::loncommon::start_data_table_header_row() |
|
.'<th>'.&mt('Download').'</th>' |
|
.'<th>'.&mt('Creation Date').'</th>' |
|
.'<th>'.&mt('File Size (Bytes)').'</th>' |
|
.&Apache::loncommon::end_data_table_header_row() |
|
.$zip_result |
|
.&Apache::loncommon::end_data_table() |
|
); |
} |
} |
if ($pdf_result) { |
if ($pdf_result) { |
$r->print('<h4>'.&mt('Recently generated printouts')."</h4>\n" |
$r->print('<h3>'.&mt('Recently generated printouts')."</h3>\n" |
.$pdf_result); |
.&Apache::loncommon::start_data_table() |
|
.&Apache::loncommon::start_data_table_header_row() |
|
.'<th>'.&mt('Download').'</th>' |
|
.'<th>'.&mt('Creation Date').'</th>' |
|
.'<th>'.&mt('File Size (Bytes)').'</th>' |
|
.&Apache::loncommon::end_data_table_header_row() |
|
.$pdf_result |
|
.&Apache::loncommon::end_data_table() |
|
); |
} |
} |
} |
} |
|
|
Line 1482 ENDPART
|
Line 1505 ENDPART
|
my ($result,$selectionmade) = ('',''); |
my ($result,$selectionmade) = ('',''); |
my $number_of_columns = 1; #used only for pages to determine the width of the cell |
my $number_of_columns = 1; #used only for pages to determine the width of the cell |
my @temporary_array=split /\|/,$format_from_helper; |
my @temporary_array=split /\|/,$format_from_helper; |
my ($laystyle,$numberofcolumns,$papersize,$pdfFormFields)=@temporary_array; |
my ($laystyle,$numberofcolumns,$papersize)=@temporary_array; |
if ($laystyle eq 'L') { |
if ($laystyle eq 'L') { |
$laystyle='album'; |
$laystyle='album'; |
} else { |
} else { |
Line 1503 ENDPART
|
Line 1526 ENDPART
|
my %form; |
my %form; |
$form{'grade_target'} = 'tex'; |
$form{'grade_target'} = 'tex'; |
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); |
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); |
$form{'pdfFormFields'} = $pdfFormFields; |
|
|
|
# If form.showallfoils is set, then request all foils be shown: |
# If form.showallfoils is set, then request all foils be shown: |
# privilege will be enforced both by not allowing the |
# privilege will be enforced both by not allowing the |
Line 2464 sub get_randomly_ordered_warning {
|
Line 2486 sub get_randomly_ordered_warning {
|
|
|
my $postdata = $env{'form.postdata'} || $helper->{VARS}{'postdata'}; |
my $postdata = $env{'form.postdata'} || $helper->{VARS}{'postdata'}; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $res = $navmap->getResourceByUrl($map); |
if (defined($navmap)) { |
if ($res) { |
my $res = $navmap->getResourceByUrl($map); |
my $func = |
if ($res) { |
sub { return ($_[0]->is_map() && $_[0]->randomorder); }; |
my $func = |
my @matches = $navmap->retrieveResources($res, $func,1,1,1); |
sub { return ($_[0]->is_map() && $_[0]->randomorder); }; |
if (@matches) { |
my @matches = $navmap->retrieveResources($res, $func,1,1,1); |
$message = "Some of the items below are in folders set to be randomly ordered. However, when printing the contents of these folders, they will be printed in the original order for all students, not the randomized order."; |
if (@matches) { |
} |
$message = "Some of the items below are in folders set to be randomly ordered. However, when printing the contents of these folders, they will be printed in the original order for all students, not the randomized order."; |
} |
} |
if ($message) { |
} |
return '<message type="warning">'.$message.'</message>'; |
if ($message) { |
|
return '<message type="warning">'.$message.'</message>'; |
|
} |
|
} else { |
|
&Apache::lonnet::logthis('Retrieval of resources to check for folders set to be randomly ordered failed - could not create navmap object'); |
|
$message = "Retrieval of information about ordering of resources failed."; |
|
return '<message type="warning">'.$message.'</message>'; |
} |
} |
return; |
return; |
} |
} |
Line 3128 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3156 CHOOSE_FROM_ANY_SEQUENCE
|
|
|
if (($perm{'pav'} and &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) or |
if (($perm{'pav'} and &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) or |
($helper->{VARS}->{'construction'} eq '1')) { |
($helper->{VARS}->{'construction'} eq '1')) { |
addMessage("<hr width='33%' /><table><tr><td align='right'>". |
&addMessage('<br />' |
'<label for="ANSWER_TYPE_forminput">'. |
.'<h3>'.&mt('Print Options').'</h3>' |
&mt('Print'). |
.&Apache::lonhtmlcommon::start_pick_box() |
"</label>: </td><td>"); |
# .&Apache::lonhtmlcommon::row_headline() |
|
# .'<h3>'.&mt('Print Options').'</h3>' |
|
# .&Apache::lonhtmlcommon::row_closure() |
|
.&Apache::lonhtmlcommon::row_title( |
|
'<label for="ANSWER_TYPE_forminput">' |
|
.&mt('Print Answers') |
|
.'</label>' |
|
) |
|
); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = 'ANSWER_TYPE'; |
$paramHash->{'variable'} = 'ANSWER_TYPE'; |
$helper->declareVar('ANSWER_TYPE'); |
$helper->declareVar('ANSWER_TYPE'); |
Line 3141 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3177 CHOOSE_FROM_ANY_SEQUENCE
|
['Only Answers', 'only'] |
['Only Answers', 'only'] |
]; |
]; |
Apache::lonhelper::dropdown->new(); |
Apache::lonhelper::dropdown->new(); |
addMessage("</td></tr>"); |
&addMessage(&Apache::lonhtmlcommon::row_closure()); |
$startedTable = 1; |
$startedTable = 1; |
} |
} |
|
|
Line 3153 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3189 CHOOSE_FROM_ANY_SEQUENCE
|
"</label>: </td><td>"); |
"</label>: </td><td>"); |
$startedTable = 1; |
$startedTable = 1; |
} else { |
} else { |
addMessage("<tr><td align='right'>". |
&addMessage(&Apache::lonhtmlcommon::row_title( |
'<label for="LATEX_TYPE_forminput">'. |
'<label for="LATEX_TYPE_forminput">' |
&mt('LaTeX mode'). |
.&mt('LaTeX mode') |
"</label>: </td><td>"); |
.'</label>' |
|
) |
|
); |
} |
} |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = 'LATEX_TYPE'; |
$paramHash->{'variable'} = 'LATEX_TYPE'; |
Line 3172 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3210 CHOOSE_FROM_ANY_SEQUENCE
|
} |
} |
Apache::lonhelper::dropdown->new(); |
Apache::lonhelper::dropdown->new(); |
|
|
addMessage("</td></tr><tr><td align='right'>". |
&addMessage(&Apache::lonhtmlcommon::row_closure() |
'<label for="TABLE_CONTENTS_forminput">'. |
.&Apache::lonhtmlcommon::row_title( |
&mt('Print Table of Contents'). |
'<label for="TABLE_CONTENTS_forminput">' |
"</label>: </td><td>"); |
.&mt('Print Table of Contents') |
|
.'</label>' |
|
) |
|
); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = 'TABLE_CONTENTS'; |
$paramHash->{'variable'} = 'TABLE_CONTENTS'; |
$helper->declareVar('TABLE_CONTENTS'); |
$helper->declareVar('TABLE_CONTENTS'); |
Line 3183 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3224 CHOOSE_FROM_ANY_SEQUENCE
|
['No', 'no'], |
['No', 'no'], |
['Yes', 'yes'] ]; |
['Yes', 'yes'] ]; |
Apache::lonhelper::dropdown->new(); |
Apache::lonhelper::dropdown->new(); |
addMessage("</td></tr>"); |
&addMessage(&Apache::lonhtmlcommon::row_closure()); |
|
|
if (not $helper->{VARS}->{'construction'}) { |
if (not $helper->{VARS}->{'construction'}) { |
addMessage("<tr><td align='right'>". |
&addMessage(&Apache::lonhtmlcommon::row_title( |
'<label for="TABLE_INDEX_forminput">'. |
'<label for="TABLE_INDEX_forminput">' |
&mt('Print Index'). |
.&mt('Print Index') |
"</label>: </td><td>"); |
.'</label>' |
|
) |
|
); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = 'TABLE_INDEX'; |
$paramHash->{'variable'} = 'TABLE_INDEX'; |
$helper->declareVar('TABLE_INDEX'); |
$helper->declareVar('TABLE_INDEX'); |
Line 3197 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3240 CHOOSE_FROM_ANY_SEQUENCE
|
['No', 'no'], |
['No', 'no'], |
['Yes', 'yes'] ]; |
['Yes', 'yes'] ]; |
Apache::lonhelper::dropdown->new(); |
Apache::lonhelper::dropdown->new(); |
addMessage("</td></tr>"); |
&addMessage(&Apache::lonhtmlcommon::row_closure()); |
addMessage("<tr><td align='right'>". |
&addMessage(&Apache::lonhtmlcommon::row_title( |
'<label for="PRINT_DISCUSSIONS_forminput">'. |
'<label for="PRINT_DISCUSSIONS_forminput">' |
&mt('Print Discussions'). |
.&mt('Print Discussions') |
"</label>: </td><td>"); |
.'</label>' |
|
) |
|
); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = 'PRINT_DISCUSSIONS'; |
$paramHash->{'variable'} = 'PRINT_DISCUSSIONS'; |
$helper->declareVar('PRINT_DISCUSSIONS'); |
$helper->declareVar('PRINT_DISCUSSIONS'); |
Line 3209 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3254 CHOOSE_FROM_ANY_SEQUENCE
|
['No', 'no'], |
['No', 'no'], |
['Yes', 'yes'] ]; |
['Yes', 'yes'] ]; |
Apache::lonhelper::dropdown->new(); |
Apache::lonhelper::dropdown->new(); |
addMessage("</td></tr>"); |
&addMessage(&Apache::lonhtmlcommon::row_closure()); |
|
|
# Prompt for printing annotations too. |
# Prompt for printing annotations too. |
|
|
addMessage("<tr><td align='right'>". |
&addMessage(&Apache::lonhtmlcommon::row_title( |
'<label for="PRINT_ANNOTATIONS_forminput">'. |
'<label for="PRINT_ANNOTATIONS_forminput">' |
&mt('Print Annotations'). |
.&mt('Print Annotations') |
"</label>:</td><td>"); |
.'</label>' |
|
) |
|
); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = "PRINT_ANNOTATIONS"; |
$paramHash->{'variable'} = "PRINT_ANNOTATIONS"; |
$helper->declareVar("PRINT_ANNOTATIONS"); |
$helper->declareVar("PRINT_ANNOTATIONS"); |
Line 3224 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3271 CHOOSE_FROM_ANY_SEQUENCE
|
['No', 'no'], |
['No', 'no'], |
['Yes', 'yes']]; |
['Yes', 'yes']]; |
Apache::lonhelper::dropdown->new(); |
Apache::lonhelper::dropdown->new(); |
addMessage("</td></tr>"); |
&addMessage(&Apache::lonhtmlcommon::row_closure()); |
|
|
addMessage("<tr><td align = 'right'> </td><td>"); |
&addMessage(&Apache::lonhtmlcommon::row_title(&mt('Foils'))); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'multichoice'} = "true"; |
$paramHash->{'multichoice'} = "true"; |
$paramHash->{'allowempty'} = "true"; |
$paramHash->{'allowempty'} = "true"; |
$paramHash->{'variable'} = "showallfoils"; |
$paramHash->{'variable'} = "showallfoils"; |
$paramHash->{'CHOICES'} = [ ["Show all foils", "1"] ]; |
$paramHash->{'CHOICES'} = [ ["Show all foils", "1"] ]; |
Apache::lonhelper::choices->new(); |
Apache::lonhelper::choices->new(); |
addMessage("</td></tr>"); |
&addMessage(&Apache::lonhtmlcommon::row_closure(1)); |
} |
} |
|
|
if ($helper->{'VARS'}->{'construction'}) { |
if ($helper->{'VARS'}->{'construction'}) { |
Line 3242 CHOOSE_FROM_ANY_SEQUENCE
|
Line 3289 CHOOSE_FROM_ANY_SEQUENCE
|
my $stylefiletext=&mt("Use style file"); |
my $stylefiletext=&mt("Use style file"); |
my $selectfiletext=&mt("Select style file"); |
my $selectfiletext=&mt("Select style file"); |
|
|
my $xmlfrag .= <<"RNDSEED"; |
my $xmlfrag .= '<message>' |
<message><tr><td align='right'> |
.&Apache::lonhtmlcommon::row_title('<label for="curseed_forminput">' |
<label for="curseed_forminput">$randseedtext</label>: |
.$randseedtext |
</td><td></message> |
.'</label>' |
<string variable="curseed" size="15" maxlength="15"> |
) |
<defaultvalue> |
.'</message> |
return $helper->{VARS}->{'curseed'}; |
<string variable="curseed" size="15" maxlength="15"> |
</defaultvalue> |
<defaultvalue> |
</string> |
return '.$helper->{VARS}->{'curseed'}.'; |
<message></td></tr><tr><td align="right"> |
</defaultvalue>' |
<label for="style_file">$stylefiletext</label>: |
.'</string>' |
</td><td></message> |
.'<message>' |
|
.&Apache::lonhtmlcommon::row_closure() |
|
.&Apache::lonhtmlcommon::row_title('<label for="style_file">' |
|
.$stylefiletext |
|
.'</label>' |
|
) |
|
.'</message> |
<string variable="style_file" size="40"> |
<string variable="style_file" size="40"> |
<defaultvalue> |
<defaultvalue> |
return $stylevalue; |
return '.$stylevalue.'; |
</defaultvalue> |
</defaultvalue> |
</string><message> <a href="javascript:openbrowser('helpform','style_file_forminput','sty')">$selectfiletext</a> </td></tr><tr><td></td><td align="left"></message> |
</string><message> ' |
|
.qq|<a href="javascript:openbrowser('helpform','style_file_forminput','sty')">| |
|
.$selectfiletext.'</a>' |
|
.&Apache::lonhtmlcommon::row_closure() |
|
.&Apache::lonhtmlcommon::row_title(&mt('Show all foils')) |
|
.'</message> |
<choices allowempty="1" multichoice="true" variable="showallfoils"> |
<choices allowempty="1" multichoice="true" variable="showallfoils"> |
<choice computer="1">Show all foils</choice> |
<choice computer="1"> </choice> |
</choices> |
</choices>' |
<message></td></tr></message> |
.'<message>' |
RNDSEED |
.&Apache::lonhtmlcommon::row_closure() |
|
.'</message>'; |
&Apache::lonxml::xmlparse($r, 'helper', $xmlfrag); |
&Apache::lonxml::xmlparse($r, 'helper', $xmlfrag); |
|
|
|
|
addMessage("<tr><td>Problem Type:</td><td>"); |
&addMessage(&Apache::lonhtmlcommon::row_title(&mt('Problem Type'))); |
# |
# |
# Initial value from construction space: |
# Initial value from construction space: |
# |
# |
Line 3286 RNDSEED
|
Line 3345 RNDSEED
|
PROBTYPE |
PROBTYPE |
&Apache::lonxml::xmlparse($r, 'helper', $xmlfrag); |
&Apache::lonxml::xmlparse($r, 'helper', $xmlfrag); |
|
|
addMessage("</td></tr>"); |
&addMessage(&Apache::lonhtmlcommon::row_closure(1)); |
|
|
} |
} |
} |
} |
|
|
|
|
|
|
|
|
if ($startedTable) { |
if ($startedTable) { |
addMessage("</table>"); |
&addMessage(&Apache::lonhtmlcommon::end_pick_box()); |
} |
} |
|
|
Apache::lonprintout::page_format_state->new("FORMAT"); |
Apache::lonprintout::page_format_state->new("FORMAT"); |
Line 3394 sub render {
|
Line 3453 sub render {
|
my $PaperType=&mt('Paper type'); |
my $PaperType=&mt('Paper type'); |
my $landscape=&mt('Landscape'); |
my $landscape=&mt('Landscape'); |
my $portrait=&mt('Portrait'); |
my $portrait=&mt('Portrait'); |
my $pdfFormLabel=&mt('PDF-Formfields'); |
$result.='<h3>'.&mt('Layout Options').'</h3>' |
my $with=&mt('with Formfields'); |
.&Apache::loncommon::start_data_table() |
my $without=&mt('without Formfields'); |
.&Apache::loncommon::start_data_table_header_row() |
$result .= <<STATEHTML; |
.'<th>'.$PageLayout.'</th>' |
|
.'<th>'.$NumberOfColumns.'</th>' |
<hr width="33%" /> |
.'<th>'.$PaperType.'</th>' |
<table cellpadding="3"> |
.&Apache::loncommon::end_data_table_header_row() |
<tr> |
.&Apache::loncommon::start_data_table_row() |
<td align="center"><b>$PageLayout</b></td> |
.'<td>' |
<td align="center"><b>$NumberOfColumns</b></td> |
.'<label><input type="radio" name="'.${var}.'.layout" value="L" />'.$landscape.'</label><br />' |
<td align="center"><b>$PaperType</b></td> |
.'<label><input type="radio" name="'.${var}.'.layout" value="P" checked="checked" />'.$portrait.'</label>' |
<td align="center"><b>$pdfFormLabel</b></td> |
.'</td>'; |
</tr> |
|
<tr> |
$result.='<td align="center">' |
<td> |
.'<select name="'.${var}.'.cols">'; |
<label><input type="radio" name="${var}.layout" value="L" /> $landscape </label><br /> |
|
<label><input type="radio" name="${var}.layout" value="P" checked='1' /> $portrait </label> |
|
</td> |
|
<td align="center"> |
|
<select name="${var}.cols"> |
|
STATEHTML |
|
|
|
my $i; |
my $i; |
for ($i = 1; $i <= $maxColumns; $i++) { |
for ($i = 1; $i <= $maxColumns; $i++) { |
Line 3446 STATEHTML
|
Line 3499 STATEHTML
|
$result .= <<HTML; |
$result .= <<HTML; |
</select> |
</select> |
</td> |
</td> |
<td align='center'> |
|
<select name='${var}.pdfFormFields'> |
|
<option selected value='no'>$without</option> |
|
<option value='yes'>$with</option> |
|
</select> |
|
</td> |
|
</tr></table> |
|
HTML |
HTML |
|
$result.=&Apache::loncommon::end_data_table_row() |
|
.&Apache::loncommon::end_data_table(); |
|
|
return $result; |
return $result; |
} |
} |
Line 3465 sub postprocess {
|
Line 3513 sub postprocess {
|
my $helper = Apache::lonhelper->getHelper(); |
my $helper = Apache::lonhelper->getHelper(); |
$helper->{VARS}->{$var} = |
$helper->{VARS}->{$var} = |
$env{"form.$var.layout"} . '|' . $env{"form.$var.cols"} . '|' . |
$env{"form.$var.layout"} . '|' . $env{"form.$var.cols"} . '|' . |
$env{"form.$var.paper"} . '|' . $env{"form.$var.pdfFormFields"}; |
$env{"form.$var.paper"}; |
return 1; |
return 1; |
} |
} |
|
|