I attempted using the Set Class to no success. I believe that is because the Set Class is using real numbers and not variables? Is there a way to use the Set Class, or something similar, with letters, not just real numbers?
Below is the code I currently have that works with strings, but I would like to make it so that the student is required to enter the curly brackets. Any advice?
Thanks,
*Brittni
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl",
"PGcourse.pl",
"contextString.pl"
);
###########################
# Setup
Context("String");
Context()->operators->redefine(',', using=>','); # allow lists of strings
Context()->strings->add(
"a" => {caseSensitive=>1}, "b" => {caseSensitive=>1},
"c" => {caseSensitive=>1}, "d" => {caseSensitive=>1},
"e" => {caseSensitive=>1}, "f" => {caseSensitive=>1},
"g" => {caseSensitive=>1}, "h" => {caseSensitive=>1},
);
###########################
# Main text
BEGIN_PGML
Given the sets
[`U=\{a,b,c,d,e,f,g,h\}`]
[`A= \{a, d, g, h\}`]
[`B=\{b,g,h\}`]
[`C=\{b,c,d,f\}`]
compute the following set operations.
a. [`A\cap B=\{`] [____________]{"g,h"} [`\}`]
b. [`B\cap C=\{`] [____________]{"b"} [`\}`]
END_PGML