version 1.147, 2003/02/14 19:35:54
|
version 1.150, 2003/02/25 23:18:22
|
Line 101 sub page_start {
|
Line 101 sub page_start {
|
$body_tag_start.='bgcolor="#ffffff"'; |
$body_tag_start.='bgcolor="#ffffff"'; |
} |
} |
} |
} |
$body_tag_start.='>'; |
$body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target); |
if ($target eq 'web' && $ENV{'request.state'} ne 'construct') { |
if ($target eq 'web' && $ENV{'request.state'} ne 'construct') { |
my ($symb)=&Apache::lonxml::whichuser(); |
my ($symb)=&Apache::lonxml::whichuser(); |
if ($symb eq '') { |
if ($symb eq '') { |
Line 666 sub start_part {
|
Line 666 sub start_part {
|
$Apache::inputtags::part=$id; |
$Apache::inputtags::part=$id; |
@Apache::inputtags::responselist = (); |
@Apache::inputtags::responselist = (); |
@Apache::inputtags::previous=(); |
@Apache::inputtags::previous=(); |
|
my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part); |
|
|
if ($target eq 'meta') { |
if ($target eq 'meta') { |
return &Apache::response::mandatory_part_meta; |
return &Apache::response::mandatory_part_meta; |
} elsif ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') { |
} elsif ($target eq 'web' || $target eq 'grade' || |
my ($status,$accessmsg) = &Apache::lonhomework::check_access($id); |
$target eq 'answer' || $target eq 'tex') { |
push (@Apache::inputtags::status,$status); |
if ($hidden) { |
my $expression='$external::datestatus="'.$status.'";'; |
my $bodytext=&Apache::lonxml::get_all_text("/part",$parser); |
$expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.$id.solved"}.'";'; |
} else { |
&Apache::run::run($expression,$safeeval); |
my ($status,$accessmsg) = &Apache::lonhomework::check_access($id); |
if ( $status eq 'CLOSED' ) { |
push (@Apache::inputtags::status,$status); |
my $bodytext=&Apache::lonxml::get_all_text("/part",$parser); |
my $expression='$external::datestatus="'.$status.'";'; |
if ( $target eq "web" ) { |
$expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.$id.solved"}.'";'; |
$result="<br />Part is not open to be viewed. It $accessmsg<br />"; |
&Apache::run::run($expression,$safeeval); |
} elsif ( $target eq 'tex' ) { |
if ( $status eq 'CLOSED' ) { |
$result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}"; |
my $bodytext=&Apache::lonxml::get_all_text("/part",$parser); |
} |
if ( $target eq "web" ) { |
} else { |
$result="<br />Part is not open to be viewed. It $accessmsg<br />"; |
if ($target eq 'tex') { |
} elsif ( $target eq 'tex' ) { |
if ($$tagstack[-2] ne 'problem') { |
$result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}"; |
$result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent'; |
} |
} |
} else { |
|
if ($target eq 'tex') { |
|
if ($$tagstack[-2] ne 'problem') { |
|
$result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent'; |
|
} |
|
} |
|
} |
} |
} |
} |
|
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::text_arg('Part ID:','id',$token). |
$result.=&Apache::edit::text_arg('Part ID:','id',$token). |
Line 709 sub end_part {
|
Line 716 sub end_part {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
&Apache::lonxml::debug("in end_part $target "); |
&Apache::lonxml::debug("in end_part $target "); |
my $status=$Apache::inputtags::status['-1']; |
my $status=$Apache::inputtags::status['-1']; |
|
my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part); |
my $result=''; |
my $result=''; |
if ( $target eq 'meta' ) { |
if ( $target eq 'meta' ) { |
$result=''; |
$result=''; |
} elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER') { |
} elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER' && !$hidden) { |
$result=&Apache::inputtags::grade; |
$result=&Apache::inputtags::grade; |
} elsif ($target eq 'web' || $target eq 'tex' ) { |
} elsif (($target eq 'web' || $target eq 'tex') && !$hidden ) { |
my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part, |
my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part, |
$target); |
$target); |
if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';} |
if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';} |
Line 807 sub end_startouttext {
|
Line 815 sub end_startouttext {
|
."</td> |
."</td> |
<td>". |
<td>". |
&Apache::edit::insertlist($target,$token). |
&Apache::edit::insertlist($target,$token). |
&Apache::edit::end_row().&Apache::edit::start_spanning_row()."\n". |
&Apache::edit::end_row().&Apache::edit::start_spanning_row()."\n" |
&Apache::edit::editfield($token->[1],$text,"",80,4); |
.'<table><tr><td>'. |
|
&Apache::loncommon::help_open_topic("Greek_Symbols",'Greek Symbols', |
|
undef,undef,600) |
|
.'</td><td>'. |
|
&Apache::loncommon::help_open_topic("Other_Symbols",'Other Symbols', |
|
undef,undef,600) |
|
.'</td></tr></table>'. |
|
&Apache::edit::editfield($token->[1],$text,"",80,4); |
} |
} |
if ($target eq 'modified') { |
if ($target eq 'modified') { |
$text=&Apache::lonxml::get_all_text("endouttext",$parser); |
$text=&Apache::lonxml::get_all_text("endouttext",$parser); |