--- loncom/interface/lonprintout.pm 2008/09/05 11:16:13 1.539
+++ loncom/interface/lonprintout.pm 2009/01/23 16:00:46 1.548
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.539 2008/09/05 11:16:13 onken Exp $
+# $Id: lonprintout.pm,v 1.548 2009/01/23 16:00:46 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -392,8 +392,8 @@ sub is_valid_alpha_code {
sub is_code_valid {
my ($code_value, $code_option) = @_;
my ($code_type, $code_length) = ('letter', 6); # defaults.
- open(FG, $Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab');
- foreach my $line (
';
+ my $ext_text = 'pdf' ? &mt('PDF File'):&mt('Zip File');
+ my $result=&Apache::loncommon::start_data_table_row()
+ .''
+ .''.$ext_text.''
+ .' '
+ .''.&Apache::lonlocal::locallocaltime($cctime).' '
+ .''.$csize.' '
+ .&Apache::loncommon::end_data_table_row();
if ($ext eq 'pdf') { $pdf_result .= $result; }
if ($ext eq 'zip') { $zip_result .= $result; }
}
+ if ($zip_result || $pdf_result) {
+ $r->print('
');
+ }
if ($zip_result) {
- $r->print(''.&mt('Recently generated printout zip files')."
\n"
- .$zip_result);
+ $r->print(''.&mt('Recently generated printout zip files')."
\n"
+ .&Apache::loncommon::start_data_table()
+ .&Apache::loncommon::start_data_table_header_row()
+ .''.&mt('Download').' '
+ .''.&mt('Creation Date').' '
+ .''.&mt('File Size (Bytes)').' '
+ .&Apache::loncommon::end_data_table_header_row()
+ .$zip_result
+ .&Apache::loncommon::end_data_table()
+ );
}
if ($pdf_result) {
- $r->print(''.&mt('Recently generated printouts')."
\n"
- .$pdf_result);
+ $r->print(''.&mt('Recently generated printouts')."
\n"
+ .&Apache::loncommon::start_data_table()
+ .&Apache::loncommon::start_data_table_header_row()
+ .''.&mt('Download').' '
+ .''.&mt('Creation Date').' '
+ .''.&mt('File Size (Bytes)').' '
+ .&Apache::loncommon::end_data_table_header_row()
+ .$pdf_result
+ .&Apache::loncommon::end_data_table()
+ );
}
}
@@ -1942,9 +1966,9 @@ ENDPART
my $selected_code = $helper->{'VARS'}->{'CODE_SELECTED_FROM_LIST'};
my $code_option=$helper->{'VARS'}->{'CODE_OPTION'};
- open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab');
+ my @lines = &Apache::grades::get_scantronformat_file();
my ($code_type,$code_length)=('letter',6);
- foreach my $line (
");
+ &addMessage(&Apache::lonhtmlcommon::end_pick_box());
}
Apache::lonprintout::page_format_state->new("FORMAT");
@@ -3397,24 +3457,22 @@ sub render {
my $pdfFormLabel=&mt('PDF-Formfields');
my $with=&mt('with Formfields');
my $without=&mt('without Formfields');
- $result .= < ");
+ &addMessage(&Apache::lonhtmlcommon::row_closure());
$startedTable = 1;
}
@@ -3153,10 +3190,12 @@ CHOOSE_FROM_ANY_SEQUENCE
": ".
- ': ");
+ &addMessage('
'
+ .''.&mt('Print Options').'
'
+ .&Apache::lonhtmlcommon::start_pick_box()
+# .&Apache::lonhtmlcommon::row_headline()
+# .''.&mt('Print Options').'
'
+# .&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title(
+ ''
+ )
+ );
$paramHash = Apache::lonhelper::getParamHash();
$paramHash->{'variable'} = 'ANSWER_TYPE';
$helper->declareVar('ANSWER_TYPE');
@@ -3141,7 +3178,7 @@ CHOOSE_FROM_ANY_SEQUENCE
['Only Answers', 'only']
];
Apache::lonhelper::dropdown->new();
- addMessage("");
$startedTable = 1;
} else {
- addMessage(" ".
- ': ");
+ &addMessage(&Apache::lonhtmlcommon::row_title(
+ ''
+ )
+ );
}
$paramHash = Apache::lonhelper::getParamHash();
$paramHash->{'variable'} = 'LATEX_TYPE';
@@ -3172,10 +3211,13 @@ CHOOSE_FROM_ANY_SEQUENCE
}
Apache::lonhelper::dropdown->new();
- addMessage(" ");
+ &addMessage(&Apache::lonhtmlcommon::row_closure());
if (not $helper->{VARS}->{'construction'}) {
- addMessage("".
- ': ");
+ &addMessage(&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title(
+ ''
+ )
+ );
$paramHash = Apache::lonhelper::getParamHash();
$paramHash->{'variable'} = 'TABLE_CONTENTS';
$helper->declareVar('TABLE_CONTENTS');
@@ -3183,13 +3225,15 @@ CHOOSE_FROM_ANY_SEQUENCE
['No', 'no'],
['Yes', 'yes'] ];
Apache::lonhelper::dropdown->new();
- addMessage(" ");
- addMessage("".
- ': ");
+ &addMessage(&Apache::lonhtmlcommon::row_title(
+ ''
+ )
+ );
$paramHash = Apache::lonhelper::getParamHash();
$paramHash->{'variable'} = 'TABLE_INDEX';
$helper->declareVar('TABLE_INDEX');
@@ -3197,11 +3241,13 @@ CHOOSE_FROM_ANY_SEQUENCE
['No', 'no'],
['Yes', 'yes'] ];
Apache::lonhelper::dropdown->new();
- addMessage(" ");
+ &addMessage(&Apache::lonhtmlcommon::row_closure());
# Prompt for printing annotations too.
- addMessage("".
- ': ");
+ &addMessage(&Apache::lonhtmlcommon::row_closure());
+ &addMessage(&Apache::lonhtmlcommon::row_title(
+ ''
+ )
+ );
$paramHash = Apache::lonhelper::getParamHash();
$paramHash->{'variable'} = 'PRINT_DISCUSSIONS';
$helper->declareVar('PRINT_DISCUSSIONS');
@@ -3209,14 +3255,16 @@ CHOOSE_FROM_ANY_SEQUENCE
['No', 'no'],
['Yes', 'yes'] ];
Apache::lonhelper::dropdown->new();
- addMessage(" ");
+ &addMessage(&Apache::lonhtmlcommon::row_closure());
- addMessage("".
- ': ");
+ &addMessage(&Apache::lonhtmlcommon::row_title(
+ ''
+ )
+ );
$paramHash = Apache::lonhelper::getParamHash();
$paramHash->{'variable'} = "PRINT_ANNOTATIONS";
$helper->declareVar("PRINT_ANNOTATIONS");
@@ -3224,16 +3272,16 @@ CHOOSE_FROM_ANY_SEQUENCE
['No', 'no'],
['Yes', 'yes']];
Apache::lonhelper::dropdown->new();
- addMessage(" ");
+ &addMessage(&Apache::lonhtmlcommon::row_closure(1));
}
if ($helper->{'VARS'}->{'construction'}) {
@@ -3242,32 +3290,44 @@ CHOOSE_FROM_ANY_SEQUENCE
my $stylefiletext=&mt("Use style file");
my $selectfiletext=&mt("Select style file");
- my $xmlfrag .= <<"RNDSEED";
- ");
+ &addMessage(&Apache::lonhtmlcommon::row_title(&mt('Foils')));
$paramHash = Apache::lonhelper::getParamHash();
$paramHash->{'multichoice'} = "true";
$paramHash->{'allowempty'} = "true";
$paramHash->{'variable'} = "showallfoils";
$paramHash->{'CHOICES'} = [ ["Show all foils", "1"] ];
Apache::lonhelper::choices->new();
- addMessage("
- :
-
-
- :
-
+ my $xmlfrag .= '
+ ");
+ &addMessage(&Apache::lonhtmlcommon::row_closure(1));
- }
+ }
}
if ($startedTable) {
- addMessage("Problem Type: ");
+ &addMessage(&Apache::lonhtmlcommon::row_title(&mt('Problem Type')));
#
# Initial value from construction space:
#
@@ -3286,16 +3346,16 @@ RNDSEED
PROBTYPE
&Apache::lonxml::xmlparse($r, 'helper', $xmlfrag);
- addMessage(" '.$PageLayout.' '
+ .''.$NumberOfColumns.' '
+ .''.$PaperType.' '
+ .''.$pdfFormLabel.' '
+ .&Apache::loncommon::end_data_table_header_row()
+ .&Apache::loncommon::start_data_table_row()
+ .''
+ .' ';
-
'
+ .''
+ .'
-
-
HTML
+ $result.=&Apache::loncommon::end_data_table_row()
+ .&Apache::loncommon::end_data_table();
return $result;
}
@@ -3577,50 +3636,36 @@ sub render {
} else {
$size{'margin'} += 2.54;
}
- my %text = ('format' => 'How should each column be formatted?',
- 'width' => 'Width:',
- 'height' => 'Height:',
- 'margin' => 'Left Margin:',);
- %text = &Apache::lonlocal::texthash(%text);
-
- $result .= <
-
- $PageLayout
- $NumberOfColumns
- $PaperType
- $pdfFormLabel
-
-
-
-
-
-
-
$text{'width'} | -- |
- |
-
$text{'height'} | -- |
- |
-
$text{'margin'} | -- |
- |
-
'.$lt{'format'}.'
' + .&Apache::lonhtmlcommon::start_pick_box() + .&Apache::lonhtmlcommon::row_title($lt{'width'}) + .'' + .'Hint: Some instructors like to leave scratch space for the student by + # making the width much smaller than the width of the page.
return $result; }