diff --git a/doc/guide/appendices/schema-install.xml b/doc/guide/appendices/schema-install.xml index 6221bfee78..addd8dd8bc 100644 --- a/doc/guide/appendices/schema-install.xml +++ b/doc/guide/appendices/schema-install.xml @@ -11,7 +11,7 @@
This appendix has technical information about tools that work with the
This appendix has technical information about tools that work with the
+ This exercise has no content in its statement. + It should throw a PTX warning during the representations build. +
+What is
These answer blanks are all expecting some sort of answer in an array format.
Three more flavors, each needing a macro file loaded by
Three quarters, as a fraction:
The solutions of
Four meters, a number with its units:
+
+
+
Nine flavors of answer, each blank linking to format help of its own kind. +
An angle, in degrees, half of a right angle:
Three quarters, as a decimal:
The exponent in
The natural logarithm of
The value of
Any formula equal to
The open interval from
The point where
The vector from the origin to that point:
+
+
+
+
+
+
+
+
+
Ordered list.
Suppose the correct answer is
Structured item
diff --git a/examples/webwork/sample-chapter/my-generated/webwork/list-indentation.xml b/examples/webwork/sample-chapter/my-generated/webwork/list-indentation.xml index 4f9e40a9e1..bb7ee80d26 100644 --- a/examples/webwork/sample-chapter/my-generated/webwork/list-indentation.xml +++ b/examples/webwork/sample-chapter/my-generated/webwork/list-indentation.xml @@ -1,6 +1,6 @@Simple item
diff --git a/examples/webwork/sample-chapter/my-generated/webwork/mathobject-string-answers.xml b/examples/webwork/sample-chapter/my-generated/webwork/mathobject-string-answers.xml index 30425e12d4..ea59786051 100644 --- a/examples/webwork/sample-chapter/my-generated/webwork/mathobject-string-answers.xml +++ b/examples/webwork/sample-chapter/my-generated/webwork/mathobject-string-answers.xml @@ -1,6 +1,6 @@Special characters used by XML, character escaping: <>&'";
diff --git a/examples/webwork/sample-chapter/my-generated/webwork/multiple-choice-popup-or-radio-buttons.xml b/examples/webwork/sample-chapter/my-generated/webwork/multiple-choice-popup-or-radio-buttons.xml index b68f09b6aa..21ac59d2c1 100644 --- a/examples/webwork/sample-chapter/my-generated/webwork/multiple-choice-popup-or-radio-buttons.xml +++ b/examples/webwork/sample-chapter/my-generated/webwork/multiple-choice-popup-or-radio-buttons.xml @@ -1,6 +1,6 @@My favorite color is
?
Suppose the correct answer is
Suppose the correct answer is
Suppose the correct answer is
Suppose the correct answer is
-
-
Solution explanation goes here.
diff --git a/examples/webwork/sample-chapter/my-generated/webwork/pg/Integrating_WeBWorK_into_Textbooks/1-Instructive_Examples/1_9-Answer_Formats_and_Extra_Macros/1_9_1-A_Gallery_of_Answer_Formats.pg b/examples/webwork/sample-chapter/my-generated/webwork/pg/Integrating_WeBWorK_into_Textbooks/1-Instructive_Examples/1_9-Answer_Formats_and_Extra_Macros/1_9_1-A_Gallery_of_Answer_Formats.pg new file mode 100644 index 0000000000..1484bba5bc --- /dev/null +++ b/examples/webwork/sample-chapter/my-generated/webwork/pg/Integrating_WeBWorK_into_Textbooks/1-Instructive_Examples/1_9-Answer_Formats_and_Extra_Macros/1_9_1-A_Gallery_of_Answer_Formats.pg @@ -0,0 +1,85 @@ +############################################# +### Generated from PreTeXt source +### +### https://pretextbook.org +### +############################################# +## DBsubject() +## DBchapter() +## DBsection() +## Level() +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1(not reported) +## Problem1(1.9.1) +## Author() +## Institution() +## Language(en-US) + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "contextForm.pl", + "PGcourse.pl", +); +COMMENT('Authored in PreTeXt'); + +############################################################ +# Header +############################################################ + +############################################################ +# PG Setup Code +############################################################ +Context("Numeric"); +$angle = Real(45); +$decimal = Real(0.75); +$exponent = Real(3); +$logarithm = Compute("ln(2)"); +$limit = Real(6); +$syntaxanswer = Formula("x^2+1"); +Context("Interval"); +$interval = Compute("(1,5)"); +Context("Vector"); +$point = Point("(1,2)"); +$vector = Vector("<1,2>"); + +############################################################ +# Body +############################################################ + +BEGIN_PGML +Nine flavors of answer, each blank linking to format help of its own kind. +a. An angle, in degrees, half of a right angle: [_]{$angle}{4} [@AnswerFormatHelp('angles')@]* + +a. Three quarters, as a decimal: [_]{$decimal}{6} [@AnswerFormatHelp('decimals')@]* + +a. The exponent in [`2^3 = 8\text{:}`] [_]{$exponent}{4} [@AnswerFormatHelp('exponents')@]* + +a. The natural logarithm of [`2\text{,}`] exactly: [_]{$logarithm}{6} [@AnswerFormatHelp('logarithms')@]* + +a. The value of [`\lim_{x\to 2}(x^2+2)\text{:}`] [_]{$limit}{4} [@AnswerFormatHelp('limits')@]* + +a. Any formula equal to [`x^2+1\text{:}`] [_]{$syntaxanswer}{10} [@AnswerFormatHelp('syntax')@]* + +a. The open interval from [`1`] to [`5\text{:}`] [_]{$interval}{8} [@AnswerFormatHelp('intervals')@]* + +a. The point where [`y=x+1`] crosses [`x=1\text{:}`] [_]{$point}{8} [@AnswerFormatHelp('points')@]* + +a. The vector from the origin to that point: [_]{$vector}{8} [@AnswerFormatHelp('vectors')@]* + +END_PGML + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/examples/webwork/sample-chapter/my-generated/webwork/pg/Integrating_WeBWorK_into_Textbooks/1-Instructive_Examples/1_9-Answer_Formats_and_Extra_Macros/1_9_2-Answers_Needing_Extra_Macros.pg b/examples/webwork/sample-chapter/my-generated/webwork/pg/Integrating_WeBWorK_into_Textbooks/1-Instructive_Examples/1_9-Answer_Formats_and_Extra_Macros/1_9_2-Answers_Needing_Extra_Macros.pg new file mode 100644 index 0000000000..66f64b2f73 --- /dev/null +++ b/examples/webwork/sample-chapter/my-generated/webwork/pg/Integrating_WeBWorK_into_Textbooks/1-Instructive_Examples/1_9-Answer_Formats_and_Extra_Macros/1_9_2-Answers_Needing_Extra_Macros.pg @@ -0,0 +1,69 @@ +############################################# +### Generated from PreTeXt source +### +### https://pretextbook.org +### +############################################# +## DBsubject() +## DBchapter() +## DBsection() +## Level() +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1(not reported) +## Problem1(1.9.2) +## Author() +## Institution() +## Language(en-US) + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "parserNumberWithUnits.pl", + "contextFraction.pl", + "contextInequalities.pl", + "PGcourse.pl", +); +COMMENT('Authored in PreTeXt'); + +############################################################ +# Header +############################################################ + +############################################################ +# PG Setup Code +############################################################ +Context("Fraction"); +$fraction = Fraction(3, 4); +Context("Inequalities"); +$inequality = Compute("x > 2"); +Context("Numeric"); +$quantity = NumberWithUnits("4 m"); + +############################################################ +# Body +############################################################ + +BEGIN_PGML +Three more flavors, each needing a macro file loaded by [|some PGML math: [`\frac{1}{2}+\frac{3}{2}=2`]; and some *bold text* makes:
some PGML math:
There is math in each option for this question. Which expression is not a polynomial?
A table with minimal XML source.
Smart double quotes:
Smart single quotes:
Regular apostrophes: My siblings
@@ -1422,9 +1422,9 @@ ENDDOCUMENT();
The graph reveals that the solution set to
Each answer blank may carry a
Nine flavors of answer, each blank linking to format help of its own kind.
An angle, in degrees, half of a right angle:
Three quarters, as a decimal:
The exponent in
The natural logarithm of
The value of
Any formula equal to
The open interval from
The point where
The vector from the origin to that point:
Three more flavors, each needing a macro file loaded by
Three quarters, as a fraction:
The solutions of
Four meters, a number with its units:
- This exercise has no content in its statement. - It should throw a PTX warning during the representations build. -
-
diff --git a/schema/pretext-validation-plus.xsl b/schema/pretext-validation-plus.xsl
index 0859ed39a3..8c39cc179f 100644
--- a/schema/pretext-validation-plus.xsl
+++ b/schema/pretext-validation-plus.xsl
@@ -480,6 +480,21 @@ along with PreTeXt. If not, see A large class of similarly indivisible items are units on physical quantities. The A large class of similarly indivisible items are units on physical quantities. The
- Image = ImageRaster | ImageCode
+ Image = ImageRaster | ImageCode | ImagePG
+ # An image drawn by the PG code of a WeBWorK problem, named
+ # by @pg-name. Like "var", the form is admitted schema-wide
+ # (it can appear deep within list items, say) but is
+ # exclusive to a "webwork" problem; the validation-plus
+ # stylesheet enforces the location.
+ ImagePG =
+ element image {
+ attribute pg-name {text},
+ attribute width {text}?,
+ attribute margins {text}?,
+ empty
+ }
ImageDescription = element description {(Paragraph | Tabular)+}
- ImageShortDescription = element shortdescription {text}
+ # A "var" may ride along, per the schema-wide "var" pattern:
+ # the validation-plus stylesheet confines it to a WeBWorK problem
+ ImageShortDescription = element shortdescription {(text | WWVariable)*}
ImageShortDescriptionCode = element shortdescription {
(text | WWVariable)+
}
@@ -3208,6 +3222,9 @@
SimpleLine+
)
}
+ # A "webwork" with @copy is an empty, lightweight reference
+ # to another authored problem (perhaps reseeded); the
+ # assembly resolves it to a duplicate
WebWorkAuthored =
element webwork {
(
@@ -3215,7 +3232,6 @@
LabelID?,
Component?,
attribute seed {xsd:integer}?,
- attribute copy {text}?,
WWDescription?,
WWMacros?,
element pg-code {text}?,
@@ -3225,6 +3241,14 @@
(IntroductionText?, TaskWW+, ConclusionText?)
)
) |
+ (
+ UniqueID?,
+ LabelID?,
+ Component?,
+ attribute copy {text},
+ attribute seed {xsd:integer}?,
+ empty
+ ) |
text
}
BlockStatementWW =
@@ -3249,11 +3273,13 @@
element macro-file {text}+
}
WWVariable =
- ## The WeBWorK "var" element appears in the RELAX-NG schema as a child of many elements, but almost always as a descendant of a "p" element or a "cell" element. As an element that is only relevant for a WeBWorK problem, occurrences of "var" must be within a "webwork" element. PreTeXt's additional validation will check on these two situations.
+ ## The WeBWorK "var" element appears in the RELAX-NG schema as a child of many elements, but almost always as a descendant of a "p" element or a "cell" element. As an element that is only relevant for a WeBWorK problem, occurrences of "var" must be within a "webwork" element. The validation-plus stylesheet will check on these two situations.
element var {
(attribute name {text},
attribute evaluator {text}?,
attribute width {text}?,
+ # the variable holds PGML markup to be processed
+ attribute data {"pgml"}?,
attribute category {
"angle" | "decimal" | "exponent"
| "formula" | "fraction" | "inequality"
@@ -3261,7 +3287,7 @@
| "limit" | "number" | "point"
| "syntax" | "quantity" | "vector"
}?,
- attribute form {"popup"|"buttons"|"checkboxes"|"none"}?) |
+ attribute form {"popup"|"buttons"|"checkboxes"|"none"|"array"}?) |
(attribute form {"essay"},
attribute width {text}?)
}