version 1.273, 2004/11/30 23:28:57
|
version 1.280, 2005/02/25 04:56:05
|
Line 91 sub page_start {
|
Line 91 sub page_start {
|
if (!defined($found{'body'}) && $ENV{'request.state'} eq 'construct' |
if (!defined($found{'body'}) && $ENV{'request.state'} eq 'construct' |
&& $ENV{'environment.remote'} eq 'off') { |
&& $ENV{'environment.remote'} eq 'off') { |
$body_tag_start=&Apache::loncommon::bodytag(); |
$body_tag_start=&Apache::loncommon::bodytag(); |
|
$body_tag_start.=&Apache::lonxml::message_location(); |
} elsif (!defined($found{'body'})) { |
} elsif (!defined($found{'body'})) { |
$body_tag_start='<body onload="'.&Apache::lonmenu::loadevents().'" '. |
$body_tag_start='<body onload="'.&Apache::lonmenu::loadevents().'" '. |
'onunload="'.&Apache::lonmenu::unloadevents().'" '; |
'onunload="'.&Apache::lonmenu::unloadevents().'" '; |
Line 127 sub page_start {
|
Line 128 sub page_start {
|
} |
} |
my $form_tag_start; |
my $form_tag_start; |
if (!defined($found{'form'})) { |
if (!defined($found{'form'})) { |
$form_tag_start='<form name="lonhomework" method="post" action="'; |
$form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="post" action="'; |
my $uri=$ENV{'request.uri'}; |
my $uri=$ENV{'request.uri'}; |
if ($ENV{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); } |
if ($ENV{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); } |
$form_tag_start.=$uri.'">'; |
$form_tag_start.=$uri.'">'; |
Line 141 sub get_resource_name {
|
Line 142 sub get_resource_name {
|
if (defined($Apache::lonhomework::name)) { |
if (defined($Apache::lonhomework::name)) { |
return $Apache::lonhomework::name; |
return $Apache::lonhomework::name; |
} |
} |
my $name=&Apache::lonnet::gettitle(); |
my ($symb)=&Apache::lonxml::whichuser(); |
|
my $name=&Apache::lonnet::gettitle($symb); |
if ($name eq '') { |
if ($name eq '') { |
$name=&Apache::lonnet::EXT('resource.title'); |
$name=&Apache::lonnet::EXT('resource.title'); |
if ($name eq 'con_lost') { $name = ''; } |
if ($name eq 'con_lost') { $name = ''; } |
Line 215 sub problem_edit_footer {
|
Line 217 sub problem_edit_footer {
|
return '</td></tr></table><br /><input type="submit" name="submit" value="'.&mt('Submit Changes and Edit').'" /> |
return '</td></tr></table><br /><input type="submit" name="submit" value="'.&mt('Submit Changes and Edit').'" /> |
<input type="submit" name="submit" value="'.&mt('Submit Changes and View').'" />'. |
<input type="submit" name="submit" value="'.&mt('Submit Changes and View').'" />'. |
&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields). |
&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields). |
"\n</form>\n</body>\n</html>"; |
"\n</form>\n".&Apache::loncommon::endbodytag()."\n</html>"; |
} |
} |
|
|
sub option { |
sub option { |
Line 580 sub start_problem {
|
Line 582 sub start_problem {
|
$allow_print_points=1; |
$allow_print_points=1; |
} |
} |
} |
} |
|
my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); |
|
if (defined($maxtries) && $maxtries < 0) { $allow_print_points=0; } |
my $duedate = &Apache::lonnet::EXT("resource.$id.duedate"); |
my $duedate = &Apache::lonnet::EXT("resource.$id.duedate"); |
$duedate = POSIX::strftime("%c",localtime($duedate)); |
$duedate = POSIX::strftime("%c",localtime($duedate)); |
my $temp_file; |
my $temp_file; |
Line 662 sub end_problem {
|
Line 666 sub end_problem {
|
$ENV{'form.answer_output_mode'} ne 'tex') { |
$ENV{'form.answer_output_mode'} ne 'tex') { |
$result.="</form>"; |
$result.="</form>"; |
$result.=&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields); |
$result.=&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields); |
$result.="</body>\n"; |
$result.=&Apache::loncommon::endbodytag(); |
} |
} |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result.=&Apache::lonxml::xmlend(); |
$result.=&Apache::lonxml::xmlend(); |
Line 753 sub end_library {
|
Line 757 sub end_library {
|
$result=&problem_edit_footer(); |
$result=&problem_edit_footer(); |
} elsif ($target eq 'web' && $$tagstack[0] ne 'problem' && |
} elsif ($target eq 'web' && $$tagstack[0] ne 'problem' && |
$ENV{'request.state'} eq "construct") { |
$ENV{'request.state'} eq "construct") { |
$result.='</form></body>'.&Apache::lonxml::xmlend(); |
$result.='</form>'.&Apache::loncommon::endbodytag(). |
|
&Apache::lonxml::xmlend(); |
} |
} |
if ($$tagstack[0] eq 'library') { &reset_problem_globals('library') }; |
if ($$tagstack[0] eq 'library') { &reset_problem_globals('library') }; |
return $result; |
return $result; |
Line 1126 sub start_part {
|
Line 1131 sub start_part {
|
if ($1 ne '0') {$allow_print_points=1;} |
if ($1 ne '0') {$allow_print_points=1;} |
} |
} |
} |
} |
|
my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); |
|
if (defined($maxtries) && $maxtries < 0) { |
|
$allow_print_points=0; |
|
} |
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} |
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
$result.='<a name="'.&Apache::lonnet::escape($Apache::inputtags::part).'" />'; |
$result.='<a name="'.&Apache::lonnet::escape($Apache::inputtags::part).'" />'; |
Line 1368 sub start_simpleeditbutton {
|
Line 1377 sub start_simpleeditbutton {
|
(&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { |
(&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { |
my $url=$ENV{'request.noversionuri'}; |
my $url=$ENV{'request.noversionuri'}; |
$url=~s/\?.*$//; |
$url=~s/\?.*$//; |
|
my ($symb) = &Apache::lonxml::whichuser(); |
$result='<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'. |
$result='<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'. |
'<a href="'.$url.'/smpedit">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). |
'<a href="'.$url.'/smpedit?symb='.&Apache::lonnet::escape($symb).'">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). |
&Apache::loncommon::help_open_topic('Caching').'</td></tr></table><br />'; |
&Apache::loncommon::help_open_topic('Caching').'</td></tr></table><br />'; |
} |
} |
return $result; |
return $result; |