version 1.175, 2004/05/25 21:25:53
|
version 1.177, 2004/05/27 22:25:16
|
Line 292 sub check_access {
|
Line 292 sub check_access {
|
$status = 'CANNOT_ANSWER'; |
$status = 'CANNOT_ANSWER'; |
} |
} |
} |
} |
|
if ($status eq 'CAN_ANSWER') { |
|
my $interval=&Apache::lonnet::EXT("resource.$id.interval"); |
|
&Apache::lonxml::debug("looking for interval $interval"); |
|
if ($interval) { |
|
my $first_access=&Apache::lonnet::get_first_access('map'); |
|
&Apache::lonxml::debug("looking for accesstime $first_access"); |
|
if (!$first_access) { |
|
$status='NOT_YET_VIEWED'; |
|
$datemsg=' '.$interval.' seconds'; |
|
} else { |
|
my $newdate=localtime($first_access+$interval); |
|
if (time > ($first_access+$interval)) { |
|
$status='CLOSED'; |
|
$datemsg = &mt("was due on")." $newdate".&mt(", and answers will be available on")." $date"; |
|
} else { |
|
$datemsg = &mt("is due at")." $newdate"; |
|
} |
|
} |
|
} |
|
} |
#if (($status ne 'CLOSED') && ($Apache::lonhomework::type eq 'exam') && |
#if (($status ne 'CLOSED') && ($Apache::lonhomework::type eq 'exam') && |
# (!$Apache::lonhomework::history{"resource.0.outtoken"})) { |
# (!$Apache::lonhomework::history{"resource.0.outtoken"})) { |
# return ('UNCHECKEDOUT','needs to be checked out'); |
# return ('UNCHECKEDOUT','needs to be checked out'); |
Line 434 sub analyze_header {
|
Line 453 sub analyze_header {
|
<head><title>'.&mt("Analyzing a problem").'</title></head> |
<head><title>'.&mt("Analyzing a problem").'</title></head> |
<body bgcolor="#FFFFFF">'.&Apache::lonxml::message_location().' |
<body bgcolor="#FFFFFF">'.&Apache::lonxml::message_location().' |
<form name="lonhomework" method="POST" action="'. |
<form name="lonhomework" method="POST" action="'. |
$ENV{'request.uri'}.'"> |
&HTML::Entities::encode($ENV{'request.uri'},'<>&"').'"> |
<input type="submit" name="problemmode" value="'.&mt("EditXML").'" /> |
<input type="submit" name="problemmode" value="'.&mt("EditXML").'" /> |
<input type="submit" name="problemmode" value="'.&mt('Edit').'" /> |
<input type="submit" name="problemmode" value="'.&mt('Edit').'" /> |
<hr /> |
<hr /> |
Line 554 sub editxmlmode {
|
Line 573 sub editxmlmode {
|
$result.='<html><body bgcolor="#FFFFFF">'. |
$result.='<html><body bgcolor="#FFFFFF">'. |
&Apache::lonxml::message_location().' |
&Apache::lonxml::message_location().' |
<form name="lonhomework" method="POST" action="'. |
<form name="lonhomework" method="POST" action="'. |
$ENV{'request.uri'}.'"> |
&HTML::Entities::encode($ENV{'request.uri'},'<>&"').'"> |
<input type="hidden" name="problemmode" value="'.&mt('EditXML').'" /> |
<input type="hidden" name="problemmode" value="'.&mt('EditXML').'" /> |
<input type="submit" name="problemmode" accesskey="d" value="'.&mt('Discard Edits and View').'" /> |
<input type="submit" name="problemmode" accesskey="d" value="'.&mt('Discard Edits and View').'" /> |
<input type="submit" name="problemmode" accesskey="e" value="'.&mt('Edit').'" /> |
<input type="submit" name="problemmode" accesskey="e" value="'.&mt('Edit').'" /> |
Line 669 sub newproblem {
|
Line 688 sub newproblem {
|
copy($templatefilename,$dest); |
copy($templatefilename,$dest); |
&renderpage($request,$dest); |
&renderpage($request,$dest); |
} else { |
} else { |
my $url=$request->uri; |
my $url=&HTML::Entities::encode($request->uri,'<>&"'); |
my $shownurl=$url; |
my $shownurl=$url; |
$shownurl=~s-^/~-/priv/-; |
$shownurl=~s-^/~-/priv/-; |
my $dest = &Apache::lonnet::filelocation("",$request->uri); |
my $dest = &Apache::lonnet::filelocation("",$request->uri); |
my $errormsg; |
my $errormsg; |
Line 709 ENDNEWPROBLEM
|
Line 728 ENDNEWPROBLEM
|
|
|
sub view_or_edit_menu { |
sub view_or_edit_menu { |
my ($request) = @_; |
my ($request) = @_; |
my $url=$request->uri; |
my $url=&HTML::Entities::encode($request->uri,'<>&"'); |
my %lt=&Apache::lonlocal::texthash( 'would' => 'Would you like to', |
my %lt=&Apache::lonlocal::texthash( 'would' => 'Would you like to', |
'view' => 'View', |
'view' => 'View', |
'Edit' => 'edit', |
'Edit' => 'edit', |