version 1.84, 2003/05/16 15:12:49
|
version 1.85, 2003/06/10 18:46:02
|
Line 807 sub start_function {
|
Line 807 sub start_function {
|
my $result=''; |
my $result=''; |
if ($target eq 'web' || $target eq 'tex') { |
if ($target eq 'web' || $target eq 'tex') { |
if (exists($curves[-1]->{'data'})) { |
if (exists($curves[-1]->{'data'})) { |
&Apache::lonxml::warning('Use of <function> precludes use of <data>. The <data> will be omitted in favor of the <function> declaration.'); |
&Apache::lonxml::warning |
|
('Use of the <b>curve function</b> tag precludes use of '. |
|
' the <b>curve data</b> tag. '. |
|
'The curve data tag will be omitted in favor of the '. |
|
'curve function declaration.'); |
delete $curves[-1]->{'data'} ; |
delete $curves[-1]->{'data'} ; |
} |
} |
my $function = &Apache::lonxml::get_all_text("/function",$parser); |
my $function = &Apache::lonxml::get_all_text("/function",$parser); |
Line 843 sub start_data {
|
Line 847 sub start_data {
|
my $result=''; |
my $result=''; |
if ($target eq 'web' || $target eq 'tex') { |
if ($target eq 'web' || $target eq 'tex') { |
if (exists($curves[-1]->{'function'})) { |
if (exists($curves[-1]->{'function'})) { |
&Apache::lonxml::warning('Use of <data> precludes use of .'. |
&Apache::lonxml::warning |
'<function>. The <function> will be omitted in favor of '. |
('Use of the <b>curve function</b> tag precludes use of '. |
'the <data> declaration.'); |
' the <b>curve data</b> tag. '. |
|
'The curve function tag will be omitted in favor of the '. |
|
'curve data declaration.'); |
delete($curves[-1]->{'function'}); |
delete($curves[-1]->{'function'}); |
} |
} |
my $datatext = &Apache::lonxml::get_all_text("/data",$parser); |
my $datatext = &Apache::lonxml::get_all_text("/data",$parser); |
Line 869 sub start_data {
|
Line 875 sub start_data {
|
# Check that it's non-empty |
# Check that it's non-empty |
if (! defined($data[$i])) { |
if (! defined($data[$i])) { |
&Apache::lonxml::warning( |
&Apache::lonxml::warning( |
'undefined <data> value. Replacing with '. |
'undefined curve data value. Replacing with '. |
' pi/e = 1.15572734979092'); |
' pi/e = 1.15572734979092'); |
$data[$i] = 1.15572734979092; |
$data[$i] = 1.15572734979092; |
} |
} |
# Check that it's a number |
# Check that it's a number |
if (! &$real_test($data[$i]) & ! &$int_test($data[$i])) { |
if (! &$real_test($data[$i]) & ! &$int_test($data[$i])) { |
&Apache::lonxml::warning( |
&Apache::lonxml::warning( |
'Bad <data> value of '.$data[$i].' Replacing with '. |
'Bad curve data value of '.$data[$i].' Replacing with '. |
' pi/e = 1.15572734979092'); |
' pi/e = 1.15572734979092'); |
$data[$i] = 1.15572734979092; |
$data[$i] = 1.15572734979092; |
} |
} |
Line 1144 sub check_inputs {
|
Line 1150 sub check_inputs {
|
my $curve; |
my $curve; |
foreach $curve (@curves) { |
foreach $curve (@curves) { |
if (!defined($curve->{'function'})&&!defined($curve->{'data'})){ |
if (!defined($curve->{'function'})&&!defined($curve->{'data'})){ |
&Apache::lonxml::warning("One of the curves specified did not contain any <data> or <function> declarations\n"); |
&Apache::lonxml::warning("One of the curves specified did not contain any curve data or curve function declarations\n"); |
return ''; |
return ''; |
} |
} |
} |
} |