version 1.225, 2008/05/30 16:04:33
|
version 1.227.2.1, 2008/09/12 10:09:18
|
Line 311 sub start_numericalresponse {
|
Line 311 sub start_numericalresponse {
|
if ($unit =~ /\S/) { $result.=" (in $unit) "; } |
if ($unit =~ /\S/) { $result.=" (in $unit) "; } |
} |
} |
if (($token->[1] eq 'formularesponse') && |
if (($token->[1] eq 'formularesponse') && |
($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') && |
($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')) { |
(!&Apache::lonxml::get_param_var('samples',$parstack,$safeeval))) { |
|
$result.=&edit_formula_button($id,"HWVAL_$id"); |
$result.=&edit_formula_button($id,"HWVAL_$id"); |
} |
} |
if ( &Apache::response::show_answer() ) { |
if ( &Apache::response::show_answer() ) { |
Line 326 sub start_numericalresponse {
|
Line 325 sub start_numericalresponse {
|
sub edit_formula_button { |
sub edit_formula_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'); |
return(<<ENDFORMULABUTTON); |
return(<<ENDFORMULABUTTON); |
<script language="JavaScript"> |
<script language="JavaScript"> |
function edit_${id}_${field} (textarea) { |
function edit_${id}_${field} (textarea) { |
Line 334 function edit_${id}_${field} (textarea)
|
Line 334 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);" /> |
<input type='button' value='$button' onclick="javascript:edit_${id}_${field}('${field}');void(0);" />$helplink |
ENDFORMULABUTTON |
ENDFORMULABUTTON |
} |
} |
|
|
Line 464 sub check_submission {
|
Line 464 sub check_submission {
|
use Time::HiRes; |
use Time::HiRes; |
my $t0 = [Time::HiRes::gettimeofday()]; |
my $t0 = [Time::HiRes::gettimeofday()]; |
my ($result,@msgs) = |
my ($result,@msgs) = |
&Apache::run::run("&caparesponse_check_list()",$safeeval); |
&Apache::run::run("&caparesponse_check_list($tag)",$safeeval); |
&Apache::lonxml::debug("checking $name $result with $response took ".&Time::HiRes::tv_interval($t0)); |
&Apache::lonxml::debug("checking $name $result with $response took ".&Time::HiRes::tv_interval($t0)); |
&Apache::lonxml::debug('msgs are '.join(':',@msgs)); |
&Apache::lonxml::debug('msgs are '.join(':',@msgs)); |
my ($awards)=split(/:/,$result); |
my ($awards)=split(/:/,$result); |
Line 1177 sub end_stringresponse {
|
Line 1177 sub end_stringresponse {
|
foreach my $name (keys(%answer)) { |
foreach my $name (keys(%answer)) { |
&Apache::lonxml::debug(" doing $name with ".join(':',@{ $answer{$name}{'answers'} })); |
&Apache::lonxml::debug(" doing $name with ".join(':',@{ $answer{$name}{'answers'} })); |
${$safeeval->varglob('LONCAPA::CAPAresponse_answer')}=dclone($answer{$name}); |
${$safeeval->varglob('LONCAPA::CAPAresponse_answer')}=dclone($answer{$name}); |
my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list()",$safeeval); |
my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list($$tagstack[-1])",$safeeval); |
&Apache::lonxml::debug('msgs are'.join(':',@msgs)); |
&Apache::lonxml::debug('msgs are'.join(':',@msgs)); |
my ($awards)=split(/:/,$result); |
my ($awards)=split(/:/,$result); |
my (@awards) = split(/,/,$awards); |
my (@awards) = split(/,/,$awards); |