version 1.343, 2006/04/14 20:16:23
|
version 1.346, 2006/04/15 01:06:59
|
Line 70 sub end_tex {
|
Line 70 sub end_tex {
|
} |
} |
|
|
sub page_start { |
sub page_start { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name, |
|
$extra_head)=@_; |
my %found; |
my %found; |
foreach my $taginside (@$tagstack) { |
foreach my $taginside (@$tagstack) { |
foreach my $taglookedfor ('html','body','form') { |
foreach my $taglookedfor ('html','body','form') { |
Line 85 sub page_start {
|
Line 86 sub page_start {
|
$parstack,$parser,$safeeval); |
$parstack,$parser,$safeeval); |
} |
} |
|
|
my $page_start; |
my %body_args; |
if (!defined($found{'html'})) { |
if (defined($found{'html'})) { |
|
$body_args{'skip_phases'}{'head'}=1; |
|
} else { |
|
|
my $extra_head = &Apache::lonhtmlcommon::spellheader(); |
$extra_head .= &Apache::lonhtmlcommon::spellheader(); |
|
|
my $css_href = &Apache::lonnet::EXT('resource.0.cssfile'); |
my $css_href = &Apache::lonnet::EXT('resource.0.cssfile'); |
if ($css_href =~ /\S/) { |
if ($css_href =~ /\S/) { |
Line 102 sub page_start {
|
Line 105 sub page_start {
|
"if (typeof swmenu != 'undefined') {swmenu.currentURL=null;}\n". |
"if (typeof swmenu != 'undefined') {swmenu.currentURL=null;}\n". |
&Apache::loncommon::browser_and_searcher_javascript(). |
&Apache::loncommon::browser_and_searcher_javascript(). |
"\n</script>\n"; |
"\n</script>\n"; |
|
|
} |
} |
$page_start .= |
|
&Apache::loncommon::head($name,$extra_head, |
|
{'force_register' => |
|
($target ne 'edit') }); |
|
} |
} |
|
|
if (!defined($found{'body'}) && $env{'request.state'} eq 'construct') { |
if (defined($found{'body'})) { |
|
$body_args{'skip_phases'}{'body'}=1; |
|
} elsif (!defined($found{'body'}) |
|
&& $env{'request.state'} eq 'construct') { |
if ($target eq 'web' || $target eq 'edit') { |
if ($target eq 'web' || $target eq 'edit') { |
$page_start.=&Apache::loncommon::bodytag(); |
# no extra args to bodytag |
$page_start.=&Apache::lonxml::message_location(); |
|
} |
} |
} elsif (!defined($found{'body'})) { |
} elsif (!defined($found{'body'})) { |
my %add_entries; |
my %add_entries; |
Line 122 sub page_start {
|
Line 122 sub page_start {
|
if ($background ne '' ) { |
if ($background ne '' ) { |
$add_entries{'background'} = $background; |
$add_entries{'background'} = $background; |
} |
} |
|
|
my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack, |
my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack, |
$safeeval); |
$safeeval); |
|
if ($bgcolor eq '' ) { $bgcolor = '#FFFFFF'; } |
if ($bgcolor eq '' ) { $bgcolor = '#FFFFFF'; } |
|
$page_start .= |
$body_args{'bgcolor'} = $bgcolor; |
&Apache::loncommon::bodytag(undef,undef,\%add_entries,undef,undef, |
$body_args{'no_title'} = 1; |
1,undef,undef,$bgcolor,$target,1); |
$body_args{'force_register'} = 1; |
|
$body_args{'add_entries'} = \%add_entries; |
if ( ($target eq 'web' || $target eq 'webgrade') |
} |
&& $env{'request.state'} ne 'construct') { |
|
my ($symb,undef,undef,undef,$publicuser)= |
my $page_start = &Apache::loncommon::start_page($name,$extra_head, |
&Apache::lonxml::whichuser(); |
\%body_args); |
if ($symb eq '' && !$publicuser) { |
|
my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference"); |
if (!defined($found{'body'}) |
$help=&mt("Browsing resource, all submissions are temporary.")."<br />"; |
&& $env{'request.state'} ne 'construct' |
$page_start .= $help; |
&& ($target eq 'web' || $target eq 'webgrade')) { |
} |
|
|
my ($symb,undef,undef,undef,$publicuser)= &Apache::lonxml::whichuser(); |
|
if ($symb eq '' && !$publicuser) { |
|
my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference"); |
|
$help=&mt("Browsing resource, all submissions are temporary.")."<br />"; |
|
$page_start .= $help; |
} |
} |
$page_start .= &Apache::lonxml::message_location(); |
|
} |
} |
|
|
|
if (!defined($found{'body'})) { |
|
$page_start .= &Apache::lonxml::message_location(); |
|
} |
|
|
my $form_tag_start; |
my $form_tag_start; |
if (!defined($found{'form'})) { |
if (!defined($found{'form'})) { |
$form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="post" action="'; |
$form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="post" action="'; |
Line 153 sub page_start {
|
Line 162 sub page_start {
|
} |
} |
$form_tag_start.='>'; |
$form_tag_start.='>'; |
} |
} |
|
|
return ($page_start,$form_tag_start); |
return ($page_start,$form_tag_start); |
} |
} |
|
|
Line 586 sub start_problem {
|
Line 596 sub start_problem {
|
my $status; |
my $status; |
my $accessmsg; |
my $accessmsg; |
|
|
#should get back a <html> or the neccesary stuff to start XML/MathML |
|
my $name= &get_resource_name($parstack,$safeeval); |
my $name= &get_resource_name($parstack,$safeeval); |
my ($result,$form_tag_start)= |
my ($result,$form_tag_start)= |
&page_start($target,$token,$tagstack,$parstack,$parser,$safeeval, |
&page_start($target,$token,$tagstack,$parstack,$parser,$safeeval, |
Line 855 sub end_problem {
|
Line 864 sub end_problem {
|
$result.=&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields); |
$result.=&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields); |
} |
} |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result.=&Apache::lonxml::xmlend().'</html>'; |
$result.= &Apache::loncommon::end_page({'discussion' => 1}); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my $endminipage = ''; |
my $endminipage = ''; |
if (not $env{'form.problem_split'}=~/yes/) { |
if (not $env{'form.problem_split'}=~/yes/) { |
Line 880 sub end_problem {
|
Line 889 sub end_problem {
|
} |
} |
if ($target eq 'answer' && ($env{'request.state'} eq 'construct') |
if ($target eq 'answer' && ($env{'request.state'} eq 'construct') |
&& $env{'form.answer_output_mode'} ne 'tex') { |
&& $env{'form.answer_output_mode'} ne 'tex') { |
$result.=&Apache::lonxml::xmlend().'</html>'; |
$result.=&Apache::loncommon::end_page({'discussion' => 1}); |
# normally we get it from above, but in CSTR |
# normally we get it from above, but in CSTR |
# we always show answer mode too. |
# we always show answer mode too. |
} |
} |