version 1.238, 2006/04/11 21:05:54
|
version 1.242, 2006/04/25 15:32:40
|
Line 234 sub check_slot_access {
|
Line 234 sub check_slot_access {
|
my ($status,$datemsg)=&check_access($id); |
my ($status,$datemsg)=&check_access($id); |
|
|
my $useslots = &Apache::lonnet::EXT("resource.$id.useslots"); |
my $useslots = &Apache::lonnet::EXT("resource.$id.useslots"); |
if ($useslots ne 'resource') { |
if ($useslots ne 'resource' && $useslots ne 'sequence') { |
return ($status,$datemsg); |
return ($status,$datemsg); |
} |
} |
|
|
Line 266 sub check_slot_access {
|
Line 266 sub check_slot_access {
|
my $slotstatus='NOT_IN_A_SLOT'; |
my $slotstatus='NOT_IN_A_SLOT'; |
my ($returned_slot,$slot_name); |
my ($returned_slot,$slot_name); |
foreach my $slot (@slots) { |
foreach my $slot (@slots) { |
|
$slot =~ s/(^\s*|\s*$)//g; |
&Apache::lonxml::debug("getting $slot"); |
&Apache::lonxml::debug("getting $slot"); |
my %slot=&Apache::lonnet::get_slot($slot); |
my %slot=&Apache::lonnet::get_slot($slot); |
&Apache::lonhomework::showhash(%slot); |
&Apache::lonhomework::showhash(%slot); |
Line 623 sub handle_save_or_undo {
|
Line 624 sub handle_save_or_undo {
|
sub analyze_header { |
sub analyze_header { |
my ($request) = @_; |
my ($request) = @_; |
my $result = |
my $result = |
&Apache::loncommon::start_page('Analyzing a problem',undef, |
&Apache::loncommon::start_page('Analyzing a problem',undef); |
{'only_body' => ($env{'environment.remote'} ne 'off'),}); |
|
$result .= |
$result .= |
&Apache::lonxml::message_location().' |
&Apache::lonxml::message_location().' |
<form name="lonhomework" method="POST" action="'. |
<form name="lonhomework" method="POST" action="'. |
Line 756 sub editxmlmode {
|
Line 757 sub editxmlmode {
|
if ($rows < 20) { $rows = 20; } |
if ($rows < 20) { $rows = 20; } |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page("EditXML $file", |
&Apache::loncommon::start_page("EditXML $file", |
&Apache::edit::js_change_detection(), |
&Apache::edit::js_change_detection()); |
{'only_body' => |
|
($env{'environment.remote'} ne 'off')}); |
|
|
|
$result.=$start_page. |
$result.=$start_page. |
&renderpage($request,$file,['no_output_web'],1). |
&renderpage($request,$file,['no_output_web'],1). |
Line 911 sub newproblem {
|
Line 910 sub newproblem {
|
$errormsg='<p><font color="red">'.&mt('You did not select a template.').'</font></p>'."\n"; |
$errormsg='<p><font color="red">'.&mt('You did not select a template.').'</font></p>'."\n"; |
} |
} |
my $instructions; |
my $instructions; |
my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef, |
my $start_page = |
($env{'environment.remote'} ne 'off')); |
&Apache::loncommon::start_page("Create New $extension"); |
if ($templatelist) { $instructions=&mt(", select a template from the pull-down menu below.").'<br />'.&mt("Then");} |
if ($templatelist) { $instructions=&mt(", select a template from the pull-down menu below.").'<br />'.&mt("Then");} |
my %lt=&Apache::lonlocal::texthash( 'create' => 'Creating a new', |
my %lt=&Apache::lonlocal::texthash( 'create' => 'Creating a new', |
'resource' => 'resource', |
'resource' => 'resource', |
Line 923 sub newproblem {
|
Line 922 sub newproblem {
|
'Create' => 'Create', |
'Create' => 'Create', |
'button' => 'button'); |
'button' => 'button'); |
$request->print(<<ENDNEWPROBLEM); |
$request->print(<<ENDNEWPROBLEM); |
$bodytag |
$start_page |
<h1>$lt{'create'} $extension $lt{'resource'}</h1> |
<h1>$lt{'create'} $extension $lt{'resource'}</h1> |
$errormsg |
$errormsg |
$lt{'requested'} <tt>$shownurl</tt> $lt{'not exist'}. |
$lt{'requested'} <tt>$shownurl</tt> $lt{'not exist'}. |
Line 941 ENDNEWPROBLEM
|
Line 940 ENDNEWPROBLEM
|
return ''; |
return ''; |
} |
} |
|
|
sub view_or_edit_menu { |
|
my ($request) = @_; |
|
my $url=&HTML::Entities::encode($request->uri,'<>&"'); |
|
my %lt=&Apache::lonlocal::texthash( 'would' => 'Would you like to', |
|
'view' => 'View', |
|
'Edit' => 'edit', |
|
'or' => 'or', |
|
'the problem' => 'the problem'); |
|
$request->print(<<EDITMENU); |
|
<body bgcolor="#FFFFFF"> |
|
<form action="$url" method="POST"> |
|
$lt{'would'} <input type="submit" name="problemmode" accesskey="v" value="<{'view'}"> |
|
<{'or'} <input type="submit" name="problemmode" accesskey="e" value="<{'Edit'}"> |
|
<{'the problem'}. |
|
</form> |
|
</body> |
|
EDITMENU |
|
} |
|
|
|
sub handler { |
sub handler { |
#my $t0 = [&gettimeofday()]; |
#my $t0 = [&gettimeofday()]; |
my $request=$_[0]; |
my $request=$_[0]; |
Line 997 sub handler {
|
Line 977 sub handler {
|
['problemmode']); |
['problemmode']); |
if (!(defined $env{'form.problemmode'})) { |
if (!(defined $env{'form.problemmode'})) { |
#first visit to problem in construction space |
#first visit to problem in construction space |
#&view_or_edit_menu($request); |
|
$env{'form.problemmode'}='View'; |
$env{'form.problemmode'}='View'; |
&renderpage($request,$file); |
&renderpage($request,$file); |
} elsif ($env{'form.problemmode'} eq &mt('EditXML') || |
} elsif ($env{'form.problemmode'} eq &mt('EditXML') || |