version 1.469, 2007/11/13 22:16:10
|
version 1.471, 2008/02/15 12:59:50
|
Line 723 sub init_safespace {
|
Line 723 sub init_safespace {
|
$safehole->wrap(\&Apache::chemresponse::chem_standard_order,$safeeval, |
$safehole->wrap(\&Apache::chemresponse::chem_standard_order,$safeeval, |
'&chem_standard_order'); |
'&chem_standard_order'); |
$safehole->wrap(\&Apache::response::check_status,$safeeval,'&check_status'); |
$safehole->wrap(\&Apache::response::check_status,$safeeval,'&check_status'); |
|
$safehole->wrap(\&Apache::response::implicit_multiplication,$safeeval,'&implicit_multiplication'); |
|
|
$safehole->wrap(\&Apache::lonmaxima::maxima_eval,$safeeval,'&maxima_eval'); |
$safehole->wrap(\&Apache::lonmaxima::maxima_eval,$safeeval,'&maxima_eval'); |
$safehole->wrap(\&Apache::lonmaxima::maxima_check,$safeeval,'&maxima_check'); |
$safehole->wrap(\&Apache::lonmaxima::maxima_check,$safeeval,'&maxima_check'); |
Line 1083 sub increment_counter {
|
Line 1084 sub increment_counter {
|
# If the caller supplied the response_id parameter, |
# If the caller supplied the response_id parameter, |
# Maintain its counter.. creating if necessary. |
# Maintain its counter.. creating if necessary. |
|
|
if(defined($part_response)) { |
if (defined($part_response)) { |
if (!defined($Apache::lonxml::counters_per_part{$part_response})) { |
if (!defined($Apache::lonxml::counters_per_part{$part_response})) { |
$Apache::lonxml::counters_per_part{$part_response} = 0; |
$Apache::lonxml::counters_per_part{$part_response} = 0; |
} |
} |
Line 1164 sub bubble_lines_for_part {
|
Line 1165 sub bubble_lines_for_part {
|
} else { |
} else { |
return $Apache::lonxml::counters_per_part{$part_response}; |
return $Apache::lonxml::counters_per_part{$part_response}; |
} |
} |
|
|
} |
} |
|
|
=pod |
=pod |
Line 1477 SIMPLECONTENT
|
Line 1477 SIMPLECONTENT
|
|
|
|
|
sub inserteditinfo { |
sub inserteditinfo { |
my ($filecontents,$filetype)=@_; |
my ($filecontents, $filetype, $filename)=@_; |
$filecontents = &HTML::Entities::encode($filecontents,'<>&"'); |
$filecontents = &HTML::Entities::encode($filecontents,'<>&"'); |
# my $editheader='<a href="#editsection">Edit below</a><hr />'; |
# my $editheader='<a href="#editsection">Edit below</a><hr />'; |
my $xml_help = ''; |
my $xml_help = ''; |
Line 1529 FULLPAGE
|
Line 1529 FULLPAGE
|
$xml_help=&Apache::loncommon::helpLatexCheatsheet(); |
$xml_help=&Apache::loncommon::helpLatexCheatsheet(); |
} |
} |
|
|
my $cleanbut = ''; |
|
|
|
my $titledisplay=&display_title(); |
my $titledisplay=&display_title(); |
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', |
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', |
'vi' => 'Save and View', |
'vi' => 'Save and View', |
'dv' => 'Discard Edits and View', |
'dv' => 'Discard Edits and View', |
'un' => 'undo', |
'un' => 'undo', |
'ed' => 'Edit'); |
'ed' => 'Edit'); |
my $buttons=(<<BUTTONS); |
my $spelllink .=&Apache::lonhtmlcommon::spelllink('xmledit','filecont'); |
$cleanbut |
|
<input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" /> |
|
<input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" /><hr /> |
|
<input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" /> |
|
<input type="submit" name="viewmode" accesskey="v" value="$lt{'vi'}" /> |
|
BUTTONS |
|
$buttons.=&Apache::lonhtmlcommon::spelllink('xmledit','filecont'); |
|
my $textarea_events = &Apache::edit::element_change_detection(); |
my $textarea_events = &Apache::edit::element_change_detection(); |
my $form_events = &Apache::edit::form_change_detection(); |
my $form_events = &Apache::edit::form_change_detection(); |
my $editfooter=(<<ENDFOOTER); |
my $editfooter=(<<ENDFOOTER); |
$initialize |
$initialize |
<hr /> |
|
<a name="editsection" /> |
<a name="editsection" /> |
<form $form_events method="post" name="xmledit"> |
<form $form_events method="post" name="xmledit"> |
$xml_help |
<div class="LC_edit_problem_editxml_header"> |
<input type="hidden" name="editmode" value="$lt{'ed'}" /> |
<table class="LC_edit_problem_header_title"><tr><td> |
$buttons<br /> |
$filename |
<textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea> |
</td><td align="right"> |
<div id="LC_aftertextarea"> |
$xml_help |
<br />$buttons |
</td></tr> |
<br /> |
</table> |
$titledisplay |
<div class="LC_edit_problem_discards"> |
</div> |
<input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" /> |
|
<input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" /> |
|
$spelllink |
|
</div> |
|
<div class="LC_edit_problem_saves"> |
|
<input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" /> |
|
<input type="submit" name="viewmode" accesskey="v" value="$lt{'vi'}" /> |
|
</div> |
|
</div> |
|
<textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea> |
|
<div id="LC_aftertextarea"> |
|
<br /> |
|
$titledisplay |
|
</div> |
</form> |
</form> |
</body> |
</body> |
ENDFOOTER |
ENDFOOTER |
Line 1690 ENDNOTFOUND
|
Line 1693 ENDNOTFOUND
|
unless ($env{'request.state'} eq 'published') { |
unless ($env{'request.state'} eq 'published') { |
if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'}))) |
if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'}))) |
{ |
{ |
my ($edit_info, $add_to_onload, $add_to_onresize)= |
|
&inserteditinfo($filecontents,$filetype); |
|
|
|
my $displayfile=$request->uri; |
my $displayfile=$request->uri; |
$displayfile=~s/^\/[^\/]*//; |
$displayfile=~s/^\/[^\/]*//; |
|
|
|
my ($edit_info, $add_to_onload, $add_to_onresize)= |
|
&inserteditinfo($filecontents,$filetype,$displayfile); |
|
|
my %options = |
my %options = |
('add_entries' => |
('add_entries' => |
{'onresize' => $add_to_onresize, |
{'onresize' => $add_to_onresize, |
Line 1710 ENDNOTFOUND
|
Line 1714 ENDNOTFOUND
|
my $start_page = &Apache::loncommon::start_page(undef,$js, |
my $start_page = &Apache::loncommon::start_page(undef,$js, |
\%options); |
\%options); |
$result=$start_page. |
$result=$start_page. |
&Apache::lonxml::message_location().'<h3>'. |
&Apache::lonxml::message_location(). |
$displayfile. |
|
'</h3>'. |
|
$edit_info. |
$edit_info. |
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
} |
} |