version 1.407, 2007/10/30 00:17:09
|
version 1.415, 2008/01/14 14:32:14
|
Line 199 sub page_start {
|
Line 199 sub page_start {
|
} |
} |
} |
} |
|
|
if (!defined($found{'body'})) { |
if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') { |
$page_start .= &Apache::lonxml::message_location(); |
$page_start .= &Apache::lonxml::message_location(); |
} |
} |
|
|
Line 302 sub remember_problem_state {
|
Line 302 sub remember_problem_state {
|
sub problem_edit_header { |
sub problem_edit_header { |
return '<input type="hidden" name="submitted" value="edit" />'. |
return '<input type="hidden" name="submitted" value="edit" />'. |
&Apache::structuretags::remember_problem_state().' |
&Apache::structuretags::remember_problem_state().' |
|
<div class="LC_edit_problem_header"> |
|
<div class="LC_edit_problem_header_title"> |
|
'.&mt('Problem Editing').&Apache::loncommon::help_open_menu('Problem Editing','Problem_Editor_XML_Index',5,'Authoring').' |
|
</div> |
|
<div class="LC_edit_problem_discards"> |
<input type="hidden" name="problemmode" value="'.&mt('Edit').'" /> |
<input type="hidden" name="problemmode" value="'.&mt('Edit').'" /> |
<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 '.&Apache::edit::submit_ask_anyway().' type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" /> |
<input '.&Apache::edit::submit_ask_anyway().' type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" /> |
<input type="submit" name="Undo" accesskey="u" value="'.&mt('undo').'" /> |
<input type="submit" name="Undo" accesskey="u" value="'.&mt('undo').'" /> |
<hr class="LC_edit_problem_divide" /> |
</div> |
<input type="submit" name="submit" accesskey="s" value="'.&mt('Submit Changes and Edit').'" /> |
<div class="LC_edit_problem_saves"> |
<input type="submit" name="submit" accesskey="v" value="'.&mt('Submit Changes and View').'" /> |
<input type="submit" name="submit" accesskey="s" value="'.&mt('Save and Edit').'" /> |
<div>'. |
<input type="submit" name="submit" accesskey="v" value="'.&mt('Save and View').'" /> |
&Apache::loncommon::help_open_menu('Problem Editing Help','Problem_Editor_XML_Index',5,'Authoring',undef,undef,undef,'Problem Editing Help') |
</div> |
.'</div>'. |
<hr class="LC_edit_problem_divide" /> |
|
'.&Apache::lonxml::message_location().' |
|
</div> |
|
'. |
'<table border="0" width="100%"><tr><td bgcolor="#DDDDDD">'; |
'<table border="0" width="100%"><tr><td bgcolor="#DDDDDD">'; |
} |
} |
|
|
sub problem_edit_footer { |
sub problem_edit_footer { |
return '</td></tr></table><br /><input type="submit" name="submit" value="'.&mt('Submit Changes and Edit').'" /> |
return '</td></tr></table><br /> |
<input type="submit" name="submit" value="'.&mt('Submit Changes and View').'" />'. |
<div class="LC_edit_problem_footer"> |
|
<hr class="LC_edit_problem_divide" /> |
|
<div class="LC_edit_problem_discards"> |
|
<input type="submit" name="problemmode" accesskey="d" value="'.&mt('Discard Edits and View').'" /> |
|
<input '.&Apache::edit::submit_ask_anyway().' type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" /> |
|
<input type="submit" name="Undo" accesskey="u" value="'.&mt('undo').'" /> |
|
</div> |
|
<div class="LC_edit_problem_saves"> |
|
<input type="submit" name="submit" value="'.&mt('Save and Edit').'" /> |
|
<input type="submit" name="submit" value="'.&mt('Save and View').'" /> |
|
</div> |
|
<hr class="LC_edit_problem_divide" /> |
|
</div> |
|
'. |
|
|
&Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()). |
&Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()). |
"\n</form>\n".&Apache::loncommon::end_page(); |
"\n</form>\n".&Apache::loncommon::end_page(); |
} |
} |
Line 336 sub problem_web_to_edit_header {
|
Line 358 sub problem_web_to_edit_header {
|
my ($rndseed)=@_; |
my ($rndseed)=@_; |
my $result .= '<div class="LC_edit_problem_header">'; |
my $result .= '<div class="LC_edit_problem_header">'; |
|
|
$result.='<div class="LC_edit_problem_header_edit_row">'; |
|
$result.='<input type="hidden" name="problemmode" value="'.&mt('View').'" />'; |
|
$result .= '<input type="submit" name="problemmode" accesskey="e" value="'.&mt('Edit').'" />'; |
|
$result .= '<input type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" />'; |
|
$result.='</div>'; |
|
|
|
if (!$Apache::lonhomework::parsing_a_task) { |
if (!$Apache::lonhomework::parsing_a_task) { |
$result .= |
$result .= |
'<div class="LC_edit_problem_header_title">'. |
'<div class="LC_edit_problem_header_title">'. |
Line 443 $show_all
|
Line 459 $show_all
|
if (!$Apache::lonhomework::parsing_a_task) { |
if (!$Apache::lonhomework::parsing_a_task) { |
my $numtoanalyze=$env{'form.numtoanalyze'}; |
my $numtoanalyze=$env{'form.numtoanalyze'}; |
if (!$numtoanalyze) { $numtoanalyze=20; } |
if (!$numtoanalyze) { $numtoanalyze=20; } |
$result .= &mt('[_1] for [_2] versions of this problem.', |
$result .= '<span class="LC_nobreak">'. |
'<input type="submit" name="problemmode" value='.&mt('"Calculate answers').'" />', |
&mt('[_1] for [_2] versions.', |
'<input type="text" name="numtoanalyze" value="'. |
'<input type="submit" name="problemmode" value='.&mt('"Calculate answers').'" />', |
$numtoanalyze.'" size="5" />'). |
'<input type="text" name="numtoanalyze" value="'. |
&Apache::loncommon::help_open_topic("Analyze_Problem", |
$numtoanalyze.'" size="5" />'). |
'',undef,undef,300); |
&Apache::loncommon::help_open_topic("Analyze_Problem",'',undef,undef,300). |
|
'</span>'; |
|
|
} |
} |
|
|
$result.=' |
$result.=' |
</div> |
</div> |
<hr class="LC_edit_problem_divide" /> |
<div class="LC_edit_problem_header_edit_row">'; |
|
$result.='<input type="hidden" name="problemmode" value="'.&mt('View').'" />'; |
|
$result .= '<input type="submit" name="problemmode" accesskey="e" value="'.&mt('Edit').'" />'; |
|
$result .= '<input type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" />'; |
|
$result.=' |
|
</div> |
|
'.&Apache::lonxml::message_location().' |
</div>'; |
</div>'; |
return $result; |
return $result; |
} |
} |
Line 596 ENDCHECKOUT
|
Line 620 ENDCHECKOUT
|
|
|
sub firstaccess_msg { |
sub firstaccess_msg { |
my ($time,$symb)=@_; |
my ($time,$symb)=@_; |
my ($map)=&Apache::lonnet::decode_symb($symb); |
my $result; |
my $foldertitle=&Apache::lonnet::gettitle($map); |
my @interval=&Apache::lonnet::EXT("resource.0.interval"); |
&Apache::lonxml::debug("map is $map title is $foldertitle"); |
if ($interval[1] eq 'map') { |
my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); |
my ($map)=&Apache::lonnet::decode_symb($symb); |
return (<<ENDCHECKOUT); |
my $foldertitle=&Apache::lonnet::gettitle($map); |
|
|
|
&Apache::lonxml::debug("map is $map title is $foldertitle"); |
|
$result .= (<<ENDCHECKOUT); |
<h2>The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle".</h2> |
<h2>The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle".</h2> |
|
ENDCHECKOUT |
|
} elsif ($interval[1] eq 'course') { |
|
my $course = $env{'course.'.$env{'request.course.id'}.'.description'}; |
|
$result .= (<<ENDCHECKOUT); |
|
<h2>The resources in "$course" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources in "$course".</h2> |
|
ENDCHECKOUT |
|
} else { |
|
my $title=&Apache::lonnet::gettitle($symb); |
|
$result .= (<<ENDCHECKOUT); |
|
<h2>This resource "$title" is open for a limited time. Once you click the 'Show Resource' button below you have $time to complete this resource "$title".</h2> |
|
ENDCHECKOUT |
|
|
|
} |
|
my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); |
|
$result .= (<<ENDCHECKOUT); |
<form name="markaccess" method="POST" action="$uri"> |
<form name="markaccess" method="POST" action="$uri"> |
<input type="hidden" name="markaccess" value="yes" /> |
<input type="hidden" name="markaccess" value="yes" /> |
<input type="button" name="accessbutton" value="Show Resource" onClick="javascript:if (confirm('Start Timer?')) { document.markaccess.submit(); }" /> |
<input type="button" name="accessbutton" value="Show Resource" onClick="javascript:if (confirm('Start Timer?')) { document.markaccess.submit(); }" /> |
</form> |
</form> |
ENDCHECKOUT |
ENDCHECKOUT |
|
return $result; |
} |
} |
|
|
sub init_problem_globals { |
sub init_problem_globals { |
Line 711 sub start_problem {
|
Line 754 sub start_problem {
|
} |
} |
|
|
if ($target ne 'analyze') { |
if ($target ne 'analyze') { |
$Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type'); |
my $type = &Apache::lonnet::EXT('resource.0.type'); |
|
$Apache::lonhomework::type=$type; |
if (($env{'request.state'} eq 'construct') && |
if (($env{'request.state'} eq 'construct') && |
defined($env{'form.problemtype'})) { |
$env{'form.problemtype'} =~ /\S/) { |
$Apache::lonhomework::type=$env{'form.problemtype'}; |
$Apache::lonhomework::type=$env{'form.problemtype'}; |
} |
} |
&Apache::lonxml::debug("Found this to be of type :$Apache::lonhomework::type:"); |
&Apache::lonxml::debug("Found this to be of type :$Apache::lonhomework::type:"); |
Line 774 sub start_problem {
|
Line 818 sub start_problem {
|
$result.=&Apache::lonxml::printtokenheader($target,$token); |
$result.=&Apache::lonxml::printtokenheader($target,$token); |
} |
} |
if ($env{'form.markaccess'}) { |
if ($env{'form.markaccess'}) { |
&Apache::lonnet::set_first_access('map'); |
my @interval=&Apache::lonnet::EXT("resource.0.interval"); |
|
&Apache::lonnet::set_first_access($interval[1]); |
} |
} |
#handle rand seed in construction space |
#handle rand seed in construction space |
my $rndseed=&setup_rndseed($safeeval); |
my $rndseed=&setup_rndseed($safeeval); |