version 1.190, 2008/04/05 15:50:22
|
version 1.207, 2008/11/24 16:53:26
|
Line 217 sub meta_stores_write {
|
Line 217 sub meta_stores_write {
|
} |
} |
|
|
sub mandatory_part_meta { |
sub mandatory_part_meta { |
# |
=pod |
# Autogenerate metadata for mandatory |
|
# input (from RAT or lonparmset) and |
=item meta_part_order |
# output (to lonspreadsheet) |
|
# of each part |
Autogenerate metadata for mandatory |
|
input (from RAT or lonparmset) and |
|
output (to lonspreadsheet) |
|
of each part |
# |
# |
return |
return |
# &meta_parameter_write('opendate','date_start','', |
&meta_parameter_write('opendate','date_start','', |
# 'Opening Date'). |
'Opening Date'). |
# &meta_parameter_write('duedate','date_end','', |
&meta_parameter_write('duedate','date_end','', |
# 'Due Date'). |
'Due Date'). |
# &meta_parameter_write('answerdate','date_start','', |
&meta_parameter_write('answerdate','date_start','', |
# 'Show Answer Date'). |
'Show Answer Date'). |
# &meta_parameter_write('weight','int_zeropos','', |
&meta_parameter_write('weight','int_zeropos','', |
# 'Available Points'). |
'Available Points'). |
# &meta_parameter_write('maxtries','int_pos','', |
&meta_parameter_write('maxtries','int_pos','', |
# 'Maximum Number of Tries'). |
'Maximum Number of Tries'). |
&meta_package_write('part'). |
&meta_package_write('part'). |
&meta_stores_write('solved','string', |
&meta_stores_write('solved','string', |
'Problem Status'). |
'Problem Status'). |
Line 241 sub mandatory_part_meta {
|
Line 244 sub mandatory_part_meta {
|
'Number of Attempts'). |
'Number of Attempts'). |
&meta_stores_write('awarded','float', |
&meta_stores_write('awarded','float', |
'Partial Credit Factor'); |
'Partial Credit Factor'); |
# |
|
# Note: responseid-specific data 'submission' and 'awarddetail' |
Note: responseid-specific data 'submission' and 'awarddetail' |
# not available to spreadsheet -> skip here |
not available to spreadsheet -> skip here |
# |
|
|
=cut |
|
|
} |
} |
|
|
sub meta_part_order { |
sub meta_part_order { |
Line 486 sub start_mathresponse {
|
Line 491 sub start_mathresponse {
|
$safeeval); |
$safeeval); |
$Apache::inputtags::answertxt{$id}=[$answer]; |
$Apache::inputtags::answertxt{$id}=[$answer]; |
} |
} |
|
|
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::text_arg('String to display for answer:', |
$result.=&Apache::edit::text_arg('String to display for answer:', |
Line 495 sub start_mathresponse {
|
Line 501 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 512 sub start_mathresponse {
|
Line 522 sub start_mathresponse {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub edit_mathresponse_button { |
|
my ($id,$field)=@_; |
|
my $button=&mt('Edit Answer'); |
|
# my $helplink=&Apache::loncommon::help_open_topic('Formula_Editor'); |
|
my $iconpath=$Apache::lonnet::perlvar{'lonIconsURL'}; |
|
return(<<ENDFORMULABUTTON); |
|
<script language="JavaScript"> |
|
function edit_${id}_${field} (textarea) { |
|
thenumber = textarea; |
|
thedata = document.forms['lonhomework'].elements[textarea].value; |
|
newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable"); |
|
} |
|
</script> |
|
<a href="javascript:edit_${id}_${field}('${field}');void(0);"><img class="stift" src='$iconpath/stift.gif' alt='$button' title='$button'/></a> |
|
ENDFORMULABUTTON |
|
} |
|
|
sub end_mathresponse { |
sub end_mathresponse { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $result; |
my $result; |
Line 532 sub end_mathresponse {
|
Line 559 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 549 sub end_mathresponse {
|
Line 577 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 651 sub start_responseparam {
|
Line 685 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 1163 sub submitted {
|
Line 1197 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; |
} |
} |
|
|