You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(53) |
Feb
(56) |
Mar
|
Apr
|
May
(30) |
Jun
(78) |
Jul
(121) |
Aug
(155) |
Sep
(77) |
Oct
(61) |
Nov
(45) |
Dec
(94) |
2006 |
Jan
(116) |
Feb
(33) |
Mar
(11) |
Apr
(23) |
May
(60) |
Jun
(89) |
Jul
(130) |
Aug
(109) |
Sep
(124) |
Oct
(63) |
Nov
(82) |
Dec
(45) |
2007 |
Jan
(31) |
Feb
(35) |
Mar
(123) |
Apr
(36) |
May
(18) |
Jun
(134) |
Jul
(133) |
Aug
(241) |
Sep
(126) |
Oct
(31) |
Nov
(15) |
Dec
(5) |
2008 |
Jan
(11) |
Feb
(6) |
Mar
(16) |
Apr
(29) |
May
(43) |
Jun
(149) |
Jul
(27) |
Aug
(29) |
Sep
(37) |
Oct
(20) |
Nov
(4) |
Dec
(6) |
2009 |
Jan
(34) |
Feb
(30) |
Mar
(16) |
Apr
(6) |
May
(1) |
Jun
(32) |
Jul
(22) |
Aug
(7) |
Sep
(18) |
Oct
(50) |
Nov
(22) |
Dec
(8) |
2010 |
Jan
(17) |
Feb
(15) |
Mar
(10) |
Apr
(9) |
May
(67) |
Jun
(30) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
From: Mike G. v. a. <we...@ma...> - 2008-04-26 21:35:50
|
Log Message: ----------- add reinitialize applet button to the standard installation to complement reset state button. CVS: ---------------------------------------------------------------------- Modified Files: -------------- pg/macros: AppletObjects.pl Revision Data ------------- Index: AppletObjects.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.6 -r1.7 --- macros/AppletObjects.pl +++ macros/AppletObjects.pl @@ -234,7 +234,8 @@ my $state_input_element = ($self->debug == 1) ? $debug_input_element : qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!; my $reset_button_str = ($reset_button) ? - qq!<br/><input type='button' value='reset applet' onClick="applet_setState_list['$appletName']('<xml></xml>')">! + qq!<br/><input type='button' value='set applet state empty' onClick="applet_setState_list['$appletName']('<xml></xml>')"> + <input type="button" value="reinitialize applet" onClick="initializeAction()"/>! : '' ; # always base64 encode the hidden answer value to prevent problems with quotes. |
From: Mike G. v. a. <we...@ma...> - 2008-04-26 21:30:59
|
Log Message: ----------- Fixed bug that would cause problem with checking previous answers if there was not answer label provided to the answer evaluator. Modified Files: -------------- pg/macros: PGfunctionevaluators.pl Revision Data ------------- Index: PGfunctionevaluators.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGfunctionevaluators.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -Lmacros/PGfunctionevaluators.pl -Lmacros/PGfunctionevaluators.pl -u -r1.3 -r1.4 --- macros/PGfunctionevaluators.pl +++ macros/PGfunctionevaluators.pl @@ -745,17 +745,25 @@ # Get previous answer from hidden field of form # $cmp->install_pre_filter( - sub { - my $rh_ans = shift; - $rh_ans->{_filter_name} = "fetch_previous_answer"; - my $prev_ans_label = "previous_".$rh_ans->{ans_label}; - $rh_ans->{prev_ans} = - (defined $inputs_ref->{$prev_ans_label} and - $inputs_ref->{$prev_ans_label} =~/\S/) ? $inputs_ref->{$prev_ans_label} : undef; - $rh_ans; - } + sub { + my $rh_ans = shift; + $rh_ans->{_filter_name} = "fetch_previous_answer"; + $rh_ans->{prev_ans} = undef; + if ( defined($rh_ans->{ans_label} ) ) { + my $prev_ans_label = "previous_".$rh_ans->{ans_label}; + if ( defined $inputs_ref->{$prev_ans_label} and $inputs_ref->{$prev_ans_label} =~/\S/) { + $rh_ans->{prev_ans} = $inputs_ref->{$prev_ans_label}; + #warn "inputs reference is ", join(" ",%$inputs_ref); + #warn "$prev_ans_label is ",$rh_ans->{prev_ans}; + #FIXME -- previous answer item is not always being updated in inputs_ref (which comes from formField) + } + } + # if no ans_label or previous answer then leave undefined. + $rh_ans; # prev_ans contains previous answer or "undef" + } ); + # # Parse the previous answer, if any # |
From: Mike G. v. a. <we...@ma...> - 2008-04-26 21:30:00
|
Log Message: ----------- Modifications to pass answer label for previous answer. This still does not provide correct functionality because the previous answer is an equation of the form lhs = rhs while the form being passed to fun_cmp is lhs - rhs Modified Files: -------------- pg/macros: extraAnswerEvaluators.pl Revision Data ------------- Index: extraAnswerEvaluators.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/extraAnswerEvaluators.pl,v retrieving revision 1.20 retrieving revision 1.21 diff -Lmacros/extraAnswerEvaluators.pl -Lmacros/extraAnswerEvaluators.pl -u -r1.20 -r1.21 --- macros/extraAnswerEvaluators.pl +++ macros/extraAnswerEvaluators.pl @@ -55,7 +55,10 @@ split /=/, $instring; } - + #FIXME -- this could be improved so that + # 1. it uses an answer evaluator object instead of a sub routine + # 2. it provides error messages when previous answers are equivalent + sub equation_cmp { my $right_ans = shift; my %opts = @_; @@ -66,17 +69,17 @@ my $ans_eval = sub { my $student = shift; - + my %response_options = @_; my $ans_hash = new AnswerHash( - 'score'=>0, - 'correct_ans'=>$right_ans, - 'student_ans'=>$student, - 'original_student_ans' => $student, - # 'type' => undef, - 'ans_message'=>'', - 'preview_text_string'=>'', - 'preview_latex_string'=>'', - ); + 'score'=>0, + 'correct_ans'=>$right_ans, + 'student_ans'=>$student, + 'original_student_ans' => $student, + 'type' => 'equation_cmp', + 'ans_message'=>'', + 'preview_text_string'=>'', + 'preview_latex_string'=>'', + ); if(! ($student =~ /\S/)) { return $ans_hash; } @@ -157,7 +160,7 @@ # Finally, use fun_cmp to check the answers $ae = main::fun_cmp("o*($right[0]-($right[1]))", vars=>$vars, params=>['o'], %opts); - $res= $ae->evaluate("$studsplit[0]-($studsplit[1])"); + $res= $ae->evaluate("$studsplit[0]-($studsplit[1])",%response_options); $ans_hash-> setKeys('score' => $res->{'score'}); return $ans_hash; |
From: Mike G. v. a. <we...@ma...> - 2008-04-26 21:16:36
|
Log Message: ----------- define ans_label slot in a new AnswerHash to be undefined. Modified Files: -------------- pg/lib: AnswerHash.pm Revision Data ------------- Index: AnswerHash.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/AnswerHash.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -Llib/AnswerHash.pm -Llib/AnswerHash.pm -u -r1.15 -r1.16 --- lib/AnswerHash.pm +++ lib/AnswerHash.pm @@ -148,6 +148,7 @@ 'correct_ans' => 'No correct answer specified', 'student_ans' => undef, 'ans_message' => '', + 'ans_label' => undef, 'type' => 'Undefined answer evaluator type', 'preview_text_string' => undef, 'preview_latex_string' => undef, |
From: Mike G. v. a. <we...@ma...> - 2008-04-26 21:09:24
|
Log Message: ----------- provide ans_label for the current answer being evaluated to answer evaluator subroutines as well to AnswerEvaluator objects. Modified Files: -------------- pg/lib/WeBWorK/PG: Translator.pm Revision Data ------------- Index: Translator.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/WeBWorK/PG/Translator.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -Llib/WeBWorK/PG/Translator.pm -Llib/WeBWorK/PG/Translator.pm -u -r1.19 -r1.20 --- lib/WeBWorK/PG/Translator.pm +++ lib/WeBWorK/PG/Translator.pm @@ -1141,7 +1141,7 @@ my $rh_ans_evaluation_result; if (ref($rf_fun) eq 'CODE' ) { - $rh_ans_evaluation_result = $self->{safe} ->reval( '&{ $rf_fun }($temp_ans)' ) ; + $rh_ans_evaluation_result = $self->{safe} ->reval( '&{ $rf_fun }($temp_ans, ans_label => \''.$ans_name.'\')' ) ; warn "Error in Translator.pm::process_answers: Answer $ans_name: |$temp_ans|\n $@\n" if $@; } elsif (ref($rf_fun) =~ /AnswerEvaluator/) { $rh_ans_evaluation_result = $self->{safe} ->reval('$rf_fun->evaluate($temp_ans, ans_label => \''.$ans_name.'\')'); |
From: Mike G. v. a. <we...@ma...> - 2008-04-22 12:37:35
|
Log Message: ----------- Fixed bug #1435 which prevented showHints and showSolutions from working. Added -value =>1 to the checkbox items so that they return numeric values rather than "on". Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Problem.pm Revision Data ------------- Index: Problem.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm,v retrieving revision 1.211 retrieving revision 1.212 diff -Llib/WeBWorK/ContentGenerator/Problem.pm -Llib/WeBWorK/ContentGenerator/Problem.pm -u -r1.211 -r1.212 --- lib/WeBWorK/ContentGenerator/Problem.pm +++ lib/WeBWorK/ContentGenerator/Problem.pm @@ -581,6 +581,7 @@ my %will; foreach (keys %must) { $will{$_} = $can{$_} && ($want{$_} || $must{$_}); + #warn "final values for options $_ is can $can{$_}, want $want{$_}, must $must{$_}, will $will{$_}"; } ##### sticky answers ##### @@ -1000,6 +1001,7 @@ -name => "showCorrectAnswers", -checked => $will{showCorrectAnswers}, -label => "Show correct answers", + -value => 1, ); } if ($can{showHints}) { @@ -1008,6 +1010,7 @@ -name => "showHints", -checked => $will{showHints}, -label => "Show Hints", + -value =>1, ) ); } @@ -1016,6 +1019,7 @@ -name => "showSolutions", -checked => $will{showSolutions}, -label => "Show Solutions", + -value => 1, ); } |
From: Mike G. v. a. <we...@ma...> - 2008-04-22 12:03:13
|
Log Message: ----------- Changed references to "feedback" to "email instructor", "cancel email" and so forth for consistency. This was in response to a suggestion by Bob Palais at University of Utah. -- Mike Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Feedback.pm Revision Data ------------- Index: Feedback.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -Llib/WeBWorK/ContentGenerator/Feedback.pm -Llib/WeBWorK/ContentGenerator/Feedback.pm -u -r1.45 -r1.46 --- lib/WeBWorK/ContentGenerator/Feedback.pm +++ lib/WeBWorK/ContentGenerator/Feedback.pm @@ -198,7 +198,7 @@ ); my $chars = join("", keys %subject_map); my $subject = $ce->{mail}{feedbackSubjectFormat} - || "WeBWorK feedback from %c: %u set %s/prob %p"; # default if not entered + || "WeBWorK question from %c: %u set %s/prob %p"; # default if not entered $subject =~ s/%([$chars])/defined $subject_map{$1} ? $subject_map{$1} : ""/eg; # get info about remote user (stolen from &WeBWorK::Authen::write_log_entry) @@ -247,7 +247,7 @@ # print message print $MAIL - wrap("", "", "This feedback message was automatically generated by the WeBWorK", + wrap("", "", "This message was automatically generated by the WeBWorK", "system at $systemURL, in response to a request from $remote_host:$remote_port." ), "\n\n"; @@ -317,17 +317,19 @@ sub feedbackNotAllowed { my ($self, $returnURL) = @_; - print CGI::p("You are not allowed to send feedback."); - print CGI::p(CGI::a({-href=>$returnURL}, "Cancel Feedback")) if $returnURL; + print CGI::p("You are not allowed to send e-mail."); + print CGI::p(CGI::a({-href=>$returnURL}, "Cancel E-Mail")) if $returnURL; } sub noRecipientsAvailable { my ($self, $returnURL) = @_; - print CGI::p("No feedback recipients are listed for this course."); - print CGI::p(CGI::a({-href=>$returnURL}, "Cancel Feedback")) if $returnURL; + print CGI::p("No e-mail recipients are listed for this course."); + print CGI::p(CGI::a({-href=>$returnURL}, "Cancel E-Mail")) if $returnURL; +} +sub title { + return "E-mail Instructor"; } - sub feedbackForm { my ($self, $user, $returnURL, $message) = @_; my $r = $self->r; @@ -350,12 +352,12 @@ included."); print CGI::p(CGI::i($message)) if $message; print CGI::p( - CGI::b("Feedback:"), CGI::br(), + CGI::b("E-mail:"), CGI::br(), CGI::textarea("feedback", "", 20, 80), ); - print CGI::submit("sendFeedback", "Send Feedback"); + print CGI::submit("sendFeedback", "Send E-mail"); print CGI::end_form(); - print CGI::p(CGI::a({-href=>$returnURL}, "Cancel Feedback")) if $returnURL; + print CGI::p(CGI::a({-href=>$returnURL}, "Cancel E-mail")) if $returnURL; } sub getFeedbackRecipients { |
From: Mike G. v. a. <we...@ma...> - 2008-04-22 02:17:25
|
Log Message: ----------- Fixed an error in formatting comment Modified Files: -------------- pg/macros: PGinfo.pl Revision Data ------------- Index: PGinfo.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGinfo.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -Lmacros/PGinfo.pl -Lmacros/PGinfo.pl -u -r1.3 -r1.4 --- macros/PGinfo.pl +++ macros/PGinfo.pl @@ -8,13 +8,19 @@ PGinfo.pl -=cut Provides macros for determining the values of the current context in which the problem is being written. +=cut + + loadMacros("MathObjects.pl"); + + + + =head3 listVariables Usage: listVariables(); @@ -93,3 +99,4 @@ my $hash = shift; "printing |". ref($hash)."|$BR". pretty_print($hash); } +1; \ No newline at end of file |
From: Mike G. v. a. <we...@ma...> - 2008-04-15 04:55:58
|
Log Message: ----------- Edited the first three paragraphs describing why math objects are used. (I also copied these paragraphs into the wiki itself in the "introduction to math objects" page.) Modified Files: -------------- pg/doc/MathObjects: MathObjectsAnswerCheckers.pod Revision Data ------------- Index: MathObjectsAnswerCheckers.pod =================================================================== RCS file: /webwork/cvs/system/pg/doc/MathObjects/MathObjectsAnswerCheckers.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -Ldoc/MathObjects/MathObjectsAnswerCheckers.pod -Ldoc/MathObjects/MathObjectsAnswerCheckers.pod -u -r1.1 -r1.2 --- doc/MathObjects/MathObjectsAnswerCheckers.pod +++ doc/MathObjects/MathObjectsAnswerCheckers.pod @@ -1,22 +1,26 @@ =head1 MathObjects-based Answer Checkers -MathObjects is designed to be used in two ways. First, you can use -it within your perl code when writing problems as a means of making it -easier to handle formulas, and in particular, to genarate be able to -use a single object to produce numeric values, TeX output and answer -strings. This avoids having to type a function three different ways -(which makes maintaining a problem much harder). Since MathObjects -also included vector and complex arthimatic, it is easier to work with -these types of values as well. - -The second reason for MathObjects is to use it to process student -input. This is accomplished through special answer checkers that are -part of the Parser package (rather than the traditional WeBWorK answer -checkers). Checkers are available for all the types of values that -the parser can produce (numbers, complex numbers, infinities, points, -vectors, intervals, unions, formulas, lists of numbers, lists of -points, lists of intervals, lists of formulas returning numbers, lists -of formulas returning points, and so on). +MathObjects are designed to be used in two ways. First, you can use it +within your perl code when writing problems as a means of making it +easier to handle formulas, and in particular, to be able to use a single +object to produce numeric values, TeX output and answer strings from a +single formula entry. This avoids having to type a function three +different ways (which makes maintaining a problem much harder). Since +MathObjects also included vector and complex arthimetic, it is easier to +work with these types of values as well. + +Secondly using MathObjects improves the processing of student input. +This is accomplished through special answer checkers that are part of +the Parser package (rather than the traditional WeBWorK answer +checkers). Each of these checkers has error checking customized to the +type of input expected from the student and can provide helpful feedback +if the syntax of the student's entry is incorrect. + +Checkers are available for each of the types of values that the parser +can produce (numbers, complex numbers, infinities, points, vectors, +intervals, unions, formulas, lists of numbers, lists of points, lists of +intervals, lists of formulas returning numbers, lists of formulas +returning points, and so on). To use one of these checkers, simply call the ->cmp method of the object that represents the correct answer. For example: |
From: Sam H. v. a. <we...@ma...> - 2008-04-14 23:44:32
|
Log Message: ----------- documentation improvements Modified Files: -------------- pg/macros: parserMultiAnswer.pl Revision Data ------------- Index: parserMultiAnswer.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserMultiAnswer.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -Lmacros/parserMultiAnswer.pl -Lmacros/parserMultiAnswer.pl -u -r1.9 -r1.10 --- macros/parserMultiAnswer.pl +++ macros/parserMultiAnswer.pl @@ -108,69 +108,70 @@ our $answerPrefix = "MuLtIaNsWeR"; # answer rule prefix our $separator = ';'; # separator for singleResult previews -=pod +=head1 CONSTRUCTOR - # - # Create a new MultiAnswer item from a list of items. - # The items are converted if Value items, if they aren't already. - # You can set the following fields of the resulting item: - # - # checker => code a subroutine to be called to check the - # student answers. The routine is passed - # four parameters: a reference to the array - # or correct answers, a reference to the - # array of student answers, a reference to the - # MultiAnswer object itself, and a reference to - # the checker's answer hash. The routine - # should return either a score or a reference - # to an array of scores (one for each answer). - # - # singleResult => 0 or 1 whether to show only one entry in the - # results area at the top of the page, - # or one for each answer rule. - # (Default: 0) - # - # namedRules => 0 or 1 whether to use named rules or default - # rule names. Use named rules if you need - # to intersperse other rules with the - # ones for the MultiAnswer, in which case - # you must use NAMED_ANS not ANS. - # (Default: 0) - # - # checkTypes => 0 or 1 whether the types of the student and - # professor's answers must match exactly - # or just pass the usual type-match error - # checking (in which case, you should check - # the types before you use the data). - # (Default: 1) - # - # allowBlankAnswers=>0 or 1 whether to remove the blank-check prefilter - # from the answer checkers for the answer - # checkers used for type checking the student's - # answers. - # (Default: 0) - # - # separator => string the string to use between entries in the - # results area when singleResult is set. - # (Default: semicolon) - # - # tex_separator => string same, but for the preview area. - # (Default: semicolon followed by thinspace) - # - # format => string an sprintf-style string used to format the - # students answers for the results area - # when singleResults is true. If undefined, - # the separator parameter (above) is used to - # form the string. - # (Default: undef) - # - # tex_format => string an sprintf-style string used to format the - # students answer previews when singleResults - # mode is in effect. If undefined, the - # tex_separator (above) is used to form the - # string. - # (Default: undef) - # + MultiAnswer($answer1, $answer2, ...); + MultiAnswer($answer1, $answer2, ...)->with(...); + +Create a new MultiAnswer item from a list of items. The items are converted if +Value items, if they aren't already. You can set the following fields of the +resulting item: + + checker => code a subroutine to be called to check the + student answers. The routine is passed + four parameters: a reference to the array + or correct answers, a reference to the + array of student answers, a reference to the + MultiAnswer object itself, and a reference to + the checker's answer hash. The routine + should return either a score or a reference + to an array of scores (one for each answer). + + singleResult => 0 or 1 whether to show only one entry in the + results area at the top of the page, + or one for each answer rule. + (Default: 0) + + namedRules => 0 or 1 whether to use named rules or default + rule names. Use named rules if you need + to intersperse other rules with the + ones for the MultiAnswer, in which case + you must use NAMED_ANS not ANS. + (Default: 0) + + checkTypes => 0 or 1 whether the types of the student and + professor's answers must match exactly + or just pass the usual type-match error + checking (in which case, you should check + the types before you use the data). + (Default: 1) + + allowBlankAnswers=>0 or 1 whether to remove the blank-check prefilter + from the answer checkers for the answer + checkers used for type checking the student's + answers. + (Default: 0) + + separator => string the string to use between entries in the + results area when singleResult is set. + (Default: semicolon) + + tex_separator => string same, but for the preview area. + (Default: semicolon followed by thinspace) + + format => string an sprintf-style string used to format the + students answers for the results area + when singleResults is true. If undefined, + the separator parameter (above) is used to + form the string. + (Default: undef) + + tex_format => string an sprintf-style string used to format the + students answer previews when singleResults + mode is in effect. If undefined, the + tex_separator (above) is used to form the + string. + (Default: undef) =cut |
From: Sam H. v. a. <we...@ma...> - 2008-04-14 23:27:22
|
Log Message: ----------- This script is designed to scan PG macro files for documentation strings that note where variables and functions are declared and used. it then outputs an HTML which describes the uses/used-by relationships among symbols. This will be useful in determining dependencies within PG when cleaning up the language. Documentation strings are of the form # ^key value Any number of comment characters in a row are supported, and there may be any amount of whitespace on either side of the comment character(s) as well as between the key and the value. Example: # ^package Foo::Bar package Foo::Bar; # ^variable @hello my @hello; # ^function foo # ^uses @hello sub foo { push @hello, @_; } Added Files: ----------- admintools: ww-symbol-map Revision Data ------------- --- /dev/null +++ ww-symbol-map @@ -0,0 +1,294 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Encode; +use File::Find; +use IO::File; +use Data::Dumper; + +our $POD_PREFIX = "http://webwork.maa.org/doc/cvs/pg_CURRENT"; + +=head1 NAME + +ww-symbol-map - generate symbol maps from embedded documentation. + +=head1 SYNOPSIS + + ww-symbol-map path/to/pg > pg_symbols.html + +=head1 DESCRIPTION + +This script is designed to scan PG macro files for documentation strings that +note where variables and functions are declared and used. It then outputs an +HTML which describes the uses/used-by relationships among symbols. This will be +useful in determining dependencies within PG when cleaning up the language. +Documentation strings are of the form: + + # ^key value + +Any number of comment characters in a row are supported, and there may be any +amount of whitespace on either side of the comment character(s) as well as +between the key and the value. + +=head1 EXAMPLE + + # ^package Foo::Bar + package Foo::Bar; + + # ^variable @hello + my @hello; + + # ^function foo + # ^uses @hello + sub foo { + push @hello, @_; + } + +=cut + +my $basedir = shift; +$basedir =~ s|/+$||; + +my %names; +my %files; + +find({wanted=>\&scan_files, no_chdir=>1}, $basedir); + +#print Data::Dumper->Dump([\%names], [qw(names)]); + +report(); + +################################################################################ + +sub scan_files { + Encode::_utf8_on($File::Find::name); + if ($File::Find::name =~ /\/(?:\.*|CVS)$/ and -d $File::Find::name) { + $File::Find::prune = 1; + return; + } + return unless -f $File::Find::name; + process_file($File::Find::name); +} + +sub process_file { + my ($file) = @_; + my ($relpath) = $file =~ m|^$basedir/(.*)$|; + #warn "$relpath\n"; + + my $fh = new IO::File; + $fh->open($file, 'r') or die "$file: $!\n"; + + my $curr_package = "main"; + my $curr_function; + + while (1) { + my $line = $fh->getline; + my $lineno = $fh->input_line_number; + return if not defined $line; + + chomp $line; + #warn "$lineno\t$line\n"; + if (my ($directive, $rest) = $line =~ /^\s*#+\s*\^(\w+)\s+(.*?)\s*$/) { + warn "$relpath:$lineno: $directive - $rest\n"; + my $type = $directive; + $type = 'name' if $type =~ /^(?:variable|function)$/; + + if ($type eq 'package') { + $curr_package = $rest; + + } elsif ($type eq 'uses') { + my $name = qualify($rest, $curr_package); + if (defined $curr_function) { + push @{$names{$name}{used_by}}, $curr_function; + push @{$names{$curr_function}{uses}}, $name; + } else { + warn "$relpath:$lineno: ^uses before ^function\n"; + } + + } elsif ($type eq 'name') { + my $name = qualify($rest, $curr_package); + if (exists $names{$name}{file}) { + warn sprintf "$relpath:$lineno: $name already declared at %s:%s\n", + $names{$name}{file}, $names{$name}{line}; + } else { + $names{$name}{file} = $relpath; + $names{$name}{line} = $lineno; + my $sigil = substr($name, 0, 1); + $files{$relpath}{$sigil}{$name} = $lineno; + } + if ($name =~ /^&/) { + $curr_function = $name;#if $name =~ /^&/; + } + + } else { + warn "$relpath:$lineno: unknown directive ^$directive\n"; + + } + } + } +} + +sub qualify { + my ($var, $pkg) = @_; + return $var if $var =~ /::/; + my ($sigil, $name) = $var =~ /^([\@\$\%\&\*]?)(.*)$/; + $sigil = '&' if not length($sigil); + return $sigil . $pkg . '::' . $name; +} + +################################################################################ + +sub report { + my %o = %{shift()} if ref $_[0]; + + print <<EOF; +<html> +<head> +<title>Symbol map for $basedir</title> +<style type="text/css"> +dt.name { font-weight: bold; } +dt.name_property { font-style: italic; } +.file { border-bottom:1px solid black; } + +</style> +</head> +<body> +<h1>Symbol map for $basedir</h1> + +EOF + + my @files = sort keys %files; + report_toc(@files); + foreach my $file (@files) { + report_file($file); + } +} + +sub report_toc { + my (@files) = @_; + print "<ul class=\"toc\">\n"; + foreach my $file (@files) { + my $anchor = anchor_name($file); + print "<li class=\"toc_item\"><a href=\"#$anchor\">$file</a></li>\n"; + } + print "</ul>\n"; +} + +sub report_file { + my %o = %{shift()} if ref $_[0]; + my ($file) = @_; + my $anchor = anchor_name($file); + print <<EOF; +<h2 class="file"><a name="$anchor" href="$POD_PREFIX/$file">$file</a></h2> +EOF + + my @vars = map { keys %{$files{$file}{$_}} } '$', '@', '%'; + my @funcs = keys %{$files{$file}{'&'}}; + report_section({file_name=>$file,section_name=>'Variables'}, @vars); + report_section({file_name=>$file,section_name=>'Functions'}, @funcs); +} + +sub report_section { + my %o = %{shift()} if ref $_[0]; + my @names = @_; + my $anchor = anchor_name("$o{file_name}:$o{section_name}"); + print <<EOF; +<a name="$anchor"><h3 class="section">$o{section_name}</h3></a> +<dl class="names"> +EOF + + @names = sort { substr($a,1) cmp substr($b,1) } @names; + foreach my $name (@names) { + report_name($name); + } + + print <<EOF; +</dl> +EOF +} + +sub report_name { + my %o = %{shift()} if ref $_[0]; + my ($name) = @_; + + my $short_name = no_main($name); + my $anchor = anchor_name($name); + my @uses = get_uses_html($name); + my @used_by = get_used_by_html($name); + + local $" = ", "; + print <<EOF; +<a name="$anchor"><dt class="name">$short_name</dt></a> +<dd> + <dl class="name_properties"> +EOF + @uses and print <<EOF; + <dt class="name_property">Uses</dt> + <dd class="name_property">@uses</dd> +EOF + @used_by and print <<EOF; + <dt class="name_property">Used by</dt> + <dd class="name_property">@used_by</dd> +EOF + print <<EOF; + </dl> +</dd> +EOF +} + +sub get_uses_html { + my ($name) = @_; + return unless exists $names{$name}{uses}; + + my @uses; + foreach my $curr (@{$names{$name}{uses}}) { + my $short_curr = no_main($curr); + my $anchor = anchor_name($curr); + push @uses, "<a href=\"#$anchor\">$short_curr</a>"; + } + return @uses; +} + +sub get_used_by_html { + my ($name) = @_; + return unless exists $names{$name}{used_by}; + + my @used_by; + foreach my $curr (@{$names{$name}{used_by}}) { + my $short_curr = no_main($curr); + my $anchor = anchor_name($curr); + push @used_by, "<a href=\"#$anchor\">$short_curr</a>"; + } + return @used_by; +} + +sub no_main { + my ($name) = @_; + if ($name =~ /^(.)main::([^\:]+)$/) { + return "$1$2"; + } else { + return $name; + } +} + +sub anchor_name { + my ($string) = @_; + my ($sigil, $rest) = (substr($string,0,1), substr($string,1)); + $sigil = ($sigil eq '$' ? 's' + : ($sigil eq '@' ? 'a' + : ($sigil eq '%' ? 'h' + : ($sigil eq '&' ? 'f' + : '')))); + $rest =~ s/([^A-Za-z0-9_])/sprintf(".%02X",ord($1))/ge; + return "$sigil$rest"; +} + +sub relpath { + my ($src, $dest) = @_; + return File::Spec->abs2rel( + File::Spec->rel2abs($src), + (File::Spec->splitpath(File::Spec->rel2abs($dest)))[1] + ); +} |
From: Sam H. v. a. <we...@ma...> - 2008-04-14 23:10:50
|
Log Message: ----------- disable logmsg handling Modified Files: -------------- admintools: ww-mail-merge Revision Data ------------- Index: ww-mail-merge =================================================================== RCS file: /webwork/cvs/system/admintools/ww-mail-merge,v retrieving revision 1.3 retrieving revision 1.4 diff -Lww-mail-merge -Lww-mail-merge -u -r1.3 -r1.4 --- ww-mail-merge +++ ww-mail-merge @@ -3,7 +3,7 @@ use strict; use warnings; -my $logmsg; +#my $logmsg; my $out; while (<>) { @@ -11,7 +11,7 @@ <>; # next line is underlines while (<>) { last if /^(Added|Modified|Deleted) Files:$/; - $logmsg .= $_; + #$logmsg .= $_; } } if (/^--- \/dev\/null$/) { @@ -25,7 +25,7 @@ $out .= "cvs up -kk -j$2 -j$3 $1\n"; } -$logmsg =~ s/\n+$//s; +#$logmsg =~ s/\n+$//s; if (defined $out) { print $out; |
From: Sam H. v. a. <we...@ma...> - 2008-04-04 19:39:59
|
Log Message: ----------- backport (sh002i): When viewing a file-based problem library, don't show to problem library's prefix in the "select a problem collection" popup. This can significantly shorten the length of the options in that popup, making them more managable. Tags: ---- rel-2-4-dev Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: SetMaker.pm Revision Data ------------- Index: SetMaker.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v retrieving revision 1.77.2.2 retrieving revision 1.77.2.3 diff -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -u -r1.77.2.2 -r1.77.2.3 --- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm @@ -340,10 +340,18 @@ } debug("library is $lib and sets are $library_selected"); my $view_problem_line = view_problems_line('view_local_set', 'View Problems', $self->r); + my @popup_menu_args = ( + -name => 'library_sets', + -values => $list_of_prob_dirs, + -default => $library_selected, + ); + # make labels without the $lib prefix -- reduces the width of the popup menu + if (length($lib)) { + my %labels = map { my($l)=$_=~/^$lib\/(.*)$/;$_=>$l } @$list_of_prob_dirs; + push @popup_menu_args, -labels => \%labels; + } print CGI::Tr({}, CGI::td({-class=>"InfoPanel", -align=>"left"}, "$name Problems: ", - CGI::popup_menu(-name=> 'library_sets', - -values=>$list_of_prob_dirs, - -default=> $library_selected), + CGI::popup_menu(@popup_menu_args), CGI::br(), $view_problem_line, )); |
From: Sam H. v. a. <we...@ma...> - 2008-04-04 19:36:54
|
Log Message: ----------- When viewing a file-based problem library, don't show to problem library's prefix in the "select a problem collection" popup. This can significantly shorten the length of the options in that popup, making them more managable. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: SetMaker.pm Revision Data ------------- Index: SetMaker.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v retrieving revision 1.81 retrieving revision 1.82 diff -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -u -r1.81 -r1.82 --- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm @@ -347,10 +347,18 @@ } debug("library is $lib and sets are $library_selected"); my $view_problem_line = view_problems_line('view_local_set', 'View Problems', $self->r); + my @popup_menu_args = ( + -name => 'library_sets', + -values => $list_of_prob_dirs, + -default => $library_selected, + ); + # make labels without the $lib prefix -- reduces the width of the popup menu + if (length($lib)) { + my %labels = map { my($l)=$_=~/^$lib\/(.*)$/;$_=>$l } @$list_of_prob_dirs; + push @popup_menu_args, -labels => \%labels; + } print CGI::Tr({}, CGI::td({-class=>"InfoPanel", -align=>"left"}, "$name Problems: ", - CGI::popup_menu(-name=> 'library_sets', - -values=>$list_of_prob_dirs, - -default=> $library_selected), + CGI::popup_menu(@popup_menu_args), CGI::br(), $view_problem_line, )); |
From: dpvc v. a. <we...@ma...> - 2008-03-27 01:32:56
|
Log Message: ----------- Include aligned and gathered LaTeX environments. Modified Files: -------------- webwork2/htdocs/jsMath/extensions: AMSmath.js Revision Data ------------- Index: AMSmath.js =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/jsMath/extensions/AMSmath.js,v retrieving revision 1.1 retrieving revision 1.2 diff -Lhtdocs/jsMath/extensions/AMSmath.js -Lhtdocs/jsMath/extensions/AMSmath.js -u -r1.1 -r1.2 --- htdocs/jsMath/extensions/AMSmath.js +++ htdocs/jsMath/extensions/AMSmath.js @@ -82,11 +82,13 @@ environments: { align: ['Array',null,null,'rlrlrlrlrlrl',[5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18],1,'D'], 'align*': ['Array',null,null,'rlrlrlrlrlrl',[5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18],1,'D'], + aligned: ['Array',null,null,'rlrlrlrlrlrl',[5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18],1,'D'], multline: 'Multline', 'multline*': 'Multline', split: ['Array',null,null,'rl',[5/18],1,'D'], gather: ['Array',null,null,'c',null,1,'D'], 'gather*': ['Array',null,null,'c',null,1,'D'], + gathered: ['Array',null,null,'c',null,1,'D'], subarray: ['Array',null,null,null,[0,0,0,0],1,'S',0,.25], smallmatrix: ['Array',null,null,'cccccccccc',[1/3,1/3,1/3,1/3,1/3,1/3,1/3,1/3,1/3,1/3],1,'S',0] }, @@ -174,7 +176,7 @@ }, /* - * Implement AMS generalizes fraction + * Implement AMS generalized fraction */ Genfrac: function (name,data) { var left = data[0]; var right = data[1]; |
From: dpvc v. a. <we...@ma...> - 2008-03-27 01:27:11
|
Log Message: ----------- Bring jsMath up to version 3.5. Changes include: * Fixed a problem with the boldsymbol extension where it could leave the fonts set to the bold fonts, so that all the rest of the mathematics on the page would be in bold. (This would occur if a jsMath auxiliary file had to be autoloaded by the \boldsymbol command.) * Fixed a timing problem with easy/load.js when autoloading and tex2math are both used (the default) that could cause some internal routines to run in the wrong order. * Fixed a problem in detecting a font size change in MSIE when the font used at one location on the page is only slightly smaller or larger than that used at the previous location. * Added ability for extra fonts to specify how they are handled in symbols-only image mode. This is used by the cmmib10 font to specify that the italic letters should be handled by bold italic letters in the serif font rather than by images, which was the old behaviour. You will need to replace the jsMath/fonts/cmmib10/def.js file with the new one to take advantage of this. * Added a new autobold extension that allows jsMath to detect the presence of a <B>...</B> tags (or CSS that sets font-weight:bold) surrounding the mathematics and automatically apply \boldsymbol to the mathematics. Since this requires the extra cmmib10 and cmmsy10 fonts, this is an extension that you must activate yourself. See the autobold documentation for details * Implemented the \verb command for entering verbatim material. See the verb extension documentation for details. * Added aligned and gathered environments to the AMSmath plugin. * Added equation and equation* environments. (Since tex2math now processes LaTeX environments within the text of the page, it makes more sense to have these defined.) * Fixed a problem with \newcommand where it would reject control-sequence names that included upper-case letters. * Fixed a problem with the \font command where the control sequence would be lost when the font was loaded (if it wasn't already loaded when the \font command was issued). * Fixed a timing bug with easy/load.js when there are files specified in the loadFiles array. The bug only occurred with the Opera browser. * Worked around a problem with Opera where the autoload plugin could hang when trying to load the jsMath.js file. * Worked around a spacing problem in IE7 where some elements in an array or fraction could be misaligned. * Worked around a problem in IE7 where accented characters could disappear under some circumstances (particularly when they appear by themselves). * Fixed a problem with Firefox3 where the control panel would not open. * Firefox3's new single-origin policy restricts access to file outside the currect directory when local files (i.e., file: URL's) are used. JsMath now uses the new window.postMessage() facilty to work around this. If you use window.postMessage() yourself you should be aware that jsMath is also using window messages, and so you should be careful to properly identify your own messages so as not to confuse them with the ones used by jsMath. All messages used by jsMath will begin with jsMLD:, jsMCP:, or jsMAL: so you can filter these out of our own message-processing code. * Disabled the BaKoMa font processing in Firefox3 since jsMath no longer works properly with those fonts in Firefox3. Modified Files: -------------- webwork2/htdocs/jsMath: jsMath-controls.html jsMath-easy-load.js jsMath-loader.html jsMath-ww.js jsMath.js webwork2/htdocs/jsMath/extensions: bbox.js boldsymbol.js font.js newcommand.js webwork2/htdocs/jsMath/plugins: CHMmode.js autoload.js noImageFonts.js webwork2/htdocs/jsMath/uncompressed: jsMath-fallback-mac.js jsMath.js Added Files: ----------- webwork2/htdocs/jsMath: jsMath-loader-post.html webwork2/htdocs/jsMath/extensions: autobold.js verb.js Revision Data ------------- Index: jsMath-loader.html =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/jsMath/jsMath-loader.html,v retrieving revision 1.4 retrieving revision 1.5 diff -Lhtdocs/jsMath/jsMath-loader.html -Lhtdocs/jsMath/jsMath-loader.html -u -r1.4 -r1.5 --- htdocs/jsMath/jsMath-loader.html +++ htdocs/jsMath/jsMath-loader.html @@ -7,7 +7,7 @@ | | This file is used for jsMath components when the browser doesn't | handle the XmlHttpRequest function, or when they must be obtained - | from a server other than the one server the page that is using jsMath. + | from a server other than the one serving the page that is using jsMath. | | --------------------------------------------------------------------- | Index: jsMath-controls.html =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/jsMath/jsMath-controls.html,v retrieving revision 1.12 retrieving revision 1.13 diff -Lhtdocs/jsMath/jsMath-controls.html -Lhtdocs/jsMath/jsMath-controls.html -u -r1.12 -r1.13 --- htdocs/jsMath/jsMath-controls.html +++ htdocs/jsMath/jsMath-controls.html @@ -28,6 +28,8 @@ <script> var showWarning = 0; +var domain = document.domain || ""; +var mustPost = ((domain == "" || domain == "localhost") && window.postMessage); while (!window.jsMath && !showWarning) { try { window.jsMath = window.parent.jsMath; @@ -58,8 +60,16 @@ ); } -if (showWarning) {setTimeout("Warning()",1)} else { -var debug = window.parent.debug; var show = window.parent.show; +if (showWarning) { + if (!mustPost) setTimeout("Warning()",1); +} else { + var debug = window.parent.debug; + var show = window.parent.show; +} +</SCRIPT> + +<SCRIPT ID="jsMath_script"> +if (window.jsMath) { jsMath.Add(jsMath.Controls,{ @@ -87,7 +97,7 @@ Main: function () { this.oldCookie = {}; jsMath.Add(this.oldCookie,this.cookie); - this.GetPanel("panel"); + this.GetPanel("main"); jsMath.Element("_version").innerHTML = jsMath.version; @@ -192,13 +202,13 @@ } }, + HTML: {}, // storage for panels for Firefox3 in local mode + GetPanel: function (name) { this.panel.innerHTML = ""; // for MSIE on the Mac - if (jsMath.browser == 'Mozilla') { - this.panel.appendChild(document.getElementById("jsMath_"+name).cloneNode(true)); - } else { - this.panel.innerHTML = document.getElementById("jsMath_"+name).innerHTML; - } + var html = this.HTML[name]; + if (html == null) {html = document.getElementById("jsMath_"+name).innerHTML} + this.panel.innerHTML = html; }, SaveOptions: function (close) { @@ -249,12 +259,23 @@ }); +jsMath.Add(jsMath.Post.Commands,{ + PAN: function (message) {jsMath.Controls.HTML.main = message}, + OPT: function (message) {jsMath.Controls.HTML.options = message}, + + PST: function (message) { + jsMath.Controls.Main(); + jsMath.Script.endLoad(); + jsMath.Message.doClear(); + } +}); + } </script> <!------------------------------------------------------------> -<div id="jsMath_panel"> +<div id="jsMath_main"> <div style="text-align:center"> <b style="font-size:133%">jsMath v<span ID="jsMath__version"></span></b> (<span id="jsMath__fontType">type</span> fonts) @@ -434,7 +455,19 @@ <!------------------------------------------------------------> <script> - if (!showWarning) {jsMath.Controls.Main()} + if (showWarning) { + if (mustPost) { + var scr = document.getElementById("jsMath_script"); + window.parent.postMessage("jsMCP:SCR:"+scr.innerHTML); + var main = document.getElementById("jsMath_main"); + window.parent.postMessage("jsMCP:PAN:"+main.innerHTML); + var options = document.getElementById("jsMath_options"); + window.parent.postMessage("jsMCP:OPT:"+options.innerHTML); + window.parent.postMessage("jsMCP:PST:"); + } + } else { + jsMath.Controls.Main() + } </script> <script> if (window.jsMath) { Index: jsMath-easy-load.js =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/jsMath/jsMath-easy-load.js,v retrieving revision 1.3 retrieving revision 1.4 diff -Lhtdocs/jsMath/jsMath-easy-load.js -Lhtdocs/jsMath/jsMath-easy-load.js -u -r1.3 -r1.4 --- htdocs/jsMath/jsMath-easy-load.js +++ htdocs/jsMath/jsMath-easy-load.js @@ -91,9 +91,8 @@ jsMath.Autoload.findCustomSettings = jsMath.Easy.findCustomSettings; jsMath.Autoload.loadFiles = jsMath.Easy.loadFiles; jsMath.Autoload.loadFonts = jsMath.Easy.loadFonts; - - if (!document.body) {jsMath.Easy.autoloadCheck = 1} - else {jsMath.Easy.autoloadReCheck = 1} + jsMath.Autoload.delayCheck = 1; + jsMath.Easy.autoloadCheck = 1; document.write('<script src="'+jsMath.Autoload.root+'plugins/autoload.js"></script>'); } else { @@ -122,7 +121,6 @@ jsMath.Easy.onload = function () { if (jsMath.Easy.loaded) {return} else {jsMath.Easy.loaded = 1} if (jsMath.Easy.autoloadCheck) jsMath.Autoload.Check(); - if (jsMath.Easy.autoloadReCheck) jsMath.Autoload.ReCheck(); if (jsMath.Easy.tex2math) { jsMath.Synchronize(function () { if (jsMath.Easy.findCustomSettings) Index: jsMath.js =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/jsMath/jsMath.js,v retrieving revision 1.40 retrieving revision 1.41 diff -Lhtdocs/jsMath/jsMath.js -Lhtdocs/jsMath/jsMath.js -u -r1.40 -r1.41 --- htdocs/jsMath/jsMath.js +++ htdocs/jsMath/jsMath.js @@ -40,11 +40,11 @@ //start = new Date().getTime(); jsMath.Script.Uncompress([ - ['if(!','window','.jsMath','||!',1,'.','jsMath.','loaded','){var ','jsMath_old','=',1,2,';',0,'document.','getElementById','||!',15,'childNodes||!',15,'createElement','){','alert("','The',' mathematics ','on this page requires W3C DOM support in its JavaScript. "+"Unfortunately, your ','browser',' doesn\'t seem to have this.")}','else{',1,2,'={version:"3.4f",document:document,',1,':',1,',','platform',':(','navigator.',37,'.match(/','Mac/)?"mac":',39,37,41,'Win/)?"pc":"unix"),','sizes',':[50,60,70,85,100,120,144,173,207,249],','styles',':{".math','":"font-family:serif; font-style:normal; font-weight:normal','",".typeset',51,'; ','line-height:normal','","div.','typeset','":"text-align',':center; margin:1em 0px;","span.',57,58,':left',52,' span',58,62,'; border:','0px; margin:0px; ','padding:0px','",".typeset .','normal',51,70,'size0','":"font-size:','50','%",".typeset .','size1',75,'60',77,'size2',75,'70',77,'size3',75,'85',77,'size4',75,'100',77,'size5',75,'120',77,'size6'! ,75,'144',77,'size7',75,'173',77,'size8',75,'207',77,'size9',75,'249',77,'cmr10','":"font-family:jsMath-','cmr10, serif',70,'cmbx10',115,118,', ','jsMath-cmr10',70,'cmti10',115,124,', ',122,70,'cmmi10',115,130,70,'cmsy10',115,134,70,'cmex10',115,138,70,'textit":"','font-family',':serif; ','font-style:italic',70,'textbf":"',143,':serif; font-weight:bold',70,'link":"','text-decoration:none',70,'error',75,'10pt; ',145,'; "+"','background-color',':#FFFFCC; padding:1px',158,'border:','1px solid',' #CC0000',70,'blank":"','display:inline-block','; ','overflow:hidden',67,'0px none; width:0px','; height:','0px;",".',57,' .','spacer','":"',167,'","#jsMath_hiddenSpan":"','visibility',':','hidden','; ','position:absolute','; top:0px',';left:0px',158,55,'; text-indent:0px","#','jsMath_message','":"','position:fixed','; bottom:','1px; left:2px; ',159,':#E6E6E6','; "+"border:solid 1px #959595; margin:0px; padding:','1px 8px','; "+"z-index:102; color',': black','; font-size:','small; ','wi! dth:auto',';","#','jsMath_panel','":"',192,193,'1.5em; right:1! .5em','; padding:.8em 1.6em',158,159,':#DDDDDD',67,'outset 2px',158,'z-index:103; ',203,'; color:black',201,'10pt; font-style:normal","#',205,' .disabled":"color:#888888","#',205,' .infoLink',75,'85%","#',205,' *":"','font-size:inherit; font-style:inherit; font-family:inherit','; ',55,'","#',205,' div":"',159,':inherit; color:inherit;","#',205,' span":"',159,237,205,' td','":"border:0px; padding:0px; margin:0px; background-color:inherit; color:inherit;","#',205,' tr',244,205,' table',244,'jsMath_button','":"',192,193,'1px; right:2px; ',159,':white',197,'0px 3px 1px 3px',199,':black; ',152,201,'x-small',158,203,'; cursor:hand;","#',251,229,69,67,68,55,158,230,'","#jsMath_global":"',145,';","#jsMath_float','":"',184,185,'; left:0px; max-width:80%; "+"z-index:101; ',203,'; height:auto',278,' .drag":"',159,':#DDDDDD',67,'outset 1px',172,'12px',201,'1px',278,' .close":"',159,196,67,'inset 1px; width:8px',172,'8px; margin:1px 2px',278,' .source":"',159,':#E2E2E2',67,290,158,203,284,'; pad! ding:8px 15px',158,143,':courier, fixed',201,'90%","#jsMath_noFont .message',58,': center',210,67,'3px solid #DD0000',158,159,':#FFF8F8; color: #AA0000',201,202,203,204,'jsMath_noFont .link','":"',69,' 5px 2px 5px',67,'2px outset; ',159,':#E8E8E8',158,'color:black',201,'80%; ',203,267,'jsMath_PrintWarning',' .message',58,':center',210,67,'3px solid #DD0000',158,159,': #FFF8F8; color: #AA0000',201,'x-',202,203,';","@media print":"#',251,' {display:none','}\\n"+"#jsMath_Warning',360,'}","@media screen":"#',344,360,'}"},Element',':function(','A){return ',6,15,16,'("jsMath_"+A)},','BBoxFor',367,'A','){this.','hidden.innerHTML','="<nobr><','span class=\\"',57,'\\"><',379,'scale\\">"+A+"</span></span></nobr>";var B={w:this.',182,'.offsetWidth',',h:this.',182,'.offsetHeight','};this.',377,'="";return B},EmBoxFor',367,'B){var A=',6,'Global.cache.R;if(!A[this.em]){A[this.em]={}}if(!A[this.em][B]){var C=this.BBoxFor(B);','A[this.em][B]={w:C.w/this.em,h:C.h/this.em}}return A[this.em][! B]},','EmBoxForItalics',367,393,6,395,'if(B.match(/<i>|class=\! \"(icm|i talic|igreek|iaccent)/i)){C.w=C.Mw','=this.BBoxFor','(B+',6,'Browser.','italicString',').w-',6,406,'italicCorrection','}',396,'Init',':function(){','if(',6,'Setup.inited','!=1){',0,6,418,'){',6,'Setup.','Body()}if(',6,418,'!=1){if(',6,418,'==-100','){return }',23,'It looks like jsMath failed to set up properly (error code "+',6,418,'+"). "+"I will try to keep going, but it could get ugly.");',6,418,'=1}}this.em',403,'("<span style=\\""+',6,406,'block+";','width:13em;height:1em','\\"></span','>").w/13;','if(this.','em==0',376,'em',403,'("<img src=\\""+',6,'blank+"\\" style=\\"',447,'\\"/>").w/13}','var A=',6,'Global.cache','.B;',0,'A[this.em]){A[this.em]={};','A[this.em].','bb',403,'("x");','var C=',466,'bb.h;',466,'d',403,'("x"+',6,'HTML.Rule(1,','C/',6,'em)).h-C;if(',6,406,407,'){',466,'ic=',6,373,'(',6,406,407,').w}}',6,406,411,'=',466,'ic;var F=',466,'bb;var D=F.h;var E=',466,'d;this.h=(D-E)/this.em;this.d=E/this.em;this.hd=this.h+this.d;this.xWidth=F.w;this.',425,'TeXfo! nts','();var B=this.EmBoxFor("<',379,'cmr10\\">M</span>").w/2;this.TeX.M_height=B*(26/14);this.TeX.h=this.h;this.TeX.d=this.d;this.TeX.hd=this.hd;this.Img.Scale();',0,'this.initialized',376,425,'Sizes','();this.','Img.UpdateFonts()}this.p_height=(','this.TeX.cmex10[0].','h+',517,'d)/0.85;',511,'=1},ReInit',415,'var A',403,'("x").w;if(A!=this.xWidth',376,'Init()}},Loaded',415,'if(',9,8,'B=["Process","ProcessBeforeShowing","ConvertTeX","ConvertTeX2","ConvertLaTeX","ConvertCustom","CustomSearch","Synchronize","Macro","document"];','for(var A=0;A<','B','.length;A++){','if(',9,'[B[A]]){','delete ',9,'[B[A]]}}}if(',9,376,'Insert(jsMath,',9,')}',9,'=null;',6,7,'=1},Add',367,'C,A){for(var B in A){','C[B]=A[B]}},Insert',367,554,'if(C[B]&&typeof (A[B])=="object"&&(','typeof (C[B])=="','object"||',559,'function")){this.Insert(C[B],A[B])}',29,'C[B]=A[B]}}},Package',367,'B,A',376,'Insert(B.prototype,A)}};',6,'Global={isLocal:1,cache:{','T:{},D:{},R:{},B',':{}},ClearCache',415,6,462,'={'! ,571,':{}}},GoGlobal',367,393,'String(',6,1,'.','location);var! C','=(' ,6,'isCHMmode','?"#":"?");if(B){A=A.replace(/\\?.*/,"")+"?"+B}',6,'Controls.','Reload(',6,'root+"jsMath-','global.html"+C+escape(A))},Init',415,'if(',6,'Controls.cookie.','global=="always"&&!',6,'noGoGlobal','){','if(navigator.','accentColorName',433,0,6,1,'){',6,1,'=',1,'}',6,591,7,'=1;',6,591,'defaults.hiddenGlobal',549,'this.GoGlobal(',6,591,'SetCookie(2))}},Register',415,460,6,1,'.parent;',0,6,'isCHMode){',6,588,'=(',6,1,'.','location.','protocol=="mk:")}try{',0,6,588,376,'Domain()}if(A',2,'&&A.',6,'isGlobal){A.',6,'Register(',6,1,')}}catch(B){',6,602,'=1}},Domain',415,604,'appName=="Microsoft Internet Explorer"&&',6,37,'=="mac"&&',39,'userProfile','!=null',433,'if(',1,'==parent',433,'var B=',6,15,'domain;try{while(true){try{if(parent.',15,'title',669,'){return }}','catch(A){}',0,15,'domain.match(/\\..*\\./)){break}',6,15,'domain=',6,15,'domain.replace(/^[^.]*\\./,"")}}',683,6,15,689,'B}};',6,'Script={request:null,Init',415,'if(!(',6,599,'asynch&&',6,599,'progress',')){i! f(',1,'.XMLHttpRequest','&&!(',6,15,'URL&&',6,15,'URL.match(/^file:\\/\\/.*\\\\/))){try{','this.request','=new XMLHttpRequest}catch(C){}}',0,718,'&&',1,'.','ActiveXObject',8,'A=["MSXML2.XMLHTTP.5','.0","MSXML2.XMLHTTP','.4',728,'.3',728,'","Microsoft.XMLHTTP"];','for(var B=0;B<','A.length&&!',718,';B++){try{',718,'=new ',725,'(A[B])}catch(C){}}}}',0,718,'||',6,425,'domainChanged',376,'Load=this.delayedLoad;this.needsBody=1}},Load',367,'B,A){','if(A){',6,'Message.Set("Loading "+','B);',6,'Script.','Delay(1);',6,'Script.Push(','this,"xmlRequest",B',');',6,760,6,'Message',',"Clear")}',29,6,760,761,')}},xmlRequest',367,'url){','this.blocking','=1;try{',718,'.open("GET",url,false);',718,'.send(null)}catch(err){',775,'=0;if(',6,'Translate.','restart&&',6,'Translate.asynchronous){return""}throw"jsMath can\'t load the file \'"+url+"\'\\n"+"',766,': "+err.message}if(',718,'.status','&&',718,791,'>=400){',775,782,6,784,'restart&&',6,787,'Error status: "+',718,791,'}',0,'url','.match(! /\\.js$/)){','return(',718,'.responseText',')}var tmpQueue','=! this.que ue;this.queue','=[];',6,1,'.eval(',718,812,');',775,'=0;','this.queue=this.queue.','concat(','tmpQueue);this.Process();return""},cancelTimeout:30*1000,iframe:null,blocking:0,cancelTimer:null,needsBody:0,queue:[],Synchronize',367,'A,B){','if(typeof (','A)!="string"){',6,760,'null,A,B)}',29,6,760,6,1,',"eval",A)}},Push',367,'A,C,B',376,'queue[','this.queue.length',']=[A,C,B];if(!(',775,'||(this.needsBody&&!',6,15,'body))){this.Process()}},Process',415,'while(',844,'&&!',775,8,'C=this.queue[0];',824,'slice(1);',460,'this.SaveQueue();var B=C[0];var E=C[1];var D=C[2];if(B){B[E](D)}',29,'if(E){E(D)}}this.','RestoreQueue','(A)}},SaveQueue',415,'var A',814,'=[];return A},',864,367,'A){',824,825,'A)},delayedLoad',367,'A',376,'Push(this,"startLoad",A)},startLoad',367,'A){','this.iframe','=',6,15,21,'("iframe");','this.iframe.style.',180,'="',182,'";',888,'position="absolute";',888,'width="0px";',888,'height="0px','";if(',6,15,'body.firstChild','){',6,15,'body.insertBefore(',882,',',6,! 15,902,')}',29,6,15,'body','.appendChild(',882,')}',775,'=1;this.','url=A;',0,'A',809,882,'.src=A}',29,882,'.src=',6,594,'loader.html"}if(A.substr(0,',6,'root.length',')==',6,'root){A=A.substr(',6,935,')}',6,754,'A);','this.cancelTimer','=setTimeout("',6,757,'cancelLoad','()",this.cancelTimeout)},endLoad',367,'A){if(',945,'){clearTimeout(',945,');',945,'=null}',6,766,'.Clear();if(A!="cancel"){',775,'=0;this.Process','()}},Start',415,'this.tmpQueue',814,'=[]},End',415,824,825,966,');',540,966,'},',949,415,945,549,6,766,'.Set("Can\'t load file");this.endLoad("cancel")},Delay',367,'A){',775,'=1;setTimeout("',6,757,'endDelay','()",A)},',990,415,775,963,'()},','imageCount',':0,WaitForImage',367,'B){',775,921,997,'++;',450,'img==null',376,'img=[]}',460,'new Image',515,'img[this.img.length]=A;A.onload=function(){if(--',6,757,997,'==0){',6,757,990,'()}};A.onerror=A.onload;A.onabort=A.onload;A.src=B},Uncompress',367,'data){for(var k=0;k<data.length;k++){var d=data[k];var n=d.length;! for(var i=0;i<n;i++){',829,'d[i])=="number"){d[i]=d[d[i]]}}dat! a[k]=d.j oin("")}',1,818,'data.join(""))}};',6,766,'={blank:null,message:null,text:null,clear:null,Init',415,0,6,15,'body||!',6,599,707,433,'if(',6,425,'stylesReady){','this.message','=',6,'Setup.DIV("message",{visibility:"hidden','"})}',29,1044,'=',6,1047,'",position:"absolute",','bottom:"1px",left:"2px",','backgroundColor',':"#E6E6E6",border:"solid 1px #959595",margin:"0px",padding:"1px 8px",zIndex:102,color:"black",fontSize:"small",width:"auto"})}','this.text','=',6,15,'createTextNode','("");',1044,917,1058,');',1044,'.onmousedown=',6,784,'Cancel},Set',367,751,'if(this.clear){clearTimeout(this.clear',');this.clear=null}if(',6,599,707,'){',0,1058,376,'Init();',0,1058,682,'if(',6,406,'textNodeBug','){',1044,'.innerHTML','=B}',29,1058,'.nodeValue','=B}','this.message.style.',180,'="visible";',752,1100,'cursor="pointer";',0,1100,'cursor){',1100,'cursor="hand"}',1044,'.title=" Cancel Processing of Math "}',29,1100,'cursor="";',1044,'.title=""}}',29,'if(B.substr(0,8)!="Loading "){',6,1,! 791,'=B}}},Clear',415,1075,')}this.clear=setTimeout("',6,766,'.doClear()",1000)},doClear',415,450,'clear',376,'clear',549,6,1,791,'="";if(',1058,'){',1058,1098,'=""}if(',1044,'){',1100,180,'="',182,'"}}},Blank',415,'if(','this.blank','||!',6,15,'body',433,1154,'=',6,425,'DIV("blank",{position:(',6,406,'msiePositionFixedBug','?"absolute":"fixed"),top:"0px",left:"0px",bottom:"0px",right:"0px",zIndex:101,',1056,':"white"});if(',6,406,'msieBlankBug){',1154,1094,'=" ";',1154,'.style.width="110%";',1154,'.style.height="110%"}},UnBlank',415,'if(',1154,'){',6,15,'body.removeChild(',1154,')}',1154,'=null}};',6,'Setup={',7,':[],DIV',367,'D,B',8,'C=',6,15,21,'("div");C.id="jsMath_"+D;','for(var A in ','B){C.style[A]=B[A]}',0,6,15,'body.hasChildNodes){',6,15,'body',917,'C)}',29,6,15,906,'C,',6,15,902,')}return C},Script',367,751,450,7,'[B]){return }',29,'this.',7,'[B]=1}',0,'B.match("^([a-zA-Z]+:/?)?/")){B=',6,'root+B}',6,757,'Load(B,A)},Hidden',415,6,182,'=this.DIV("Hidden",{',18! 0,':"',182,1054,'top:0,left:0,border:0,padding:0,margin:0});',! 6,'hidde nTop=',6,182,';return },Source',415,'if(',6,'Autoload','&&',6,1257,'.root){',6,'root=',6,1257,'.','root}',29,6,'root="";',460,6,15,'getElementsByTagName("','script");',752,734,'A.','length;B++){','var D=A[B].src;if(D&&D.match("(^|/|\\\\\\\\)',6,'js$")){',6,1263,'D.','replace(/',6,'js$/,"");break}}}}if(',6,'root.charAt(','0)=="\\\\"){',6,1263,6,'root.replace','(/\\\\/g,"/")}if(',6,1290,'0)=="/"){if(',6,1290,'1)!="/"){if(',6,15,642,'port){',6,'root=":"+',6,15,642,'port+',6,1267,6,'root="//"+',6,15,642,'host+',6,1267,6,1263,6,15,642,'protocol+',6,1267,29,0,6,'root.match','(/^[a-z]+:/i)){var D=','new String(',6,15,585,'=new RegExp("/[^/]*/\\\\.\\\\./");',6,1263,'D.replace(new RegExp("[^/]*$"),"")+',6,'root;while(',6,1334,'(C)){',6,1263,6,1295,'(C,"/")}}}',6,'Img.',1263,6,'root+"fonts/";',6,'blank=',6,'root+"blank.gif";this.Domain()},Domain',415,'try{',6,15,'domain}catch(D',433,'var C="";',460,6,15,'domain;if(',6,1334,'("://([^/]*)/")){C=RegExp.$1}C=C.replace(/:\\d+$/,"");if(C=="! "||C==A',433,604,'appName=="Microsoft Internet Explorer"&&',6,37,'=="mac"&&',39,'onLine&&',39,668,'&&',6,15,'all',433,'C=C.split(/\\./);A=A.split(/\\./);if(C.length<2||A.length<2||','C[C.length-','1',']!=A[A.length-','1]||',1393,'2',1395,'2]){this.','DomainWarning','();return }var E=',1393,'2]+"."+',1393,'1];for(var B=3;B<=C.length&&B<=A.',1279,'if(',1393,'B',1395,'B]){break}E=',1393,'B]+"."+E}',6,15,689,'E;this.',747,'=1},',1401,415,23,'In order for jsMath to be able to load the additional "+"components that it may need, the ',6,'js file must be "+"',7,' from a server in the same domain as the page that "+"contains it. Because that is not the case for this page, "+"the',25,'displayed here may not appear correctly.")},','EncodeFont',367,'C',8,'B=',6,'TeX[C];if(B','[0].c',669,433,534,'128;A++){var D=B[A];B[A]=D[3];if(B[A]==null){B[A]={}}B[A].w=D[0];B[A].h=D[1];if(D[2]!=null){B[A].d=D[2]}B[A].c=',6,'TeX.encoding[A]}},Fonts',415,734,6,'TeX.fam.length;','B++){',460,6,'TeX.fam[! ','B];if(A',376,1431,'(A)}}},TeXfont',367,'C',8,'B=',6,1437,'=! =null',4 33,460,6,'EmBoxFor("<span class=\\""+C+"\\">"+B[65].c','+"</span>");B.hd=A.h;B.dh=0.05;B.d=',6,1467,'+',6,478,'B.hd)+"</span>").h-B.hd;B.h=B.hd-B.d;','if(C=="',130,'"){B.skewchar=','127}',29,1475,134,1477,'48}}},',506,415,534,6,1448,'A++){if(',6,1452,'A]){this.TeXfont(',6,1452,'A])}}},Sizes',415,6,'TeXparams','=[];var B;var A;for(A=0;A<',6,47,536,6,1498,'[A]={}}for(B in ',6,'TeX){',829,6,'TeX[B])!="object"){for(A=0;A<',6,47,536,6,1498,'[A][B]=',6,47,'[A]*',6,'TeX[B]/100}}}},Styles',367,'A){',0,'A){A=',6,49,';A[".',57,' .scale"]="font-size:"+',6,599,'scale+"%";this.stylesReady=1}',6,760,'this,"','AddStyleSheet','",A);if(',6,406,'styleChangeDelay','){',6,760,6,'Script,"Delay",1)}},',1537,367,'D',8,'B=',6,15,1274,'head")[0];var A="";for(var E in D){A+=E+" {"+D[E]+"}\\n"}if(',6,15,'createStyleSheet){B.insertAdjacentHTML("beforeEnd","<','span style=\\"','display:none\\">x</span>"+"<style type=\\"text/css\\">"+A+"</style>")}',29,470,6,15,21,'("style");C.type="text/css";C',917,6,15! ,1062,'(A));B',917,'C)}},Body',415,450,'inited',433,'this.inited=-','1;',6,425,'Hidden();',1578,'2;',6,406,1084,1578,'3;if(',6,599,'blank){',6,766,'.Blank()}',1578,'4;',6,425,'Styles();',1578,'5;',6,591,1084,1578,'6;',6,760,6,'Setup,"User","pre-font");',1578,'7;',6,760,6,'Font,"Check");if(',6,'Font.register.length){',6,760,6,'Font,"LoadRegistered")}this.inited=1},User',367,952,6,'Setup.UserEvent[A',']){(',6,1627,'])()}},UserEvent:{"pre-font":null,"onload":null}};',6,'Update={',506,367,'D){',1204,'D){for(var B in D[A]){for(var C in D[A][B]){',6,'TeX[A][B][C]=D[A][B][C]}}}},TeXfontCodes',367,'C){',1204,'C){',734,'C[A].',1279,6,'TeX[A][B].c=C[A][B]}}}};',6,'Browser={allowAbsolute:1,allowAbsoluteDelim:0,separateSkips:0,valignBug:0,operaHiddenFix:"",','msieCenterBugFix',':"",','msieInlineBlockFix',':"",','msieSpaceFix',':"",imgScale:1,renameOK:1,',1541,':0,delay:1,version:0,','TestSpanHeight',415,6,377,'="<span','><','span style=\\""+this.block+";','height:2em;width:','1px',448,! '></span>";var B=',6,'hidden.firstChild;',460,'B.firstChild;',! 'this.sp anHeightVaries','=(B',388,'>=A',388,'&&B',388,'>0);','this.spanHeightTooBig','=(B',388,'>A',388,');',6,377,'=""},','TestInlineBlock',415,'this.block','="display:-moz-inline-box";','this.hasInlineBlock','=',6,'BBoxFor("<span style=\\""+this.block+";','width:10px;height:5px\\"></span>").w>0;if','(',1696,'){',6,'styles[".typeset .','blank"]=',6,1705,'blank','"].replace(/',167,'/,',1694,');',6,1705,176,'"]=',6,1705,176,1710,167,'/,"")}',29,1694,'="',167,'";',1696,'=',6,1699,1700,'(!',1696,682,1694,'+=";',169,'";',460,6,373,'("x").h;this.mozInlineBlockBug=',6,1699,'height:"+A+"px;width:1px',448,'>x"+"<',1666,1748,';vertical-align:-"+A+"px',448,'>").h>2*A;this.widthAddsBorder=',6,1699,169,';height:1px;width:10px',';border-left:','10px solid',448,'>").w>10;','this.msieBorderBug','=',6,1699,1748,448,'>x").h!=',6,1699,1748,1760,163,448,'>x").h;','this.blankWidthBug=',1764,'||',6,1699,1667,'0px',448,'>").h==0},','TestRenameOK',415,6,377,1664,'></span>";',460,6,1672,'A.setAttribute("na! me","','jsMath_test','");this.renameOK=(',6,15,'getElementsByName("',1797,'").length>0);',6,377,1691,'TestStyleChange',415,6,377,1664,' ID=\\"',1797,'\\">x</span>";var B=',6,1672,460,'B',385,';',6,425,1537,'({"#',1797,75,'200%"});this.',1541,'=(B',385,'==A);',6,377,1691,'VersionAtLeast',367,393,1336,'this.version',').split(".");','B=',1336,'B',1840,'if(B[1]==null){B[1]="0"}return A[0]>B[0]||(A[0]==B[0]&&A[1]>=B[1])},Init',415,6,27,'="unknown";this.',1692,515,1660,515,1787,515,1807,515,'MSIE',515,'Mozilla',515,'Opera',515,'OmniWeb',515,'Safari',515,'Konqueror','();if(','this.allowAbsoluteDelim','){',6,'Box.DelimExtend=',6,'Box.DelimExtendAbsolute;',6,'Box.Layout=',6,'Box.LayoutAbsolute}',29,6,'Box.DelimExtend=',6,'Box.DelimExtendRelative;',6,'Box.Layout=',6,'Box.LayoutRelative}if(','this.separateSkips','){',6,'HTML.Place=',6,'HTML.','PlaceSeparateSkips',';',6,'Typeset.prototype.','Place=',6,1898,1895,'}},MSIE',415,'if(',1675,'&&!',1683,'){',6,27,'="MSIE',899,6,37,'=="pc"){th! is.','IE7=(',1,710,669,');','this.quirks','=(',6,15,'compatMod! e=="Back Compat");this.msieStandard6=!',1922,'&&!','this.IE7',';',1870,'=1;',1889,'=1',';this.buttonCheck=1;this.','msieBlankBug=1;this.','msieAccentBug',921,'msieRelativeClipBug','=1;this.msieDivWidthBug=1;this.',1167,921,'msieIntegralBug',921,'waitForImages',921,'msieAlphaBug=!',1929,';this.','alphaPrintBug','=!',1929,';this.',1652,'="position:relative; ";this.',1654,'=" ',167,';";this.msieTeXfontBaselineBug=!',1922,';',1764,'=',1778,'1;',0,1929,376,1656,'="<',1559,167,448,'>"}',6,'Macro("joinrel","\\\\mathrel{\\\\kern-5mu}"),',6,'Parser.prototype.mathchardef.','mapstocharOrig','=',6,1978,'mapstochar;',540,6,1978,1983,6,'Macro("mapstochar","\\\\rlap{\\\\',1979,'\\\\,}\\\\kern1mu"),',6,1705,'arial"]="',143,': \'Arial unicode MS\'";',0,1929,'||',1922,'){',6,'styles["#',190,'"]=',6,2003,190,1710,192,'/,"',184,'").',1286,203,'/,"");',6,2003,205,'"]=',6,2003,205,1710,192,'/,"',184,'").',1286,203,'/,"");',6,2003,251,'"]="width:','1px; "+',6,2003,251,1710,192,'/,"',184,'").',1286,203,'/,"! ");',6,1,'.attachEvent("','onscroll",',6,591,'MoveButton',');if(',1929,'){',6,1,2050,'onresize",',6,591,2054,')}this.msieMoveButtonHack=',1929,'}',6,2003,330,'"]+=" ','display: inline-block',';";',6,1705,176,'"]=',6,1705,176,1710,167,'/,"");',6,49,'[".tex2math_div"]=',6,49,'["div.',57,'"]+"; width: 100%; ',2072,899,'screen.deviceXDPI','&&','screen.logicalXDPI','&&',2094,'!=',2096,376,'imgScale*=',2096,'/',2094,';',6,599,'alpha=0}this.',407,'="<i>x</i>";',6,'EmBoxFor=',6,397,'}',29,'if(',6,37,'=="mac"){this.msieAbsoluteBug',921,'msieButtonBug',1940,1936,'quirks=1;',6,425,'Script("jsMath-msie-mac.js");',6,'Parser.prototype.macros.angle=["Replace","ord","<font face=\\"Symbol\\">‹</font>","normal"];',6,2003,205,2035,'42em; "+',6,2003,205,1710,203,'/,"");',6,599,'printwarn=0}}',6,'Macro("not","\\\\mathrel{\\\\rlap{\\\\kern3mu','/}}")}},',1860,415,'if(',6,182,'.ATTRIBUTE_NODE){',6,27,'="',1860,899,6,37,1916,1950,'=1}',1870,'=1;',6,2003,251,'"]=',6,2003,251,1710,'cursor:hand'! ,'/,"cursor:pointer");',6,2003,330,'"]=',6,2003,330,1710,2175,! '/,"curs or:pointer");',6,2147,'/}}");',604,'vendor=="Firefox"){',1839,'=',39,'vendorSub}',29,604,'userAgent.match','(" Firefox/([0-9.]+)( |$)")){',1839,'=RegExp.$1}}}},',1864,415,604,'accentColorName){',6,27,'="',1864,'";','this.allowAbsolute','=',1696,';',1870,'=',2211,';this.valignBug=!',2211,1935,1091,'=1;',6,'noChangeGlobal=1;',0,1696,'){',6,'Setup.Script("jsMath-old-browsers.js','")}}},Opera',415,'if(',1683,'){',6,27,'="Opera";',460,39,2198,'("Opera 7");',2211,'=0;this.delay=10;this.operaHiddenFix="[Processing]";',752,6,2229,'")}}},Safari',415,604,'appVersion',41,'Safari\\//)){',6,27,'="Safari";',460,39,2198,'("Safari/([0-9]+)");A=(A)?A[1]:400;',734,6,1448,'B++){if(',6,1452,'B]&&',6,'TeX[',6,1452,'B]]){',6,'TeX[',6,1452,'B]].dh=0.1}}',6,'TeX.axis_height+=0.05;',6,'TeX.default_rule_thickness+=0.025;',1870,'=A>=125;this.safariIFRAMEbug=A>=312&&A<412;this.safariButtonBug=A<412;this.safariImgBug',921,1091,'=1',1935,1541,'=1}},',1868,415,604,'product&&',39,'product.match("',1868,'")! ){',6,27,'="',1868,'";',2211,'=0;',1870,'=0;',604,2198,'(/',1868,'\\/(\\d+)\\.(\\d+)/)){if(RegExp.$1<3||(RegExp.$1==3&&RegExp.$2<3)){',1889,921,'valignBug=1;',6,2229,'")}}',6,'Add(',6,49,',{".',57,' .cmr10":"',143,': ',122,', jsMath cmr10, serif'], - ['",".typeset .','cmbx10','":"','font-family: ','jsMath','-',1,', ',4,' ',1,', ',4,'-cmr10, ',4,' cmr10',0,'cmti10":"',3,4,'-cmti10, ',4,' cmti10, ',4,'-cmr10, ',4,' cmr10',0,'cmmi10','":"',3,4,'-',28,', ',4,' ',28,0,'cmsy10','":"',3,4,'-',39,', ',4,' ',39,0,'cmex10','":"',3,4,'-','cmex10, ',4,' ',50,'"});',4,'.Font.testFont','="',4,'-',55,4,' ',50,'"}}};',4,'.Font={testFont:"',4,'-',50,'",fallback:"symbol",register:[],message:"<b>No ',4,' TeX fonts ','found</b> -- using',' image fonts instead','.<br/>\\n"+"','These may be slow and might not print well',80,'Use the ',4,' control panel to get additional information.",','extra_message',':"Extra',77,'not found: <b><span id=\\"jsMath_ExtraFonts\\"></span></b><br/>"+"Using',79,'. This may be slow and might not print well',80,'Use the ',4,85,'print_message',':"To print higher-resolution math symbols, click the<br/>\\n"+"<b>Hi-Res Fonts for Printing</b> button on the ',4,' control panel.<br/>\\n",','alpha_message',':"If the mat! h symbols print as black boxes, turn off <b>image alpha channels</b><br/>\\n"+"using the <B>Options</B> pane of the ',4,99,'Test1',':function(','C',',F,D,E){if(F==null){F=124}if(D==null){D=2}if(E==null){E=""}var B=jsMath.BBoxFor("<span style=\\"font-family: "+E+C+", serif\\">"+jsMath.TeX[C][F].c+"</span>");var A=jsMath.BBoxFor("<span style=\\"font-family: serif\\">"+jsMath.TeX[C][F].c+"</span>");return','(B.w>D*A.w&&B.h!=0)},Test2',105,'C',107,'(A.w>D*B.w&&B.h!=0)},CheckTeX',':function(){var A=',4,'.BBoxFor("<','span style=\\"','font-family: "+',4,61,'+", serif\\">"+',4,'.TeX.',50,'[1','].c+"</span>");',4,'.nofonts=((A.w*3>A.h||A.h==0)&&!this.Test1("cmr10','",null,null,"',4,'-"));if(',4,'.nofonts','&&(',4,'.platform','!="mac"||',4,'.browser!="Mozilla"||!',4,'.Browser.','VersionAtLeast(1.5))){A=',4,'.BBoxFor("<',116,3,55,'serif\\">"+',4,122,50,'[1',125,4,127,'"));if(!',4,132,'){',4,'.Setup.','Script','("',4,'-BaKoMa-fonts.js")}}},Check',113,4,'.Controls','.cookie',';this.Che! ckTeX();if(',4,132,'){if(A.autofont||A','.font=="tex"){','A.fo! nt=this. fallback;if(A.warn){',4,'.nofontMessage=1;A.warn=0;',4,167,'.SetCookie(0);if','(',4,'.window.NoFontMessage','){',4,182,'()}else{','this.Message(this.','message)}}}}else{if(A.autofont){A.font="tex"}if(A',173,'return }}if(',4,'.noImgFonts){','A.font="unicode"}if(A','.font=="unicode','"){',4,160,161,'("',4,'-fallback','-"+',4,135,'+".js");',4,'.Box.TeXnonfallback=',4,'.Box.TeX',';',4,209,'=',4,'.Box.TeXfallback;return }','if(!A.print&&A.printwarn){this.','PrintMessage','((',4,140,'alphaPrintBug&&',4,167,168,'.alpha)?this.',96,'+this.',100,':this.',96,')}if(',4,140,'waitForImages){',4,'.Script.','Push(',4,'.',161,',"WaitForImage",',4,'.blank)}if(A.font=="symbol"){',4,160,161,'("',4,201,'-symbols.js");',4,'.Box.TeXnonfallback=',4,209,';',4,209,'=',4,215,4,'.Img.SetFont','({cmr10',':["all"],',28,264,39,264,50,264,1,264,'cmti10:["all"]});',4,'.Img.LoadFont','("cm-fonts")},Message',105,'A){if(',4,'.Element("','Warning")){','return }var ','B=',4,160,'DIV("Warning','",{});B.innerHTML=! "<center><table><tr><td>"+"<div ','id=\\"jsMath_noFont\\"><div ','class=\\"message\\">"+A','+"<div style=\\"text-align:left\\"><',116,'float:left; ','margin: 8px ','0px 0px 20px\\">"+"<span onclick=\\"',4,167,'.Panel()\\" ','title=\\" Open ','the ',4,' Control Panel',' \\" class=\\"link\\">',4,301,'</span>"+"</span','><',116,293,'20px 0px 0px; float:right\\">"+"<span onclick=\\"',4,'.Font.','HideMessage','()\\" title=\\" Remove this font warning message',302,'Hide this Message',305,'></div><div style=\\"height:6px\\"></div><br clear=\\"all\\"/></div></','div>"+"<div style=\\"width:22em; height:1px\\"></div>"+"</td></tr></table></center><hr/>"},',312,113,4,280,'Warning");if(A','){A.style.display="none"}},',217,105,278,4,280,'PrintWarning','")){',282,'B=',4,160,'DIV("',330,287,289,'+"</',318,'Register',105,'H,B){if(typeof (H)=="string"){H={name:H}}if(!',4,160,'inited&&!B){','this.register','[',348,'.length]=H;',282,'I=H.name;var A=I.replace(/10$/,"");var F=',4,122,'fam.length! ;if(H.prefix==null){H.prefix=""}if(!H.style){H.style="',117,'H! .prefix+ I+", serif"}if(!H.styles){H.styles={}}if(!H.macros){H.macros={}}',4,122,'fam[F]=I;',4,122,'famName[I]=F;H.macros[A]=["HandleFont",F];',4,'.Add(',4,'.Parser.prototype.macros,H.macros);H.styles[".typeset ."+I]=H.style;',4,160,'Styles(H.styles);if(',4,'.initialized){',4,236,'Push(',4,'.Setup,"TeXfont",I)}var C=',4,167,168,';var E=!',4,132,'&&H.test(I,H.testChar,H.testFactor,H.prefix);if(E&&C',173,'if(H.tex){H.tex(I,F,H)}return }if(!E&&C.warn&&C.font=="tex"&&!',4,132,'){if(!C.fonts.match("/"+I+"/")){C.fonts+=I+"/";',4,167,179,'(!',4,280,281,187,86,')}var G=',4,280,'ExtraFonts");if(G){if(G','.innerHTML','!=""){G',404,'+=","}G',404,'+=" "+H.prefix+I}}}if(C',194,'"||',4,192,'if(H.fallback){H.fallback(I,F,H)}',282,'D={};D[I]=["all"];',4,262,'(D);',4,275,'(I);if(',4,'.initialized){',4,236,'Push(',4,'.Img,"Scale");',4,236,'Push(',4,'.Img,"UpdateFonts")}},LoadRegistered',113,'0;while(A<',348,'.length){this.Register(',348,'[A++],1)}',348,'=[]},Load',105,'A){',4,160,161,'(this.URL(A))},U! RL',105,'A){','return ',4,'.Img.root+A+"/def.js"}};',4,167,'={cookie:{scale:100,font:"tex",autofont:1,scaleImg:0,alpha:1,warn:1,fonts:"/",printwarn:1,stayhires:0,button:1,progress:1,asynch:0,blank:0,print:0,keep:"0D",global:"auto",hiddenGlobal:1},cookiePath:"/",','noCookiePattern',':/^(file|mk):$/,Init',':function(){','this.panel=',4,160,'DIV("panel",{display:"none"});if(!',4,140,'msieButtonBug){this.Button',186,'setTimeout("',4,167,'.Button()",500)}},Panel',459,4,'.Translate.Cancel();if(this.loaded){this.Main',186,4,236,'delayedLoad(',4,'.root+"',4,'-controls.html")}},Button',113,4,160,'DIV("button",{});A.title=" Open ',4,301,' ";A',404,'="<span onclick=\\"',4,167,'.Panel()\\">',4,'</span>";if(!',4,'.Global.','isLocal&&!',4,'.noShowGlobal){A',404,'+="<span id=\\"jsMath_global\\" ',298,4,' Global Panel \\" "+"onclick=\\"',4,498,'Show(1)\\">Global </span>"}if(A.offsetWidth<30){A.style.width="auto"}if(!','this.cookie','.button',324,'MoveButton',459,'var C=',4,167,';if(!C! .button){C.button=',4,280,'button")}if(C.button','){C.MoveElem! ent(C.', 'button,3,2)}var B=20;var A=20;if(C.button){A=C.button.offsetHeight+6;B=A+5}if(C.panel',522,'panel,B,A)}},MoveElement',105,'D,C,B){if(',4,140,'IE7){var A=document.body;D.style.right','="auto";D.style.','bottom',531,'left=A.clientWidth+A.scrollLeft-D.offsetWidth-C+"px";D.style.top=A.clientHeight+A.scrollTop-D.offsetHeight-B+"px"}else{','D.style.visibility="','hidden";',535,'visible"}},GetCookie',459,'if(','this.defaults','==null){',541,'={}}',4,366,541,',',510,');this.userSet={};var C=',4,'.document.cookie',';if(',4,'.window.location','.protocol.match(this.',457,')){C=this.','localGetCookie','();','this.isLocalCookie','=1}if(C.match(/',4,'=([^;]+)/)){var D=unescape(RegExp.$1).split(/,/);for(var B=0;B<D.length;B++){var A=D[B].match(/(.*):(.*)/);if(A[2].match(/^\\d+$/)){A[2]=1*A[2]}',510,'[A[1]]=A[2];this.userSet[A[1]]=1}}},',559,459,451,4,555,'.search.substr(1)},SetCookie',105,'F){var B=[];for(var E in ',510,'){if(',541,'[E]==null||',510,'[E]!=',541,'[E]){B[B.length]=E+":"+',5! 10,'[E]}}B=B.join(",");if(',561,'){if(F==2){return"',4,'="+escape(B)}','this.','localSetCookie','(B,F)}else{B=escape(B);if(B==""){F=0}if(','this.cookiePath','){B+="; path="+',592,'}if(','this.cookieDomain','){B+="; domain="+',596,'}if(',510,'.keep!="0D"){var A={D',':1000*60*60*24',',W',602,'*7,M',602,'*30,Y',602,'*365};var D=new Date;D.setTime(D.getTime()+',510,'.keep.substr(','0,1)*A[',510,611,'1,1)]);B+="; expires="+D.toGMTString()}if(B!=""){',4,552,'="',4,'="+B;var C=',4,552,';if(F&&!C.match(/',4,'=/)){alert("Cookies must be enabled in order to save ',4,' options")}}}',451,'null},',590,105,'B,C){if(!C){',282,'A=String(',4,555,').replace(/\\?.*/,"");if(B!=""){A+="?',4,588,'if(A!=',4,555,'.href){this.Reload(A)}},Reload',105,'A){if(!this.loaded){return }this.loaded=0;',4,160,'inited=-100;',4,498,'ClearCache();if(A){',4,555,'.replace(A)}else{',4,555,'.reload()}}};',4,'.Click={CheckClick',105,'A){if(!A){A=',4,'.window.event}if','(A.altKey){',4,167,'.Panel()}},CheckDblClick',1! 05,'B){if(!B){B=',4,663,'(!',4,'.Click.DblClick){',4,'.Extensi! on.Requi re("double-click",1);var A=B;B={};for(var C in A){B[C]=A[C]}}',4,236,'Push(',4,'.Click,"DblClick",[B,this.alt])}};',4,'.TeX={thinmuskip:3/18,medmuskip:4/18,thickmuskip:5/18,x_height:0.430554,quad:1,num1:0.676508,num2:0.393732,num3:0.44373,denom1:0.685951,denom2:0.344841,sup1:0.412892,sup2:0.362892,sup3:0.288888,sub1:0.15,sub2:0.247217,sup_drop:0.386108,sub_drop:0.05,delim1:2.39,delim2:1,axis_height:0.25,default_rule_thickness:0.06,big_op_spacing1:0.111111,big_op_spacing2:0.166666,big_op_spacing3:0.2,big_op_spacing4:0.6,big_op_spacing5:0.1,integer:6553.6,scriptspace:0.05,nulldelimiterspace:0.12,delimiterfactor:901,delimitershortfall:0.5,scale:1,atom:["ord","op","bin","rel","open","close","punct","ord"],fam:["cmr10","',28,'","',39,'","',50,'","cmti10","","',1,'",""],famName:{cmr10:0,',28,':1,',39,':2,',50,':3,cmti10:4,',1,':6},encoding:["À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï! ","°","Ñ","Ò","Ó","Ô","Õ","Ö","·","Ø","Ù","Ú","Û","Ü","µ","¶","ß","ï","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","ÿ"],cmr10:[[0.625',',0.683],[0.','833',700,'778',700,'694',700,'667',700,'75',700,'722',700,'778',700,'722',700,'778',700,'722',700,'583',',0.694,0,{ic:0.0778,krn:{"39":0.0778,"63":0.0778,"33":0.0778,"41":0.0778,"93":0.0778},lig:{"105":','14,"108":15}}],[0.556',',0.694],[0.','556',724,'833',724,'833',724,'278',',0.431],[0.','306',',0.431,0.194],[0.','5',724,'5',724,'5,0.628],[0.5',724,'5,0.568],[0.75',724,'444,0,! 0.17],[0.5',724,'722',732,'778',732,'5,0.528,0.0972],[0.903,0.! 683],[1. 01',700,'778,0.732,0.0486],[0.278',',0.431,0,{','krn:{"108":-0.278,"76":-0.319}}],[0.278',',0.694,0,{','lig:{"96":','60}}],[0.5',724,'833',',0.694,0.194],[','0.5',',0.75,0.0556],[0.','833',761,'778',724,'278',754,'krn:{"63":0.111,"33":0.111},lig:{"39":34}}],[0.389',',0.75,0.25],[0.','389',769,'5,0.75],[','0.778,0.583,0.0833],[','0.278,0.106',',0.194],[0.','333',752,'lig:{"45":','123}}],[',774,'],[0.5',769,'5,0.644','],[0.5,0.644],[0.5,0.','644',784,'644',784,'644',784,'644],[0.5,0.644],[0.278',732,'278',734,'278,0.5',775,'778',',0.367,-0.133],[','0.472,0.5',775,'472',754,755,'62}}],[0.778',724,'75',',0.683,0,{krn:{"','116','":-0.0278,"','67',809,'79',809,'71',809,'85',809,'81',809,'84":-0.0833,"89":-0.0833,"86":-0.111,"87":-0.111}}],[0.','708',700,'722',700,'764',807,'88',809,'87',809,'65',809,'86',809,'89":-','0.0278}}],[0.','681',700,'653',',0.683,0,{','krn:{"111":-0.0833,"101":-0.0833,"117":-0.0833,"114":-0.0833,"97":-0.0833,"65":-0.111,"79":-0.0278,"67":-0.0278,"71":-0.0! 278,"81":-0.0278}}],[','0.785',700,'75',700,'361',807,'73":',836,'514',700,'778',807,'79',809,'67',809,'71',809,'81":-',836,'625',807,820,'917',700,'75',700,'778',807,'88',809,'87',809,'65',809,'86',809,'89":-',836,'681',807,'65','":-0.0833,"','111',809,'101',809,'97',809,'46',884,'44":-0.','0833}}],[0.','778,0.683',775,'736',807,'116',809,'67',809,'79',809,'71',809,'85',809,'81',809,820,'556',700,'722',807,'121',809,'101',884,'111',884,'114',884,'97',884,'65',884,'117":-0.',894,'75',700,'75',',0.683,0,{ic:0.','0139,',841,'1.03',933,'0139,',841,'0.75',807,'79',809,'67',809,'71',809,'81":-',836,'75',933,'025,krn:{"101',884,'111',884,'114',884,'97',884,'65',884,928,894,'611',700,'278',769,'5',724,'278',769,'5',724,'278,0.668],[0.','278',754,755,'92}}],[0.5',752,'krn:{"118',809,'106":0.0556,"121',809,'119":-',836,'556,0.','694,0',',{krn:{"101":0.0278,"111":0.0278,"120":-0.0278,"100":0.0278,"99":0.0278,"113":0.0278,"118":-0.0278,"106":0.0556,"121":-0.0278,"119":-0.0278}}],[0.',! '444',752,'krn:{"104',809,'107":-',836,'556',724,'444',732,'30! 6',722,' 12,"102":11,"108":13}}],[0.5',',0.431,0.194,{','ic:0.','0139,krn:{"','106":',836,'556',754,'krn:{"116',809,'117',809,'98',809,'121',809,'118',809,'119":-',836,974,'306,0.668',775,'528',754,'krn:{"97','":-0.0556,"','101',809,'97',809,'111',809,'99":-',836,'278',724,'833',752,'krn:{"116',809,'117',809,'98',809,'121',809,'118',809,'119":-',836,'556',752,'krn:{"116',809,'117',809,'98',809,'121',809,'118',809,'119":-',836,'5,0.431,0',988,986,'431,0.194',988,'528',734,'392',732,'394',732,'389,0.615,0,{krn:{"121',809,'119":-',836,'556',752,'krn:{"119":-',836,'528',',0.431,0,{ic:0.',1004,'97',1027,'101',809,'97',809,'111',809,'99":-',836,'722',1086,1004,'101',809,'97',809,'111',809,'99":-',836,'528',732,'528',1002,'ic:0.',1004,'111',809,'101',809,'97',809,'46',884,'44":-0.',894,'444',732,'5',1086,'0278,',778,'124}}],[1',1086,'0278}],[0.','5',724,'5,0.668],[0.5,0.668]],',28,':[[0.615',933,'139',',krn:{"61":-0.0556,"59":-0.111,"58":-0.111,"127":0.',894,'833',807,'127":0.167}}],[0.','7! 63',933,1129,'krn:{"127":0.0833}}],[0.','694',807,1145,'742',933,'0757,',1149,'831',933,'0812,krn:{"61',1027,'59":-0.0556,"58":-0.0556,"127":0.','0556}}],[0.','78',933,'0576,',1149,'583',933,'139',1141,1162,'667',840,1149,'612',933,'11,krn:{"61',1027,1161,1162,'772',933,'0502,',1149,'64',1086,'0037,','krn:{"127":',836,'566',',0.694,0.194,{ic:0.','0528,',1149,'518',1002,'ic:0.0556','}],[0.444',754,'ic:0.0378,krn:{"',1161,1162,'406',752,'krn:{"127":0.0556}}],[0.','438',1191,'0738,',1149,'497',1002,'ic:0.0359',',',1204,'469',754,'ic:0.',1129,1149,'354',752,1204,'576',732,'583',724,'603',1002,1188,836,'494',1086,'0637,krn:{"',1161,'0278}}],[0.','438',1191,'046,',1188,'0.111}}],[0.','57',1086,'0359}],[0.','517',1002,1149,'571',1086,'0359,krn:{"59',1027,'58":-0.',1162,'437',1086,'113,krn:{"',1161,1234,'54',1086,'0359,',1188,836,'596,0.694,0.194,{',1149,'626',1002,1204,'651',1191,'0359,',1188,1239,'622',1086,1242,'466',752,1149,'591',754,1149,'828',1086,1133,'517',1002,1149,'363,0! .431,0.0972,{ic:0.0799,',1149,'654',1002,1188,'0.0833}}],[1',7! 98,'1',7 98,'1',798,'1',798,'0.278',',0.464,-0.0363],[','0.278',1301,'0.5,0.465,-0.0347],[',1304,'0.5',732,'5',732,'5',732,'5',734,'5',734,'5,0.',1069,784,1069,784,'431',775,'278,0.106],[',774,775,'778',',0.539,0.0391],[','0.5,0.75,0.25,{krn:{"1',1027,'65',1027,'77',1027,'78',1027,'89":0.0556,"90":-0.',1162,'778',1327,1304,'0.531',754,1196,',',1149,'75',807,'127":','0.','139}}],[0.','759',933,'0502,',1149,'715',933,'0715,krn:{"61',809,1161,894,'828',933,1129,1204,'738',933,'0576,',1149,'643',933,'139',1141,894,'786',840,1149,'831',933,'0812,krn:{"61',1027,1161,1162,'44',933,'0785,',1188,1239,'555',933,'0962',1141,'167}}],[0.','849',933,'0715,krn:{"61',1027,1161,1162,'681',807,1348,836,'97',933,'109,krn:{"','61',1027,1161,894,'803',933,1405,'61',884,'61',809,1161,894,'763',933,1129,1149,'642',933,'139',1141,894,'791,0.683,0.194,{',1149,'759',933,'00773,',1149,'613',933,'0576,krn:{"61',1027,1161,894,'584',933,'139,krn:{"61',809,1161,894,'683',933,1405,'59":-0.111,"',1250,'111,"61',1027! ,1348,836,'583',933,'222',',krn:{"59":-0.167,"58":-0.167,"61":-0.111}}],[0.','944',933,'139',1458,'828',933,'0785,krn:{"61',884,'61',809,1161,894,'581',933,'222',1458,'683',933,'0715,krn:{"61',1027,1161,894,'389,0.75],[0.389',759,'0.389',759,'1,0.358,-0.142],[',1485,'0.417',754,1188,1239,'529',732,'429',724,'433',752,1204,'52',754,'krn:{"89":0.0556,"90',1027,'106":-0.111,"102":-0.167,"',1145,'466',752,1204,'49',1191,'108,krn:{"',1161,1392,'477',1002,1211,',',1188,836,'576',754,'krn:{"127":-',836,'345,0.66],[0.412,0.66,0.194,{ic:0.0572,krn:{"59',1027,1250,1162,'521',754,'ic:0.0315}],[0.298',754,'ic:0.0197,',1149,'878',732,'6',732,'485',752,1204,'503',1002,1149,'446',1002,1211,',',1149,'451',1086,1129,'krn:{"',1161,1162,'469',752,1204,'361,0.615,0,{',1149,'572',752,1188,836,'485',1086,'0359,',1188,836,'716',1086,'0269,',1149,'572',752,1188,836,'49',1002,1211,',',1204,'465',1086,'044,',1204,'322',752,1188,836,'384',1002,1149,'636',1002,1188,1239,'5,0.714,0,{ic:0.154}],[0.278',! 754,'ic:0.399}]],',39,':[[',773,'0.278,0.444,-0.0556],[',773,1! 304,773, '0.5,0.444,-0.0556],[',773,773,773,773,773,773,773,'1',759,1605,1605,'0.778',1301,'0.778,0.464,-0.0363','],[0.778,0.636,0.136',1620,1620,1620,1620,1620,'],[0.778',798,'0.778,0.483,-0.0169],[0.778',1327,'0.778',1327,'1',1327,'1',1327,'0.778',1327,'0.778',1327,'1',798,'1',798,'0.5',759,'0.5',759,'1',798,'1',759,'1',759,'0.778',1301,'1',798,'1',798,'0.611',759,'0.611',759,'1',798,'1',759,'1',759,'0.778',732,'275,0.556],[1',732,'667',1327,'0.667',1327,'0.889',759,'0.889',759,'0',759,'0',798,'0.556',724,'556',724,'667',732,'5',761,'722',724,'722',724,'778',724,'778',724,'611',724,'798',807,'48":0.','194}}],[0.657',933,'0304',',krn:{"48":0.',1350,'527',933,'0583',1710,1350,'771',933,'0278',1710,894,'528',933,'0894',1710,'111}}],[0.','719',933,'0993',1710,1726,'595',',0.683,0.0972,{ic:0.','0593',1710,1726,'845',933,'00965',1710,1726,'545',933,'0738,krn:{"48":',836,'678',1733,'185',1710,1392,'762',933,'0144',1710,1162,'69',807,1706,'139}}],[1.2',807,1706,1350,'82',933,'147',1710,894! ,'796',933,1719,1710,1726,'696',933,'0822',1710,894,'817,0.683,0.0972,{krn:{"48":',1239,'848',807,1706,894,'606',933,'075',1710,1350,'545',933,'254,krn:{"48":',836,'626',933,'0993',1710,894,'613',933,'0822,krn:{"48":',836,'988',933,'0822',1710,894,'713',933,'146',1710,1350,'668',1733,'0822',1710,894,'725',933,'0794',1710,1350,'667,0.556],[0.',1822,1822,1822,1822,'611',724,'611',724,'444',769,'444',769,'444',769,'444',769,'5',769,'5',769,'389',769,'389',769,'278',769,'5',769,'5',769,'611',769,'5',769,'278',759,'0.833,0.04,0.96],[0.75',700,'833',700,'417',1191,'111}],[0.',1822,'667,0.556',1620,1620,'],[0.444',759,'0.444',759,'0.444',759,'0.611',759,'0.778,0.694,0.13','],[',1878,'],[',1878,'],[',1878,']],',50,':[[0.458',',0.04,1.16,{n:','16}],[0.458',1888,'17}],[0.417',1888,'104}],[0.417',1888,'105','}],[0.472,0.04,1.16,{n:','106',1896,'107',1896,'108',1896,'109}],[0.583',1888,'110}],[0.583',1888,'111',1896,'68',1896,'69}],[0.333',',0,0.6,{delim:{rep:','12}}],[0.556',1912,'13}! }],[0.578',1888,'46}],[0.578',1888,'47}],[0.597',',0.04,1.76,{! n:','18} ],[0.597',1920,'19}],[0.736',',0.04,2.36,{n:','32}],[0.736',1924,'33}],[0.528',1924,'34}],[0.528',1924,'35}],[0.583',1924,'36}],[0.583',1924,'37}],[0.583',1924,'38}],[0.583',1924,'39}],[0.75',1924,'40}],[0.75',1924,'41}],[0.75',1924,'42}],[0.75',1924,'43}],[1.04',1924,'44}],[1.04',1924,'45}],[0.792',',0.04,2.96,{n:','48}],[0.792',1952,'49}],[0.583',1952,'50}],[0.583',1952,'51}],[0.639',1952,'52}],[0.639',1952,'53}],[0.639',1952,'54}],[0.639',1952,'55}],[0.806',1952,'56}],[0.806',1952,'57}],[0.806',',0.04,2.96],[','0.806',1972,'1.28',1972,'1.28',1972,'0.811',1920,'30}],[0.811',1920,'31}],[0.875',',0.04,1.76,{delim:{top:','48,bot:64,rep:66}}],[0.875',1984,'49,bot:65,rep:67}}],[0.667',1984,'50,bot:52,rep:54}}],[0.667',1984,'51,bot:53,rep:55','}}],[0.667,0.04,1.76,{delim:{bot:','52,rep:54',1992,'53,rep:55','}}],[0.667,0,0.6,{delim:{top:','50,rep:54',1996,'51,rep:55','}}],[0.889,0,0.9,{delim:{top:','56,mid:60,bot:58,rep:62',2000,'57,mid:61,bot:59,rep:62',2000,'56,bot:58,rep:62',2! 000,'57,bot:59,rep:62','}}],[0.889,0,1.8,{delim:{rep:','63',2008,'119}}],[0.889,0,0.3,{delim:{rep:62',1996,'120,bot:121,rep:63}}],[0.875',1984,'56,bot:59,rep:62}}],[0.875',1984,'57,bot:58,rep:62}}],[0.875',1912,'66}}],[0.875',1912,'67}}],[0.611',1920,'28}],[0.611',1920,'29','}],[0.833,0,1,{n:','71}],[1.11',',0.1,1.5],[','0.472,0,1.11,{ic:0.194,n:','73}],[','0.556,0,2.22,{ic:0.444}],[1.11,0',',1,{n:75}],[1.51,0','.1,1.5],[1.11,0',',1,{n:77}],[1.51,0',2033,',1,{n:79}],[1.51',2028,'1.06,0,1,{n:88}],[0.944,0,1,{n:89}],[',2029,'90',2026,'91',2026,'92',2026,'93',2026,'94',2026,'95}],[1.44',2028,'1.28',2028,2031,2033,2033,2033,2033,'.1,1.5],[0.944,0,1,{n:97}],[1.28',2028,'0.556,0.722,0,{n:','99','}],[1,0.75,0,{n:','100}],[1.44,0.75],[',2061,'102',2063,'103}],[1.44,0.75],[0.472',1920,'20}],[0.472',1920,'21}],[0.528',1920,'22}],[0.528',1920,'23}],[0.528',1920,'24}],[0.528',1920,'25}],[0.667',1920,'26}],[0.667',1920,'27}],[1',1888,'113}],[1',1920,'114}],[1',1924,'115}],[1',1952,'116}! ],[1.06,0,1.8,{delim:{top:118,b'], - ['ot:116,rep:117}}],[1.06,0,0.6],[1.06,0.04,0.56],[0.778',',0,0.6,{delim:{','top:126,','bot:127,rep:119','}}],[0.','667',1,'top:120,rep:63',4,'667',1,'bot:121,rep:63',4,'45,0.12],[0.',13,13,13,'778',1,2,'rep:119',4,'778',1,3,'}}]],cmti10:[[0.627',',0.683,0,{ic:0.','133}],[0.818,0.683],[0.767',26,'094}],[0.','692,0.683],[0.664',26,'153}],[0.743',26,'164}],[0.','716',26,'12}],[0.','767',26,'111}],[0.716',26,'0599}],[0.767',26,'111}],[0.716',26,'103}],[0.','613',',0.694',',0.194,{ic:0.','212,krn:{"39":0.104,"63":0.104,"33":0.104,"41":0.104,"93":0.104},lig:{"105":','14,"108":15',4,'562',48,49,46,'588',48,49,46,'882',48,49,46,'894',48,49,46,'307',',0.431,0,{ic:0.','0767}],[0.','332,0.431',49,'0374}],[0.511',',0.694],[0.','511',',0.694,0,{ic:0.','0969','}],[0.511,0.','628',',0,{ic:0.','083}],[0.511',77,'108',79,'562',81,46,'831',75,'46,0,0.17],[0.537',48,49,'105}],[0.','716',70,'0751','}],[0.716',70,97,79,'528,0.0972,{ic:0.0919}],[0.883',26,37,'985',26,37,'767,0.732,0.0486,{ic:! 0.',29,'256,0.431,0,{krn:{"108":-0.256,"76":-0.321',4,'307',77,'124,lig:{"96":','60',4,'514',77,'0696}],[0.818',48,49,'0662}],[0.769',75,'818',',0.75,0.0556',',{ic:0.136}],[0.','767',77,'0969}],[0.307',77,'124',',krn:{"','63":0.102,"33":0.102},lig:{"39":34',4,'409',',0.75,0.25,{ic:0.','162}],[0.409',136,'0369',79,'75',81,'149}],[0.767,0.562,0.0567,{ic:0.0369','}],[0.307,0.','106',',0.194],[0.','358',70,'0283,lig:{"45":123',4,'307,0.106],[0.511',136,'162',79,'644,0',',{ic:0.136}],[0.511,0.644,0',156,156,156,'.194',156,156,156,160,156,156,126,'307',70,'0582',144,'431',49,'0582',144,'5',49,'0756}],[0.767,0.367,-0.133,{ic:0.0662',79,'5',146,'511',77,'122,lig:{"96":62',4,'767',77,'096}],[0.743,0.683,0,{','krn:{"110":-0.0256,"108":-0.0256,"114":-0.0256,"117":-0.0256,"109":-0.0256,"116":-0.0256,"105":-0.0256,"67":-0.0256,"79":-0.0256,"71":-0.0256,"104":-0.0256,"98":-0.0256,"85":-0.0256,"107":-0.0256,"118":-0.0256,"119":-0.0256,"81":-','0.0256,"84','":-0.0767,"','89',191,'86','":-0! .102,"','87',195,'101":-0.0511,"97":-0.0511,"111":-0.0511,"100! ":-0.051 1,"99":-0.0511,"103":-0.0511,"113":-0.0511}}],[0.','704',26,46,'716',26,'145}],[0.','755',26,'094',132,'88','":-0.0256,"','87',210,'65',210,'86',210,'89','":-0.0256',4,'678',26,37,'653',26,'133',132,'111',191,'101',191,'117','":-0.0767,"114":-0.0767,"97":-0.0767,"','65',195,'79":-0.0256,"67":-0.0256,"71":-0.0256,"81":-0.0256}}],[0.','774',26,'0872}],[0.743',26,34,'386',26,'158}],[0.525',26,'14}],[0.769',26,'145',132,235,'627,0.683,0,{krn:{"84',191,'89',191,'86',195,'87',195,198,'897',26,34,'743',26,34,'767',26,'094',132,'88',210,'87',210,'65',210,'86',210,'89',218,4,'678',26,'103',132,'65":-0.0767}}],[0.','767,0.683',49,29,'729',26,'0387,',189,'0.0256,"84',191,'89',191,'86',195,'87',195,198,'562',26,37,'716',26,'133',132,'121',191,'101',191,'111',232,'117',191,284,'743',26,34,'743',26,'184',132,'111',191,'101',191,'117',232,'65',195,235,'999',26,'184',132,284,'743',26,'158',132,235,'743',26,'194',132,'101',191,'111',232,'117',191,284,'613',26,204,'307',136,'188}],[0.514',77,! '169}],[0.307',136,94,'511',77,'0665',144,'668',81,'118}],[0.307',77,114,'92',4,'511',70,71,'46',77,'0631',132,198,'46',70,'0565',132,198,'511',77,'103',',krn:{"108":0.0511}}],[0.','46',70,97,132,198,'307',48,49,50,'12,"102":11,"108":13}}],[0.','46,0.431',49,'0885}],[0.','511',77,71,'307,0.655',81,'102',144,'655',49,204,'46',77,'108}],[0.','256',77,'103',391,'818',70,71,'562',70,'0767',132,'39":-0.102',4,'511',70,'0631',132,198,'511,0.431',49,'0631',132,198,'46,0.431',49,404,'422',70,'108',132,198,'409',70,'0821}],[0.332,0.615',81,'0949}],[0.537',70,71,'46',70,417,'664',70,'108',391,'464',70,37,'486,0.431',49,404,'409',70,'123}],[0.511',70,'0921',',lig:{"45":124}}],[1.','02',70,'0921}],[0.511',77,'122',79,'668',81,'116',79,'668',81,'105}]],cmbx10:[[0.692',',0.686],[0.','958',488,'894',488,'806',488,'767',488,'9',488,'831',488,'894',488,'831',488,'894',488,'831',488,'671',77,'109,krn:{"39":0.109,"63":0.109,"33":0.109,"41":0.109,"93":0.109},lig:{"105":','14,"108":15',4,'639',! 75,'639',75,'958',75,'958',75,'319',',0.444],[0.','351,0.444',! 146,'575 ',75,'575',75,'575,0.','632],[0.575',75,530,'596],[0.869',75,'511,0,0.17],[0.597',75,'831',523,'894',523,530,'542,0.0972],[1.04,0.686],[1.17',488,'894,0.735,0.0486],[0.319',',0.444,0,{krn:{"','108":-0.319,"76":-0.378',4,'35',',0.694,0,{lig:{"96":','60',4,'603',75,'958',48,146,'575',125,'],[0.958',125,'],[0.894',75,'319',',0.694,0,{krn:{"','63":0.128,"33":0.128},lig:{"39":34',4,'447',',0.75,0.25],[0.','447',569,530,'75],[0.894,0.633,0.133],[0.','319,0.156',146,'383,0.444,0,{lig:{"45":123',4,574,'],[0.575',569,530,'644],[','0.575,0.644],[0.575,0.644],[',583,583,583,'0.',530,'644],[0.319',523,'319,0.444',146,'35,0.5',146,'894,0.391,-0.109],[0.543,0.5',146,'543',550,'62',4,'894',75,'869',',0.686,0,{krn:{"','116','":-0.0319,"','67',606,'79',606,'71',606,'85',606,'81',606,'84":-0.0958,"89":-0.0958,"86":-0.128,"87":-0.128}}],[','0.818',488,'831',488,'882',604,'88',606,'87',606,'65',606,'86',606,'89','":-0.0319}}],[0.','756',488,'724,0.686,0,{','krn:{"111":-0.0958,"101":-0.0958,"117! ":-0.0958,"114":-0.0958,"97":-0.0958,"65":-0.128,"79":-0.0319,"67":-0.0319,"71":-0.0319,"81":-0.0319}}],[','0.904',488,'9',488,'436',604,'73":0.0319',4,'594',488,'901',604,'79',606,'67',606,'71',606,'81',633,'692',604,617,'1.09',488,'9',488,'864',604,'88',606,'87',606,'65',606,'86',606,'89',633,'786',604,'65":-0.0958,"111',606,'101',606,'97',606,'46":-0.0958,"44":-0.0958}}],[0.','864,0.686',146,'862',604,'116',606,'67',606,'79',606,'71',606,'85',606,'81',606,617,'0.639',488,'8',604,'121',606,'101":-0.0958,"111":-0.0958,"114":-0.0958,"97":-0.0958,"65":-0.0958,"117":-0.0958}}],[0.','885',488,'869,0.686',81,'016,',637,'1.19,0.686',81,'016,',637,'0.869',604,'79',606,'67',606,'71',606,'81',633,'869,0.686',81,'0287',132,709,'703',488,'319',569,'603',75,'319',569,'575',75,'319',75,'319',550,'92',4,'559',546,'118',606,'106":0.0639,"121',606,'119',633,'639',48,',0',',{krn:{"101":0.0319,"111":0.0319,"120":-0.0319,"100":0.0319,"99":0.0319,"113":0.0319,"118":-0.0319,"106":0.0639,"121":! -0.0319,"119":-0.0319}}],[0.','511',546,'104',606,'107',633,'6! 39',75,' 527',523,'351',77,511,401,530,'444',49,'016',132,'106":0.0319',4,'639',565,'116',606,'117',606,'98',606,'121',606,'118',606,'119',633,'319',75,'351',48,146,'607',565,'97":-0.0639,"101',606,'97',606,'111',606,'99',633,'319',75,'958',546,'116',606,'117',606,'98',606,'121',606,'118',606,'119',633,'639',546,'116',606,'117',606,'98',606,'121',606,'118',606,'119',633,530,'444,0',762,'639,0.444,0',160,762,'607,0.444',146,'474',523,'454',523,'447,0.635,0,{krn:{"121',606,'119',633,'639',546,'119',633,849,81,'016',132,'97":-0.0639,"101',606,'97',606,'111',606,'99',633,'831,0.444',81,'016',132,'101',606,'97',606,'111',606,'99',633,'607',523,849,49,'016',132,'111',606,'101',606,'97',606,685,'511',523,530,'444',81,'0319',474,'15,0.444',81,'0319}],[0.575',75,'575',75,'575',48,']]};','jsMath.Img','={fonts:[50,60,70,85,100,120,144,173,207,249,298,358,430],w:{"50":6.9,"60":8.3,"70":9.7,"85":11.8,"100":13.9,"120":16.7,"144":20,"173":24,"207":28.8,"249":34.6,"298":41.4,"358":49.8,"430":59.8},b! est:4,update:{},factor:1,loaded:0,SetFont',':function(','B){for(var A in B){if(!','this.update[A',']){',920,']=[]}',920,']=',920,'].concat(B[A])}},AddFont',918,'A,B){if(!',916,'[A]){',916,'[A]={}}jsMath.Add(',916,'[A],B)},UpdateFonts',':function(){','var D=this.update;','if(!this.loaded){','return }for(var A in D){for(var B=0;B<D[A].length;B++){var C=D[A][B];if(C=="all"){for(C in ','jsMath.TeX[','A]){',940,'A][C].img','={}}}else{',940,943,'={}}}}this.update={}},BestSize',936,'var B=jsMath.em*this.factor;var A=','this.w[this.fonts[','0]];for(var C=1;C<this.fonts.length;C++){if(B<(',950,'C]]+2*A)/3){return C-1}A=',950,'C]]}return C-1},Scale',936,938,'return }this.best=this.BestSize();this.em=',916,'.w[this.fonts[this.best]];','this.scale','=(jsMath.em/this.em);','if(Math.abs(',961,'-1)<0.12){',961,'=1}},URL',918,'A,B,E){var D=(','jsMath.Controls.cookie.','alpha)?"/alpha/":"/plain/";','if(E==null','){E="def.js"}else{E="char"+E+".png"}if(B!=""){B+="/"}','return this.','root+A+D! +B+E},LoadFont',918,'A){',938,'this.Init()}jsMath.Setup.Script! (this.UR L(A,""))},Init',936,'if(',970,'print||',970,'stayhires','){',970,'print=',970,985,';this.factor*=3;if(!','jsMath.Controls.','isLocalCookie||!jsMath.Global.isLocal){',992,'SetCookie(0)}if(','jsMath.Browser.','alphaPrintBug){',970,'alpha=0}}var B="0123456789ABCDEF";this.HexCode=[];for(var C=0;C<128;C++){var D=Math.floor(C/16);var A=C-16*D;this.HexCode[C]=B.charAt(D)+B.charAt(A)}this.loaded=1}};jsMath.HTML={Em',918,'A){var C=','5;if(A<0){C++}',963,'A)<0.000001){A=0}v... [truncated message content] |
From: Mike G. v. a. <we...@ma...> - 2008-03-26 02:56:59
|
Log Message: ----------- Fixed bug in base64Q subroutine Modified Files: -------------- pg/macros: AppletObjects.pl PG.pl PGbasicmacros.pl Revision Data ------------- Index: AppletObjects.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.5 -r1.6 --- macros/AppletObjects.pl +++ macros/AppletObjects.pl @@ -52,7 +52,7 @@ function base64Q(str) { - return !str.match(/<XML/i && !str.match(/<?xml/i)); + return ( !str.match(/<XML/i) && !str.match(/<?xml/i)); } function submitAction() { Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.49 retrieving revision 1.50 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.49 -r1.50 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -306,6 +306,41 @@ ); } +sub NAMED_HIDDEN_ANS_RULE { # this is used to hold information being passed into and out of applets + # -- preserves state -- identical to NAMED_ANS_RULE except input type "hidden" + my($name,$col) = @_; + my $answer_value = ''; + $answer_value = ${$inputs_ref}{$name} if defined(${$inputs_ref}{$name}); + if ($answer_value =~ /\0/ ) { + my @answers = split("\0", $answer_value); + $answer_value = shift(@answers); # use up the first answer + $rh_sticky_answers->{$name}=\@answers; + # store the rest -- beacuse this stores to a main:; variable + # it must be evaluated at run time + $answer_value= '' unless defined($answer_value); + } elsif (ref($answer_value) eq 'ARRAY') { + my @answers = @{ $answer_value}; + $answer_value = shift(@answers); # use up the first answer + $rh_sticky_answers->{$name}=\@answers; + # store the rest -- beacuse this stores to a main:; variable + # it must be evaluated at run time + $answer_value= '' unless defined($answer_value); + } + + $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3 + $answer_value =~ s/\s+/ /g; ## remove excessive whitespace from student answer + $name = RECORD_ANS_NAME($name); + + my $tcol = $col/2 > 3 ? $col/2 : 3; ## get max + $tcol = $tcol < 40 ? $tcol : 40; ## get min + + MODES( + TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}", + Latex2HTML => qq!\\begin{rawhtml}<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\\end{rawhtml}!, + HTML => qq!<INPUT TYPE=HIDDEN SIZE=$col NAME="$name" VALUE="$answer_value">!. + qq!<INPUT TYPE=HIDDEN NAME="previous_$name" VALUE="$answer_value">! + ); +} sub NAMED_ANS_RULE_OPTION { # deprecated &NAMED_ANS_RULE_EXTENSION; } Index: PG.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PG.pl,v retrieving revision 1.34 retrieving revision 1.35 diff -Lmacros/PG.pl -Lmacros/PG.pl -u -r1.34 -r1.35 --- macros/PG.pl +++ macros/PG.pl @@ -155,6 +155,7 @@ # and Safe::Root2 (the current one) # There is a good chance they won't be properly updated in one or the other of these compartments. + # @main::PG_ANSWER_ENTRY_ORDER = (); # $main::ANSWER_PREFIX = 'AnSwEr'; # %main::PG_FLAGS=(); #global flags @@ -164,6 +165,9 @@ # $main::hintExists =0; # %main::gifs_created = (); eval(q! + # set perl to use capital E for scientific notation: e.g. 5.4E-05 instead of 5.4e-05 + $#="%G"; #FIXME -- check that this works + @main::PG_ANSWER_ENTRY_ORDER = (); $main::ANSWER_PREFIX = 'AnSwEr'; %main::PG_FLAGS=(); #global flags |
From: Mike G. v. a. <we...@ma...> - 2008-03-26 02:56:12
|
Log Message: ----------- Added more debugging code Modified Files: -------------- pg/lib: Applet.pm Revision Data ------------- Index: Applet.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Applet.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -Llib/Applet.pm -Llib/Applet.pm -u -r1.7 -r1.8 --- lib/Applet.pm +++ lib/Applet.pm @@ -195,7 +195,7 @@ base64_state => '', base64_config => '', getStateAlias => 'getXML', - setStateAlias => 'setState', + setStateAlias => 'setXML', configAlias => 'config', initializeActionAlias => 'setXML', submitActionAlias => 'getXML', @@ -422,13 +422,14 @@ //STATE // // state can vary as the applet is manipulated. - applet_setState_list["$appletName"] = function(state) { + applet_setState_list["$appletName"] = function(state) { + if (debug) { alert("set state for $appletName to " + state);} state = state || getQE("$appletName"+"_state").value - if (state.match("\S") ) { // if state is not all white space + if (state.match(/<xml/i) || state.match(/<?xml/i) ) { // if state is not all white space if ( base64Q(state) ) { state=Base64.decode(state); } - if (debug) { alert("set state for $appletName to " + state);} + alert("set (decoded) state for $appletName to " + state); try { if (debug || !( typeof(getApplet("$appletName").$setState) =="undefined" ) ) { getApplet("$appletName").$setState( state ); @@ -436,6 +437,8 @@ } catch(e) { alert("Error in setting state of $appletName using command $setState : " + e ); } + } else if (debug) { + alert("new state was empty string or did not begin with <xml-- state was not reset"); } }; applet_getState_list["$appletName"] = function () { |
From: Mike G. v. a. <we...@ma...> - 2008-03-26 01:39:45
|
Log Message: ----------- Modified method in which parameters are passed to flash applets (uses FlashVars parameter ) Modified Files: -------------- pg/lib: Applet.pm Revision Data ------------- Index: Applet.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Applet.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -Llib/Applet.pm -Llib/Applet.pm -u -r1.6 -r1.7 --- lib/Applet.pm +++ lib/Applet.pm @@ -92,7 +92,7 @@ package Applet; - +use URI::Escape; @@ -373,13 +373,16 @@ my $archive = $self->{archive}; my $width = $self->{width}; my $height = $self->{height}; - my $parameters = ''; - my $parameters = ''; + my $javaParameters = ''; + my $flashParameters = ''; my %param_hash = %{$self->params()}; foreach my $key (keys %param_hash) { - $parameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n! + $javaParameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n!; + $flashParameters .= uri_escape($key).'='.uri_escape($param_hash{$key}).'&'; } + $flashParameters =~ s/\&$//; # trim last & + $objectText = $self->{objectText}; $objectText =~ s/(\$\w+)/$1/gee; return $objectText; @@ -514,11 +517,13 @@ <param name="quality" value="high" /> <param name="bgcolor" value="#869ca7" /> <param name="allowScriptAccess" value="sameDomain" /> + <param name="FlashVars" value="$flashParameters"/> <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" width="$width" height="$height" name="$appletName" align="middle" id="$appletName" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" - pluginspage="http://www.macromedia.com/go/getflashplayer"> + pluginspage="http://www.macromedia.com/go/getflashplayer" + FlashVars="$flashParameters"> </embed> </object> @@ -564,7 +569,7 @@ height = "$height" MAYSCRIPT > - $parameters + $javaParameters </applet> END_OBJECT_TEXT @@ -582,7 +587,7 @@ height = "$height" MAYSCRIPT > - $parameters + $javaParameters </applet> END_OBJECT_TEXT |
From: Mike G. v. a. <we...@ma...> - 2008-03-25 22:14:16
|
Log Message: ----------- corrected typos in setState macros. Modified Files: -------------- pg/macros: AppletObjects.pl Revision Data ------------- Index: AppletObjects.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.4 -r1.5 --- macros/AppletObjects.pl +++ macros/AppletObjects.pl @@ -52,7 +52,7 @@ function base64Q(str) { - return !str.match(/<XML>*/i); + return !str.match(/<XML/i && !str.match(/<?xml/i)); } function submitAction() { @@ -223,11 +223,13 @@ my $decoded_answer_value = ($answer_value =~/<XML>/i) ? $answer_value : decode_base64($answer_value); my $debug_input_element = qq!\n<textarea rows="4" cols="80" name = "$appletStateName">$decoded_answer_value</textarea><br/> - <input type="button" value="getState" - onClick="applet_getState_list['$appletName']()"> - <input type="button" value="setState" - onClick="applet_setState_list['$appletName'](); - var tmp = getQE('$appletStateName').value;"> + <input type="button" value="$getState" + onClick="applet_getState_list['$appletName']()" + > + <input type="button" value="$setState" + onClick="var tmp = getQE('$appletStateName').value; + applet_setState_list['$appletName'](tmp);" + > !; my $state_input_element = ($self->debug == 1) ? $debug_input_element : qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!; |
From: Mike G. v. a. <we...@ma...> - 2008-03-25 22:13:11
|
Log Message: ----------- cosmetic changes some corrections on typos for setState subroutines. Modified Files: -------------- pg/lib: Applet.pm Revision Data ------------- Index: Applet.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Applet.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -Llib/Applet.pm -Llib/Applet.pm -u -r1.5 -r1.6 --- lib/Applet.pm +++ lib/Applet.pm @@ -341,21 +341,22 @@ sub insertHeader { my $self = shift; - my $codebase = $self->codebase; - my $appletId = $self->appletId; - my $appletName = $self->appletName; + my $codebase = $self->codebase; + my $appletId = $self->appletId; + my $appletName = $self->appletName; my $base64_initialState = $self->base64_state; - my $initializeAction = $self->initializeActionAlias; - my $submitAction = $self->submitActionAlias; + my $initializeAction = $self->initializeActionAlias; + my $submitAction = $self->submitActionAlias; my $setState = $self->setStateAlias; my $getState = $self->getStateAlias; my $config = $self->configAlias; my $base64_config = $self->base64_config; my $debugMode = ($self->debug) ? "1": "0"; - my $returnFieldName = $self->{returnFieldName}; -# my $encodeStateQ = ($self->debug)?'' : "state = Base64.encode(state);"; # in debug mode base64 encoding is not used. -# my $decodeStateQ = "if (!state.match(/<XML>*/i) ) {state = Base64.decode(state)}"; # decode if <XML> is not present - my $headerText = $self->header(); + my $returnFieldName = $self->{returnFieldName}; +# my $encodeStateQ = ($self->debug)?'' : "state = Base64.encode(state);"; # in debug mode base64 encoding is not used. +# my $decodeStateQ = "if (!state.match(/<XML>*/i) ) {state = Base64.decode(state)}"; # decode if <XML> is not present + my $headerText = $self->header(); + $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook return $headerText; @@ -419,16 +420,20 @@ // // state can vary as the applet is manipulated. applet_setState_list["$appletName"] = function(state) { - state = state || getQE("$appletName"+"_state").value || "<xml></xml>"; - if ( base64Q(state) ) { state=Base64.decode(state);} - if (debug) { alert("set state for $appletName to " + state);} - try { - if (debug || !( typeof(getApplet("$appletName").$setState) =="undefined" ) ) { - getApplet("$appletName").$setState( state ); - } - } catch(e) { - alert("Error in setting state of $appletName: " + e ); - } + state = state || getQE("$appletName"+"_state").value + if (state.match("\S") ) { // if state is not all white space + if ( base64Q(state) ) { + state=Base64.decode(state); + } + if (debug) { alert("set state for $appletName to " + state);} + try { + if (debug || !( typeof(getApplet("$appletName").$setState) =="undefined" ) ) { + getApplet("$appletName").$setState( state ); + } + } catch(e) { + alert("Error in setting state of $appletName using command $setState : " + e ); + } + } }; applet_getState_list["$appletName"] = function () { if (debug) { alert("getState for applet $appletName");} |
From: Sam H. v. a. <we...@ma...> - 2008-03-19 19:31:04
|
Log Message: ----------- formatting fix Modified Files: -------------- webwork2/doc: Copying Revision Data ------------- Index: Copying =================================================================== RCS file: /webwork/cvs/system/webwork2/doc/Copying,v retrieving revision 1.2 retrieving revision 1.3 diff -Ldoc/Copying -Ldoc/Copying -u -r1.2 -r1.3 --- doc/Copying +++ doc/Copying @@ -3,7 +3,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -341,4 +341,4 @@ proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General -Public License instead of this License. \ No newline at end of file +Public License instead of this License. |
From: Sam H. v. a. <we...@ma...> - 2008-03-19 19:29:48
|
Log Message: ----------- For some reason we were distributing GPLv1 rather than GPLv2 -- weird! Modified Files: -------------- webwork2/doc: Copying Revision Data ------------- Index: Copying =================================================================== RCS file: /webwork/cvs/system/webwork2/doc/Copying,v retrieving revision 1.1 retrieving revision 1.2 diff -Ldoc/Copying -Ldoc/Copying -u -r1.1 -r1.2 --- doc/Copying +++ doc/Copying @@ -1,37 +1,41 @@ + GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 + Version 2, June 1991 - Copyright (C) 1989 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble - The license agreements of most software companies try to keep users -at the mercy of those companies. By contrast, our General Public + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. The -General Public License applies to the Free Software Foundation's -software and to any other program whose authors commit to using it. -You can use it for your programs, too. +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. When we speak of free software, we are referring to freedom, not -price. Specifically, the General Public License is designed to make -sure that you have the freedom to give away or sell copies of free -software, that you receive source code or can get it if you want it, -that you can change the software or use pieces of it in new free -programs; and that you know you can do these things. +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. - For example, if you distribute copies of a such a program, whether + For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the -source code. And you must tell them their rights. +source code. And you must show them these terms so they know their +rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, @@ -44,120 +48,208 @@ that any problems introduced by others will not reflect on the original authors' reputations. + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + The precise terms and conditions for copying, distribution and modification follow. - + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. This License Agreement applies to any program or other work which -contains a notice placed by the copyright holder saying it may be -distributed under the terms of this General Public License. The -"Program", below, refers to any such program or work, and a "work based -on the Program" means either the Program or any work containing the -Program or a portion of it, either verbatim or with modifications. Each -licensee is addressed as "you". - - 1. You may copy and distribute verbatim copies of the Program's source -code as you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and -disclaimer of warranty; keep intact all the notices that refer to this -General Public License and to the absence of any warranty; and give any -other recipients of the Program a copy of this General Public License -along with the Program. You may charge a fee for the physical act of -transferring a copy. - - 2. You may modify your copy or copies of the Program or any portion of -it, and copy and distribute such modifications under the terms of Paragraph -1 above, provided that you also do the following: - - a) cause the modified files to carry prominent notices stating that - you changed the files and the date of any change; and - - b) cause the whole of any work that you distribute or publish, that - in whole or in part contains the Program or any part thereof, either - with or without modifications, to be licensed at no charge to all - third parties under the terms of this General Public License (except - that you may choose to grant warranty protection to some or all - third parties, at your option). - - c) If the modified program normally reads commands interactively when - run, you must cause it, when started running for such interactive use - in the simplest and most usual way, to print or display an - announcement including an appropriate copyright notice and a notice - that there is no warranty (or else, saying that you provide a - warranty) and that users may redistribute the program under these - conditions, and telling the user how to view a copy of this General - Public License. - - d) You may charge a fee for the physical act of transferring a - copy, and you may at your option offer warranty protection in - exchange for a fee. - -Mere aggregation of another independent work with the Program (or its -derivative) on a volume of a storage or distribution medium does not bring -the other work under the scope of these terms. - - 3. You may copy and distribute the Program (or a portion or derivative of -it, under Paragraph 2) in object code or executable form under the terms of -Paragraphs 1 and 2 above provided that you also do one of the following: - - a) accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of - Paragraphs 1 and 2 above; or, - - b) accompany it with a written offer, valid for at least three - years, to give any third party free (except for a nominal charge - for the cost of distribution) a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of - Paragraphs 1 and 2 above; or, + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software + interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, - c) accompany it with the information you received as to where the - corresponding source code may be obtained. (This alternative is + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you - received the program in object code or executable form alone.) + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) -Source code for a work means the preferred form of the work for making -modifications to it. For an executable file, complete source code means -all the source code for all modules it contains; but, as a special -exception, it need not include source code for modules which are standard -libraries that accompany the operating system on which the executable -file runs, or for standard header files or definitions files that -accompany that operating system. - - 4. You may not copy, modify, sublicense, distribute or transfer the -Program except as expressly provided under this General Public License. -Any attempt otherwise to copy, modify, sublicense, distribute or transfer -the Program is void, and will automatically terminate your rights to use -the Program under this License. However, parties who have received -copies, or rights to use copies, from you under this General Public -License will not have their licenses terminated so long as such parties -remain in full compliance. - - 5. By copying, distributing or modifying the Program (or any work based -on the Program) you indicate your acceptance of this license to do so, -and all its terms and conditions. +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the original -licensor to copy, distribute or modify the Program subject to these -terms and conditions. You may not impose any further restrictions on the -recipients' exercise of the rights granted herein. - - 7. The Free Software Foundation may publish revised and/or new versions +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program -specifies a version number of the license which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -the license, you may choose any version ever published by the Free Software -Foundation. +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Program does not specify a +version number of this License, you may choose any version ever +published by the Free Software Foundation. - 8. If you wish to incorporate parts of the Program into other free + 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes @@ -167,47 +259,48 @@ NO WARRANTY - 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest -possible use to humanity, the best way to achieve this is to make it +possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - To do so, attach the following notices to the program. It is safest to -attach them to the start of each source file to most effectively convey -the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> - Copyright (C) 19yy <name of author> + Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) - any later version. + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -215,34 +308,37 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. -The hypothetical commands `show w' and `show c' should show the -appropriate parts of the General Public License. Of course, the -commands you use may be called something other than `show w' and `show -c'; they could even be mouse-clicks or menu items--whatever suits your -program. +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here a sample; alter the names: +necessary. Here is a sample; alter the names: - Yoyodyne, Inc., hereby disclaims all copyright interest in the - program `Gnomovision' (a program to direct compilers to make passes - at assemblers) written by James Hacker. + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice -That's all there is to it! +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file |
From: Mike G. v. a. <we...@ma...> - 2008-03-16 14:53:12
|
Log Message: ----------- New version of Applet.pm and AppletObjects.pl that supports both flashnew FlashApplet(); and java applets new JavaApplet(); see pod docs in those two files for more details. Modified Files: -------------- pg/lib: Applet.pm Revision Data ------------- Index: Applet.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Applet.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -Llib/Applet.pm -Llib/Applet.pm -u -r1.4 -r1.5 --- lib/Applet.pm +++ lib/Applet.pm @@ -37,7 +37,7 @@ ################################### #xml data to set up the problem-rac - $applet->xmlString(qq{<XML> + $applet->state(qq{<XML> <point xval='$xval_1' yval='$yval_1' /> <point xval='$xval_2' yval='$yval_2' /> </XML>}); @@ -77,11 +77,14 @@ The module JavaApplet has defaults for inserting java applets. -The module Applet will store common code for the two types of applet. +The module Applet stores common code for the two types of applet. =head1 USAGE -This file is included by listing it in the modules section of global.conf. +These modules are activate by listing it in the modules section of global.conf and rebooting the server. +The companion file to this one is macros/AppletObjects.pl + +qw(Applet FlashApplet JavaApplet) =cut @@ -90,7 +93,7 @@ package Applet; -package FlashApplet; + use MIME::Base64 qw( encode_base64 decode_base64); @@ -101,12 +104,12 @@ These functions are automatically defined for use for any javaScript placed in the text of a PG question. - getFlashMovie(appletName) -- finds the applet path in the DOM + getApplet(appletName) -- finds the applet path in the DOM - submitAction() -- calls the submit action of the applet - -- the submitAction is defined + submitAction() -- calls the submit action of the applets + - initialize() -- calls the initialize action of the applet + initializeAction() -- calls the initialize action of the applets getQE(name) -- gets an HTML element of the question by name or by id. Be sure to keep all names and ids @@ -123,162 +126,86 @@ TEXT(qq!<script> listQuestionElements() </script>!); ENDDOCUMENT(); + list of accessor methods format: current_value = $self->method(new_value or empty) -=cut - + appletId for simplicity and reliability appletId and appletName are always the same + appletName + + archive the name of the .jar file containing the applet code + code the name of the applet code in the .jar archive + codebase a prefix url used to find the archive and the applet itself + + height rectangle alloted in the html page for displaying the applet + width + + params an anonymous array containing name/value pairs + to configure the applet [name =>'value, ...] + + header stores the text to be added to the header section of the html page + object stores the text which places the applet on the html page + + debug in debug mode several alerts mark progress through the procedure of calling the applet + + config configuration are those customizable attributes of the applet which don't + change as it is used. When stored in hidden answer fields + it is usually stored in base64 encoded format. + base64_config base64 encode version of the contents of config + + configAlias (default: config ) names the applet command called with the contents of $self->config + to configure the applet. The parameters are passed to the applet in plain text using <xml> + The outer tags must be <xml> ..... </xml> + state state consists of those customizable attributes of the applet which change + as the applet is used. It is stored by the calling .pg question so that + when revisiting the question the applet + will be restored to the same state it was left in when the question was last + viewed. + + getStateAlias (default: getState) alias for command called to read the current state of the applet. + The state is passed in plain text xml format with outer tags: <xml>....</xml> + setStateAlias (default: setState) alias for the command called to reset the state of the applet. + The state is passed in plain text in xml format with outer tags: <xml>....</xml> + + base64_state returns the base64 encoded version of the state stored in the applet object. + + initializeActionAlias -- (default: initializeAction) the name of the javaScript subroutine called to initialize the applet (some overlap with config/ and setState + submitActionAlias -- (default: submitAction)the name of the javaScript subroutine called when the submit button of the + .pg question is pressed. + + returnFieldName + + -use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT'; - <script language="javascript">AC_FL_RunContent = 0;</script> - <script src="http://hosted2.webwork.rochester.edu/webwork2_files/applets/AC_RunActiveContent.js" language="javascript"> - </script> - - - <script language="JavaScript"> - - var flash; - function getFlashMovie(appletName) { - var isIE = navigator.appName.indexOf("Microsoft") != -1; - var obj = (isIE) ? window[appletName] : window.document[appletName]; - //return window.document[appletName]; - if (obj.name = appletName) { - return( obj ); - } else { - alert ("can't find applet " + appletName); - } - } - - function submitAction() { - getQE("$returnFieldName").value = getFlashMovie("$appletId").$submitAction(); - } - function initialize() { - getFlashMovie("$appletId").$initializeAction("$base64_xmlString"); - } - function getQE(name1) { // get Question Element in problemMainForm by name - var isIE = navigator.appName.indexOf("Microsoft") != -1; - var obj = (isIE) ? document.getElementById(name1) - :document.problemMainForm[name1]; - // needed for IE -- searches id and name space so it can be unreliable if names are not unique - if (obj.name = name1 ) { - return( obj ); - } else { - alert("Can't find " + name1); - listQuestionElements(); - } - - } - function getQuestionElement(name1) { - return getQE(name1); - } - function listQuestionElements() { // list all HTML elements in main problem form - var isIE = navigator.appName.indexOf("Microsoft") != -1; - var mainForm = (isIE) ? document.getElementsByTagName("input") : document.getElementsByTagName("input"); - var str=mainForm.length +" Question Elements\n type | name = value < id > \n"; - for( var i=0; i< mainForm.length; i++) { - str = str + " "+i+" " + mainForm[i].type - + " | " + mainForm[i].name - + "= " + mainForm[i].value + - " <" + mainForm[i].id + ">\n"; - } - alert(str +"\n Place listQuestionElements() at end of document in order to get all form elements!"); - } - - - </script> - -END_HEADER_SCRIPT - - -# <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" -# width="550" height="400" id="$appletId" align="middle"> -# <param name="allowScriptAccess" value="sameDomain" /> -# <param name="allowFullScreen" value="false" /> -# <param name="movie" value="$appletName.swf" /> -# <param name="quality" value="high" /> -# <param name="bgcolor" value="#ffffcc" /> -# <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#ffffcc" width="550" height="400" name="$appletName" -# align="middle" id="$appletId", -# align="middle" allowScriptAccess="sameDomain" -# allowFullScreen="false" -# type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> -# <param name="quality" value="high" /><param name="bgcolor" value="#ffffcc" /> -# </object> - -=pod - -The secret to making this applet work with IE in addition to normal browsers -is the addition of the C(<form></form>) construct just before the object. - -For some reason IE has trouble locating a flash object which is contained -within a form. Adding this second blank form with the larger problemMainForm -seems to solve the problem. - -This follows method2 of the advice given in url(http://kb.adobe.com/selfservice/viewContent.do?externalId=kb400730&sliceId=2) -Method1 and methods involving SWFObject(Geoff Stearns) and SWFFormFix (Steve Kamerman) have yet to be fully investigated: -http://devel.teratechnologies.net/swfformfix/swfobject_swfformfix_source.js -http://www.teratechnologies.net/stevekamerman/index.php?m=01&y=07&entry=entry070101-033933 - - use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; - <form></form> - <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - id="$appletName" width="500" height="375" - codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> - <param name="movie" value="$codebase/$appletName.swf" /> - <param name="quality" value="high" /> - <param name="bgcolor" value="#869ca7" /> - <param name="allowScriptAccess" value="sameDomain" /> - <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" - width="550" height="400" name="$appletName" align="middle" id="$appletID" - play="true" loop="false" quality="high" allowScriptAccess="sameDomain" - type="application/x-shockwave-flash" - pluginspage="http://www.macromedia.com/go/getflashplayer"> - </embed> - - </object> - END_OBJECT_TEXT =cut -use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; - <form></form> - <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - id="$appletName" width="500" height="375" - codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> - <param name="movie" value="$codebase/$appletName.swf" /> - <param name="quality" value="high" /> - <param name="bgcolor" value="#869ca7" /> - <param name="allowScriptAccess" value="sameDomain" /> - <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" - width="550" height="400" name="$appletName" align="middle" id="$appletID" - play="true" loop="false" quality="high" allowScriptAccess="sameDomain" - type="application/x-shockwave-flash" - pluginspage="http://www.macromedia.com/go/getflashplayer"> - </embed> - </object> -END_OBJECT_TEXT sub new { my $class = shift; my $self = { - host =>'', - port => '', - path => '', appletName =>'', + code=>'', codebase=>'', - appletId =>'', +# appletId =>'', #always use identical applet Id's and applet Names params =>undef, - base64_xmlString => 'foobar', - initializeActionAlias => 'setupProblem', - submitActionAlias => 'checkAnswer', - returnFieldName => 'receivedField', - headerText => DEFAULT_HEADER_TEXT(), - objectText => DEFAULT_OBJECT_TEXT(), + width => 550, + height => 400, + base64_state => '', + base64_config => '', + getStateAlias => 'getXML', + setStateAlias => 'setState', + configAlias => 'config', + initializeActionAlias => 'setXML', + submitActionAlias => 'getXML', + returnFieldName => 'receivedField', + headerText => DEFAULT_HEADER_TEXT(), + objectText => '', + debug => 0, @_, }; bless $self, $class; - #$self -> _initialize(@_); return $self; } @@ -304,7 +231,7 @@ my $self = shift; if (ref($_[0]) =~/HASH/) { $self->{params} = shift; - } elsif ( $_[0] =~ '') { + } elsif ( !defined($_[0]) or $_[0] =~ '') { # do nothing (read) } else { warn "You must enter a reference to a hash for the parameter list"; @@ -323,6 +250,22 @@ $self->{submitActionAlias} = shift ||$self->{submitActionAlias}; # replace the current contents if non-empty $self->{submitActionAlias}; } +sub getStateAlias { + my $self = shift; + $self->{getStateAlias} = shift ||$self->{getStateAlias}; # replace the current contents if non-empty + $self->{getStateAlias}; +} + +sub setStateAlias { + my $self = shift; + $self->{setStateAlias} = shift ||$self->{setStateAlias}; # replace the current contents if non-empty + $self->{setStateAlias}; +} +sub configAlias { + my $self = shift; + $self->{configAlias} = shift ||$self->{configAlias}; # replace the current contents if non-empty + $self->{configAlias}; +} sub returnFieldName { my $self = shift; $self->{returnFieldName} = shift ||$self->{returnFieldName}; # replace the current contents if non-empty @@ -333,43 +276,86 @@ $self->{codebase} = shift ||$self->{codebase}; # replace the current codebase if non-empty $self->{codebase}; } +sub code { + my $self = shift; + $self->{code} = shift ||$self->{code}; # replace the current code if non-empty + $self->{code}; +} +sub height { + my $self = shift; + $self->{height} = shift ||$self->{height}; # replace the current height if non-empty + $self->{height}; +} +sub width { + my $self = shift; + $self->{width} = shift ||$self->{width}; # replace the current width if non-empty + $self->{width}; +} +sub archive { + my $self = shift; + $self->{archive} = shift ||$self->{archive}; # replace the current archive if non-empty + $self->{archive}; +} sub appletName { my $self = shift; $self->{appletName} = shift ||$self->{appletName}; # replace the current appletName if non-empty $self->{appletName}; } -sub appletId { +sub debug { my $self = shift; - $self->{appletId} = shift ||$self->{appletId}; # replace the current appletName if non-empty - $self->{appletId}; + my $new_flag = shift; + $self->{debug} = $new_flag if defined($new_flag); + $self->{debug}; +} +sub appletId { + appletName(@_); } -sub xmlString { +sub state { my $self = shift; my $str = shift; - $self->{base64_xmlString} = encode_base64($str) ||$self->{base64_xmlString}; # replace the current string if non-empty - $self->{base64_xmlString} =~ s/\n//g; - decode_base64($self->{base64_xmlString}); + $self->{base64_state} = encode_base64($str) ||$self->{base64_state}; # replace the current string if non-empty + $self->{base64_state} =~ s/\n//g; + decode_base64($self->{base64_state}); } -sub base64_xmlString{ +sub base64_state{ my $self = shift; - $self->{base64_xmlString} = shift ||$self->{base64_xmlString}; # replace the current string if non-empty - $self->{base64_xmlString}; + $self->{base64_state} = shift ||$self->{base64_state}; # replace the current string if non-empty + $self->{base64_state}; +} +sub config { + my $self = shift; + my $str = shift; + $self->{base64_config} = encode_base64($str) || $self->{base64_config}; # replace the current string if non-empty + $self->{base64_config} =~ s/\n//g; + decode_base64($self->{base64_config}); +} +sub base64_config { + my $self = shift; + $self->{base64_config} = shift ||$self->{base64_config}; # replace the current string if non-empty + $self->{base64_config} =$self->{base64_config}; + $self->{base64_config}; } - #FIXME # need to be able to adjust header material sub insertHeader { my $self = shift; - my $codebase = $self->{codebase}; - my $appletId = $self->{appletId}; - my $appletName = $self->{appletName}; - my $base64_xmlString = $self->{base64_xmlString}; - my $initializeAction = $self->{initializeActionAlias}; - my $submitAction = $self->{submitActionAlias}; - my $returnFieldName= $self->{returnFieldName}; - my $headerText = $self->header(); + my $codebase = $self->codebase; + my $appletId = $self->appletId; + my $appletName = $self->appletName; + my $base64_initialState = $self->base64_state; + my $initializeAction = $self->initializeActionAlias; + my $submitAction = $self->submitActionAlias; + my $setState = $self->setStateAlias; + my $getState = $self->getStateAlias; + my $config = $self->configAlias; + my $base64_config = $self->base64_config; + my $debugMode = ($self->debug) ? "1": "0"; + my $returnFieldName = $self->{returnFieldName}; +# my $encodeStateQ = ($self->debug)?'' : "state = Base64.encode(state);"; # in debug mode base64 encoding is not used. +# my $decodeStateQ = "if (!state.match(/<XML>*/i) ) {state = Base64.decode(state)}"; # decode if <XML> is not present + my $headerText = $self->header(); $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook return $headerText; @@ -377,55 +363,232 @@ } - -# <script language="javascript"> -# if (AC_FL_RunContent == 0) { -# alert("This page requires AC_RunActiveContent.js."); -# } else { -# AC_FL_RunContent( -# 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', -# 'width', '100%', -# 'height', '100%', -# 'src', 'http://$codebase/$appletName', -# 'quality', 'high', -# 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', -# 'align', 'middle', -# 'play', 'true', -# 'loop', 'true', -# 'scale', 'showall', -# 'wmode', 'window', -# 'devicefont', 'false', -# 'id', '$appletId', -# 'bgcolor', '#ffffcc', -# 'name', '$appletName', -# 'menu', 'true', -# 'allowFullScreen', 'false', -# 'allowScriptAccess','sameDomain', -# 'movie', '$appletName', -# 'salign', '' -# ); //end AC code -# } -# </script> sub insertObject { - my $self = shift; - my $codebase = $self->{codebase}; - my $appletId = $self->{appletId}; + my $self = shift; + my $code = $self->{code}; + my $codebase = $self->{codebase}; + my $appletId = $self->{appletName}; my $appletName = $self->{appletName}; - $codebase = findAppletCodebase("$appletName.swf") unless $codebase; + my $archive = $self->{archive}; + my $width = $self->{width}; + my $height = $self->{height}; + my $parameters = ''; + my $parameters = ''; + my %param_hash = %{$self->params()}; + foreach my $key (keys %param_hash) { + $parameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n! + } + $objectText = $self->{objectText}; $objectText =~ s/(\$\w+)/$1/gee; return $objectText; } - sub initialize { my $self = shift; return q{ <script> - initialize(); + initializeAction(); // this should really be done in the <body> tag </script> }; } + +use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT'; + + <script language="JavaScript"> + var debug = $debugMode; + // + //CONFIGURATIONS + // + // configurations are "permanent" + applet_config_list["$appletName"] = function() { + if (debug) { alert("configure $appletName . $config ( $base64_config )");} + try { + if (debug || !( typeof(getApplet("$appletName").$config) == "undefined" ) ) { + + getApplet("$appletName").$config(Base64.decode("$base64_config")); + } + } catch(e) { + alert("error executing configuration command $config for $appletName: " + e ); + } + } + // + //STATE + // + // state can vary as the applet is manipulated. + applet_setState_list["$appletName"] = function(state) { + state = state || getQE("$appletName"+"_state").value || "<xml></xml>"; + if ( base64Q(state) ) { state=Base64.decode(state);} + if (debug) { alert("set state for $appletName to " + state);} + try { + if (debug || !( typeof(getApplet("$appletName").$setState) =="undefined" ) ) { + getApplet("$appletName").$setState( state ); + } + } catch(e) { + alert("Error in setting state of $appletName: " + e ); + } + }; + applet_getState_list["$appletName"] = function () { + if (debug) { alert("getState for applet $appletName");} + try { + var applet = getApplet("$appletName"); + var state; + if (!( typeof(getApplet("$appletName").$getState) =="undefined" ) ) { + state = applet.$getState(); // get state in xml format + } + if (!debug) {state = Base64.encode(state) }; // replace state by encoded version + getQE("$appletName"+"_state").value = state; //place in state htmlItem (debug: textarea, otherwise hidden) + } catch (e) { + alert("Error in getting state for $appletName " + e ); + } + }; + // + //INITIALIZE + // + applet_initializeAction_list["$appletName"] = function () { + applet_setState_list["$appletName"](); + }; + + applet_submitAction_list["$appletName"] = function () { + applet_getState_list["$appletName"](); + getQE("$returnFieldName").value = getApplet("$appletName").sendData(); + }; + </script> + +END_HEADER_SCRIPT + +package FlashApplet; +@ISA = qw(Applet); + + + +=pod + +The secret to making this applet work with IE in addition to normal browsers +is the addition of the C(<form></form>) construct just before the object. + +For some reason IE has trouble locating a flash object which is contained +within a form. Adding this second blank form with the larger problemMainForm +seems to solve the problem. + +This follows method2 of the advice given in url(http://kb.adobe.com/selfservice/viewContent.do?externalId=kb400730&sliceId=2) +Method1 and methods involving SWFObject(Geoff Stearns) and SWFFormFix (Steve Kamerman) have yet to be fully investigated: +http://devel.teratechnologies.net/swfformfix/swfobject_swfformfix_source.js +http://www.teratechnologies.net/stevekamerman/index.php?m=01&y=07&entry=entry070101-033933 + + use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; + <form></form> + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="$appletName" width="500" height="375" + codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> + <param name="movie" value="$codebase/$appletName.swf" /> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" + width="$width" height="$height" name="$appletName" align="middle" id="$appletName" + play="true" loop="false" quality="high" allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.macromedia.com/go/getflashplayer"> + </embed> + + </object> + END_OBJECT_TEXT + + +=cut + +use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; + <form></form> + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="$appletName" width="500" height="375" + codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> + <param name="movie" value="$codebase/$appletName.swf" /> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" + width="$width" height="$height" name="$appletName" align="middle" id="$appletName" + play="true" loop="false" quality="high" allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.macromedia.com/go/getflashplayer"> + </embed> + + </object> +END_OBJECT_TEXT + +sub new { + my $class = shift; + $class -> SUPER::new( objectText => DEFAULT_OBJECT_TEXT(), + @_ + ); + +} + + +package JavaApplet; +@ISA = qw(Applet); + + + +=pod + +The secret to making this applet work with IE in addition to normal browsers +is the addition of the C(<form></form>) construct just before the object. + +For some reason IE has trouble locating a flash object which is contained +within a form. Adding this second blank form with the larger problemMainForm +seems to solve the problem. + +This follows method2 of the advice given in url(http://kb.adobe.com/selfservice/viewContent.do?externalId=kb400730&sliceId=2) +Method1 and methods involving SWFObject(Geoff Stearns) and SWFFormFix (Steve Kamerman) have yet to be fully investigated: +http://devel.teratechnologies.net/swfformfix/swfobject_swfformfix_source.js +http://www.teratechnologies.net/stevekamerman/index.php?m=01&y=07&entry=entry070101-033933 + + use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; + <form></form> + <applet + code = "$code" + codebase = "$codebase" + archive = "$archive" + name = "$appletName" + id = "$appletName" + width = "$width" + height = "$height" + MAYSCRIPT + > + $parameters + </applet> + END_OBJECT_TEXT + +=cut + +use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; + <form></form> + <applet + code = "$code" + codebase = "$codebase" + archive = "$archive" + name = "$appletName" + id = "$appletName" + width = "$width" + height = "$height" + MAYSCRIPT + > + $parameters + </applet> +END_OBJECT_TEXT + +sub new { + my $class = shift; + $class -> SUPER::new( objectText => DEFAULT_OBJECT_TEXT(), + @_ + ); + +} + + + 1; \ No newline at end of file |
From: Mike G. v. a. <we...@ma...> - 2008-03-16 14:52:46
|
Log Message: ----------- New version of Applet.pm and AppletObjects.pl that supports both flash new FlashApplet(); and java applets new JavaApplet(); see pod docs in those two files for more details. Modified Files: -------------- pg/macros: AppletObjects.pl Revision Data ------------- Index: AppletObjects.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.3 -r1.4 --- macros/AppletObjects.pl +++ macros/AppletObjects.pl @@ -16,7 +16,7 @@ =head1 NAME -AppletOjects.pl - Macro-based front end for the Applet.pm module. +AppletObjects.pl - Macro-based front end for the Applet.pm module. =head1 DESCRIPTION @@ -32,7 +32,116 @@ =cut -sub _PGapplets_init {}; # don't reload this file + +sub _AppletObjects_init{}; # don't reload this file + + +main::HEADER_TEXT(<<'END_HEADER_TEXT'); + <script language="javascript">AC_FL_RunContent = 0;</script> + <script src="/webwork2_files/applets/AC_RunActiveContent.js" language="javascript"> + </script> + <script src="/webwork2_files/js/Base64.js" language="javascript"> + </script> + +<script language="JavaScript"> + var applet_initializeAction_list = new Object; + var applet_submitAction_list = new Object; + var applet_setState_list = new Object; + var applet_getState_list = new Object; + var applet_config_list = new Object; + + + function base64Q(str) { + return !str.match(/<XML>*/i); + } + + function submitAction() { + //alert("submit Action" ); + for (var applet in applet_submitAction_list) { + //alert(applet); + applet_submitAction_list[applet](); + } + + } + // Give some time delay before initializing + function initializeAction() { + //alert("ready to initialize"); + // give some delay to allow flash applet to load. FIXME + window.setTimeout("initializeAction1()",200); + //initializeAction1(); + } + function initializeAction1() { + + for (var appletName in applet_initializeAction_list) { + //alert("initialize: " + appletName); + try{ + applet_config_list[appletName](); + } catch(e) { + alert("unable to configure " + appletName + " It may have been slow to load. " +e ); + } + try{ + applet_initializeAction_list[appletName](); + } catch(e) { + alert("unable to initialize " + appletName + " It may have been slow to load. " +e ); + } + } + } + + + var flash; + function getApplet(appletName) { + var isIE = navigator.appName.indexOf("Microsoft") != -1; + var obj = (isIE) ? window[appletName] : window.document[appletName]; + //return window.document[appletName]; + if (obj && (obj.name = appletName)) { + return( obj ); + } else { + alert ("can't find applet " + appletName); + } + } + + function listQuestionElements() { // list all HTML input and textarea elements in main problem form + var isIE = navigator.appName.indexOf("Microsoft") != -1; + var elementList = (isIE) ? document.getElementsByTagName("input") : document.problemMainForm.getElementsByTagName("input"); + var str=elementList.length +" Question Elements\n type | name = value < id > \n"; + for( var i=0; i< elementList.length; i++) { + str = str + " "+i+" " + elementList[i].type + + " | " + elementList[i].name + + "= " + elementList[i].value + + " <" + elementList[i].id + ">\n"; + } + elementList = (isIE) ? document.getElementsByTagName("textarea") : document.problemMainForm.getElementsByTagName("textarea"); + for( var i=0; i< elementList.length; i++) { + str = str + " "+i+" " + elementList[i].type + + " | " + elementList[i].name + + "= " + elementList[i].value + + " <" + elementList[i].id + ">\n"; + } + alert(str +"\n Place listQuestionElements() at end of document in order to get all form elements!"); + } + + function getQE(name1) { // get Question Element in problemMainForm by name + var isIE = navigator.appName.indexOf("Microsoft") != -1; + var obj = (isIE) ? document.getElementById(name1) + :document.problemMainForm[name1]; + // needed for IE -- searches id and name space so it can be unreliable if names are not unique + if (!obj || obj.name != name1) { + alert("Can't find element " + name1); + listQuestionElements(); + } else { + return( obj ); + } + + } + function getQuestionElement(name1) { + return getQE(name1); + } + + </script> + +END_HEADER_TEXT + + =head3 FlashApplet @@ -46,8 +155,15 @@ } -package FlashApplet; +sub JavaApplet { + return new JavaApplet(@_); + +} + +package Applet; + + =head2 Methods =cut @@ -57,10 +173,10 @@ ## not available to the module FlashApplet when that file ## is compiled (at the time the apache child process is first initialized) -=head3 insert +=head3 insertAll - Useage: TEXT( $applet->insert() ); - \{ $applet->insert \} (used within BEGIN_TEXT/END_TEXT blocks) + Useage: TEXT( $applet->insertAll() ); + \{ $applet->insertAll() \} (used within BEGIN_TEXT/END_TEXT blocks) =cut @@ -68,17 +184,70 @@ Inserts applet at this point in the HTML code. (In TeX mode a message "Applet" is written.) This method also adds the applets header material into the header portion of the HTML page. It effectively inserts -the outputs of both C<$applet-E<gt>insertHeader> and C<$applet-E<gt>insertObject> (defined in L<Applet.pm> ) in the appropriate places. +the outputs of both C<$applet-E<gt>insertHeader> and C<$applet-E<gt>insertObject> (defined in L<Applet.pm> ) +in the appropriate places. + +Note: This method is defined here rather than in Applet.pl because it + requires access to the RECORD_FORM_LABEL subroutine + and to the routine accessing the stored values of the answers. These are defined in main::. =cut -sub insert { ## inserts both header text and object text +sub insertAll { ## inserts both header text and object text my $self = shift; + my %options = @_; + $self->debug( (defined($options{debug}) and $options{debug}==1) ? 1 : 0 ); + my $reset_button = $options{reset_button} || 0; + # prepare html code for storing state + my $appletName = $self->appletName; + my $appletStateName = "${appletName}_state"; + my $getState = $self->getStateAlias; + my $setState = $self->setStateAlias; + my $base64_initialState = $self->base64_state; + main::RECORD_FORM_LABEL($appletStateName); #this insures that they'll be saved from one invocation to the next + #main::RECORD_FORM_LABEL("previous_$appletStateName"); + my $answer_value = ''; + $answer_value = ${$main::inputs_ref}{$appletStateName} if defined(${$main::inputs_ref}{$appletStateName}); + + if ( defined( $main::rh_sticky_answers->{$appletStateName} ) ) { + $answer_value = shift( @{ $main::rh_sticky_answers->{$appletStateName} }); + $answer_value = '' unless defined($answer_value); + } + $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3 + $answer_value =~ s/\s+/ /g; ## remove excessive whitespace from student answer + + ####### + # insert a hidden variable to hold the applet's state (debug =>1 makes it visible for debugging and provides debugging buttons) + ####### + my $base_64_encoded_answer_value = ($answer_value =~/<XML>/i)? encode_base64($answer_value) : $answer_value; + my $decoded_answer_value = ($answer_value =~/<XML>/i) ? $answer_value : decode_base64($answer_value); + my $debug_input_element = qq!\n<textarea rows="4" cols="80" + name = "$appletStateName">$decoded_answer_value</textarea><br/> + <input type="button" value="getState" + onClick="applet_getState_list['$appletName']()"> + <input type="button" value="setState" + onClick="applet_setState_list['$appletName'](); + var tmp = getQE('$appletStateName').value;"> + !; + my $state_input_element = ($self->debug == 1) ? $debug_input_element : + qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!; + my $reset_button_str = ($reset_button) ? + qq!<br/><input type='button' value='reset applet' onClick="applet_setState_list['$appletName']('<xml></xml>')">! + : '' + ; + # always base64 encode the hidden answer value to prevent problems with quotes. + # + $state_storage_html_code = + $reset_button_str. + $state_input_element. + qq!<input type="hidden" name="previous_$appletStateName" value = "$base_64_encoded_answer_value">!; + ####### + # insert header material + ####### main::HEADER_TEXT($self->insertHeader()); - return main::MODES(TeX=>' {\bf flash applet } ', HTML=>$self->insertObject); + return main::MODES(TeX=>' {\bf applet } ', HTML=>$self->insertObject.$main::BR.$state_storage_html_code); } - =head3 Example problem @@ -120,7 +289,7 @@ # of locations specified in global.conf ################################### - # Add java script functions to header section of HTML to + # Add additional javaScript functions to header section of HTML to # communicate with the "ExternalInterface" applet. ################################### @@ -138,27 +307,14 @@ } function updateStatus(sMessage) { - //alert("update form with " + sMessage); - //window.document.problemMainForm.playbackStatus.value = sMessage; - //document.problemMainForm.playbackStatus.value = sMessage; - document.getElementById("playbackStatus").value = sMessage; + getQE("playbackStatus").value = sMessage; } function newColor() { - //var app = getFlashMovie("ExternalInterface").getElementById("movie1"); - // alert(app); - // The difficult issue in adapting Barbara's original file was locating - // the object. It took several tries to find a method that worked - // and it is quite likely that it will not work in all browsers. - - //alert("update color"); - //alert(getFlashMovie("ExternalInterface")); - getFlashMovie("ExternalInterface").updateColor(Math.round(Math.random() * 0xFFFFFF)); + + getApplet("ExternalInterface").updateColor(Math.round(Math.random() * 0xFFFFFF)); } - function submitAction() { newColor() - } - </script> END_HEADER @@ -178,17 +334,9 @@ TEXT(beginproblem()); - TEXT( MODES(TeX=>'object code', HTML=><<END_SCRIPT ) ); - <script> - //alert("foobar"); - initialize(); - // this should really be done in the <body> tag -- can we make that happen? - </script> - END_SCRIPT - BEGIN_TEXT - \{ $applet->insert \} + \{ $applet->insertAll() \} $PAR The Flash object operates above this line. The box and button below this line are part of |