version 1.20, 2001/05/25 21:20:19
|
version 1.22, 2001/05/30 15:24:53
|
Line 3
|
Line 3
|
# |
# |
# |
# |
#init some globals |
#init some globals |
#use Math::Trig; |
|
# |
# |
# Guy Albertelli |
# Guy Albertelli |
# |
# |
Line 11
|
Line 10
|
# |
# |
$RANDOMINIT=0; |
$RANDOMINIT=0; |
$pi=atan2(1,1)*4; |
$pi=atan2(1,1)*4; |
|
$rad2deg=180.0/$pi; |
|
$deg2rad=$pi/180.0; |
|
|
sub caparesponse_check { |
sub caparesponse_check { |
my $answer=''; #done |
my $answer=''; #done |
Line 151 sub random {
|
Line 152 sub random {
|
} |
} |
|
|
sub tan { sin($_[0]) / cos($_[0]) } |
sub tan { sin($_[0]) / cos($_[0]) } |
sub atan { atan2($_[0], 1); } |
#sub atan { atan2($_[0], 1); } |
sub acos { atan2(sqrt(1 - $_[0] * $_[0]), $_[0] ); } |
#sub acos { atan2(sqrt(1 - $_[0] * $_[0]), $_[0] ); } |
sub asin { atan2($_[0], sqrt(1- $_[0] * $_[0]) ); } |
#sub asin { atan2($_[0], sqrt(1- $_[0] * $_[0]) ); } |
|
|
sub log10 { log($_[0])/log(10); } |
sub log10 { log($_[0])/log(10); } |
|
|
sub factorial { |
sub factorial { |
my $input = int(shift); |
my $input = int(shift); |
return "Error - unable to take factorial of an negative number ($input)" if $input < 0; |
return "Error - unable to take factorial of an negative number ($input)" if $input < 0; |
Line 230 sub map {
|
Line 233 sub map {
|
} |
} |
} |
} |
|
|
|
sub name{ |
|
my $fullname = &EXT('environment.lastname').', '.&EXT('environment.firstname').' '.&EXT('environment.middlename'); |
|
$fullname = "" if $fullname eq ", "; |
|
return $fullname; |
|
} |
|
|
|
sub student_number { |
|
my $id = &EXT('environment.id'); |
|
$id = '' if $id eq ""; |
|
return $id; |
|
} |
|
|
|
sub class { |
|
my $course = &EXT('course.description'); |
|
$course = '' if $course eq ""; |
|
return $course; |
|
} |
|
|
|
sub sec { |
|
my $sec = &EXT('request.course.sec'); |
|
$sec = '' if $sec eq ''; |
|
return $sec; |
|
} |
|
|
|
sub open_date { &EXT('resource.0.opendate') } |
|
sub due_date { &EXT('resource.0.duedate') } |
|
sub answer_date { &EXT('resource.0.answerdate') } |
|
|
sub choose { |
sub choose { |
my $num = $_[0]; |
my $num = $_[0]; |
return $_[$num]; |
return $_[$num]; |