diff --git a/lib/WeBWorK/PG/Metadata.pm b/lib/WeBWorK/PG/Metadata.pm new file mode 100644 index 0000000000..a63fc9cb4d --- /dev/null +++ b/lib/WeBWorK/PG/Metadata.pm @@ -0,0 +1,159 @@ +package WeBWorK::PG::Metadata; +use parent qw(Exporter); + +use strict; +use warnings; +use feature 'signatures'; +no warnings qw(experimental::signatures); + +use Encode qw(encode); +use YAML::XS; + +our @EXPORT_OK = qw(parse_metadata); + +=head1 NAME + +WeBWorK::PG::Metadata - Parse the metadata block of a PG problem. + +=head1 SYNOPSIS + + use WeBWorK::PG::Metadata qw(parse_metadata); + + my $metadata = eval { parse_metadata($source) }; + die "Invalid PG metadata: $@" if $@; + +=head1 DESCRIPTION + +The metadata block of a PG problem is a YAML document written in Perl comments +and delimited by lines consisting of C<## --->. The first line of the block +must declare the C. For example, + + ## DESCRIPTION + ## A problem + ## ENDDESCRIPTION + ## DBsubject(WeBWorK) + + ## --- + ## pgAuthoringVersion: 1 + ## macros: + ## - parserMultiAnswer.pl + ## - contextFraction.pl + ## --- + + Context('Fraction'); + ... + +The block may be preceded by any number of comment lines (such as OPL tags) and +lines consisting entirely of whitespace, but must occur before the first line of +code. Any C<## ---> line after the first line of code is ignored, so text +within the problem (for example in a PGML block) can never be interpreted as +metadata. + +The leading C<##> and at most one following space or tab are removed from each +line in the block, and the remaining text is parsed as YAML. + +The presence of the block indicates that the problem is a new style problem. +Such problems should not call C, C, or C. +The C and C calls are added by the translator, and the +C call loads C, C, +C, the macros declared in the metadata, and finally C. + +Problems that do not have the block are evaluated exactly as they always have +been, and must call C, C, and C themselves. + +The following keys are recognized in the block. Keys are case insensitive (so +C is the same as C), but otherwise any +other key is an error. + +=over + +=item pgAuthoringVersion + +The version of the PG authoring expectations that the problem is written for. +This is required, and currently must be 1. + +=item macros + +A list of the macro files used by the problem. This is optional. + +=back + +=head1 FUNCTIONS + +=head2 parse_metadata + + my $metadata = parse_metadata($source); + +Parse the metadata block from the problem source. If the source does not have a +metadata block, then this returns undefined. Otherwise the returned hash +reference has the keys C and C. This dies with a +message describing the problem if the block is not terminated, is not valid +YAML, or does not conform to the requirements above. + +=cut + +my @supportedVersions = (1); +my %knownKeys = map { lc($_) => $_ } qw(pgAuthoringVersion macros); + +sub parse_metadata($source) { + $source //= ''; + + my @lines = split(/\r?\n/, $source); + + my $blockStart; + for (0 .. $#lines - 1) { + last unless $lines[$_] =~ /^\h*(#.*)?$/; + if ($lines[$_] =~ /^\h*##\h*---\h*$/ && $lines[ $_ + 1 ] =~ /^\h*##\h*pgAuthoringVersion\h*:/i) { + $blockStart = $_; + last; + } + } + + return unless defined $blockStart; + + my (@yaml, $terminated); + for my $line (@lines[ $blockStart + 1 .. $#lines ]) { + if ($line =~ /^\h*##\h*---\h*$/) { + $terminated = 1; + last; + } + last unless $line =~ /^\h*##\h?(.*)$/; + push(@yaml, $1); + } + die "The metadata block that starts on line @{[ $blockStart + 1 ]} is not terminated with a ## --- line.\n" + unless $terminated; + + my $data = eval { + local $YAML::XS::LoadBlessed = 0; + local $YAML::XS::LoadCode = 0; + YAML::XS::Load(encode('UTF-8', join("\n", @yaml, ''))); + }; + # Make the line numbers in the YAML error message relative to the problem source. + die 'The metadata block is not valid YAML: ' . ($@ =~ s/line: (\d+)/'line: ' . ($1 + $blockStart + 1)/ger) + if $@; + + my @unknownKeys = grep { !$knownKeys{ lc($_) } } keys %$data; + die 'Unknown metadata key' . (@unknownKeys > 1 ? 's' : '') . ': ' . join(', ', @unknownKeys) . "\n" + if @unknownKeys; + + # Keys are case insensitive, so convert them to their canonical form. + my %canonical; + for (keys %$data) { + my $key = $knownKeys{ lc($_) }; + die "The metadata key $key is declared more than once.\n" if exists $canonical{$key}; + $canonical{$key} = $data->{$_}; + } + $data = \%canonical; + + my $version = $data->{pgAuthoringVersion}; + die 'Unsupported pgAuthoringVersion: ' . ($version // '') . "\n" + if !defined $version || ref $version || !(grep { $version eq $_ } @supportedVersions); + + my $macros = $data->{macros} // []; + die "The macros in the metadata block must be a list of macro file names.\n" + unless ref $macros eq 'ARRAY' && !grep { !defined $_ || ref $_ || $_ eq '' } @$macros; + + return { pgAuthoringVersion => $version, macros => [@$macros] }; +} + +1; diff --git a/lib/WeBWorK/PG/SampleProblemParser.pm b/lib/WeBWorK/PG/SampleProblemParser.pm index 42fd73ffc3..0c2c84e6c4 100644 --- a/lib/WeBWorK/PG/SampleProblemParser.pm +++ b/lib/WeBWorK/PG/SampleProblemParser.pm @@ -19,6 +19,8 @@ use Pandoc; use Pod::Simple::Search; use Pod::Simple::SimpleTree; +use WeBWorK::PG::Metadata qw(parse_metadata); + our @EXPORT_OK = qw(parseSampleProblem generateMetadata getSampleProblemCode getSearchData); =head1 NAME @@ -190,7 +192,10 @@ sub parseMetadata ($path, $problem_dir) { my @problem_types = qw(sample technique snippet); - my $metadata = { dir => (dirname($path) =~ s/$problem_dir\/?//r) =~ s/\/*$//r }; + my $metadata = { + dir => (dirname($path) =~ s/$problem_dir\/?//r) =~ s/\/*$//r, + macros => problemMetadata(join('', @file_contents), $path)->{macros} // [] + }; while (my $row = shift @file_contents) { if ($row =~ /^#:%\s*(categor(y|ies)|types?|subjects?|see_also|name)\s*=\s*(.*)\s*$/) { @@ -233,6 +238,13 @@ sub parseMetadata ($path, $problem_dir) { return $metadata; } +# Sample problems are expected to have valid metadata, so an invalid metadata block is only warned about here. +sub problemMetadata ($contents, $path) { + my $metadata = eval { parse_metadata($contents) }; + warn qq{Invalid metadata in "$path": $@} if $@; + return $metadata // {}; +} + =head2 getSampleProblemCode Parse a PG file with extra documentation comments and strip that all out @@ -252,7 +264,10 @@ sub getSampleProblemCode ($file) { my @file_contents = <$FH>; close $FH; - my (@code_rows, $inCode); + # Problems that have a metadata block have no DOCUMENT or ENDDOCUMENT calls, and the comments at the beginning of + # the file (including the metadata block) are part of the problem code. + my $inCode = defined problemMetadata(join('', @file_contents), $file)->{pgAuthoringVersion}; + my @code_rows; while (my $row = shift @file_contents) { chomp($row); @@ -263,11 +278,14 @@ sub getSampleProblemCode ($file) { $inCode = $1 ? 0 : 1; push(@code_rows, $row); } elsif ($inCode) { - push(@code_rows, $row); + # Removing documentation can leave consecutive blank lines, so only keep the first. + push(@code_rows, $row) unless $row =~ /^\s*$/ && @code_rows && $code_rows[-1] =~ /^\s*$/; } } - return join("\n", @code_rows); + pop(@code_rows) while @code_rows && $code_rows[-1] =~ /^\s*$/; + + return join("\n", @code_rows) . "\n"; } =head2 getSearchData @@ -377,7 +395,8 @@ sub getSearchData ($searchDataFileName) { } $files{$_}{lastModified} = $lastModified; - my (%words, @kw, @macros, @subjects, $description); + my (%words, @kw, @subjects, $description); + my @macros = @{ problemMetadata(join("\n", @fileContents), $File::Find::name)->{macros} // [] }; while (@fileContents) { my $line = shift @fileContents; diff --git a/lib/WeBWorK/PG/Translator.pm b/lib/WeBWorK/PG/Translator.pm index 0f8b17a385..ad8caff619 100644 --- a/lib/WeBWorK/PG/Translator.pm +++ b/lib/WeBWorK/PG/Translator.pm @@ -53,8 +53,9 @@ use Carp; use Mojo::DOM; use WWSafe; -use PGUtil qw(pretty_print); -use WeBWorK::PG::IO qw(fileFromPath); +use PGUtil qw(pretty_print); +use WeBWorK::PG::IO qw(fileFromPath); +use WeBWorK::PG::Metadata qw(parse_metadata); use WeBWorK::PG::SafeIOHandle; use WeBWorK::PG::SafeGD; @@ -695,6 +696,12 @@ sub translate { $self->{errors} .= qq{ERROR: You must define the environment before translating.} unless defined($self->{envir}); + # This must be done before the die handler below is installed so that metadata errors are not + # reported with a traceback. If the metadata is invalid, the problem is not evaluated. + my $metadata = eval { parse_metadata($evalString) }; + my $metadataError = $@; + $self->{errors} .= "ERRORS in the PG metadata:\n$metadataError" if $metadataError; + # Create a global reference to the __files__ hash in the envir so that # it can be accessed in the $PG_errorMessage method. $main::__files__ = $self->{envir}{__files__}; @@ -716,21 +723,34 @@ sub translate { : die PG_errorMessage('traceback', $_[0]); }; + # Problems that have a metadata block and declare a pgAuthoringVersion have the DOCUMENT and ENDDOCUMENT calls + # added, and the macros declared in the metadata are loaded in the DOCUMENT call. Everything is on the first line + # of the evaluated code so that line numbers in error messages are correct for the problem code. + my ($documentCall, $endDocumentCall) = ('', ''); + if ($metadata) { + $documentCall = + "DOCUMENT(pgAuthoringVersion => $metadata->{pgAuthoringVersion}, macros => [" + . join(',', map {"'$_'"} @{ $metadata->{macros} }) . ']);'; + $endDocumentCall = "\nENDDOCUMENT();"; + } + # PG preprocessing code $evalString = 'BEGIN { my $eval = __FILE__; $main::envir{__files__}{$eval} = "' . $self->{envir}{probFileName} . '" };' - . &{ $self->{preprocess_code} }($evalString); + . $documentCall + . &{ $self->{preprocess_code} }($evalString) + . $endDocumentCall; my ($PG_PROBLEM_TEXT_REF, $PG_HEADER_TEXT_REF, $PG_ANSWER_HASH_REF, $PG_FLAGS_REF, $PGcore) = - $safe_cmpt->reval($evalString); + $metadataError ? () : $safe_cmpt->reval($evalString); # This section could use some more error messages. In particular if a problem doesn't produce the right output, # the user needs information about which problem was at fault. # FIXME The various warning message tracks are still being sorted out # WARNING and DEBUG tracks are being handled elsewhere (in Problem.pm?) - $self->{errors} .= "ERRORS from evaluating PG file:\n$@\n" if $@; + $self->{errors} .= "ERRORS from evaluating PG file:\n$@\n" if !$metadataError && $@; my @PROBLEM_TEXT_OUTPUT; push(@PROBLEM_TEXT_OUTPUT, split(/^/, $$PG_PROBLEM_TEXT_REF)) if ref($PG_PROBLEM_TEXT_REF) eq 'SCALAR'; @@ -1020,13 +1040,19 @@ sub rf_std_problem_grader { return \&std_problem_grader; } -sub std_problem_grader { - my ($rh_evaluated_answers, $rh_problem_state, %form_options) = @_; +=head2 std_problem_grader + +This is an all-or-nothing grader. A student must get all parts of the problem +right before receiving credit. You should make sure to use this grader on +multiple choice and true-false questions, otherwise students will be able to +deduce how many answers are correct by the grade reported by webwork. - my %evaluated_answers = %{$rh_evaluated_answers}; + install_problem_grader('std_problem_grader'); - # By default the old problem state is simply passed back out again. - my %problem_state = %$rh_problem_state; +=cut + +sub std_problem_grader { + my ($answers, $problem_state, %form_options) = @_; # Initial setup of the answer. my %problem_result = ( @@ -1036,44 +1062,41 @@ sub std_problem_grader { msg => '', ); - my $ansCount = keys %evaluated_answers; + my $ansCount = keys %$answers; unless ($ansCount > 0) { - $problem_result{msg} = 'This problem did not ask any questions.'; - return (\%problem_result, \%problem_state); + $problem_result{msg} = eval('main::maketext("This problem did not ask any questions.")'); + return (\%problem_result, $problem_state); } - - $problem_result{msg} = 'In order to get credit for this problem all answers must be correct.' + $problem_result{msg} = + eval('main::maketext("In order to get credit for this problem all answers must be correct.")') if $ansCount > 1; - return (\%problem_result, \%problem_state) - unless defined $form_options{answers_submitted} && $form_options{answers_submitted} == 1; + # Return unless answers have been submitted. + return (\%problem_result, $problem_state) unless $form_options{answers_submitted} == 1; my $allAnswersCorrectQ = 1; - for my $ans_name (keys %evaluated_answers) { - if (ref $evaluated_answers{$ans_name} eq 'HASH' or ref $evaluated_answers{$ans_name} eq 'AnswerHash') { - $allAnswersCorrectQ = 0 unless $evaluated_answers{$ans_name}->{score} == 1; + for my $ans_name (keys %$answers) { + if (ref $answers->{$ans_name} eq 'HASH' || ref $answers->{$ans_name} eq 'AnswerHash') { + $allAnswersCorrectQ = 0 unless $answers->{$ans_name}{score} == 1; } else { - warn "Error: Answer $ans_name is not a hash"; - warn "$evaluated_answers{$ans_name}"; - warn 'This probably means that the answer evaluator for this answer is not working correctly.'; - $problem_result{error} = "Error: Answer $ans_name is not a hash: $evaluated_answers{$ans_name}"; + die "Error: Answer |$ans_name| is not a hash reference\n" + . $answers->{$ans_name} + . "\nThis probably means that the answer evaluator for this answer is not working correctly."; } } # Report the results. $problem_result{score} = $allAnswersCorrectQ; - $problem_state{recorded_score} //= 0; - if ($allAnswersCorrectQ == 1 || $problem_state{recorded_score} == 1) { - $problem_state{recorded_score} = 1; - } else { - $problem_state{recorded_score} = 0; - } + ++$problem_state->{num_of_correct_ans} if $allAnswersCorrectQ == 1; + ++$problem_state->{num_of_incorrect_ans} if $allAnswersCorrectQ == 0; + $problem_state->{recorded_score} //= 0; - ++$problem_state{num_of_correct_ans} if $allAnswersCorrectQ == 1; - ++$problem_state{num_of_incorrect_ans} if $allAnswersCorrectQ == 0; + # Increase recorded score if the current score is greater. + $problem_state->{recorded_score} = $problem_result{score} + if $problem_result{score} > $problem_state->{recorded_score}; - return (\%problem_result, \%problem_state); + return (\%problem_result, $problem_state); } sub rf_avg_problem_grader { @@ -1081,6 +1104,78 @@ sub rf_avg_problem_grader { return \&avg_problem_grader; } +=head2 avg_problem_grader + +This grader gives a "weighted" average score to the problem and is the default +grader. + +The grader can be selected by calling + + install_problem_grader('avg_problem_grader'); + +However, since this is the default grader, that is not necessary to use this +grader. + +Each answer is assigned a weight (the default is 1). The score is then the sum +of the product of the weights and scores for the correct answers divided by the +total of the weights for all answers. (To assign weights as percentages, use +integers that add up to 100. For example, use 40 and 60 for the weights for two +answers.) Assign weights to answers using the C option C<< weight => n >>. +For example, in PGML create the answer rule with + + [_]{$answer}{10}{ cmp_options => { weight => 40 } } + +With the classic C method call + + ANS($answer->cmp(weight => 40); + +This grader also allows for one "goal" answer that is answered correctly to +automatically give credit for one or more other "optional" answers. This way, if +there are several "optional" answers leading up to the "goal" answer, and the +student produces the "goal" answer by some other means and does not answer the +"optional" answers, the student can be given full credit for the problem anyway. +To use this feature use the C option of the C method for the "goal" +answer. For example, C<< credit => $answer1Name >> or C<< credit => [ +$answer1Name, $answer2Name, ... ] >>, where C<$answer1Name>, C<$answer2Name>, +etc., are the names of the "optional" answers that will be given credit if the +"goal" answer is correct. Note that the other answers must be assigned names +either by calling C and C, or by creating the answer +rule in PGML with C<[_]{$answer1}{15}{$answer1Name}>, for example. The answer +names should be generated by calling C (for example, +C<$answer1Name = NEW_ANS_NAME()>) rather than being made up. Otherwise the +problem will fail to work in many situations (for example, in tests). For +example, to set this up in PGML use + + BEGIN_PGML + Optional Answer 1: [_]{$answer1}{10}{$answer1Name = NEW_ANS_NAME()} + + Optional Answer 2: [_]{$answer2}{10}{$answer2Name = NEW_ANS_NAME()} + + Goal: [_]{$answer3}{10}{ cmp_options => { credit => [ $answer1Name, $answer2Name ] } } + END_PGML + +Note that the C and C options can be used together. For example: + + BEING_PGML + Optional Answer: [_]{$optional}{10}{$optionalName = NEW_ANS_NAME()}{{ weight => 20 }} + + Goal: [_]{$goalAnswer}{10}{ cmp_options => { credit => $optionalName, weight => 80 } } + END_PGML + +This way, if the "optional" answer is correct but the "goal" answer is not, the +problem score will be 20%, but if the "goal" answer is correct, the problem +score will be 100%. + +One caveat to keep in mind is that credit is given to an "optional" answer ONLY +if the answer is left blank (or is actually correct). Credit will NOT be given +if an "optional" answer is incorrect, even if the "goal" answer IS correct. + +When credit is given to an "optional" answer due to the "goal" answer being +correct, a message will be added to the "optional" answer stating, "This answer +was marked correct because the primary answer is correct." + +=cut + sub avg_problem_grader { my ($answers, $problem_state, %form_options) = @_; diff --git a/macros/PG.pl b/macros/PG.pl index a72b7ea6c6..9c6aa7ddb2 100644 --- a/macros/PG.pl +++ b/macros/PG.pl @@ -107,9 +107,18 @@ =head2 DOCUMENT C should be the first executable statement in any problem. It initializes variables and defines the problem environment. +Problems that have a metadata block must not call this method. For those +problems the translator calls this method with the options C +and C set from the problem metadata. See L. + =cut sub DOCUMENT { + my %options = @_; + + die "DOCUMENT must not be called in a problem that has a metadata block.\n" + if $PG && $PG->{pgAuthoringVersion} && (caller)[1] eq $PG->{problemEvalFile}; + # get environment $rh_envir = \%envir; #KLUDGE FIXME @@ -149,6 +158,15 @@ sub DOCUMENT { load_css(); load_js(); + + if (defined $options{pgAuthoringVersion}) { + $PG->{pgAuthoringVersion} = $options{pgAuthoringVersion}; + # This is the file name that perl assigns to the evaluated problem code. It is used to detect calls to + # loadMacros from the problem code as opposed to calls from within macros. + $PG->{problemEvalFile} = (caller)[1]; + loadMacros('PGbasicmacros.pl', 'PGauxiliaryFunctions.pl', 'PGML.pl', @{ $options{macros} // [] }, + 'PGcourse.pl'); + } } $main::displayMode = $PG->{displayMode}; @@ -706,34 +724,12 @@ =head2 ENDDOCUMENT =item * -C: a reference to the chosen problem grader. -C chooses the problem grader as follows: - -=over - -=item * - -If a problem grader has been chosen in the problem by calling -C, it is used. - -=item * - -Otherwise, if the C PG environment variable contains a -reference to a subroutine, it is used. - -=item * - -Otherwise, if the C PG environment variable contains the -string C or the string C, -C<&std_problem_grader> or C<&avg_problem_grader> are used. These graders are -defined in L. - -=item * - -Otherwise, the C flag will contain an empty value and the -PG translator should select C<&std_problem_grader>. - -=back +C: Either the string C, the string +C, or a reference to problem grader code. Note that the +C PG environment variable setting is transferred to this +flag in C if this flag is not set prior to the C call. +L handles conversion of the string values into the appropriate +L methods as needed. =back @@ -936,6 +932,9 @@ =head2 ENDDOCUMENT =cut sub ENDDOCUMENT { + die "ENDDOCUMENT must not be called in a problem that has a metadata block.\n" + if $PG->{pgAuthoringVersion} && $PG->{documentEnded}++; + # Insert MathQuill responses if MathQuill is enabled. Add responses to each answer's response group that store the # latex form of the students' answers and add corresponding hidden input boxes to the page. if ($envir{useMathQuill} && $main::displayMode =~ /HTML/i) { @@ -1460,24 +1459,10 @@ sub ENDDOCUMENT { }); } - # Install problem grader. - # WeBWorK::PG::Translator will install its default problem grader if none of the conditions below are true. - if (defined($PG->{flags}{PROBLEM_GRADER_TO_USE})) { - # Problem grader defined within problem. No further action needed. - } elsif (defined($rh_envir->{PROBLEM_GRADER_TO_USE})) { - if (ref($rh_envir->{PROBLEM_GRADER_TO_USE}) eq 'CODE') { - # User defined grader. - $PG->{flags}{PROBLEM_GRADER_TO_USE} = $rh_envir->{PROBLEM_GRADER_TO_USE}; - } elsif ($rh_envir->{PROBLEM_GRADER_TO_USE} eq 'std_problem_grader') { - $PG->{flags}{PROBLEM_GRADER_TO_USE} = \&std_problem_grader if (defined(&std_problem_grader)); - } elsif ($rh_envir->{PROBLEM_GRADER_TO_USE} eq 'avg_problem_grader') { - $PG->{flags}{PROBLEM_GRADER_TO_USE} = \&avg_problem_grader if (defined(&avg_problem_grader)); - } else { - warn "Error: $PG->{flags}{PROBLEM_GRADER_TO_USE} is not a known problem grader."; - } - } elsif (defined(&std_problem_grader)) { - $PG->{flags}{PROBLEM_GRADER_TO_USE} = \&std_problem_grader; - } + # Transfer the environment problem grader setting to the flag. WeBWorK::PG will handle conversion of the + # avg_problem_grader or std_problem_grader string values into the appropriate WeBWorK::PG::Translator methods, leave + # this as a code reference if that is what it is, or die if it is anything else. + $PG->{flags}{PROBLEM_GRADER_TO_USE} //= $rh_envir->{PROBLEM_GRADER_TO_USE}; TEXT(MODES(%{ $rh_envir->{problemPostamble} })); @@ -1562,6 +1547,9 @@ sub findMacroFile { } sub loadMacros { + die "loadMacros must not be called in a problem that has a metadata block. " + . "Declare the macros in the problem metadata instead.\n" + if $PG->{pgAuthoringVersion} && (caller)[1] eq $PG->{problemEvalFile}; $PG->{PG_loadMacros}->loadMacros(@_); } @@ -1569,23 +1557,16 @@ sub loadMacros { # problems that do so actually work even though this method does nothing. sub findAppletCodebase { return ''; } -## Problem Grader Subroutines +# Problem Grader Subroutines -##################################### -# This is a model for plug-in problem graders -##################################### -# ^function install_problem_grader -# ^uses PG_restricted_eval -# ^uses %PG_FLAGS{PROBLEM_GRADER_TO_USE} sub install_problem_grader { - my $rf_problem_grader = shift; - my $rh_flags = $PG->{flags}; - $rh_flags->{PROBLEM_GRADER_TO_USE} = $rf_problem_grader if not_null($rf_problem_grader); - $rh_flags->{PROBLEM_GRADER_TO_USE}; + my $problem_grader = shift; + $PG->{flags}{PROBLEM_GRADER_TO_USE} = $problem_grader if not_null($problem_grader); + return $PG->{flags}{PROBLEM_GRADER_TO_USE}; } sub current_problem_grader { - install_problem_grader(@_); + return install_problem_grader(@_); } # FIXME? The following functions were taken from the former diff --git a/macros/core/PGanswermacros.pl b/macros/core/PGanswermacros.pl index fbe899f44a..3357297aa3 100644 --- a/macros/core/PGanswermacros.pl +++ b/macros/core/PGanswermacros.pl @@ -1417,7 +1417,7 @@ sub check_units { =head3 C -This is an all-or-nothing grader. A student must get all parts of the problem write +This is an all-or-nothing grader. A student must get all parts of the problem right before receiving credit. You should make sure to use this grader on multiple choice and true-false questions, otherwise students will be able to deduce how many answers are correct by the grade reported by webwork. @@ -1427,14 +1427,9 @@ =head3 C =cut sub std_problem_grader { - my ($rh_evaluated_answers, $rh_problem_state, %form_options) = @_; - - my %evaluated_answers = %{$rh_evaluated_answers}; - - # By default the old problem state is simply passed back out again. - my %problem_state = %$rh_problem_state; + my ($answers, $problem_state, %form_options) = @_; - # Initial setup of the answer + # Initial setup of the answer. my %problem_result = ( score => 0, errors => '', @@ -1442,47 +1437,45 @@ sub std_problem_grader { msg => '', ); - my $ansCount = keys %evaluated_answers; - + my $ansCount = keys %$answers; unless ($ansCount > 0) { - $problem_result{msg} = 'This problem did not ask any questions.'; - return (\%problem_result, \%problem_state); + $problem_result{msg} = maketext('This problem did not ask any questions.'); + return (\%problem_result, $problem_state); } + $problem_result{msg} = maketext('In order to get credit for this problem all answers must be correct.') + if $ansCount > 1; - $problem_result{msg} = 'In order to get credit for this problem all answers must be correct.' if ($ansCount > 1); - - return (\%problem_result, \%problem_state) unless $form_options{answers_submitted} == 1; + # Return unless answers have been submitted. + return (\%problem_result, $problem_state) unless $form_options{answers_submitted} == 1; my $allAnswersCorrectQ = 1; - for my $ans_name (keys %evaluated_answers) { - if (ref $evaluated_answers{$ans_name} eq 'HASH' || ref $evaluated_answers{$ans_name} eq 'AnswerHash') { - $allAnswersCorrectQ = 0 unless $evaluated_answers{$ans_name}{score} == 1; + for my $ans_name (keys %$answers) { + if (ref $answers->{$ans_name} eq 'HASH' || ref $answers->{$ans_name} eq 'AnswerHash') { + $allAnswersCorrectQ = 0 unless $answers->{$ans_name}{score} == 1; } else { - die 'Error at file ', __FILE__, 'line ', __LINE__, - ": Answer |$ans_name| is not a hash reference\n" - . $evaluated_answers{$ans_name} - . 'This probably means that the answer evaluator for this answer is not working correctly.'; - $problem_result{error} = "Error: Answer $ans_name is not a hash: $evaluated_answers{$ans_name}"; + die "Error: Answer |$ans_name| is not a hash reference\n" + . $answers->{$ans_name} + . "\nThis probably means that the answer evaluator for this answer is not working correctly."; } } - # Report the results + # Report the results. $problem_result{score} = $allAnswersCorrectQ; - ++$problem_state{num_of_correct_ans} if $allAnswersCorrectQ == 1; - ++$problem_state{num_of_incorrect_ans} if $allAnswersCorrectQ == 0; - $problem_state{recorded_score} //= 0; + ++$problem_state->{num_of_correct_ans} if $allAnswersCorrectQ == 1; + ++$problem_state->{num_of_incorrect_ans} if $allAnswersCorrectQ == 0; + $problem_state->{recorded_score} //= 0; # Increase recorded score if the current score is greater. - $problem_state{recorded_score} = $problem_result{score} - if $problem_result{score} > $problem_state{recorded_score}; + $problem_state->{recorded_score} = $problem_result{score} + if $problem_result{score} > $problem_state->{recorded_score}; - (\%problem_result, \%problem_state); + return (\%problem_result, $problem_state); } =head3 C -This is an all-or-nothing grader. A student must get all parts of the problem write +This is an all-or-nothing grader. A student must get all parts of the problem right before receiving credit. You should make sure to use this grader on multiple choice and true-false questions, otherwise students will be able to deduce how many answers are correct by the grade reported by webwork. diff --git a/t/contexts/significant_figures.t b/t/contexts/significant_figures.t index 1e5553e59c..1d9ba6da9f 100644 --- a/t/contexts/significant_figures.t +++ b/t/contexts/significant_figures.t @@ -391,8 +391,10 @@ subtest 'Significant Figures for integers' => sub { subtest 'Significant Figures for partial credit' => sub { # test an actual problem my $source = <<~'END_SOURCE'; - DOCUMENT(); - loadMacros('PGstandard.pl', 'PGML.pl', 'contextSignificantFigures.pl'); + ## --- + ## pgAuthoringVersion: 1 + ## macros: [contextSignificantFigures.pl] + ## --- Context('SignificantFigures')->flags->set( tolerance => 0.001, partial_incorrect_sf => 0.6, @@ -402,7 +404,6 @@ subtest 'Significant Figures for partial credit' => sub { BEGIN_PGML [_]{$a} END_PGML - ENDDOCUMENT(); END_SOURCE ok my $pg = WeBWorK::PG->new( @@ -463,8 +464,10 @@ subtest 'Significant Figures for partial credit' => sub { # test an actual problem my $source = <<~'END_SOURCE'; - DOCUMENT(); - loadMacros('PGstandard.pl', 'PGML.pl', 'contextSignificantFigures.pl'); + ## --- + ## pgAuthoringVersion: 1 + ## macros: [contextSignificantFigures.pl] + ## --- Context('SignificantFigures')->flags->set( tolerance => 0.001, partial_incorrect_sf => 0.6, @@ -474,7 +477,6 @@ subtest 'Significant Figures for partial credit' => sub { BEGIN_PGML [_]{$a} END_PGML - ENDDOCUMENT(); END_SOURCE ok my $pg = WeBWorK::PG->new( diff --git a/t/macros/load_macros.t b/t/macros/load_macros.t index c8ab7e6575..cef2c64866 100644 --- a/t/macros/load_macros.t +++ b/t/macros/load_macros.t @@ -21,19 +21,12 @@ use WeBWorK::PG; my %baseMacros = ( 'PG.pl' => 1, - 'PGstandard.pl' => 1, 'PGbasicmacros.pl' => 1, - 'PGanswermacros.pl' => 1, 'PGauxiliaryFunctions.pl' => 1, - 'customizeLaTeX.pl' => 1, - 'PGnumericevaluators.pl' => 1, - 'PGfunctionevaluators.pl' => 1, - 'PGstringevaluators.pl' => 1, - 'PGmiscevaluators.pl' => 1, 'PGcommonFunctions.pl' => 1 ); -my %brokenMacros = ('answerDiscussion.pl' => 1); +my %brokenMacros = ('answerDiscussion.pl' => 1, 'PGmorematrixmacros.pl' => 1); # Find all macro files inside the $ENV{PG_ROOT}/macros directory. my @macro_files; @@ -52,7 +45,7 @@ find( for (@macro_files) { subtest $_ => sub { my $pg = WeBWorK::PG->new( - r_source => \"DOCUMENT(); loadMacros('PGstandard.pl', '$_'); ENDDOCUMENT();", + r_source => \"##---\n## pgAuthoringVersion: 1\n## macros: [$_]\n##---\n", debuggingOptions => { view_problem_debugging_info => 1 } ); diff --git a/t/pg_problems/blankProblem.pg b/t/pg_problems/blankProblem.pg index 5c36a95a95..cc2b48bd3d 100644 --- a/t/pg_problems/blankProblem.pg +++ b/t/pg_problems/blankProblem.pg @@ -1,6 +1,8 @@ -DOCUMENT(); - -loadMacros('PGstandard.pl', 'MathObjects.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - MathObjects.pl +## --- $pi = Real('pi'); @@ -9,5 +11,3 @@ Enter a value for [`\pi`]. [_____]{$pi} END_PGML - -ENDDOCUMENT(); diff --git a/t/pg_problems/problem_metadata.t b/t/pg_problems/problem_metadata.t new file mode 100644 index 0000000000..839dfedcef --- /dev/null +++ b/t/pg_problems/problem_metadata.t @@ -0,0 +1,191 @@ +#!/usr/bin/env perl + +die "PG_ROOT not found in environment.\n" unless $ENV{PG_ROOT}; +use lib "$ENV{PG_ROOT}/lib"; + +use Test2::V0; + +use WeBWorK::PG; +use WeBWorK::PG::Metadata qw(parse_metadata); + +sub render { + my $source = shift; + return WeBWorK::PG->new(r_source => \$source, debuggingOptions => { view_problem_debugging_info => 1 }); +} + +subtest 'parse_metadata' => sub { + is( + parse_metadata(<<~'END_SOURCE'), + ## DESCRIPTION + ## A problem + ## ENDDESCRIPTION + ## DBsubject(WeBWorK) + # An ordinary comment + + ##--- + ## pgAuthoringVersion: 1 + ## macros: + ## - parserMultiAnswer.pl + ## - contextFraction.pl + ##--- + + $a = 1; + END_SOURCE + { pgAuthoringVersion => 1, macros => [ 'parserMultiAnswer.pl', 'contextFraction.pl' ] }, + 'block preceded by comments and blank lines is parsed' + ); + + is( + parse_metadata("##---\n##pgAuthoringVersion: 1\n##---\n"), + { pgAuthoringVersion => 1, macros => [] }, + 'macros are optional and the space after ## is optional' + ); + + is(parse_metadata("\$a = 1;\n##---\n## pgAuthoringVersion: 1\n##---\n"), + undef, 'block after the first line of code is ignored'); + + is( + parse_metadata("##---\n## pgAuthoringversion: 1\n## MACROS:\n## - a.pl\n##---\n"), + { pgAuthoringVersion => 1, macros => ['a.pl'] }, + 'keys are case insensitive' + ); + + is(parse_metadata("##---\n## pgAuthorringVersion: 1\n##---\n"), + undef, 'a misspelled pgAuthoringVersion does not start a block'); + + is(parse_metadata("## pgAuthoringVersion: 1\n"), undef, 'metadata outside of a block is ignored'); + + is( + parse_metadata(<<~'END_SOURCE'), + ##--- + ## A divider comment + ##--- + ## --- + ## macros: + ## - a.pl + ## --- + END_SOURCE + undef, + '## --- lines that are not immediately followed by the pgAuthoringVersion do not start a block' + ); + + is( + parse_metadata("##---\n## A divider comment\n##---\n##---\n## pgAuthoringVersion: 1\n##---\n"), + { pgAuthoringVersion => 1, macros => [] }, + 'block following divider comments is parsed' + ); + is(parse_metadata(''), undef, 'empty source'); + + for ( + [ "##---\n## pgAuthoringVersion: 1\n" => qr/not terminated/, 'unterminated block' ], + [ "##---\n## pgAuthoringVersion: 1\n\$a = 1;\n" => qr/not terminated/, 'code inside block' ], + [ "##---\n## pgAuthoringVersion:\n##---\n" => qr/Unsupported pgAuthoringVersion: $/m, 'empty version' ], + [ "##---\n## pgAuthoringVersion: 2\n##---\n" => qr/Unsupported pgAuthoringVersion: 2/, 'bad version' ], + [ + "##---\n## pgAuthoringVersion: 1\n## macro:\n## - a.pl\n##---\n" => qr/Unknown metadata key: macro/, + 'unknown key' + ], + [ + "##---\n## pgAuthoringVersion: 1\n## macros:\n## - a.pl\n## Macros:\n## - b.pl\n##---\n" => + qr/The metadata key macros is declared more than once/, + 'key declared more than once with different case' + ], + [ + "##---\n## pgAuthoringVersion: 1\n## macros: a.pl\n##---\n" => qr/must be a list/, + 'macros not a list' + ], + [ + "# comment\n##---\n## pgAuthoringVersion: [1\n##---\n" => qr/not valid YAML.*line: 4/s, + 'invalid YAML reports the line in the source' + ], + ) + { + like(dies { parse_metadata($_->[0]) }, $_->[1], $_->[2]); + } +}; + +subtest 'new style problem' => sub { + my $pg = render(<<~'END_SOURCE'); + ## DBsubject(WeBWorK) + ## --- + ## pgAuthoringVersion: 1 + ## macros: + ## - contextFraction.pl + ## --- + + Context('Fraction'); + $f = Fraction(1, 2); + + BEGIN_PGML + [_]{$f} + END_PGML + END_SOURCE + + is($pg->{errors}, '', 'renders without errors'); + ok(defined &{"$pg->{translator}{safe_compartment_name}::_contextFraction_init"}, 'declared macro is loaded'); + ok(defined &{"$pg->{translator}{safe_compartment_name}::_PGcourse_init"}, 'PGcourse.pl is loaded'); + is($pg->{translator}{rh_pgcore}{pgAuthoringVersion}, 1, 'authoring version is recorded'); + $pg->free; +}; + +subtest 'new style problem errors' => sub { + my $header = "##---\n## pgAuthoringVersion: 1\n##---\n"; + for ( + [ DOCUMENT => "${header}DOCUMENT();\n" ], + [ ENDDOCUMENT => "${header}ENDDOCUMENT();\n" ], + [ loadMacros => "${header}loadMacros('contextFraction.pl');\n" ] + ) + { + my $pg = render($_->[1]); + like($pg->{errors}, qr/$_->[0] must not be called/, "calling $_->[0] is an error"); + $pg->free; + } + + my $pg = render("##---\n## pgAuthoringVersion: 2\n##---\nBEGIN_PGML\nText\nEND_PGML\n"); + like( + $pg->{errors}, + qr/ERRORS in the PG metadata:\nUnsupported pgAuthoringVersion: 2/, + 'invalid metadata is reported' + ); + unlike($pg->{errors}, qr/ERRORS from evaluating/, 'problem is not evaluated if the metadata is invalid'); + $pg->free; +}; + +subtest 'old style problem' => sub { + my $dividers = render(<<~'END_SOURCE'); + ##--- + ## DESCRIPTION + ## An old style problem + ## ENDDESCRIPTION + ##--- + DOCUMENT(); + loadMacros('PGstandard.pl', 'PGML.pl'); + BEGIN_PGML + Old style + END_PGML + ENDDOCUMENT(); + END_SOURCE + is($dividers->{errors}, '', 'renders without errors with ## --- divider comments'); + $dividers->free; + + my $pg = render(<<~'END_SOURCE'); + DOCUMENT(); + ##--- + ## pgAuthoringVersion: 1 + ## macros: + ## - contextFraction.pl + ##--- + loadMacros('PGstandard.pl', 'PGML.pl'); + BEGIN_PGML + Old style + END_PGML + ENDDOCUMENT(); + END_SOURCE + + is($pg->{errors}, '', 'renders without errors'); + ok(!defined &{"$pg->{translator}{safe_compartment_name}::_contextFraction_init"}, + 'metadata after code is ignored'); + $pg->free; +}; + +done_testing; diff --git a/t/pg_problems/source.t b/t/pg_problems/source.t index dd0c70351b..ef9ad85e47 100644 --- a/t/pg_problems/source.t +++ b/t/pg_problems/source.t @@ -8,9 +8,11 @@ use Test2::V0; use WeBWorK::PG; my $source = <<'END_SOURCE'; -DOCUMENT(); - -loadMacros('PGstandard.pl', 'MathObjects.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - MathObjects.pl +## --- $pi = Real('pi'); @@ -19,8 +21,6 @@ Enter a value for [`\pi`]. [_____]{$pi} END_PGML - -ENDDOCUMENT(); END_SOURCE ok my $pg = WeBWorK::PG->new(r_source => \$source, problemSeed => 1234, processAnswers => 1), 'source string renders'; diff --git a/tutorial/sample-problems/Algebra/AlgebraicFractionAnswer.pg b/tutorial/sample-problems/Algebra/AlgebraicFractionAnswer.pg index ccba8797e6..8d78f14ba5 100644 --- a/tutorial/sample-problems/Algebra/AlgebraicFractionAnswer.pg +++ b/tutorial/sample-problems/Algebra/AlgebraicFractionAnswer.pg @@ -20,10 +20,12 @@ #: Load the PODLINK('parserMultiAnswer.pl') macro to be able to consider two #: answer rules together (the numerator and denominator) in the answer checker. #: Note that the PODLINK('niceTables.pl') macro is implicitly used, and is -#: automatically loaded by the `PGML.pl` macro. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserMultiAnswer.pl', 'PGcourse.pl'); +#: automatically loaded by the `PGML.pl` macro which is always loaded. +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserMultiAnswer.pl +## --- #:% section = setup #: Define MathObject formulas `$num` and `$den` which are the correct numerator @@ -130,5 +132,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/AnswerBlankInExponent.pg b/tutorial/sample-problems/Algebra/AnswerBlankInExponent.pg index 723cf0bda8..cc48ede1c1 100644 --- a/tutorial/sample-problems/Algebra/AnswerBlankInExponent.pg +++ b/tutorial/sample-problems/Algebra/AnswerBlankInExponent.pg @@ -17,9 +17,9 @@ #:% categories = [exponent] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Set the context to allow only the variables `a` and `b` and choose a random @@ -72,5 +72,3 @@ ANS($exponent->cmp); BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/AnswerUpToMultiple.pg b/tutorial/sample-problems/Algebra/AnswerUpToMultiple.pg index abb00d4437..99428981a6 100644 --- a/tutorial/sample-problems/Algebra/AnswerUpToMultiple.pg +++ b/tutorial/sample-problems/Algebra/AnswerUpToMultiple.pg @@ -17,9 +17,9 @@ #:% categories = [answers, adaptive parameters] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: The answer checker uses a local context with an adaptive parameter to check @@ -52,5 +52,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/DomainRange.pg b/tutorial/sample-problems/Algebra/DomainRange.pg index e6814ab60b..be2f33a052 100644 --- a/tutorial/sample-problems/Algebra/DomainRange.pg +++ b/tutorial/sample-problems/Algebra/DomainRange.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The PODLINK('contextInequalities.pl') macro is used for inequality answers. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextInequalities.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextInequalities.pl +## --- #:% section = setup #: In addition to showing how to use the PODLINK('contextInequalities.pl') @@ -91,5 +93,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/DynamicGraph.pg b/tutorial/sample-problems/Algebra/DynamicGraph.pg index 9245446dab..31e20c8313 100644 --- a/tutorial/sample-problems/Algebra/DynamicGraph.pg +++ b/tutorial/sample-problems/Algebra/DynamicGraph.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The dynamic graph is generated with `PGtikz.pl`, so this is needed. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: The code between `$graph->BEGIN_TIKZ` and `END_TIKZ` are TikZ commands. @@ -95,5 +97,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/EquationDefiningFunction.pg b/tutorial/sample-problems/Algebra/EquationDefiningFunction.pg index b37d88f1ba..bfa8cb32ca 100644 --- a/tutorial/sample-problems/Algebra/EquationDefiningFunction.pg +++ b/tutorial/sample-problems/Algebra/EquationDefiningFunction.pg @@ -19,9 +19,11 @@ #:% section = preamble #: The macro file PODLINK('parserAssignment.pl') needs to be included. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserAssignment.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserAssignment.pl +## --- #:% section = setup #: To allow assignments in the current context call `parser::Assignment->Allow`. @@ -46,5 +48,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/EquationImplicitFunction.pg b/tutorial/sample-problems/Algebra/EquationImplicitFunction.pg index a2c0d3ba49..fbeef491d3 100644 --- a/tutorial/sample-problems/Algebra/EquationImplicitFunction.pg +++ b/tutorial/sample-problems/Algebra/EquationImplicitFunction.pg @@ -18,12 +18,11 @@ #:% section = preamble #: The macro PODLINK('parserImplicitEquation.pl') allows the entry of equations. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserImplicitEquation.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserImplicitEquation.pl +## --- #:% section = setup #: Some error messages are prevented by redefining them to be a blank string ' ' @@ -75,5 +74,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/ExpandedPolynomial.pg b/tutorial/sample-problems/Algebra/ExpandedPolynomial.pg index 512c385b50..a1234a3fbb 100644 --- a/tutorial/sample-problems/Algebra/ExpandedPolynomial.pg +++ b/tutorial/sample-problems/Algebra/ExpandedPolynomial.pg @@ -20,12 +20,11 @@ #:% section = preamble #: Load the PODLINK('contextLimitedPolynomial.pl') macro. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'contextLimitedPolynomial.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextLimitedPolynomial.pl +## --- #:% section = setup #: The PODLINK('contextLimitedPolynomial.pl') macro provides two contexts: @@ -72,5 +71,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/FactoredPolynomial.pg b/tutorial/sample-problems/Algebra/FactoredPolynomial.pg index 49718f614f..e1acff430e 100644 --- a/tutorial/sample-problems/Algebra/FactoredPolynomial.pg +++ b/tutorial/sample-problems/Algebra/FactoredPolynomial.pg @@ -20,13 +20,12 @@ #:% section = preamble #: Additional contexts provided by the PODLINK('contextPolynomialFactors.pl') #: and PODLINK('contextLimitedPowers.pl') macros are needed. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'contextPolynomialFactors.pl', 'contextLimitedPowers.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextPolynomialFactors.pl +## - contextLimitedPowers.pl +## --- #:% section = setup #: Before computing the answer which will be the factored form of the @@ -68,5 +67,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/FractionAnswer.pg b/tutorial/sample-problems/Algebra/FractionAnswer.pg index 94c94aea3a..51880c2791 100644 --- a/tutorial/sample-problems/Algebra/FractionAnswer.pg +++ b/tutorial/sample-problems/Algebra/FractionAnswer.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The macro `contextFraction.pl` must be loaded. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextFraction.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextFraction.pl +## --- #:% section = setup #: The PODLINK('contextFraction.pl') macro provides four contexts: @@ -55,5 +57,3 @@ END_PGML BEGIN_PGML_SOLUTION Factor and cancel to obtain [`\displaystyle [$answer]`]. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/FunctionDecomposition.pg b/tutorial/sample-problems/Algebra/FunctionDecomposition.pg index 2b1accffb3..0855615bf0 100644 --- a/tutorial/sample-problems/Algebra/FunctionDecomposition.pg +++ b/tutorial/sample-problems/Algebra/FunctionDecomposition.pg @@ -22,9 +22,11 @@ #: function. This can be used in problems where a student is asked to break a #: given function into a composition of two simpler functions, neither of which #: is allowed to be the identity function. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'answerComposition.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - answerComposition.pl +## --- #:% section = setup #: This problem asks the students for functions `y = f(u)` and `u = g(x)` such @@ -57,5 +59,3 @@ COMPOSITION_ANS($f, $g, vars => [ 'u', 'x' ], showVariableHints => 1); BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/FunctionPlot.pg b/tutorial/sample-problems/Algebra/FunctionPlot.pg index 219c2cfc05..0ffde5023b 100644 --- a/tutorial/sample-problems/Algebra/FunctionPlot.pg +++ b/tutorial/sample-problems/Algebra/FunctionPlot.pg @@ -17,9 +17,11 @@ #:% categories = [plots] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plots.pl +## --- #:% section = setup #: For this problem, a plot of $y = ax^2$ for a random value of $a$ is @@ -66,5 +68,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/GraphToolCircle.pg b/tutorial/sample-problems/Algebra/GraphToolCircle.pg index e7b1ba10a5..efddd5acb2 100644 --- a/tutorial/sample-problems/Algebra/GraphToolCircle.pg +++ b/tutorial/sample-problems/Algebra/GraphToolCircle.pg @@ -19,9 +19,11 @@ #: This example shows how to get student input in the form of a graph (a circle) #: by using interactive graphing tools. Load the PODLINK('parserGraphTool.pl') #: macro for this. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: The variables `$h`, `$k` and `$r` randomly pick a center and radius of the @@ -100,5 +102,3 @@ or down from the center. The solution is [! the graph of a circle centered at ([$h], [$k]) of radius [$r] !]{$gt} END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/GraphToolCubic.pg b/tutorial/sample-problems/Algebra/GraphToolCubic.pg index e46d42966c..e72b291072 100644 --- a/tutorial/sample-problems/Algebra/GraphToolCubic.pg +++ b/tutorial/sample-problems/Algebra/GraphToolCubic.pg @@ -19,13 +19,12 @@ #: This example shows how to get student input in the form of a graph (a cubic) #: by using interactive graphing tools. Load the PODLINK('parserGraphTool.pl') #: macro for this. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserGraphTool.pl', 'contextFraction.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## - contextFraction.pl +## --- #:% section = setup #: A cubic is created with 3 random zeros and a random y-intercept. @@ -97,5 +96,3 @@ evaluating [`p(0) = [$y0]`], then select [`(0, [$y0])`]. The solution is [![$altText]!]{$gt} END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/GraphToolCustomChecker.pg b/tutorial/sample-problems/Algebra/GraphToolCustomChecker.pg index 23050bbb24..ce714eaa03 100644 --- a/tutorial/sample-problems/Algebra/GraphToolCustomChecker.pg +++ b/tutorial/sample-problems/Algebra/GraphToolCustomChecker.pg @@ -19,9 +19,11 @@ #: This example shows how to get student input in the form of a graph (a circle) #: by using interactive graphing tools, and demonstrates the usage of a custom #: checker. Load the PODLINK('parserGraphTool.pl') macro for this. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: The variables `$h`, `$k` and `$r` randomly pick a center and radius of the @@ -154,5 +156,3 @@ circle tool, then click on the center at [`([$h],[$k])`] and then click on a second point that is [$r] units from the center. This is easiest going left, right, up or down from the center. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/GraphToolLine.pg b/tutorial/sample-problems/Algebra/GraphToolLine.pg index bf5154a39d..3944c36542 100644 --- a/tutorial/sample-problems/Algebra/GraphToolLine.pg +++ b/tutorial/sample-problems/Algebra/GraphToolLine.pg @@ -19,9 +19,11 @@ #: This example shows how to get student input in the form of a graph (a line) #: by using interactive graphing tools. Load the PODLINK('parserGraphTool.pl') #: macro for this. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: A cubic is created with 3 random zeros and a random y-intercept. @@ -86,5 +88,3 @@ Thus the [`x`]-intercept is the denominator of the fraction involving [`x`] or The solution is [! the graph of the line through ([$x0],0) and (0,[$y0]) !]{$gt} END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/GraphToolNumberLine.pg b/tutorial/sample-problems/Algebra/GraphToolNumberLine.pg index d9b3d2177e..1af308b9e7 100644 --- a/tutorial/sample-problems/Algebra/GraphToolNumberLine.pg +++ b/tutorial/sample-problems/Algebra/GraphToolNumberLine.pg @@ -19,9 +19,11 @@ #: This example shows how to get student input in the form of a graph #: by using interactive graphing tools. Load the PODLINK('parserGraphTool.pl') #: macro for this. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: Two intervals are created with random endpoints. The first @@ -83,5 +85,3 @@ Graph the solution set for the linear inequality [`x < [$x2]`]. [_]{$gt2} END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/GraphToolPoints.pg b/tutorial/sample-problems/Algebra/GraphToolPoints.pg index e57505c86d..24719ee6df 100644 --- a/tutorial/sample-problems/Algebra/GraphToolPoints.pg +++ b/tutorial/sample-problems/Algebra/GraphToolPoints.pg @@ -20,9 +20,11 @@ #: This example shows how to get student input in the form of points #: by using interactive graphing tools. Load the PODLINK('parserGraphTool.pl') #: macro for this. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: Two points are created at random. @@ -70,5 +72,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/InequalityAnswer.pg b/tutorial/sample-problems/Algebra/InequalityAnswer.pg index 1115aab912..6377810208 100644 --- a/tutorial/sample-problems/Algebra/InequalityAnswer.pg +++ b/tutorial/sample-problems/Algebra/InequalityAnswer.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The PODLINK('contextInequalities.pl') macro must be loaded -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextInequalities.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextInequalities.pl +## --- #:% section = setup #: Require students to use inequalities by using `Context('Inequalities-Only')`. @@ -50,5 +52,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/LinearInequality.pg b/tutorial/sample-problems/Algebra/LinearInequality.pg index 4ce11b8d73..bf6764d243 100644 --- a/tutorial/sample-problems/Algebra/LinearInequality.pg +++ b/tutorial/sample-problems/Algebra/LinearInequality.pg @@ -19,10 +19,11 @@ #:% section = preamble #: The macro file PODLINK('parserLinearRelation.pl') must be loaded to be able #: to use the LinearRelation object. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserLinearRelation.pl', - 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserLinearRelation.pl +## --- #:% section = setup Context("LinearRelation"); @@ -49,5 +50,3 @@ END_PGML BEGIN_PGML_SOLUTION [`[$lr]`] END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/Logarithms.pg b/tutorial/sample-problems/Algebra/Logarithms.pg index c94c7b311f..32b34ee9ca 100644 --- a/tutorial/sample-problems/Algebra/Logarithms.pg +++ b/tutorial/sample-problems/Algebra/Logarithms.pg @@ -17,9 +17,9 @@ #:% categories = [logarithm] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Add the variables `x`, `y`, and `z` to the context and set their limits to be @@ -58,5 +58,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/NoSolution.pg b/tutorial/sample-problems/Algebra/NoSolution.pg index 1f170b7ee0..f5e475defe 100644 --- a/tutorial/sample-problems/Algebra/NoSolution.pg +++ b/tutorial/sample-problems/Algebra/NoSolution.pg @@ -18,12 +18,11 @@ #:% section = preamble #: Load the PODLINK('parserRadioMultiAnswer.pl') macro in addition to the usual #: macros. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserRadioMultiAnswer.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserRadioMultiAnswer.pl +## --- #:% section = setup #: A `RadioMultiAnswer` produces a set of radio buttons for each of the given @@ -64,5 +63,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/PointAnswers.pg b/tutorial/sample-problems/Algebra/PointAnswers.pg index c543ca72c3..153b0429b2 100644 --- a/tutorial/sample-problems/Algebra/PointAnswers.pg +++ b/tutorial/sample-problems/Algebra/PointAnswers.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Load PODLINK('contextLimitedPoint.pl') to prevent operations between points. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextLimitedPoint.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextLimitedPoint.pl +## --- #:% section = setup #: `Context('Point')` could be used instead, which would allow mathematical @@ -53,5 +55,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/ScalingTranslating.pg b/tutorial/sample-problems/Algebra/ScalingTranslating.pg index 59d8d7b311..bc8638b0b6 100644 --- a/tutorial/sample-problems/Algebra/ScalingTranslating.pg +++ b/tutorial/sample-problems/Algebra/ScalingTranslating.pg @@ -19,9 +19,11 @@ #:% section = preamble #: Load PODLINK('parserFunction.pl') so that a named function can be added to #: the context. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserFunction.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserFunction.pl +## --- #:% section = setup #: The `parserFunction` method allows the addition of a named function to the @@ -44,5 +46,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/SimpleFactoring.pg b/tutorial/sample-problems/Algebra/SimpleFactoring.pg index ee70cc3bff..397ee1a13b 100644 --- a/tutorial/sample-problems/Algebra/SimpleFactoring.pg +++ b/tutorial/sample-problems/Algebra/SimpleFactoring.pg @@ -19,9 +19,9 @@ #:% see_also = [FactoredPolynomial.pg, ExpandedPolynomial.pg, FactoringAndExpanding.pg] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: First, create two random roots and then create the factors. Note that calling #: `->reduce` will simplify `x-(-3)` to `x+3`. In addition, create the expanded @@ -72,5 +72,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/SolutionForEquation.pg b/tutorial/sample-problems/Algebra/SolutionForEquation.pg index bbda387238..cdc90969b5 100644 --- a/tutorial/sample-problems/Algebra/SolutionForEquation.pg +++ b/tutorial/sample-problems/Algebra/SolutionForEquation.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Load the macro PODLINK('parserSolutionFor.pl') for the `SolutionFor` method. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserSolutionFor.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserSolutionFor.pl +## --- #:% section = setup #: `SolutionFor(equation, point)` is used to define the MathObject answer. For @@ -41,5 +43,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/StringOrOtherType.pg b/tutorial/sample-problems/Algebra/StringOrOtherType.pg index cfeb428dfb..ba3611de9d 100644 --- a/tutorial/sample-problems/Algebra/StringOrOtherType.pg +++ b/tutorial/sample-problems/Algebra/StringOrOtherType.pg @@ -18,9 +18,9 @@ #:% see_also = [StringsInContext.pg] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: There are several predefined strings, such as `NONE`, `DNE`, `INF`, and @@ -59,5 +59,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/TableOfValues.pg b/tutorial/sample-problems/Algebra/TableOfValues.pg index eadaa2fb31..b9dd5bce93 100644 --- a/tutorial/sample-problems/Algebra/TableOfValues.pg +++ b/tutorial/sample-problems/Algebra/TableOfValues.pg @@ -19,9 +19,9 @@ #:% section = preamble #: The PODLINK('niceTables.pl') macro is implicitly used in this problem, but is #: automatically loaded by the `PGML.pl` macro. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Create the array `@answer` filled with values via a map. @@ -57,5 +57,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Algebra/UnorderedAnswers.pg b/tutorial/sample-problems/Algebra/UnorderedAnswers.pg index 5fbdc96b32..4380680cff 100644 --- a/tutorial/sample-problems/Algebra/UnorderedAnswers.pg +++ b/tutorial/sample-problems/Algebra/UnorderedAnswers.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The macro PODLINK('unorderedAnswer.pl') must be loaded. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'unorderedAnswer.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - unorderedAnswer.pl +## --- #:% section = setup #: The answers use the variables `x`, `y`, and `z`. The variable `x` is already @@ -54,5 +56,3 @@ UNORDERED_ANS($answer1->cmp, $answer2->cmp, $answer3->cmp); BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Arithmetic/UnitConversion.pg b/tutorial/sample-problems/Arithmetic/UnitConversion.pg index e2f319d313..8906f337cd 100644 --- a/tutorial/sample-problems/Arithmetic/UnitConversion.pg +++ b/tutorial/sample-problems/Arithmetic/UnitConversion.pg @@ -21,9 +21,11 @@ #:% section = preamble #: We load `contextUnits.pl` in order to use the Units context. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextUnits.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextUnits.pl +## --- #:% section = setup #: The Units context is from the PODLINK('contextUnits.pl') macro. @@ -83,5 +85,3 @@ b) [``` \cdot \frac{3600\;\text{sec}}{1\;\text{hr}} = [$speed_mph] ```] END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Complex/ComplexOperations.pg b/tutorial/sample-problems/Complex/ComplexOperations.pg index 64f25162a5..2986f1fd60 100644 --- a/tutorial/sample-problems/Complex/ComplexOperations.pg +++ b/tutorial/sample-problems/Complex/ComplexOperations.pg @@ -17,9 +17,9 @@ #:% categories = [complex variables] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: To use complex numbers, switch to the `Complex` context with @@ -67,5 +67,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Complex/LimitedComplex.pg b/tutorial/sample-problems/Complex/LimitedComplex.pg index a68bcf02f3..1906febe8d 100644 --- a/tutorial/sample-problems/Complex/LimitedComplex.pg +++ b/tutorial/sample-problems/Complex/LimitedComplex.pg @@ -19,12 +19,11 @@ #:% section = preamble #: This problems shows the capabilities of the #: PODLINK('contextLimitedComplex.pl') macro, so it must be loaded. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'contextLimitedComplex.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextLimitedComplex.pl +## --- #:% section = setup #: Often when students are asked to perform operations with complex numbers, @@ -81,5 +80,3 @@ The first answer in Cartesian form is [`[$ans1]`]. The second answer in polar form is [`[@ Round($abs0 * $abs1, 4) @] e^{[@ Round($arg0 + $arg1, 4) @]i}`]. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Complex/OtherOperations.pg b/tutorial/sample-problems/Complex/OtherOperations.pg index 180de8da92..1bd932040d 100644 --- a/tutorial/sample-problems/Complex/OtherOperations.pg +++ b/tutorial/sample-problems/Complex/OtherOperations.pg @@ -18,9 +18,9 @@ #:% see_also = [ComplexOperations.pg] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: To use complex numbers, switch to the `Complex` context with @@ -58,5 +58,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffCalc/AnswerWithUnits.pg b/tutorial/sample-problems/DiffCalc/AnswerWithUnits.pg index 5e86170c5b..c89df87e16 100644 --- a/tutorial/sample-problems/DiffCalc/AnswerWithUnits.pg +++ b/tutorial/sample-problems/DiffCalc/AnswerWithUnits.pg @@ -20,9 +20,11 @@ #:% section = preamble #: Load the PODLINK('parserNumberWithUnits.pl') and #: PODLINK('parserFormulaWithUnits.pl') macros. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextUnits.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextUnits.pl +## --- #:% section = setup #: First select the "Units" context, allow units for "length" and "time" in the @@ -71,5 +73,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffCalc/DifferenceQuotient.pg b/tutorial/sample-problems/DiffCalc/DifferenceQuotient.pg index 9af9ff780a..83c8d33f40 100644 --- a/tutorial/sample-problems/DiffCalc/DifferenceQuotient.pg +++ b/tutorial/sample-problems/DiffCalc/DifferenceQuotient.pg @@ -19,12 +19,11 @@ #:% section = preamble #: Include the macro file PODLINK('parserDifferenceQuotient.pl'). -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserDifferenceQuotient.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserDifferenceQuotient.pl +## --- #:% section = setup #: The `DifferenceQuotient` method takes a simplified function for its first @@ -49,5 +48,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffCalc/DifferentiateFunction.pg b/tutorial/sample-problems/DiffCalc/DifferentiateFunction.pg index 502d1db2a3..b6ef965bf2 100644 --- a/tutorial/sample-problems/DiffCalc/DifferentiateFunction.pg +++ b/tutorial/sample-problems/DiffCalc/DifferentiateFunction.pg @@ -17,9 +17,9 @@ #:% categories = [difference quotient] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: The differentiation operator is `->D('x')`. @@ -92,5 +92,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffCalc/LinearApprox.pg b/tutorial/sample-problems/DiffCalc/LinearApprox.pg index 8177d59be6..37e20fc729 100644 --- a/tutorial/sample-problems/DiffCalc/LinearApprox.pg +++ b/tutorial/sample-problems/DiffCalc/LinearApprox.pg @@ -21,13 +21,12 @@ #: as an equation of the form `y = ...`. Load PODLINK('answerHints.pl') to #: provide customized answer hints, particularly for students who enter the #: slope of the line instead of the equation of the line. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'answerHints.pl', 'parserAssignment.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - answerHints.pl +## - parserAssignment.pl +## --- #:% section = setup #: Allow assignments in the context by calling `parser::Assignment->Allow`. @@ -66,6 +65,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); - diff --git a/tutorial/sample-problems/DiffCalcMV/ContourPlot.pg b/tutorial/sample-problems/DiffCalcMV/ContourPlot.pg index dbb9346657..642099c355 100644 --- a/tutorial/sample-problems/DiffCalcMV/ContourPlot.pg +++ b/tutorial/sample-problems/DiffCalcMV/ContourPlot.pg @@ -19,12 +19,12 @@ #:% section = preamble #: The PODLINK('PGtikz.pl') macro is used for constructing the graph. The #: PODLINK('parserPopUp.pl') macro is used for a drop down menu answer. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGtikz.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserPopUp.pl +## - PGtikz.pl +## --- $showPartialCorrectAnswers = 0; @@ -79,5 +79,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffCalcMV/ImplicitPlane.pg b/tutorial/sample-problems/DiffCalcMV/ImplicitPlane.pg index ac44c9bebf..6cad040976 100644 --- a/tutorial/sample-problems/DiffCalcMV/ImplicitPlane.pg +++ b/tutorial/sample-problems/DiffCalcMV/ImplicitPlane.pg @@ -22,13 +22,12 @@ #: * The PODLINK('parserImplicitPlane.pl') macro includes the 'ImplicitPlane' #: context and the `ImplicitPlane` function used to parse and create implicit #: planes. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserImplicitPlane.pl', 'parserVectorUtils.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserImplicitPlane.pl +## - parserVectorUtils.pl +## --- #:% section = setup #: The first answer is a standard multivariable calculus question. There are @@ -74,5 +73,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffCalcMV/VectorFieldPlot.pg b/tutorial/sample-problems/DiffCalcMV/VectorFieldPlot.pg index c0c9976c6b..40d966ce8b 100644 --- a/tutorial/sample-problems/DiffCalcMV/VectorFieldPlot.pg +++ b/tutorial/sample-problems/DiffCalcMV/VectorFieldPlot.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The macro PODLINK('plots.pl') is used to create the plot. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plots.pl +## --- #:% section = setup #: This problem generates the vector field . First, create a @@ -69,5 +71,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffEq/GeneralSolutionODE.pg b/tutorial/sample-problems/DiffEq/GeneralSolutionODE.pg index 23a812d89f..a031cc3012 100644 --- a/tutorial/sample-problems/DiffEq/GeneralSolutionODE.pg +++ b/tutorial/sample-problems/DiffEq/GeneralSolutionODE.pg @@ -20,9 +20,11 @@ #:% section = preamble #: We load `parserAssignment.pl` to require student answers to be of the #: form `y = ...`. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserAssignment.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserAssignment.pl +## --- #:% section = setup #: Add the arbitrary constants `c1`, `c2`, and `c3` to the context as variables @@ -139,5 +141,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffEq/HeavisideStep.pg b/tutorial/sample-problems/DiffEq/HeavisideStep.pg index fe69f522ea..9abc985fbc 100644 --- a/tutorial/sample-problems/DiffEq/HeavisideStep.pg +++ b/tutorial/sample-problems/DiffEq/HeavisideStep.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Load PODLINK('parserFunction.pl') for adding a named function to the context. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserFunction.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserFunction.pl +## --- #:% section = setup #: Add the step function to the context with the name `step`. The function @@ -123,5 +125,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/DiffEq/PrimesInFormulas.pg b/tutorial/sample-problems/DiffEq/PrimesInFormulas.pg index 0f16d51e69..fa216e64a7 100644 --- a/tutorial/sample-problems/DiffEq/PrimesInFormulas.pg +++ b/tutorial/sample-problems/DiffEq/PrimesInFormulas.pg @@ -20,12 +20,11 @@ #: For this problem a differential equation is the answer, the variables in #: that equation will include `y'` and `y''`, and the resulting equation will be #: implicit. So the macro PODLINK('parserImplicitEquation.pl') is used. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserImplicitEquation.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserImplicitEquation.pl +## --- #:% section = setup #: Switch to the `ImplicitEquation` context and then include the variables `y`, @@ -60,5 +59,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Geometry/LineSegmentGraphTool.pg b/tutorial/sample-problems/Geometry/LineSegmentGraphTool.pg index 97670090ed..6ef0223270 100644 --- a/tutorial/sample-problems/Geometry/LineSegmentGraphTool.pg +++ b/tutorial/sample-problems/Geometry/LineSegmentGraphTool.pg @@ -19,9 +19,11 @@ #:% section = preamble #: Load the PODLINK('parserGraphTool.pl') macro to be able to use the GraphTool. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: The graph tool is created with the correct answer @@ -58,5 +60,3 @@ The correct answer is [!A graph of the line segment from ([$sx1], [$sy1]) to ([$sx2],[$sy2])!]{$gt} END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Geometry/QuadrilateralGraphTool.pg b/tutorial/sample-problems/Geometry/QuadrilateralGraphTool.pg index 09e2dc188b..9decf1973b 100644 --- a/tutorial/sample-problems/Geometry/QuadrilateralGraphTool.pg +++ b/tutorial/sample-problems/Geometry/QuadrilateralGraphTool.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Load the PODLINK('parserGraphTool.pl') macro to be able to use the GraphTool. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: This finds four unique random points and sets up the GraphTool. The line @@ -60,5 +62,3 @@ The correct answer is [![$alt_text]!]{$gt} END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Geometry/TriangleGraphTool.pg b/tutorial/sample-problems/Geometry/TriangleGraphTool.pg index 9dabc89d29..2f5813652b 100644 --- a/tutorial/sample-problems/Geometry/TriangleGraphTool.pg +++ b/tutorial/sample-problems/Geometry/TriangleGraphTool.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Load the PODLINK('parserGraphTool.pl') macro to be able to use the GraphTool. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: This finds three unique random points and sets up the GraphTool. The line @@ -53,5 +55,3 @@ The correct answer is [!A graph of the triangle with vertices ([$x1], [$y1]), ([$x2],[$y2]) and ([$x3],[$y3])!]{$gt} END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/IntegralCalc/DoubleIntegral.pg b/tutorial/sample-problems/IntegralCalc/DoubleIntegral.pg index 6173c6dd33..5144e91c01 100644 --- a/tutorial/sample-problems/IntegralCalc/DoubleIntegral.pg +++ b/tutorial/sample-problems/IntegralCalc/DoubleIntegral.pg @@ -19,9 +19,11 @@ #:% section = preamble #: Since there are multiple answer blanks that are dependent upon each other the #: PODLINK('parserMultiAnswer.pl') macro is used. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserMultiAnswer.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserMultiAnswer.pl +## --- #:% section = setup #: There are two separate cases: integrating with respect to `dx dy` (case 0) or @@ -187,5 +189,3 @@ Solution explanation goes here. END_PGML_SOLUTION COMMENT('Allows integration in either order.'); - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/IntegralCalc/GraphShading.pg b/tutorial/sample-problems/IntegralCalc/GraphShading.pg index e0c4a0242a..228557c9b4 100644 --- a/tutorial/sample-problems/IntegralCalc/GraphShading.pg +++ b/tutorial/sample-problems/IntegralCalc/GraphShading.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The macro PODLINK('PGtikz.pl') is used to create the plot. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: A randomly transformed version of `sqrt(x)` is created as the function with a @@ -88,5 +90,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/IntegralCalc/GraphShadingPlot.pg b/tutorial/sample-problems/IntegralCalc/GraphShadingPlot.pg index b0d42277c6..c6467b99af 100644 --- a/tutorial/sample-problems/IntegralCalc/GraphShadingPlot.pg +++ b/tutorial/sample-problems/IntegralCalc/GraphShadingPlot.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The macro PODLINK('plots.pl') is used to create the plot. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plots.pl +## --- #:% section = setup #: A randomly transformed version of `sqrt(x)` is created as the function with a @@ -79,5 +81,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/IntegralCalc/IndefiniteIntegrals.pg b/tutorial/sample-problems/IntegralCalc/IndefiniteIntegrals.pg index 9a158bf19b..86823249b5 100644 --- a/tutorial/sample-problems/IntegralCalc/IndefiniteIntegrals.pg +++ b/tutorial/sample-problems/IntegralCalc/IndefiniteIntegrals.pg @@ -19,12 +19,11 @@ #:% section = preamble #: The macro PODLINK('parserFormulaUpToConstant.pl') will allow the entry of #: formula with a general constant like the antiderivative. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserFormulaUpToConstant.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserFormulaUpToConstant.pl +## --- #:% section = setup #: The specific antiderivative is an ordinary formula. When the `cmp` method is @@ -61,5 +60,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/IntegralCalc/LimitsOfIntegration.pg b/tutorial/sample-problems/IntegralCalc/LimitsOfIntegration.pg index 30649550c1..e90b08c159 100644 --- a/tutorial/sample-problems/IntegralCalc/LimitsOfIntegration.pg +++ b/tutorial/sample-problems/IntegralCalc/LimitsOfIntegration.pg @@ -20,12 +20,12 @@ #: The PODLINK('niceTables.pl') macro is used to construct a table containing #: the answer rules in the limits of integration. The PODLINK('answerHints.pl') #: macro is used to help guide students toward the correct answer. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', 'niceTables.pl', 'answerHints.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - niceTables.pl +## - answerHints.pl +## --- #:% section = setup #: The variables `x`, `t`, `dx`, and `dt` are added to the context. Note that @@ -89,5 +89,3 @@ ANS(Compute('2')->cmp()); BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/IntegralCalc/RiemannSumPlot.pg b/tutorial/sample-problems/IntegralCalc/RiemannSumPlot.pg index 5e4b813333..4e9afca32f 100644 --- a/tutorial/sample-problems/IntegralCalc/RiemannSumPlot.pg +++ b/tutorial/sample-problems/IntegralCalc/RiemannSumPlot.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Make sure that PODLINK('plots.pl') is loaded. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plots.pl +## --- #:% section = setup #: For this problem, we make a Riemann Sum plot by plotting the function $y=x^3+3$ @@ -92,5 +94,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/IntegralCalc/RiemannSums.pg b/tutorial/sample-problems/IntegralCalc/RiemannSums.pg index 08e4174653..c603226cff 100644 --- a/tutorial/sample-problems/IntegralCalc/RiemannSums.pg +++ b/tutorial/sample-problems/IntegralCalc/RiemannSums.pg @@ -19,12 +19,12 @@ #:% section = preamble #: The PODLINK('parserPopUp.pl') macro is used to create drop down menus, and #: the PODLINK('PGtikz.pl') macro is used to produce the graphs. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGtikz.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserPopUp.pl +## - PGtikz.pl +## --- #:% section = setup #: First generate a random constant for the function and the interval endpoints. @@ -207,6 +207,3 @@ b. The right endpoint Riemann sum is = ([$y[1]] + [$y[2]] + \cdots + [$y[ $n ]]) \cdot 0.5 = [$sumRight]. ```] END_PGML_SOLUTION - -ENDDOCUMENT(); - diff --git a/tutorial/sample-problems/IntegralCalc/VolumeOfRevolution.pg b/tutorial/sample-problems/IntegralCalc/VolumeOfRevolution.pg index c6e0faea53..e150ae481c 100644 --- a/tutorial/sample-problems/IntegralCalc/VolumeOfRevolution.pg +++ b/tutorial/sample-problems/IntegralCalc/VolumeOfRevolution.pg @@ -22,9 +22,11 @@ #: loaded via the `PGML.pl` macro, and is used to construct a table that will #: make the answer rules for the limits of integration appear at the top and #: bottom of the integral symbol. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'answerHints.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - answerHints.pl +## --- #:% section = setup #: First, the variables `x`, `dx`, `y`, and `dy` are added to the context. @@ -120,5 +122,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/LinearAlgebra/MatrixAnswer1.pg b/tutorial/sample-problems/LinearAlgebra/MatrixAnswer1.pg index d381b8a6fa..c481b7c734 100644 --- a/tutorial/sample-problems/LinearAlgebra/MatrixAnswer1.pg +++ b/tutorial/sample-problems/LinearAlgebra/MatrixAnswer1.pg @@ -17,9 +17,9 @@ #:% categories = [matrix] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Call `Context('Matrix')` to switch to the `Matrix` context. MathObject @@ -61,5 +61,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/LinearAlgebra/MatrixAnswer2.pg b/tutorial/sample-problems/LinearAlgebra/MatrixAnswer2.pg index 1c90646e38..4349f737e1 100644 --- a/tutorial/sample-problems/LinearAlgebra/MatrixAnswer2.pg +++ b/tutorial/sample-problems/LinearAlgebra/MatrixAnswer2.pg @@ -18,9 +18,9 @@ #:% categories = [matrix, answers] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Switch to the `Matrix` context by calling `Context('Matrix')`. @@ -86,5 +86,3 @@ each matrix entry into its own answer blank. Enter the matrix [``[$example4]``] with one matrix entry per answer box. [______]*{$example4}{4} END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/LinearAlgebra/MatrixCustomAnswerChecker.pg b/tutorial/sample-problems/LinearAlgebra/MatrixCustomAnswerChecker.pg index 0fe858b31e..2df644afc6 100644 --- a/tutorial/sample-problems/LinearAlgebra/MatrixCustomAnswerChecker.pg +++ b/tutorial/sample-problems/LinearAlgebra/MatrixCustomAnswerChecker.pg @@ -19,9 +19,11 @@ #:% section = preamble #: Since the answer will depend on two matrix inputs at once, the #: PODLINK('parserMultiAnswer.pl') macro must be loaded. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserMultiAnswer.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserMultiAnswer.pl +## --- $showPartialCorrectAnswers = 0; @@ -63,5 +65,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/LinearAlgebra/MatrixOperations.pg b/tutorial/sample-problems/LinearAlgebra/MatrixOperations.pg index 6c575811a0..4868955a1b 100644 --- a/tutorial/sample-problems/LinearAlgebra/MatrixOperations.pg +++ b/tutorial/sample-problems/LinearAlgebra/MatrixOperations.pg @@ -18,12 +18,11 @@ #:% section = preamble #: This uses PODLINK('parserRadioMultiAnswer.pl'), so it needs to be loaded. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserRadioMultiAnswer.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserRadioMultiAnswer.pl +## --- #:% section = setup #: First, the two matrices are defined. @@ -99,5 +98,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/LinearAlgebra/RowOperations.pg b/tutorial/sample-problems/LinearAlgebra/RowOperations.pg index ed6a5ae0f9..c866354daa 100644 --- a/tutorial/sample-problems/LinearAlgebra/RowOperations.pg +++ b/tutorial/sample-problems/LinearAlgebra/RowOperations.pg @@ -16,9 +16,9 @@ #:% subject = linear algebra #:% categories = [matrix, row operation] -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Construct a matrix with three distinct rows. Create a string `$op` of Tex @@ -58,5 +58,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/ChemicalReaction.pg b/tutorial/sample-problems/Misc/ChemicalReaction.pg index 19c8e14c3b..4af8beb777 100644 --- a/tutorial/sample-problems/Misc/ChemicalReaction.pg +++ b/tutorial/sample-problems/Misc/ChemicalReaction.pg @@ -19,9 +19,11 @@ #:% section = preamble #: Load PODLINK('contextReaction.pl') to be able to use chemical reaction #: equations in a `Compute` call. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextReaction.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextReaction.pl +## --- #:% section = setup #: Create two arrays, `@reactants` and `@products`, and fill them with examples @@ -68,5 +70,3 @@ BEGIN_PGML Enter a subscript using an underscore, such as [|H_2 O|]* for [`\mathrm{H_2 O}`]. END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/DraggableProof.pg b/tutorial/sample-problems/Misc/DraggableProof.pg index 463451bdd8..116b40ffde 100644 --- a/tutorial/sample-problems/Misc/DraggableProof.pg +++ b/tutorial/sample-problems/Misc/DraggableProof.pg @@ -19,9 +19,11 @@ #:% section = preamble #: This problem uses the PODLINK('draggableProof.pl') macro to display "buckets" #: that the student can drag statements to and from. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'draggableProof.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - draggableProof.pl +## --- #:% section = setup #: The `DraggableProof` function takes an array reference of correct statements @@ -63,5 +65,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/DynamicGraphPolygon.pg b/tutorial/sample-problems/Misc/DynamicGraphPolygon.pg index 004e0328e5..da9e9761a0 100644 --- a/tutorial/sample-problems/Misc/DynamicGraphPolygon.pg +++ b/tutorial/sample-problems/Misc/DynamicGraphPolygon.pg @@ -19,9 +19,11 @@ #:% section = preamble #: The dynamic graphs are generated with PODLINK('PGtikz.pl'), so load that #: macro. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: See PROBLINK('DynamicGraph.pg') for the basics of using TikZ. @@ -124,5 +126,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/EssayAnswer.pg b/tutorial/sample-problems/Misc/EssayAnswer.pg index 0e00701c65..8996cc6587 100644 --- a/tutorial/sample-problems/Misc/EssayAnswer.pg +++ b/tutorial/sample-problems/Misc/EssayAnswer.pg @@ -18,13 +18,12 @@ #:% section = preamble #: This uses PODLINK('PGessaymacros.pl') for essay answers and #: PODLINK('parserPopUp.pl') for multiple choice drop down menus. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserPopUp.pl', 'PGessaymacros.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserPopUp.pl +## - PGessaymacros.pl +## --- #:% section = setup $popup = PopUp( @@ -66,6 +65,3 @@ answer. Your explanation will be graded manually at a later time. Please explain your reasoning in the answer box below. [@ ANS(essay_cmp()); essay_box(8, 60) @]* END_PGML - -ENDDOCUMENT(); - diff --git a/tutorial/sample-problems/Misc/FormulaAnswer.pg b/tutorial/sample-problems/Misc/FormulaAnswer.pg index 2db15bee57..7de503db14 100644 --- a/tutorial/sample-problems/Misc/FormulaAnswer.pg +++ b/tutorial/sample-problems/Misc/FormulaAnswer.pg @@ -17,9 +17,9 @@ #:% categories = [answers] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Use `do { $b = random(2, 9) } until $b != $a` to generate distinct random @@ -42,5 +42,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/FormulaDomain.pg b/tutorial/sample-problems/Misc/FormulaDomain.pg index c000d6aae5..defd30b086 100644 --- a/tutorial/sample-problems/Misc/FormulaDomain.pg +++ b/tutorial/sample-problems/Misc/FormulaDomain.pg @@ -18,9 +18,9 @@ #:% see_also = [FormulaTestPoints.pg] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Restrict the domain of function evaluation using @@ -64,5 +64,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/FormulaTestPoints.pg b/tutorial/sample-problems/Misc/FormulaTestPoints.pg index 345437da4a..6511dff675 100644 --- a/tutorial/sample-problems/Misc/FormulaTestPoints.pg +++ b/tutorial/sample-problems/Misc/FormulaTestPoints.pg @@ -16,9 +16,9 @@ #:% see_also = [FormulaDomain.pg] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: The first line sets the limits of evaluation for the variable `x` and for any @@ -54,5 +54,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/IframeEmbedding.pg b/tutorial/sample-problems/Misc/IframeEmbedding.pg index 474a185e91..825521cdc0 100644 --- a/tutorial/sample-problems/Misc/IframeEmbedding.pg +++ b/tutorial/sample-problems/Misc/IframeEmbedding.pg @@ -16,9 +16,9 @@ #:% categories = [misc, video] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Create a mode dependent variable `$slideshow` that displays a Google @@ -74,6 +74,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); - diff --git a/tutorial/sample-problems/Misc/ManyMultipleChoice.pg b/tutorial/sample-problems/Misc/ManyMultipleChoice.pg index ded0c6671d..720e048c8d 100644 --- a/tutorial/sample-problems/Misc/ManyMultipleChoice.pg +++ b/tutorial/sample-problems/Misc/ManyMultipleChoice.pg @@ -19,12 +19,12 @@ #: The PODLINK('PGchoicemacros.pl') macro is used to construct the list of #: multiple choice items, and the custom problem grader fluid from #: PODLINK('PGgraders.pl') is used for incremental grading. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGgraders.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserPopUp.pl +## - PGgraders.pl +## --- #:% section = setup #: Withhold feedback when answers are submitted by setting @@ -58,7 +58,7 @@ $ENV{grader_message} = . '60% partial credit for 4 - 5 correct answers.'; # All or nothing grader -# install_problem_grader(~~&std_problem_grader); +#install_problem_grader('std_problem_grader'); # Questions and answers @s_and_a = ( @@ -94,5 +94,3 @@ The answers are '[$statements[' . $_ . '][1]]: [$statements[' . $_ . '][0]]' } 0 .. $#statements) @]** END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/Matching.pg b/tutorial/sample-problems/Misc/Matching.pg index 94c6a01e94..2cdb2e167e 100644 --- a/tutorial/sample-problems/Misc/Matching.pg +++ b/tutorial/sample-problems/Misc/Matching.pg @@ -18,14 +18,17 @@ #:% section = preamble #: The PODLINK('PGchoicemacros.pl') macro is used to construct the list of #: multiple choice items, and the custom problem grader fluid from -#: PODLINK('PGgraders.pl') is used for incremental grading. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'PGchoicemacros.pl', 'PGgraders.pl', - 'unionTables.pl', 'PGcourse.pl' -); +#: PODLINK('PGgraders.pl') is used for incremental grading. The +#: PODLINK('PGanswermacros.pl') macro is needed for the `str_cmp` answer +#: checker. +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGanswermacros.pl +## - PGchoicemacros.pl +## - PGgraders.pl +## - unionTables.pl +## --- #:% section = setup #: Withhold feedback when answers are submitted by setting @@ -62,7 +65,7 @@ $ENV{grader_message} = . '60% partial credit for 4 - 5 correct answers.'; # All or nothing grader -# install_problem_grader(~~&std_problem_grader); +#install_problem_grader('std_problem_grader'); # Create a matching list and use pop ups $ml = new_match_list(); @@ -120,5 +123,3 @@ ANS(str_cmp($ml->ra_correct_ans)); BEGIN_PGML_SOLUTION The correct answers are [@ join(', ', @{ $ml->ra_correct_ans() }) @]. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/MatchingAlt.pg b/tutorial/sample-problems/Misc/MatchingAlt.pg index b1a5692309..7b66142e61 100644 --- a/tutorial/sample-problems/Misc/MatchingAlt.pg +++ b/tutorial/sample-problems/Misc/MatchingAlt.pg @@ -18,12 +18,12 @@ #: The PODLINK('parserPopUp.pl') macro is used to create drop down menus for #: answers, and the custom problem grader fluid from PODLINK('PGgraders.pl') is #: used for incremental grading. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGgraders.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserPopUp.pl +## - PGgraders.pl +## --- #:% section = setup #: Withhold feedback when answers are submitted by setting @@ -61,7 +61,7 @@ $ENV{grader_message} = . '60% partial credit for 4 - 5 correct answers.'; # All or nothing grader -# install_problem_grader(~~&std_problem_grader); +#install_problem_grader('std_problem_grader'); # Create a list of questions and answers. @q_and_a = ( @@ -155,5 +155,3 @@ BEGIN_PGML_SOLUTION The correct answers are [@ join(', ', map { $ALPHABET[($inversion[($_)])] } 0 .. $#q_and_a) @]*. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/MatchingGraphs.pg b/tutorial/sample-problems/Misc/MatchingGraphs.pg index 8bbe0e8351..41248f4ce0 100644 --- a/tutorial/sample-problems/Misc/MatchingGraphs.pg +++ b/tutorial/sample-problems/Misc/MatchingGraphs.pg @@ -21,12 +21,12 @@ #: loaded. Matching is done with pop ups, so PODLINK('parserPopUp.pl') is #: loaded. Finally, a `LayoutTable` is used from PODLINK('niceTables.pl') which #: is loaded by the `PGML.pl` macro. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'parserPopUp.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## - parserPopUp.pl +## --- #:% section = setup #: The array `@all_plots` contains the display form `f` of the function, @@ -164,5 +164,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/MultipleChoiceCheckbox.pg b/tutorial/sample-problems/Misc/MultipleChoiceCheckbox.pg index 8fe1167f08..aa23232bec 100644 --- a/tutorial/sample-problems/Misc/MultipleChoiceCheckbox.pg +++ b/tutorial/sample-problems/Misc/MultipleChoiceCheckbox.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The PODLINK('parserCheckboxList.pl') is used for check box answers. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserCheckboxList.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserCheckboxList.pl +## --- #:% section = setup #: First, call `CheckboxList` to create a check box list answer object. The @@ -100,5 +102,3 @@ The correct answer to the second is [$checks2->correct_ans]. The correct answer to the third is [$checks3->correct_ans]. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/MultipleChoicePopup.pg b/tutorial/sample-problems/Misc/MultipleChoicePopup.pg index 0669f27467..a35039bc2e 100644 --- a/tutorial/sample-problems/Misc/MultipleChoicePopup.pg +++ b/tutorial/sample-problems/Misc/MultipleChoicePopup.pg @@ -19,9 +19,11 @@ #:% section = preamble #: The macro PODLINK('parserPopUp.pl') is used for pop up (or drop down) menus. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserPopUp.pl +## --- #:% section = setup #: Call `PopUp` or `DropDown` to create a pop up answer object. The format is @@ -68,5 +70,3 @@ BEGIN_PGML_SOLUTION * The second correct answer is [$dropdown1->correct_ans]. * The third correct answer is [$dropdown2->correct_ans]. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/MultipleChoiceRadio.pg b/tutorial/sample-problems/Misc/MultipleChoiceRadio.pg index 040aeca9e6..80d7e73289 100644 --- a/tutorial/sample-problems/Misc/MultipleChoiceRadio.pg +++ b/tutorial/sample-problems/Misc/MultipleChoiceRadio.pg @@ -18,9 +18,11 @@ #:% section = preamble color:blue #: The macro PODLINK('parserRadioButtons.pl') is used for radio button answers. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserRadioButtons.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserRadioButtons.pl +## --- #:% section = setup #: Call `RadioButtons` to create a radio button answer object. The format is @@ -63,5 +65,3 @@ The correct answer to the first is [$radio1->correct_ans]. The correct answer to the first is [$radio2->correct_ans]. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/RandomPerson.pg b/tutorial/sample-problems/Misc/RandomPerson.pg index f20e04da63..c58c155165 100644 --- a/tutorial/sample-problems/Misc/RandomPerson.pg +++ b/tutorial/sample-problems/Misc/RandomPerson.pg @@ -16,9 +16,11 @@ #:% section = preamble #: We need to load `randomPerson.pl` macro -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'randomPerson.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - randomPerson.pl +## --- #:% section = setup #: The macro PODLINK('randomPerson.pl') provides functionality to @@ -73,5 +75,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Misc/Scaffolding.pg b/tutorial/sample-problems/Misc/Scaffolding.pg index 546a3d7cbb..f1e90c3c40 100644 --- a/tutorial/sample-problems/Misc/Scaffolding.pg +++ b/tutorial/sample-problems/Misc/Scaffolding.pg @@ -17,9 +17,11 @@ #:% section = preamble #: Load the PODLINK('scaffold.pl') macro to use scaffolding. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'scaffold.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - scaffold.pl +## --- #:% section = statement #: Call `Scaffold::Begin()` to start scaffolding, and `Scaffold::End()` to end @@ -61,5 +63,3 @@ Scaffold::End(); BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/ParametricEquationAnswers.pg b/tutorial/sample-problems/Parametric/ParametricEquationAnswers.pg index c628d49e3c..fbf878483a 100644 --- a/tutorial/sample-problems/Parametric/ParametricEquationAnswers.pg +++ b/tutorial/sample-problems/Parametric/ParametricEquationAnswers.pg @@ -20,9 +20,11 @@ #:% section = preamble #: The PODLINK('parserMultiAnswer.pl') macro is used to check parameterization #: equations and end points together. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserMultiAnswer.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserMultiAnswer.pl +## --- #:% section = setup #: A `MultiAnswer` is used to verify that the student answers satisfy the @@ -106,5 +108,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/ParametricPlot.pg b/tutorial/sample-problems/Parametric/ParametricPlot.pg index 5faaa021db..70d5478259 100644 --- a/tutorial/sample-problems/Parametric/ParametricPlot.pg +++ b/tutorial/sample-problems/Parametric/ParametricPlot.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The PODLINK('PGtikz.pl') macro is used to generate the graph. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: The PODLINK('PGtikz.pl') macro is used to produce the curve. The basics of @@ -93,5 +95,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/ParametricPlotAlt.pg b/tutorial/sample-problems/Parametric/ParametricPlotAlt.pg index 5950b50eb5..8b2fc294bb 100644 --- a/tutorial/sample-problems/Parametric/ParametricPlotAlt.pg +++ b/tutorial/sample-problems/Parametric/ParametricPlotAlt.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The PODLINK('plots.pl') macro is used to generate the graph. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plots.pl +## --- #:% section = setup #: This problem asks the student to find the equation of a tangent line to a @@ -72,5 +74,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/PolarGraph.pg b/tutorial/sample-problems/Parametric/PolarGraph.pg index d55e62d386..3f2621a6e6 100644 --- a/tutorial/sample-problems/Parametric/PolarGraph.pg +++ b/tutorial/sample-problems/Parametric/PolarGraph.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The PODLINK('PGtikz.pl') macro is used to generate the graph. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: The polar curve is plotted parametrically. @@ -66,5 +68,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/PolarGraphPlot.pg b/tutorial/sample-problems/Parametric/PolarGraphPlot.pg index a65b9777ea..2c54474c87 100644 --- a/tutorial/sample-problems/Parametric/PolarGraphPlot.pg +++ b/tutorial/sample-problems/Parametric/PolarGraphPlot.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The PODLINK('plots.pl') macro is used to generate the graph. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plots.pl +## --- #:% section = setup #: The plot is set up with the `Plot` object and the plotting window. @@ -65,5 +67,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/SpaceCurveGraph.pg b/tutorial/sample-problems/Parametric/SpaceCurveGraph.pg index 2b669f9d0f..f81ef8501b 100644 --- a/tutorial/sample-problems/Parametric/SpaceCurveGraph.pg +++ b/tutorial/sample-problems/Parametric/SpaceCurveGraph.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The macro PODLINK('plotly3D.pl') is used to produce the graph. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plotly3D.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plotly3D.pl +## --- #:% section = setup #: A `plotly3D` graph is created with the `Graph3D` function. There are many @@ -48,5 +50,3 @@ $graph->addCurve([ 't * cos(t)', 't * sin(t)', 't' ], [ 0, 6 * pi, 150 ]); BEGIN_PGML [@ $graph->Print @]* END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/Spacecurve.pg b/tutorial/sample-problems/Parametric/Spacecurve.pg index 28e50b9ba3..6d5cabc174 100644 --- a/tutorial/sample-problems/Parametric/Spacecurve.pg +++ b/tutorial/sample-problems/Parametric/Spacecurve.pg @@ -16,9 +16,11 @@ #:% subject = [parametric, vector calculus] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserMultiAnswer.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserMultiAnswer.pl +## --- $showPartialCorrectAnswers = 0; @@ -74,5 +76,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/SurfaceGraph.pg b/tutorial/sample-problems/Parametric/SurfaceGraph.pg index 6da4bec911..699726b108 100644 --- a/tutorial/sample-problems/Parametric/SurfaceGraph.pg +++ b/tutorial/sample-problems/Parametric/SurfaceGraph.pg @@ -18,9 +18,11 @@ #:% section = preamble #: The macro PODLINK('plotly3D.pl') is used to produce the graph. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plotly3D.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plotly3D.pl +## --- #:% section = setup #: A `plotly3D` graph is created with the `Graph3D` function. There are many @@ -56,5 +58,3 @@ $graph->addSurface( BEGIN_PGML [@ $graph->Print @]* END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/VectorParametricDerivative.pg b/tutorial/sample-problems/Parametric/VectorParametricDerivative.pg index 968c3900d8..5802f50208 100644 --- a/tutorial/sample-problems/Parametric/VectorParametricDerivative.pg +++ b/tutorial/sample-problems/Parametric/VectorParametricDerivative.pg @@ -20,9 +20,11 @@ #: Although not necessary for the code demonstrated in this example, you might #: want to load PODLINK('parserVectorUtils.pl'). It provides methods that are #: useful for vector problems. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserVectorUtils.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserVectorUtils.pl +## --- #:% section = setup #: The context flag `ijk => 0` disables the display of correct answer vectors @@ -80,5 +82,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/VectorParametricFunction.pg b/tutorial/sample-problems/Parametric/VectorParametricFunction.pg index 53847356a9..c0c011acd9 100644 --- a/tutorial/sample-problems/Parametric/VectorParametricFunction.pg +++ b/tutorial/sample-problems/Parametric/VectorParametricFunction.pg @@ -23,12 +23,12 @@ #: #: The PODLINK('parserMultiAnswer.pl') macro is used since the answers depend #: upon each other. -DOCUMENT(); -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserVectorUtils.pl', 'parserMultiAnswer.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserVectorUtils.pl +## - parserMultiAnswer.pl +## --- #:% section = setup #: In the checker the vector-valued function that the student enters is stored @@ -99,5 +99,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Parametric/VectorParametricLines.pg b/tutorial/sample-problems/Parametric/VectorParametricLines.pg index b83835cc27..90827ca479 100644 --- a/tutorial/sample-problems/Parametric/VectorParametricLines.pg +++ b/tutorial/sample-problems/Parametric/VectorParametricLines.pg @@ -21,13 +21,12 @@ #: `non_zero_point3D`, `non_zero_vector3D`, and `Line` methods. The #: PODLINK('parserParametricLine.pl') macro is also used which provides the #: `ParametricLine` method that gives a MathObject form of a parametric line. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserVectorUtils.pl', 'parserParametricLine.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserVectorUtils.pl +## - parserParametricLine.pl +## --- #:% section = setup #: The `non_zero_point3D` method returns a nonzero `Point` in the third @@ -68,5 +67,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/AdaptiveParameters.pg b/tutorial/sample-problems/ProblemTechniques/AdaptiveParameters.pg index 65f7918e0e..4b2a3946e6 100644 --- a/tutorial/sample-problems/ProblemTechniques/AdaptiveParameters.pg +++ b/tutorial/sample-problems/ProblemTechniques/AdaptiveParameters.pg @@ -16,9 +16,9 @@ #:% categories = [differential equations, adaptive parameters] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: This problem utilizes adaptive parameters in the custom answer checker. @@ -79,5 +79,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/AnswerHints.pg b/tutorial/sample-problems/ProblemTechniques/AnswerHints.pg index 5a854944a0..4af350af08 100644 --- a/tutorial/sample-problems/ProblemTechniques/AnswerHints.pg +++ b/tutorial/sample-problems/ProblemTechniques/AnswerHints.pg @@ -16,9 +16,11 @@ #:% categories = [answers, knowls] #:% section = preamble #: Make sure the `answerHints.pl` macro is loaded. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'answerHints.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - answerHints.pl +## --- #:% section = setup #: To generate specific, customized answer hints for particular answers, use @@ -83,5 +85,3 @@ END_PGML BEGIN_PGML_HINT Substitute [`3u`] wherever you see [`t`] in the formula for [`f(t) = [$f]`]. END_PGML_HINT - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/AnswerInExponent.pg b/tutorial/sample-problems/ProblemTechniques/AnswerInExponent.pg index 40888dba6e..9fcf451685 100644 --- a/tutorial/sample-problems/ProblemTechniques/AnswerInExponent.pg +++ b/tutorial/sample-problems/ProblemTechniques/AnswerInExponent.pg @@ -18,9 +18,9 @@ #:% categories = [answers, exponent] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: The `Context()->variables->are` sets the variables for the context. @@ -56,5 +56,3 @@ ANS(Real($n)->cmp); BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/AnswerIsSolutionToEquation.pg b/tutorial/sample-problems/ProblemTechniques/AnswerIsSolutionToEquation.pg index bc831909c5..142926c5d2 100644 --- a/tutorial/sample-problems/ProblemTechniques/AnswerIsSolutionToEquation.pg +++ b/tutorial/sample-problems/ProblemTechniques/AnswerIsSolutionToEquation.pg @@ -17,9 +17,11 @@ #:% section = preamble #: Include the macro PODLINK('parserSolutionFor.pl'). -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserSolutionFor.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserSolutionFor.pl +## --- #:% section = setup #: The function `SolutionFor(equation, point, options)` takes an equation, a @@ -41,5 +43,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/AnyAnswerMarkedCorrect.pg b/tutorial/sample-problems/ProblemTechniques/AnyAnswerMarkedCorrect.pg index 1a51b8faf4..6589d67141 100644 --- a/tutorial/sample-problems/ProblemTechniques/AnyAnswerMarkedCorrect.pg +++ b/tutorial/sample-problems/ProblemTechniques/AnyAnswerMarkedCorrect.pg @@ -16,9 +16,9 @@ #:% categories = [answers] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Wrap the random command with `Compute` to make `$a` a MathObject. @@ -37,5 +37,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/AskSage.pg b/tutorial/sample-problems/ProblemTechniques/AskSage.pg index 43c2f6bf52..1504903118 100644 --- a/tutorial/sample-problems/ProblemTechniques/AskSage.pg +++ b/tutorial/sample-problems/ProblemTechniques/AskSage.pg @@ -16,8 +16,9 @@ #:% categories = [matrices] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Determine a random number of rows, columns, and rank for the random matrix @@ -83,5 +84,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/CalculatingWithPoints.pg b/tutorial/sample-problems/ProblemTechniques/CalculatingWithPoints.pg index 6b636a5bba..82e2bf2f62 100644 --- a/tutorial/sample-problems/ProblemTechniques/CalculatingWithPoints.pg +++ b/tutorial/sample-problems/ProblemTechniques/CalculatingWithPoints.pg @@ -16,8 +16,9 @@ #:% categories = [point] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Switch to the `Point` context, and generate two points with random @@ -64,5 +65,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/ComposingFunctions.pg b/tutorial/sample-problems/ProblemTechniques/ComposingFunctions.pg index 534eb12b27..b256a967a1 100644 --- a/tutorial/sample-problems/ProblemTechniques/ComposingFunctions.pg +++ b/tutorial/sample-problems/ProblemTechniques/ComposingFunctions.pg @@ -17,8 +17,11 @@ #:% section = preamble #: Include the macro PODLINK('answerComposition.pl'). -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'answerComposition.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - answerComposition.pl +## --- #:% section = setup Context()->variables->are(x => 'Real', y => 'Real', u => 'Real'); @@ -50,5 +53,3 @@ COMPOSITION_ANS($f, $g); BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/ConstantsInProblems.pg b/tutorial/sample-problems/ProblemTechniques/ConstantsInProblems.pg index 77b3d2b59d..a90767a23a 100644 --- a/tutorial/sample-problems/ProblemTechniques/ConstantsInProblems.pg +++ b/tutorial/sample-problems/ProblemTechniques/ConstantsInProblems.pg @@ -16,8 +16,9 @@ #:% categories = [constant] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Add the constant `k` with value `0.023431412` to the context. Choose a value @@ -52,5 +53,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/CustomAnswerCheckers.pg b/tutorial/sample-problems/ProblemTechniques/CustomAnswerCheckers.pg index b20340aef2..550b2245d2 100644 --- a/tutorial/sample-problems/ProblemTechniques/CustomAnswerCheckers.pg +++ b/tutorial/sample-problems/ProblemTechniques/CustomAnswerCheckers.pg @@ -16,8 +16,9 @@ #:% categories = [answers, custom checker] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: This problem asks the student to enter a value of `x` such that @@ -64,5 +65,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/CustomAnswerListChecker.pg b/tutorial/sample-problems/ProblemTechniques/CustomAnswerListChecker.pg index 1f514e66c7..5011f6a522 100644 --- a/tutorial/sample-problems/ProblemTechniques/CustomAnswerListChecker.pg +++ b/tutorial/sample-problems/ProblemTechniques/CustomAnswerListChecker.pg @@ -16,8 +16,9 @@ #:% categories = [answers, custom checker, list] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: The answer to this problem will be a list of points, so select the 'Point' @@ -129,5 +130,3 @@ BEGIN_PGML_SOLUTION Any three points who's coordinates sum to [`[$c]`] are valid. For example, [`([$c], 0), (0, [$c]), (1, [$c - 1])`]. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/DataTables.pg b/tutorial/sample-problems/ProblemTechniques/DataTables.pg index 95056fe83f..f5c0fac766 100644 --- a/tutorial/sample-problems/ProblemTechniques/DataTables.pg +++ b/tutorial/sample-problems/ProblemTechniques/DataTables.pg @@ -19,8 +19,9 @@ #: This shows how to use the `DataTable` function in PODLINK('niceTables.pl'). #: Note that the PODLINK('niceTables.pl') macro is automatically loaded by #: `PGML.pl`, so it is not necessary to load it explicitly. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: A `DataTable` is meant to display data in a table. It is not meant to be used @@ -113,5 +114,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/DefiningFunctions.pg b/tutorial/sample-problems/ProblemTechniques/DefiningFunctions.pg index 10984b80e6..32d822d81f 100644 --- a/tutorial/sample-problems/ProblemTechniques/DefiningFunctions.pg +++ b/tutorial/sample-problems/ProblemTechniques/DefiningFunctions.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Load the PODLINK('parserFunction.pl') macro which is used to add a new #: function to the context. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserFunction.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserFunction.pl +## --- #:% section = setup #: Define a function `f(x,y)`. The actual function doesn't matter but shouldn't @@ -44,5 +46,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/DifferentiatingFormulas.pg b/tutorial/sample-problems/ProblemTechniques/DifferentiatingFormulas.pg index 898621b725..bb5b961bbb 100644 --- a/tutorial/sample-problems/ProblemTechniques/DifferentiatingFormulas.pg +++ b/tutorial/sample-problems/ProblemTechniques/DifferentiatingFormulas.pg @@ -16,8 +16,9 @@ #:% categories = [derivative] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: The `Numeric` context includes the variable `x` by default, but the variable @@ -56,5 +57,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/DigitsTolType.pg b/tutorial/sample-problems/ProblemTechniques/DigitsTolType.pg index 343d5c7756..324bb048b4 100644 --- a/tutorial/sample-problems/ProblemTechniques/DigitsTolType.pg +++ b/tutorial/sample-problems/ProblemTechniques/DigitsTolType.pg @@ -18,8 +18,9 @@ #:% see_also = [NumericalTolerance.pg] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Several context flags are set for this problem. The meaning of these flags @@ -92,5 +93,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/DisableFunctions.pg b/tutorial/sample-problems/ProblemTechniques/DisableFunctions.pg index 54ef7f4be0..93b3ece57f 100644 --- a/tutorial/sample-problems/ProblemTechniques/DisableFunctions.pg +++ b/tutorial/sample-problems/ProblemTechniques/DisableFunctions.pg @@ -16,8 +16,9 @@ #:% categories = [answers] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Specific operations in the context can be disabled with @@ -96,5 +97,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/DraggableSubsets.pg b/tutorial/sample-problems/ProblemTechniques/DraggableSubsets.pg index 23cecac0d4..72be22d5a2 100644 --- a/tutorial/sample-problems/ProblemTechniques/DraggableSubsets.pg +++ b/tutorial/sample-problems/ProblemTechniques/DraggableSubsets.pg @@ -17,8 +17,11 @@ #:% section = preamble #: The `draggableSubsets.pl` macro must be loaded. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'draggableSubsets.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - draggableSubsets.pl +## --- #:% section = setup #: The `DraggableSubsets` method creates a drag and drop object that when @@ -77,5 +80,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/EquationEvaluators.pg b/tutorial/sample-problems/ProblemTechniques/EquationEvaluators.pg index d90f38465f..a1220cff45 100644 --- a/tutorial/sample-problems/ProblemTechniques/EquationEvaluators.pg +++ b/tutorial/sample-problems/ProblemTechniques/EquationEvaluators.pg @@ -17,11 +17,11 @@ #:% section = preamble #: Include the macro PODLINK('parserImplicitEquation.pl'). -DOCUMENT(); -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserImplicitEquation.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserImplicitEquation.pl +## --- #:% section = setup #: Select the `ImplicitEquation` context, and define the equation for the @@ -97,5 +97,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/EquationsDefiningFunctions.pg b/tutorial/sample-problems/ProblemTechniques/EquationsDefiningFunctions.pg index 1e48c0cfa0..e7a723cb60 100644 --- a/tutorial/sample-problems/ProblemTechniques/EquationsDefiningFunctions.pg +++ b/tutorial/sample-problems/ProblemTechniques/EquationsDefiningFunctions.pg @@ -20,8 +20,11 @@ #:% section = preamble #: Include the macro PODLINK('parserAssignment.pl'). -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'parserAssignment.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserAssignment.pl +## --- #:% section = setup #: Set the variables in the context to be `x` and `y`, enable assignments in the @@ -47,5 +50,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/ErrorMessageCustomization.pg b/tutorial/sample-problems/ProblemTechniques/ErrorMessageCustomization.pg index 22ba679d4a..c198f1b57b 100644 --- a/tutorial/sample-problems/ProblemTechniques/ErrorMessageCustomization.pg +++ b/tutorial/sample-problems/ProblemTechniques/ErrorMessageCustomization.pg @@ -17,8 +17,9 @@ #:% categories = [custom error] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: To change an error message the string in the `Context()->{error}{msg}` hash @@ -40,5 +41,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/EvalVersusSubstitute.pg b/tutorial/sample-problems/ProblemTechniques/EvalVersusSubstitute.pg index 5045a080ee..d43c97ab65 100644 --- a/tutorial/sample-problems/ProblemTechniques/EvalVersusSubstitute.pg +++ b/tutorial/sample-problems/ProblemTechniques/EvalVersusSubstitute.pg @@ -16,8 +16,9 @@ #:% categories = [formula] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: First, consider `$f = Compute('sqrt(3x + 1)')` defined in the default context @@ -87,5 +88,3 @@ set to 0, then * [|$f->substitute(x => 3)|] returns [$f5] END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/ExtractingCoordinatesFromPoint.pg b/tutorial/sample-problems/ProblemTechniques/ExtractingCoordinatesFromPoint.pg index 7cf73cc343..3883a0bb07 100644 --- a/tutorial/sample-problems/ProblemTechniques/ExtractingCoordinatesFromPoint.pg +++ b/tutorial/sample-problems/ProblemTechniques/ExtractingCoordinatesFromPoint.pg @@ -16,8 +16,9 @@ #:% categories = [point] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Defined two `Point`s with randomly generated coordinates. @@ -79,5 +80,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/FactoringAndExpanding.pg b/tutorial/sample-problems/ProblemTechniques/FactoringAndExpanding.pg index f9869a719c..d272b25067 100644 --- a/tutorial/sample-problems/ProblemTechniques/FactoringAndExpanding.pg +++ b/tutorial/sample-problems/ProblemTechniques/FactoringAndExpanding.pg @@ -20,12 +20,13 @@ #: The macros PODLINK('contextLimitedPolynomial.pl'), #: PODLINK('contextPolynomialFactors.pl'), and #: PODLINK('contextLimitedPowers.pl') are needed for this example. -DOCUMENT(); -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'contextLimitedPolynomial.pl', 'contextPolynomialFactors.pl', - 'contextLimitedPowers.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextLimitedPolynomial.pl +## - contextPolynomialFactors.pl +## - contextLimitedPowers.pl +## --- #:% section = setup #: Randomly generate `$a` and `$b`. The quadratic in this problem will be @@ -100,5 +101,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/FormattingDecimals.pg b/tutorial/sample-problems/ProblemTechniques/FormattingDecimals.pg index 21b585e9a0..3fb103084a 100644 --- a/tutorial/sample-problems/ProblemTechniques/FormattingDecimals.pg +++ b/tutorial/sample-problems/ProblemTechniques/FormattingDecimals.pg @@ -16,8 +16,9 @@ #:% categories = [formatting decimals, logarithm] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Since the domain of a logarithmic function is all positive real numbers, the @@ -31,10 +32,10 @@ loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); #: `100.25` (this is because the binary representation of `100.255` actually #: rounds to `100.254999999999995` accurate to 15 decimal places). So this #: example now uses `Round` from PODLINK('PGauxiliaryFunctions.pl') (which is -#: loaded by PODLINK('PGstandard.pl')) for more reliable rounding. The format -#: for calling `Round` is `Round(number, number of decimal places)`. Be aware -#: that if further calculations are performed with a number that has been -#: rounded, numerical error may still be an issue. +#: always loaded) for more reliable rounding. The format for calling `Round` is +#: `Round(number, number of decimal places)`. Be aware that if further +#: calculations are performed with a number that has been rounded, numerical +#: error may still be an issue. #: #: So in short, do not use `sprintf` for rounding in problems as was previously #: done in this example. @@ -87,5 +88,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/FormulasToConstants.pg b/tutorial/sample-problems/ProblemTechniques/FormulasToConstants.pg index 69ec646be6..b4c0b05d27 100644 --- a/tutorial/sample-problems/ProblemTechniques/FormulasToConstants.pg +++ b/tutorial/sample-problems/ProblemTechniques/FormulasToConstants.pg @@ -26,12 +26,11 @@ #: is used. To check a particular antiderivative of a function, that is, a #: formula that is unique up to a specific additive constant, this macro is #: not needed. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserFormulaUpToConstant.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserFormulaUpToConstant.pl +## --- #:% section = setup #: Define a particular antiderivative `$func` and all antiderivatives `$gfunc`. @@ -56,5 +55,3 @@ An antiderivative of [`\cos(x)`] is [_]{$func->cmp(upToConstant => 1)} The most general antiderivative is [_]{$gfunc} END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/GraphsInTables.pg b/tutorial/sample-problems/ProblemTechniques/GraphsInTables.pg index 909dc2e972..8972b3f29f 100644 --- a/tutorial/sample-problems/ProblemTechniques/GraphsInTables.pg +++ b/tutorial/sample-problems/ProblemTechniques/GraphsInTables.pg @@ -21,13 +21,13 @@ #: the PODLINK('niceTables.pl') macro (loaded automatically via `PGML.pl`) is #: used for layout, and the PODLINK('PGchoicemacros.pl') macro provides the #: `shuffle` and `invert` functions. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'PGtikz.pl', 'parserPopUp.pl', - 'PGchoicemacros.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## - parserPopUp.pl +## - PGchoicemacros.pl +## --- #:% section = setup #: First, `@eqn_plot`, `@eqn`, `@alt_text`, and `@graph` arrays are defined @@ -137,5 +137,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/HtmlLinks.pg b/tutorial/sample-problems/ProblemTechniques/HtmlLinks.pg index 75d6de8a8e..9ec4540ec2 100644 --- a/tutorial/sample-problems/ProblemTechniques/HtmlLinks.pg +++ b/tutorial/sample-problems/ProblemTechniques/HtmlLinks.pg @@ -18,11 +18,11 @@ #:% section = preamble #: An example below uses units, so the PODLINK('parserNumberWithUnits.pl') is #: loaded. -DOCUMENT(); -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserNumberWithUnits.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserNumberWithUnits.pl +## --- #:% section = setup $ans = NumberWithUnits('4', 'ft'); @@ -69,5 +69,3 @@ Enter 4 feet: [__]{$ans} Don't forget to enter [@ helpLink('units') @]*. END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/Images.pg b/tutorial/sample-problems/ProblemTechniques/Images.pg index b8675fad1a..123559a580 100644 --- a/tutorial/sample-problems/ProblemTechniques/Images.pg +++ b/tutorial/sample-problems/ProblemTechniques/Images.pg @@ -19,14 +19,14 @@ #: The PODLINK('PGgraphmacros.pl'), PODLINK('PGtikz.pl'), #: PODLINK('PGlateximage.pl') and PODLINK('parserGraphTool.pl') macros are used #: to create the images. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'PGgraphmacros.pl', 'PGtikz.pl', - 'PGlateximage.pl', 'parserGraphTool.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGgraphmacros.pl +## - PGtikz.pl +## - PGlateximage.pl +## - parserGraphTool.pl +## --- #:% section = setup #: A WWPlot using PODLINK('PGgraphmacros.pl'), a TikZ plot using @@ -94,5 +94,3 @@ BEGIN_PGML * A graphtool plot [!A graphtool plot with a circle!]{$gt}{120} END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/InequalityEvaluators.pg b/tutorial/sample-problems/ProblemTechniques/InequalityEvaluators.pg index 9237bce8dd..62fd3fa6bd 100644 --- a/tutorial/sample-problems/ProblemTechniques/InequalityEvaluators.pg +++ b/tutorial/sample-problems/ProblemTechniques/InequalityEvaluators.pg @@ -19,8 +19,11 @@ #:% section = preamble #: Load the PODLINK('contextInequalities.pl') macro. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'contextInequalities.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextInequalities.pl +## --- #:% section = setup #: Select the `Inequalities-Only` context. In this context, an inequality such @@ -60,5 +63,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/IntervalEvaluators.pg b/tutorial/sample-problems/ProblemTechniques/IntervalEvaluators.pg index 67124b7a12..8d0bef0a20 100644 --- a/tutorial/sample-problems/ProblemTechniques/IntervalEvaluators.pg +++ b/tutorial/sample-problems/ProblemTechniques/IntervalEvaluators.pg @@ -18,8 +18,9 @@ #:% see_also = [InequalityEvaluators.pg] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Select the `Interval` context. @@ -54,5 +55,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/Knowls.pg b/tutorial/sample-problems/ProblemTechniques/Knowls.pg index 71565c869f..329f7bdec7 100644 --- a/tutorial/sample-problems/ProblemTechniques/Knowls.pg +++ b/tutorial/sample-problems/ProblemTechniques/Knowls.pg @@ -17,8 +17,9 @@ #:% categories = [knowls] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = statement #: Knowls can be added to a text section of the problem file. @@ -52,5 +53,3 @@ Here is another knowl url => '/webwork2_files/helpFiles/Entering-Angles.html' ) @]* END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/LayoutTable.pg b/tutorial/sample-problems/ProblemTechniques/LayoutTable.pg index 7830309c1f..84122e66a7 100644 --- a/tutorial/sample-problems/ProblemTechniques/LayoutTable.pg +++ b/tutorial/sample-problems/ProblemTechniques/LayoutTable.pg @@ -23,8 +23,11 @@ #: #: The PODLINK('PGtikz.pl') macro is also used in this example to demonstrate #: inserting a dynamically generated image into a table. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: A `LayoutTable` is meant to be used for layout, i.e., to organize various @@ -127,5 +130,3 @@ ANS($ans->cmp); BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/Multianswer.pg b/tutorial/sample-problems/ProblemTechniques/Multianswer.pg index 89d770da17..1d7b5206ab 100644 --- a/tutorial/sample-problems/ProblemTechniques/Multianswer.pg +++ b/tutorial/sample-problems/ProblemTechniques/Multianswer.pg @@ -19,8 +19,11 @@ #:% section = preamble #: Load the PODLINK('parserMultiAnswer.pl') which provides the `MultiAnswer` #: method. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'parserMultiAnswer.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserMultiAnswer.pl +## --- #:% section = setup #: This problem is shown as an example of using PODLINK('parserMultiAnswer.pl'). @@ -101,5 +104,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/NamedAnswerRules.pg b/tutorial/sample-problems/ProblemTechniques/NamedAnswerRules.pg index 16b56f8dfb..c0a4530d96 100644 --- a/tutorial/sample-problems/ProblemTechniques/NamedAnswerRules.pg +++ b/tutorial/sample-problems/ProblemTechniques/NamedAnswerRules.pg @@ -19,11 +19,11 @@ #:% section = preamble #: Load the PODLINK('parserLinearInequality.pl') macro so that a linear #: inequality answer can be used. -DOCUMENT(); -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserLinearInequality.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserLinearInequality.pl +## --- #:% section = setup #: Generate random variables `$a`, `$b`, and `$c` to use for coefficients in the @@ -145,5 +145,3 @@ END_SCRIPT BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/NumericalTolerance.pg b/tutorial/sample-problems/ProblemTechniques/NumericalTolerance.pg index 7a3aa5ec92..ea93933e6f 100644 --- a/tutorial/sample-problems/ProblemTechniques/NumericalTolerance.pg +++ b/tutorial/sample-problems/ProblemTechniques/NumericalTolerance.pg @@ -17,8 +17,9 @@ #:% see_also = [DigitsTolType.pg] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: This shows three different ways of setting the `toltype` and `tolerance` of @@ -83,5 +84,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/OtherVariables.pg b/tutorial/sample-problems/ProblemTechniques/OtherVariables.pg index 7c2b5a39f1..48e8c7dcd9 100644 --- a/tutorial/sample-problems/ProblemTechniques/OtherVariables.pg +++ b/tutorial/sample-problems/ProblemTechniques/OtherVariables.pg @@ -17,8 +17,9 @@ #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Typically the variables for the answers in the problem are set at the @@ -54,5 +55,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/Percent.pg b/tutorial/sample-problems/ProblemTechniques/Percent.pg index 9a1edc54ce..f654a999d9 100644 --- a/tutorial/sample-problems/ProblemTechniques/Percent.pg +++ b/tutorial/sample-problems/ProblemTechniques/Percent.pg @@ -17,8 +17,11 @@ #:% section = preamble #: The PODLINK('contextPercent.pl') macro must be loaded. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'contextPercent.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextPercent.pl +## --- #:% section = setup #: Select the `Percent` context, generate a random percentage, and `Compute` the @@ -40,5 +43,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/RandomFunction.pg b/tutorial/sample-problems/ProblemTechniques/RandomFunction.pg index 1f114807d0..f75689ea18 100644 --- a/tutorial/sample-problems/ProblemTechniques/RandomFunction.pg +++ b/tutorial/sample-problems/ProblemTechniques/RandomFunction.pg @@ -16,8 +16,9 @@ #:% categories = [random, function] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: First, generate the random numbers needed as well as an array of functions @@ -52,5 +53,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/RestrictAnswerToFraction.pg b/tutorial/sample-problems/ProblemTechniques/RestrictAnswerToFraction.pg index 6288348a3e..4fcf18b9d1 100644 --- a/tutorial/sample-problems/ProblemTechniques/RestrictAnswerToFraction.pg +++ b/tutorial/sample-problems/ProblemTechniques/RestrictAnswerToFraction.pg @@ -20,9 +20,11 @@ #:% section = preamble #: Load the PODLINK('contextFraction.pl') for the fraction contexts that it #: provides. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextFraction.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextFraction.pl +## --- #:% section = setup #: The `Fractions-NoDecimals` context is selected which requires that answers @@ -80,5 +82,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/RestrictingFunctions.pg b/tutorial/sample-problems/ProblemTechniques/RestrictingFunctions.pg index 4d5c373acf..a7458b0e75 100644 --- a/tutorial/sample-problems/ProblemTechniques/RestrictingFunctions.pg +++ b/tutorial/sample-problems/ProblemTechniques/RestrictingFunctions.pg @@ -18,9 +18,9 @@ #:% see_also = [RestrictAnswerToFraction.pg] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Pass the `showTypeWarnings => 0` option to the `cmp` method to turn off type @@ -42,5 +42,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/SimplePopUp.pg b/tutorial/sample-problems/ProblemTechniques/SimplePopUp.pg index 9f1b69317b..38b92de098 100644 --- a/tutorial/sample-problems/ProblemTechniques/SimplePopUp.pg +++ b/tutorial/sample-problems/ProblemTechniques/SimplePopUp.pg @@ -17,9 +17,11 @@ #:% section = preamble #: Load PODLINK('parserPopUp.pl') for pop up (or drop down) menu answers. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserPopUp.pl +## --- #:% section = setup #: This shows a number of ways to use either `PopUp` (the legacy version) or @@ -63,5 +65,3 @@ Solution explanation goes here. END_PGML_SOLUTION COMMENT('MathObject version. Uses PGML.'); - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/StaticImages.pg b/tutorial/sample-problems/ProblemTechniques/StaticImages.pg index f0572ff0ed..88dda1453d 100644 --- a/tutorial/sample-problems/ProblemTechniques/StaticImages.pg +++ b/tutorial/sample-problems/ProblemTechniques/StaticImages.pg @@ -16,8 +16,9 @@ #:% categories = [images] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = statement #: Use the `PGML` image syntax to include static images. For accessibility you @@ -52,5 +53,3 @@ BEGIN_PGML image_options => { tex_size => 600 } } END_PGML - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/StringsInContext.pg b/tutorial/sample-problems/ProblemTechniques/StringsInContext.pg index a325b9956c..5752bef995 100644 --- a/tutorial/sample-problems/ProblemTechniques/StringsInContext.pg +++ b/tutorial/sample-problems/ProblemTechniques/StringsInContext.pg @@ -17,9 +17,9 @@ #:% see_also = [StringOrOtherType.pg] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Note that this example is only here to demonstrate how to add strings to a @@ -64,5 +64,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/TikZImages.pg b/tutorial/sample-problems/ProblemTechniques/TikZImages.pg index c0150c3d35..c1a176a1a9 100644 --- a/tutorial/sample-problems/ProblemTechniques/TikZImages.pg +++ b/tutorial/sample-problems/ProblemTechniques/TikZImages.pg @@ -18,9 +18,11 @@ #:% section = preamble #: PODLINK('PGtikz.pl') is used to generate the graph, -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: The `createTikZImage` function creates an image to be built using TikZ. @@ -99,5 +101,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/ProblemTechniques/WeightedGrader.pg b/tutorial/sample-problems/ProblemTechniques/WeightedGrader.pg index 07a687a473..b7f682bc06 100644 --- a/tutorial/sample-problems/ProblemTechniques/WeightedGrader.pg +++ b/tutorial/sample-problems/ProblemTechniques/WeightedGrader.pg @@ -18,8 +18,9 @@ #:% categories = [grader, answers] #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup @@ -45,5 +46,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Sequences/AnswerOrderedList.pg b/tutorial/sample-problems/Sequences/AnswerOrderedList.pg index 2e4bfe69a2..45bd89e9be 100644 --- a/tutorial/sample-problems/Sequences/AnswerOrderedList.pg +++ b/tutorial/sample-problems/Sequences/AnswerOrderedList.pg @@ -17,9 +17,9 @@ #:% categories = [sequences, answers] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Create an array `@seq` with the first two elements of the sequence that will @@ -46,5 +46,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Sequences/ExplicitSequence.pg b/tutorial/sample-problems/Sequences/ExplicitSequence.pg index 2d18161cef..0b7e8b1803 100644 --- a/tutorial/sample-problems/Sequences/ExplicitSequence.pg +++ b/tutorial/sample-problems/Sequences/ExplicitSequence.pg @@ -18,9 +18,9 @@ #:% see_also = [FormulaTestPoints.pg, FormulaDomain.pg] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: The answer is a formula involving factorials that are only defined for @@ -46,5 +46,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Sequences/RecursiveSequence.pg b/tutorial/sample-problems/Sequences/RecursiveSequence.pg index c967ab954e..3e87d7c60e 100644 --- a/tutorial/sample-problems/Sequences/RecursiveSequence.pg +++ b/tutorial/sample-problems/Sequences/RecursiveSequence.pg @@ -20,9 +20,11 @@ #:% section = preamble #: A new named function will be defined and added to the context. This can be #: done using PODLINK('parserFunction.pl'). -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserFunction.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserFunction.pl +## --- #:% section = setup #: Define a new named function `f` as something the student is unlikely to @@ -53,5 +55,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Sequences/SeriesTest.pg b/tutorial/sample-problems/Sequences/SeriesTest.pg index 575e9bdc5f..dad83c113a 100644 --- a/tutorial/sample-problems/Sequences/SeriesTest.pg +++ b/tutorial/sample-problems/Sequences/SeriesTest.pg @@ -30,14 +30,14 @@ #: #: The PODLINK('PGgraders.pl') macro is used to give incremental partial credit #: (although that is a poor choice for this problem). -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserPopUp.pl', 'PGgraders.pl', - 'parserMultiAnswer.pl', 'parserRadioMultiAnswer.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserPopUp.pl +## - PGgraders.pl +## - parserMultiAnswer.pl +## - parserRadioMultiAnswer.pl +## --- #:% section = setup #: Create `$multians` as a `MultiAnswer` with the two answers `$num1` and @@ -167,5 +167,3 @@ $ENV{grader_message} = BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Snippets/CommentsForInstructors.pg b/tutorial/sample-problems/Snippets/CommentsForInstructors.pg index 64c4442053..03546e55fb 100644 --- a/tutorial/sample-problems/Snippets/CommentsForInstructors.pg +++ b/tutorial/sample-problems/Snippets/CommentsForInstructors.pg @@ -18,14 +18,12 @@ #:% categories = [comments] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = statement #: Call `COMMENT` to add a comment that is visible when the PG file is viewed in #: the Library Browser or the PG problem editor. Students do not see these #: comments. COMMENT('This problem is not randomized.'); - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/BarGraph.pg b/tutorial/sample-problems/Statistics/BarGraph.pg index 6d4a42eb60..3cf7bacda9 100644 --- a/tutorial/sample-problems/Statistics/BarGraph.pg +++ b/tutorial/sample-problems/Statistics/BarGraph.pg @@ -18,13 +18,12 @@ #: The PODLINK('PGtikz.pl') macro provides the graphing methods we will use #: in this problem and PODLINK('contextPercent.pl') will be to provide the #: Percent context. -DOCUMENT(); - -loadMacros( - "PGstandard.pl", "PGML.pl", - 'PGtikz.pl', 'contextPercent.pl', - "PGcourse.pl" -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## - contextPercent.pl +## --- #:% section = setup #: The 'Percent' context allow students to enter percents. @@ -99,5 +98,3 @@ BEGIN_PGML_SOLUTION The total number of students that took the quiz is [$total] so the percentage is the number of A students or [`[$grades[0]]/[$num_students] = [$perA] `] END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/BarGraphStatPlot.pg b/tutorial/sample-problems/Statistics/BarGraphStatPlot.pg index 63a926b3c0..d2f3bdbf54 100644 --- a/tutorial/sample-problems/Statistics/BarGraphStatPlot.pg +++ b/tutorial/sample-problems/Statistics/BarGraphStatPlot.pg @@ -19,13 +19,12 @@ #: PODLINK('StatisticalPlots.pl') macro, which provides some convenience methods #: for creating Statistical plots. This also uses the #: PODLINK('contextPercent.pl') to provide the Percent context. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'StatisticalPlots.pl', 'contextPercent.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - StatisticalPlots.pl +## - contextPercent.pl +## --- #:% section = setup #: The 'Percent' context allow students to enter percents. @@ -101,5 +100,3 @@ BEGIN_PGML_SOLUTION The total number of students that took the quiz is [$total] so the percentage is the number of A students or [`[$grades[0]]/[$num_students] = [$perA] `] END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/BoxPlot.pg b/tutorial/sample-problems/Statistics/BoxPlot.pg index 0b8460b003..a38b0303a6 100644 --- a/tutorial/sample-problems/Statistics/BoxPlot.pg +++ b/tutorial/sample-problems/Statistics/BoxPlot.pg @@ -18,13 +18,12 @@ #: Use the PODLINK('StatisticalPlots.pl') macro, which provides some convenience methods #: for creating Statistical plots. This also uses the #: PODLINK('PGstatisticsmacros.pl') for access to random normally-distributed numbers. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'StatisticalPlots.pl', 'PGstatisticsmacros.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - StatisticalPlots.pl +## - PGstatisticsmacros.pl +## --- #:% section = setup #: @@ -128,5 +127,3 @@ END_PGML BEGIN_PGML_SOLUTION Add solution here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/DonutPlot.pg b/tutorial/sample-problems/Statistics/DonutPlot.pg index 00903ebcb9..933789b13f 100644 --- a/tutorial/sample-problems/Statistics/DonutPlot.pg +++ b/tutorial/sample-problems/Statistics/DonutPlot.pg @@ -19,9 +19,11 @@ #: This uses the `add_piechart` method in the PODLINK('StatisticalPlots.pl') #: macro with the option to make it a donut plot. #: A pie chart version of this is available at PROBLINK('PieChart.pg'). -DOCUMENT(); - -loadMacros("PGstandard.pl", 'PGML.pl', 'StatisticalPlots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - StatisticalPlots.pl +## --- #:% section = setup #: In this example, the size of each wedge in the donut plot is given as an @@ -79,5 +81,3 @@ END_PGML BEGIN_PGML_SOLUTION Place a detailed solution here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/Histogram.pg b/tutorial/sample-problems/Statistics/Histogram.pg index 07e0457571..f06f8bbc57 100644 --- a/tutorial/sample-problems/Statistics/Histogram.pg +++ b/tutorial/sample-problems/Statistics/Histogram.pg @@ -19,13 +19,12 @@ #: provides some convenience methods for creating Statistical plots. This also uses #: PODLINK('PGstatisticsmacros.pl') to generate random values from the Normal #: distribution. -DOCUMENT(); - -loadMacros( - "PGstandard.pl", "PGML.pl", - 'StatisticalPlots.pl', 'PGstatisticsmacros.pl', - "PGcourse.pl" -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - StatisticalPlots.pl +## - PGstatisticsmacros.pl +## --- #:% section = setup #: @@ -96,5 +95,3 @@ END_PGML BEGIN_PGML_SOLUTION If a question was asked, provide a solution. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/LinearRegression.pg b/tutorial/sample-problems/Statistics/LinearRegression.pg index 7e95e8f14e..17c0700e33 100644 --- a/tutorial/sample-problems/Statistics/LinearRegression.pg +++ b/tutorial/sample-problems/Statistics/LinearRegression.pg @@ -16,9 +16,11 @@ #:% section = preamble #: The PODLINK('PGstatisticsmacros.pl') macro provides the `sample_correlation` #: and `linear_regression` methods. -DOCUMENT(); - -loadMacros("PGstandard.pl", "PGML.pl", 'PGstatisticsmacros.pl', "PGcourse.pl"); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGstatisticsmacros.pl +## --- #:% section = setup #: Generate random numbers, and then use the `sample_correlation` and @@ -63,5 +65,3 @@ END_PGML BEGIN_PGML_SOLUTION Provide a solution here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/MeanStdDev.pg b/tutorial/sample-problems/Statistics/MeanStdDev.pg index c824a271b4..8baf293caa 100644 --- a/tutorial/sample-problems/Statistics/MeanStdDev.pg +++ b/tutorial/sample-problems/Statistics/MeanStdDev.pg @@ -16,9 +16,11 @@ #:% section = preamble #: The PODLINK('PGstatisticsmacros.pl') macro provides the `stats_mean`, #: `stats_sd`, and `stats_SX_SXX` methods. -DOCUMENT(); - -loadMacros("PGstandard.pl", "PGML.pl", 'PGstatisticsmacros.pl', "PGcourse.pl"); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGstatisticsmacros.pl +## --- #:% section = setup #: Generate random numbers and then calculate the mean and standard deviation @@ -70,5 +72,3 @@ For the standard deviation, first, find the variance. Taking the square root gives [`s \approx [$sd]`] END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/MultiBoxPlot.pg b/tutorial/sample-problems/Statistics/MultiBoxPlot.pg index 47bad79ad7..c8bdfd6bc8 100644 --- a/tutorial/sample-problems/Statistics/MultiBoxPlot.pg +++ b/tutorial/sample-problems/Statistics/MultiBoxPlot.pg @@ -17,9 +17,11 @@ #:% section = preamble #: The PODLINK('StatisticalPlots.pl') macro is included. This provides some #: convenience methods for creating Statistical plots. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'StatisticalPlots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - StatisticalPlots.pl +## --- #:% section = setup #: To create a graph, start with a `StatPlot`. The `min` and `max` options in @@ -114,5 +116,3 @@ END_PGML BEGIN_PGML_SOLUTION Place a detailed solution here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/PieChart.pg b/tutorial/sample-problems/Statistics/PieChart.pg index 7c3e85e322..752e33179a 100644 --- a/tutorial/sample-problems/Statistics/PieChart.pg +++ b/tutorial/sample-problems/Statistics/PieChart.pg @@ -18,9 +18,11 @@ #:% section = preamble #: This uses the `add_piechart` method in the PODLINK('StatisticalPlots.pl') #: macro. A donut plot version of this is available at PROBLINK('DonutPlot.pg'). -DOCUMENT(); - -loadMacros("PGstandard.pl", 'PGML.pl', 'StatisticalPlots.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - StatisticalPlots.pl +## --- #:% section = setup #: In this example, the size of each wedge in the pie chart is given as an @@ -75,5 +77,3 @@ END_PGML BEGIN_PGML_SOLUTION Place a detailed solution here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/ScatterPlot.pg b/tutorial/sample-problems/Statistics/ScatterPlot.pg index bce5bfaaa9..4a468e8fcc 100644 --- a/tutorial/sample-problems/Statistics/ScatterPlot.pg +++ b/tutorial/sample-problems/Statistics/ScatterPlot.pg @@ -21,13 +21,12 @@ #: This produces a scatter plot with PODLINK('plots.pl'). A version of this #: with PODLINK('StatisticalPlots.pl') is available in #: PROBLINK('ScatterPlotStatPlot.pg'). -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'plots.pl', 'PGstatisticsmacros.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plots.pl +## - PGstatisticsmacros.pl +## --- #:% section = setup #: For this problem, we have a data set stored as an array of array @@ -94,5 +93,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Statistics/ScatterPlotStatPlot.pg b/tutorial/sample-problems/Statistics/ScatterPlotStatPlot.pg index a245356500..2802073fd0 100644 --- a/tutorial/sample-problems/Statistics/ScatterPlotStatPlot.pg +++ b/tutorial/sample-problems/Statistics/ScatterPlotStatPlot.pg @@ -20,13 +20,12 @@ #: Make sure that PODLINK('StatisticalPlots.pl') is loaded. This is a version #: of the problem in PROBLINK('ScatterPlot.pg') that uses the scatter plot feature #: in StatisticalPlots.pl. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'StatisticalPlots.pl', 'PGstatisticsmacros.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - StatisticalPlots.pl +## - PGstatisticsmacros.pl +## --- #:% section = setup #: For this problem, we have a data set stored as an array of array @@ -94,5 +93,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Trig/DisableFunctionsTrig.pg b/tutorial/sample-problems/Trig/DisableFunctionsTrig.pg index 9cbeb2d6fe..653990ac5f 100644 --- a/tutorial/sample-problems/Trig/DisableFunctionsTrig.pg +++ b/tutorial/sample-problems/Trig/DisableFunctionsTrig.pg @@ -19,9 +19,11 @@ #:% section = preamble #: The PODLINK('contextFraction.pl') is loaded for the `Fraction-NoDecimals` #: context. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'contextFraction.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextFraction.pl +## --- #:% section = setup #: Select the `Fraction-NoDecimals` context which requires fractions as answers @@ -61,5 +63,3 @@ END_PGML_HINT BEGIN_PGML_SOLUTION Provide a solution here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Trig/DraggableIdentity.pg b/tutorial/sample-problems/Trig/DraggableIdentity.pg index 693aa92a5f..9b30b8b31a 100644 --- a/tutorial/sample-problems/Trig/DraggableIdentity.pg +++ b/tutorial/sample-problems/Trig/DraggableIdentity.pg @@ -19,9 +19,11 @@ #:% section = preamble #: This problem uses the PODLINK('draggableProof.pl`) macro to display "buckets" #: that the student can drag statements to and from. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'draggableProof.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - draggableProof.pl +## --- #:% section = setup #: The `DraggableProof` function takes a reference to an array of correct @@ -59,5 +61,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Trig/PeriodicAnswers.pg b/tutorial/sample-problems/Trig/PeriodicAnswers.pg index 469c28359c..47c7554d9c 100644 --- a/tutorial/sample-problems/Trig/PeriodicAnswers.pg +++ b/tutorial/sample-problems/Trig/PeriodicAnswers.pg @@ -17,9 +17,9 @@ #:% categories = [answers, trigonometry] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: This allows any answer of the form `pi / 2 + n pi` where `n` is a particular @@ -44,5 +44,3 @@ END_PGML_HINT BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Trig/ProvingTrigIdentities.pg b/tutorial/sample-problems/Trig/ProvingTrigIdentities.pg index 4b286ec4c4..f0f5cd6df6 100644 --- a/tutorial/sample-problems/Trig/ProvingTrigIdentities.pg +++ b/tutorial/sample-problems/Trig/ProvingTrigIdentities.pg @@ -19,9 +19,11 @@ #:% section = preamble #: This is a scaffolded problem, so load PODLINK('scaffold.pl'). -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'scaffold.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - scaffold.pl +## --- #:% section = setup #: The sine function is cleverly redefined so that when the student enters @@ -90,5 +92,3 @@ END_PGML Section::End(); Scaffold::End(); - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Trig/SpecialTrigValues.pg b/tutorial/sample-problems/Trig/SpecialTrigValues.pg index a7c2bbd9ad..74d4f4138c 100644 --- a/tutorial/sample-problems/Trig/SpecialTrigValues.pg +++ b/tutorial/sample-problems/Trig/SpecialTrigValues.pg @@ -19,9 +19,11 @@ #:% section = preamble #: Load the PODLINK('specialTrigValues.pl') macro for the `specialRadical` and #: `specialAngle` methods. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'specialTrigValues.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - specialTrigValues.pl +## --- #:% section = setup #: The `random_coprime` function selects two random numbers that are coprime @@ -64,5 +66,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Trig/TrigDegrees.pg b/tutorial/sample-problems/Trig/TrigDegrees.pg index 659fd6e300..5b43cb6868 100644 --- a/tutorial/sample-problems/Trig/TrigDegrees.pg +++ b/tutorial/sample-problems/Trig/TrigDegrees.pg @@ -20,13 +20,12 @@ #: Load the PODLINK('contextTrigDegrees.pl') macro for the `TrigDegrees` #: context. Also load the PODLINK('contextUnits.pl') which will require that the #: answer has units of degrees. -DOCUMENT(); - -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'contextTrigDegrees.pl', 'contextUnits.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - contextTrigDegrees.pl +## - contextUnits.pl +## --- #:% section = setup #: Select the `TrigDegrees` context to which evaluates trig functions in @@ -56,5 +55,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/Trig/TrigIdentities.pg b/tutorial/sample-problems/Trig/TrigIdentities.pg index 24609c5eb0..a8584bf47a 100644 --- a/tutorial/sample-problems/Trig/TrigIdentities.pg +++ b/tutorial/sample-problems/Trig/TrigIdentities.pg @@ -17,9 +17,9 @@ #:% categories = [custom checker] #:% section = preamble -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: To prevent the student from just entering the given expression, a custom @@ -57,5 +57,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/VectorCalc/CylindricalGraph3D.pg b/tutorial/sample-problems/VectorCalc/CylindricalGraph3D.pg index 31d7a2973e..f273bad75e 100644 --- a/tutorial/sample-problems/VectorCalc/CylindricalGraph3D.pg +++ b/tutorial/sample-problems/VectorCalc/CylindricalGraph3D.pg @@ -19,9 +19,11 @@ #:% section = preamble #: The dynamic graph is generated with PODLINK('plotly3D.pl'). -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plotly3D.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plotly3D.pl +## --- #:% section = setup #: To add a plotly graph to a problem, first create a `Graph3D` object by @@ -89,5 +91,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/VectorCalc/DirectionField.pg b/tutorial/sample-problems/VectorCalc/DirectionField.pg index 9f329000e7..dff954b520 100644 --- a/tutorial/sample-problems/VectorCalc/DirectionField.pg +++ b/tutorial/sample-problems/VectorCalc/DirectionField.pg @@ -19,8 +19,11 @@ #:% section = preamble #: The macro PODLINK('PGtikz.pl') is used to produced the direction field graph. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: A direction field is a vector field where the length of the vectors are @@ -78,6 +81,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); - diff --git a/tutorial/sample-problems/VectorCalc/GraphToolVectors.pg b/tutorial/sample-problems/VectorCalc/GraphToolVectors.pg index 3268fca3e0..f826b46278 100644 --- a/tutorial/sample-problems/VectorCalc/GraphToolVectors.pg +++ b/tutorial/sample-problems/VectorCalc/GraphToolVectors.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Load the PODLINK('parserGraphTool.pl') macro to be able to use the GraphTool. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserGraphTool.pl +## --- #:% section = setup #: This problem asks the student to graph the random vector <$vx1, $vy1>. Set @@ -55,5 +57,3 @@ A correct answer is But any vector with the same length and in the same direction would be correct as well. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/VectorCalc/RectangularGraph3D.pg b/tutorial/sample-problems/VectorCalc/RectangularGraph3D.pg index 0b9e7415d4..f723a31636 100644 --- a/tutorial/sample-problems/VectorCalc/RectangularGraph3D.pg +++ b/tutorial/sample-problems/VectorCalc/RectangularGraph3D.pg @@ -19,9 +19,11 @@ #:% section = preamble #: The dynamic graph is generated with PODLINK('plotly3D.pl'). -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'plotly3D.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - plotly3D.pl +## --- #:% section = setup #: Generate the plot parametrically for the function `z = x^2 + y^2` with the @@ -55,5 +57,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/VectorCalc/VectorFieldGraph2D.pg b/tutorial/sample-problems/VectorCalc/VectorFieldGraph2D.pg index bbd1837968..7cf09b28f6 100644 --- a/tutorial/sample-problems/VectorCalc/VectorFieldGraph2D.pg +++ b/tutorial/sample-problems/VectorCalc/VectorFieldGraph2D.pg @@ -19,8 +19,11 @@ #:% section = preamble #: The macro PODLINK('PGtikz.pl') is used to produced the vector field graph. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - PGtikz.pl +## --- #:% section = setup #: The graph of the vector field is created. The vector field is @@ -76,6 +79,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); - diff --git a/tutorial/sample-problems/VectorCalc/VectorFieldGraph3D/VectorFieldGraph3D1.pg b/tutorial/sample-problems/VectorCalc/VectorFieldGraph3D/VectorFieldGraph3D1.pg index 458c69a7f2..3f33d06cc6 100644 --- a/tutorial/sample-problems/VectorCalc/VectorFieldGraph3D/VectorFieldGraph3D1.pg +++ b/tutorial/sample-problems/VectorCalc/VectorFieldGraph3D/VectorFieldGraph3D1.pg @@ -20,11 +20,11 @@ #: Include the PODLINK('LiveGraphicsVectorField3D.pl') macro. Note that the #: PODLINK('LiveGraphics3D.pl') macro is loaded by that macro and provides the #: `Live3Ddata` method. -DOCUMENT(); -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'LiveGraphicsVectorField3D.pl', 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - LiveGraphicsVectorField3D.pl +## --- #:% section = setup #: The `VectorField3D` method returns a string of plot data suitable for use @@ -88,6 +88,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); - diff --git a/tutorial/sample-problems/VectorCalc/VectorLineSegment1.pg b/tutorial/sample-problems/VectorCalc/VectorLineSegment1.pg index 859328293e..49fa7dd499 100644 --- a/tutorial/sample-problems/VectorCalc/VectorLineSegment1.pg +++ b/tutorial/sample-problems/VectorCalc/VectorLineSegment1.pg @@ -24,12 +24,12 @@ #: function which us used to check the answer. The #: PODLINK('parserMultiAnswer.pl') macro is needed since the answers are #: interdependent. -DOCUMENT(); -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserParametricLine.pl', 'parserMultiAnswer.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserParametricLine.pl +## - parserMultiAnswer.pl +## --- #:% section = setup #: Create a `MultiAnswer` object that is used to evaluate the student's vector @@ -96,5 +96,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/VectorCalc/VectorLineSegment2.pg b/tutorial/sample-problems/VectorCalc/VectorLineSegment2.pg index 15a2d8330f..1d39593677 100644 --- a/tutorial/sample-problems/VectorCalc/VectorLineSegment2.pg +++ b/tutorial/sample-problems/VectorCalc/VectorLineSegment2.pg @@ -22,8 +22,11 @@ #:% section = preamble #: The PODLINK('parserVectorUtils.pl') macro is loaded for the #: `non_zero_point3D` and `non_zero_vector3D` methods. -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'parserVectorUtils.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserVectorUtils.pl +## --- #:% section = setup #: A random point is generated with the `non_zero_point3D` method, a random @@ -58,5 +61,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/VectorCalc/VectorOperations.pg b/tutorial/sample-problems/VectorCalc/VectorOperations.pg index c9aef2f6c1..5cd206c24c 100644 --- a/tutorial/sample-problems/VectorCalc/VectorOperations.pg +++ b/tutorial/sample-problems/VectorCalc/VectorOperations.pg @@ -18,9 +18,11 @@ #:% section = preamble #: Load PODLINK('parserVectorUtils.pl') for the `non_zero_vector3D` method. -DOCUMENT(); - -loadMacros('PGstandard.pl', 'PGML.pl', 'parserVectorUtils.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserVectorUtils.pl +## --- #:% section = setup #: Use `non_zero_vector3D(low, high, increment)` to randomly generate two @@ -83,6 +85,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); - diff --git a/tutorial/sample-problems/VectorCalc/VectorParametricLine.pg b/tutorial/sample-problems/VectorCalc/VectorParametricLine.pg index 983b415116..d8aa3f32f9 100644 --- a/tutorial/sample-problems/VectorCalc/VectorParametricLine.pg +++ b/tutorial/sample-problems/VectorCalc/VectorParametricLine.pg @@ -23,12 +23,12 @@ #: The PODLINK('parserVectorUtils.pl') macro provides the `non_zero_point3D` and #: `non_zero_vector3D` methods. The macro PODLINK('parserParametricLine.pl') #: provides the `ParametricLine` function used for the answer. -DOCUMENT(); -loadMacros( - 'PGstandard.pl', 'PGML.pl', - 'parserVectorUtils.pl', 'parserParametricLine.pl', - 'PGcourse.pl' -); +## --- +## pgAuthoringVersion: 1 +## macros: +## - parserVectorUtils.pl +## - parserParametricLine.pl +## --- #:% section = setup #: Generate a random three dimensional initial point `$P` using the @@ -57,5 +57,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/sample-problems/VectorCalc/Vectors.pg b/tutorial/sample-problems/VectorCalc/Vectors.pg index 498022c208..0618dd8dcf 100644 --- a/tutorial/sample-problems/VectorCalc/Vectors.pg +++ b/tutorial/sample-problems/VectorCalc/Vectors.pg @@ -17,8 +17,9 @@ #:% subject = Vector Calculus #:% section = preamble -DOCUMENT(); -loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); +## --- +## pgAuthoringVersion: 1 +## --- #:% section = setup #: Select the `Vector` context to work with vectors. @@ -117,5 +118,3 @@ END_PGML BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION - -ENDDOCUMENT(); diff --git a/tutorial/templates/problem-template.html.epl b/tutorial/templates/problem-template.html.epl index 4aca417a0f..25eb9513d7 100644 --- a/tutorial/templates/problem-template.html.epl +++ b/tutorial/templates/problem-template.html.epl @@ -18,7 +18,7 @@ % # Default explanations % my $default = { - % preamble => 'These standard macros need to be loaded.', + % preamble => 'The metadata declares the PG authoring version and the macros that are used.', % setup => 'This perl code sets up the problem.', % statement => 'This is the problem statement in PGML.', % answer => 'This is used for answer checking.',