version 1.31, 2010/11/10 22:41:29
|
version 1.32, 2010/11/10 22:53:32
|
Line 398 sub start_functionplotrule {
|
Line 398 sub start_functionplotrule {
|
&Apache::edit::select_arg(&mt('Function:'),'derivative', |
&Apache::edit::select_arg(&mt('Function:'),'derivative', |
[['0','Function itself'], |
[['0','Function itself'], |
['1','First derivative'], |
['1','First derivative'], |
['2','Second derivative']],$token).' '. |
['2','Second derivative']],$token).'<br />'. |
|
|
&Apache::edit::text_arg('(Initial) x-value:','xinitial', |
&Apache::edit::text_arg('(Initial) x-value:','xinitial', |
$token,'4'). |
$token,'4'). |
&Apache::edit::select_or_text_arg('(Initial) x-value label:','xinitiallabel', |
&Apache::edit::select_or_text_arg('(Initial) x-value label:','xinitiallabel', |
[['start','Start of Plot']],$token,'8').' '. |
[['start','Start of Plot']],$token,'8').'<br />'. |
|
|
&Apache::edit::text_arg('Optional final x-value for ranges:','xfinal', |
&Apache::edit::text_arg('Optional final x-value for ranges:','xfinal', |
$token,'4'). |
$token,'4'). |
&Apache::edit::select_or_text_arg('Optional final x-value label:','xfinallabel', |
&Apache::edit::select_or_text_arg('Optional final x-value label:','xfinallabel', |
[['end','End of Plot']],$token,'8').' '. |
[['end','End of Plot']],$token,'8').'<br />'. |
|
|
&Apache::edit::select_arg(&mt('Relationship:'),'relationship', |
&Apache::edit::select_arg(&mt('Relationship:'),'relationship', |
[['eq','equal'], |
[['eq','equal'], |
Line 719 sub start_functionplotresponse {
|
Line 719 sub start_functionplotresponse {
|
&Apache::edit::text_arg('Maximum x-value:','xmax', |
&Apache::edit::text_arg('Maximum x-value:','xmax', |
$token,'4').' '. |
$token,'4').' '. |
&Apache::edit::select_arg('x-axis visible:','xaxisvisible', |
&Apache::edit::select_arg('x-axis visible:','xaxisvisible', |
['yes','no'],$token).' '. |
['yes','no'],$token).'<br />'. |
&Apache::edit::text_arg('Label y-axis:','ylabel', |
&Apache::edit::text_arg('Label y-axis:','ylabel', |
$token,'6').' '. |
$token,'6').' '. |
&Apache::edit::text_arg('Minimum y-value:','ymin', |
&Apache::edit::text_arg('Minimum y-value:','ymin', |
Line 727 sub start_functionplotresponse {
|
Line 727 sub start_functionplotresponse {
|
&Apache::edit::text_arg('Maximum y-value:','ymax', |
&Apache::edit::text_arg('Maximum y-value:','ymax', |
$token,'4').' '. |
$token,'4').' '. |
&Apache::edit::select_arg('y-axis visible:','yaxisvisible', |
&Apache::edit::select_arg('y-axis visible:','yaxisvisible', |
['yes','no'],$token).' '. |
['yes','no'],$token).'<br />'. |
&Apache::edit::select_arg('Grid visible:','gridvisible', |
&Apache::edit::select_arg('Grid visible:','gridvisible', |
['yes','no'],$token). |
['yes','no'],$token). |
&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
Line 792 sub compare_rel {
|
Line 792 sub compare_rel {
|
|
|
sub functionplotrulecheck { |
sub functionplotrulecheck { |
my ($rule,$xmin,$xmax,$tolfunc,$toldfdx,$told2fdx2)=@_; |
my ($rule,$xmin,$xmax,$tolfunc,$toldfdx,$told2fdx2)=@_; |
&Apache::lonnet::logthis("Rule $rule TolFunc $tolfunc TolDfDx $toldfdx TolD2fDx2 $told2fdx2"); |
# &Apache::lonnet::logthis("Rule $rule TolFunc $tolfunc TolDfDx $toldfdx TolD2fDx2 $told2fdx2"); |
my ($label,$derivative,$xinitial,$xinitiallabel,$xfinal,$xfinallabel,$relationship,$value) |
my ($label,$derivative,$xinitial,$xinitiallabel,$xfinal,$xfinallabel,$relationship,$value) |
=split(/\:/,$rule); |
=split(/\:/,$rule); |
|
|
Line 839 sub functionplotrulecheck {
|
Line 839 sub functionplotrulecheck {
|
$lh=$li; |
$lh=$li; |
} |
} |
|
|
&Apache::lonnet::logthis("Init $xinitial=$li Final $xfinal=$lh Findupper: $findupper"); |
# &Apache::lonnet::logthis("Init $xinitial=$li Final $xfinal=$lh Findupper: $findupper"); |
my $tol=$tolfunc; |
my $tol=$tolfunc; |
if ($derivative==2) { |
if ($derivative==2) { |
$tol=$told2fdx2; |
$tol=$told2fdx2; |
Line 856 sub functionplotrulecheck {
|
Line 856 sub functionplotrulecheck {
|
$val=$Apache::functionplotresponse::func[$i]; |
$val=$Apache::functionplotresponse::func[$i]; |
} |
} |
unless (&compare_rel($relationship,$value,$val,$tol)) { |
unless (&compare_rel($relationship,$value,$val,$tol)) { |
&Apache::lonnet::logthis("Condition false $findupper at $i with $val"); |
# &Apache::lonnet::logthis("Condition false $findupper at $i with $val"); |
if (($findupper) && ($i>$li)) { |
if (($findupper) && ($i>$li)) { |
$Apache::functionplotresponse::functionplotrulelabels{$xfinallabel}=$i; |
$Apache::functionplotresponse::functionplotrulelabels{$xfinallabel}=$i; |
&Apache::lonnet::logthis("Setting $xfinallabel to $i"); |
# &Apache::lonnet::logthis("Setting $xfinallabel to $i"); |
return 1; |
return 1; |
} else { |
} else { |
return 0; |
return 0; |