version 1.35, 2001/04/26 21:27:15
|
version 1.36, 2001/05/04 21:21:45
|
Line 46 sub start_problem {
|
Line 46 sub start_problem {
|
&Apache::run::run($expression,$safeeval); |
&Apache::run::run($expression,$safeeval); |
my $status; |
my $status; |
my $datemsg; |
my $datemsg; |
|
|
|
my $result=&Apache::londefdef::start_html($target,$token,$parstack,$parser,$safeeval); |
|
|
if ($target eq 'web' || $target eq 'grade') { |
if ($target eq 'web' || $target eq 'grade') { |
($status,$datemsg) = &Apache::lonhomework::check_date('0'); |
($status,$datemsg) = &Apache::lonhomework::check_date('0'); |
push (@Apache::inputtags::status,$status); |
push (@Apache::inputtags::status,$status); |
Line 55 sub start_problem {
|
Line 58 sub start_problem {
|
if ( $status eq 'CLOSED' ) { |
if ( $status eq 'CLOSED' ) { |
my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]); |
my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]); |
if ( $target eq "web" ) { |
if ( $target eq "web" ) { |
return "<body bgcolor=\"#FFFFFF\"> <br />Problem is not open to be viewed. The problem $datemsg<br />"; |
return $result."<body bgcolor=\"#FFFFFF\"> <br />Problem is not open to be viewed. The problem $datemsg<br />"; |
} |
} |
} |
} |
} |
} |
Line 70 sub start_problem {
|
Line 73 sub start_problem {
|
$Apache::lonhomework::name=$name; |
$Apache::lonhomework::name=$name; |
if ($status eq 'CAN_ANSWER') { |
if ($status eq 'CAN_ANSWER') { |
# create a page header and exit |
# create a page header and exit |
return "<title>$name</title>\n<body bgcolor=\"#FFFFFF\">\n<form name=\"lonhomework\" method=\"POST\" action=\"".$ENV{'request.uri'}."\">".'<input type="hidden" name="submitted" value="yes" />'; |
$result.="<head><title>$name</title></head>\n |
|
<body bgcolor=\"#FFFFFF\">\n |
|
<form name=\"lonhomework\" method=\"POST\" action=\"".$ENV{'request.uri'}."\">". |
|
'<input type="hidden" name="submitted" value="yes" />'; |
|
if ($ENV{'request.state'} eq "construct") { |
|
$result.='<input type="hidden" name="problemmode" value="View" /> |
|
<input type="submit" name="problemmode" value="Edit" /><hr />'; |
|
} |
|
return $result; |
} elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'CLOSED') { |
} elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'CLOSED') { |
return "<title>$name</title>\n<body bgcolor=\"#FFFFFF\">\n"; |
return $result."<title>$name</title>\n<body bgcolor=\"#FFFFFF\">\n"; |
} |
} |
} |
} |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
return '<body bgcolor="#FFFFFF"> |
$result.='<body bgcolor="#FFFFFF"> |
<form name="lonhomework" method="POST" action="'.$ENV{'request.uri'}.'"> |
<form name="lonhomework" method="POST" action="'.$ENV{'request.uri'}.'"> |
<input type="hidden" name="submitted" value="edit" /> |
<input type="hidden" name="submitted" value="edit" /> |
<input type="submit" name="undo" value="undo" /> |
<input type="hidden" name="problemmode" value="Edit" /> |
|
<input type="submit" name="problemmode" value="View" /> |
|
<input type="submit" name="Undo" value="undo" /> <hr /> |
'; |
'; |
|
my $temp=&Apache::edit::insertlist($token,$target); |
|
&Apache::lonxml::debug("edit gave me $temp"); |
|
$result.=$temp; |
|
return $result; |
} |
} |
return ''; |
return ''; |
} |
} |