Forums
Search results: 133
{{Historical|Foo [[test]] foo.}}
Which produces a banner about this being a historical document. The second part of the entry gives a link to follow for a more up-to-date information and some explanation.
The only reason this hasn't been done is lack of person-hours. Your help would be very useful.
There are also compoundProblems2.pl, etc as well as sequentialProblems.pl. The development of the right mechanism took many iterations of development over about 10 years.
The current version is quite powerful and could use a full length blog post about how to use it creatively. (That could be placed on the wiki or sometimes it gets more publicity if it's contributed to the blog aggregator reached by the "blogs" link in the left margin of the wiki. ) It's most lack of time that keeps documentation from being higher priority. :-)
Glad this is now working well for you and I look forward to the problems you produce while experimenting with it. I think scaffolded.pl problems have a lot of potential that is only beginning to be investigated. Thanks for letting us know how things turned out.
compundProblem.pl
macros are very old and no longer supported, and the scaffold.pl
macros are much better and easier to use. In particular, you don't have to keep track to the number of problems, as you did with compoundProblem.pl
.
You don't give enough of your problem code to really check what you are doing, but compoundProblem
isn't designed to do what you are trying to do (you can't have the same answer rules show up in more than one part, as you appear to be doing, or they will count as answers in both parts, and I'm not sure that will be graded correctly even if you do.
Fortunately, the scaffold
macros are set up to provide more flexibility, and you can
have previous parts open when later parts are being displayed.
Here is an example of what I think you are after:
loadMacros( "scaffold.pl", "parserPopUp.pl", "parserMultiAnswer.pl", ); Context("Numeric"); Context->strings->are(yes=>{}, no=>{}); Scaffold::Begin(is_open => 'correct_or_first_incorrect'); $a = random(2,5,1); $b = random(3,7,1); $x = random(1,5,1); $y = random(2,6,1); $c = $a * $x + $b * $y; $p = PopUp(["?","yes","no"],"yes"); $ma = MultiAnswer($x,$y)->with( checker => sub { my ($C, $S) = @_; my ($x, $y) = @$S; return $a * $x + $b * $y == $c && $x == int($x) && $y == int($y); } ); Section::Begin("Part 1: The Equation"); BEGIN_TEXT Does the following Diophantine equation have integer solutions? $PAR \[ $a x + $b y = $c \] \{ $p->menu \} END_TEXT ANS($p->cmp); Section::End(); Section::Begin("Part 2: The Solution"); BEGIN_TEXT Good! What is one possible solution? $PAR \(x\equiv\) \{ $ma->ans_rule(5) \} and \(y\equiv\) \{ $ma->ans_rule(5) \} END_TEXT ANS($ma->cmp); Section::End(); Scaffold::End();
You should be able to start with this and modify it to your needs. See the scaffold.pl
documentation for details.
\[ $a x + $b y = c \]
\{ $has_solution->menu() \} # $has_solution is a PopUp
END_TEXT Context->normalStrings;
ANS( $has_solution->cmp() );
if ( $part >= 2 ) {
Context->texStrings;
BEGIN_TEXT
Good! What is one possible solution?
$PAR
\(x\equiv\) \{ ans_rule(5) \}
END_TEXT
Context->normalStrings;
# and so forth
- I have no guard to print the introduction and its answer field for the first part; i.e., no if ($part == 1), and
- I have if ($part >= 2) rather than the documentation’s if ($part == 2) because there’s a third part, too, and I wanted the text in part 2 to stick around there, as well.
I want to make sure this is the desired behavior. It took me a couple of hours to figure out what was going on, so I’d be happy to add a note to the Wiki for the other rare birds like myself who try to do something like this. If this is not the desired behavior, but rather a bug, then of course I’d much prefer to change the problems now so that I do not have to worry about surprises in the future.
Cl^{-}
, Na^{+}
, instead of Cl^{-1}
, Na^{+1}
. Yes, I wondered about that. Doing that may be difficult to accomplish, as the MathObjects parser expects an operator to have at least one operand (and plus and minus need to be operators in order to handle negative numbers and adding two compounds). It might be possible to subclass something to override that, but I haven't looked into that.
There is also some variation as to the ordering of charge information...Pb^{+2} or Pb^{2+}, Cl^{1-}
That might be able to be handled as well, but I will have to look into it further.