version 1.191, 2008/05/30 16:19:49
|
version 1.206.2.1, 2008/12/11 04:11:09
|
Line 288 sub check_for_previous {
|
Line 288 sub check_for_previous {
|
$previous{'last'}='1'; |
$previous{'last'}='1'; |
} |
} |
if (! $previous{'award'} ) { $previous{'award'} = 'UNKNOWN'; } |
if (! $previous{'award'} ) { $previous{'award'} = 'UNKNOWN'; } |
|
if ($previous{'award'} eq 'INTERNAL_ERROR') { $previous{'used'}=0; } |
&Apache::lonxml::debug("got a match :$previous{'award'}:$previous{'used'}:"); |
&Apache::lonxml::debug("got a match :$previous{'award'}:$previous{'used'}:"); |
} |
} |
} |
} |
Line 486 sub start_mathresponse {
|
Line 487 sub start_mathresponse {
|
$safeeval); |
$safeeval); |
$Apache::inputtags::answertxt{$id}=[$answer]; |
$Apache::inputtags::answertxt{$id}=[$answer]; |
} |
} |
if ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') { |
|
$result.=&edit_mathresponse_button($id,"HWVAL_$id"); |
|
} |
|
|
|
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
Line 499 sub start_mathresponse {
|
Line 497 sub start_mathresponse {
|
['maxima'], |
['maxima'], |
$token); |
$token); |
$result.=&Apache::edit::text_arg('Argument Array:', |
$result.=&Apache::edit::text_arg('Argument Array:', |
'args',$token); |
'args',$token). |
|
&Apache::loncommon::help_open_topic('Maxima_Argument_Array'); |
|
$result.=&Apache::edit::text_arg('Libraries:', |
|
'libraries',$token). |
|
&Apache::loncommon::help_open_topic('Maxima_Libraries'); |
$result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
$result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $constructtag; |
my $constructtag; |
$constructtag=&Apache::edit::get_new_args($token,$parstack, |
$constructtag=&Apache::edit::get_new_args($token,$parstack, |
$safeeval,'answerdisplay','cas','args'); |
$safeeval,'answerdisplay','cas','args','libraries'); |
if ($constructtag) { |
if ($constructtag) { |
$result = &Apache::edit::rebuild_tag($token); |
$result = &Apache::edit::rebuild_tag($token); |
} |
} |
Line 519 sub start_mathresponse {
|
Line 521 sub start_mathresponse {
|
sub edit_mathresponse_button { |
sub edit_mathresponse_button { |
my ($id,$field)=@_; |
my ($id,$field)=@_; |
my $button=&mt('Edit Answer'); |
my $button=&mt('Edit Answer'); |
|
# my $helplink=&Apache::loncommon::help_open_topic('Formula_Editor'); |
|
my $iconpath=$Apache::lonnet::perlvar{'lonIconsURL'}; |
return(<<ENDFORMULABUTTON); |
return(<<ENDFORMULABUTTON); |
<script language="JavaScript"> |
<script language="JavaScript"> |
function edit_${id}_${field} (textarea) { |
function edit_${id}_${field} (textarea) { |
Line 527 function edit_${id}_${field} (textarea)
|
Line 531 function edit_${id}_${field} (textarea)
|
newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable"); |
newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable"); |
} |
} |
</script> |
</script> |
<input type='button' value='$button' onclick="javascript:edit_${id}_${field}('${field}');void(0);" /> |
<a href="javascript:edit_${id}_${field}('${field}');void(0);"><img class="stift" src='$iconpath/stift.gif' alt='$button' title='$button'/></a> |
ENDFORMULABUTTON |
ENDFORMULABUTTON |
} |
} |
|
|
Line 551 sub end_mathresponse {
|
Line 555 sub end_mathresponse {
|
my $cas = &Apache::lonxml::get_param('cas',$parstack,$safeeval); |
my $cas = &Apache::lonxml::get_param('cas',$parstack,$safeeval); |
if ($cas eq 'maxima') { |
if ($cas eq 'maxima') { |
my $args = [&Apache::lonxml::get_param_var('args',$parstack,$safeeval)]; |
my $args = [&Apache::lonxml::get_param_var('args',$parstack,$safeeval)]; |
$award=&Apache::lonmaxima::maxima_run($Apache::response::custom_answer[-1],$response,$args); |
$award=&Apache::lonmaxima::maxima_run($Apache::response::custom_answer[-1],$response,$args, |
|
&Apache::lonxml::get_param('libraries',$parstack,$safeeval)); |
} |
} |
if (!&Apache::inputtags::valid_award($award)) { |
if (!&Apache::inputtags::valid_award($award)) { |
$error = $award; |
$error = $award; |
Line 568 sub end_mathresponse {
|
Line 573 sub end_mathresponse {
|
} |
} |
if ($target eq 'web') { |
if ($target eq 'web') { |
&setup_prior_tries_hash(\&format_prior_response_math); |
&setup_prior_tries_hash(\&format_prior_response_math); |
|
my $partid = $Apache::inputtags::part; |
|
my $id = $Apache::inputtags::response[-1]; |
|
if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') |
|
&& (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffeditor') ne 'yes')) { |
|
$result.=&edit_mathresponse_button($id,"HWVAL_$id"); |
|
} |
} |
} |
|
|
pop(@Apache::lonxml::namespace); |
pop(@Apache::lonxml::namespace); |
Line 670 sub start_responseparam {
|
Line 681 sub start_responseparam {
|
} |
} |
} |
} |
if (defined($optionlist)) { |
if (defined($optionlist)) { |
$result.='Use template: <select name="'. |
$result.=&mt('Use template:').' <select name="'. |
&Apache::edit::html_element_name('parameter_package').'">'. |
&Apache::edit::html_element_name('parameter_package').'">'. |
'<option value=""></option>'.$optionlist.'</select><br />'; |
'<option value=""></option>'.$optionlist.'</select><br />'; |
} |
} |
Line 1182 sub submitted {
|
Line 1193 sub submitted {
|
} |
} |
# Submit All button on a .page was pressed |
# Submit All button on a .page was pressed |
if (defined($env{'form.all_submit'})) { return 1; } |
if (defined($env{'form.all_submit'})) { return 1; } |
# otherwise no submission occured |
# otherwise no submission occurred |
return 0; |
return 0; |
} |
} |
|
|