WeBWorK MultiAnswers?

12 views
Skip to first unread message

Oscar Levin

unread,
Aug 6, 2024, 9:14:48 PM8/6/24
to PreTeXt support
I'm trying to add a webwork problem (authored in PreTeXt) that would use the MultiAnswers framework.  The idea is that students can enter the number of vertices, edges, and faces for any planar graph they draw, and we can check easily if this is correct using Euler's Formula.

What I've tried so far suggests that this isn't possible, but before I give up, should I expect such a question to work in PreTeXt?

Alex Jordan

unread,
Aug 6, 2024, 9:30:02 PM8/6/24
to pretext...@googlegroups.com
That should work. I use many multianswer exercises in ORCCA. What does your source for the entire "webwork" look like?

On Tue, Aug 6, 2024 at 2:14 PM Oscar Levin <oscar...@gmail.com> wrote:
I'm trying to add a webwork problem (authored in PreTeXt) that would use the MultiAnswers framework.  The idea is that students can enter the number of vertices, edges, and faces for any planar graph they draw, and we can check easily if this is correct using Euler's Formula.

What I've tried so far suggests that this isn't possible, but before I give up, should I expect such a question to work in PreTeXt?

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/67428d6f-4e98-4232-b5ec-1b5b8e0bb86en%40googlegroups.com.

Oscar Levin

unread,
Aug 6, 2024, 9:43:00 PM8/6/24
to PreTeXt support
That's exciting to hear.  This is the test example I was working on:

<webwork>
<pg-code>
$a = 1;
$b = 1;
$multians = MultiAnswer($a, $b)->with(
singleResult => 0,
checker => sub {
my ($correct, $student, $self) = @_;
my ($astu, $bstu) = @{student};
my ($acor, $bcor) = @{correct};
if ($astu == $bstu) {
return [1,1];
} else {
return [0,0];
}
}
);
</pg-code>
<statement>
<p>
Enter two numbers that are equal: <var name="$multians" width="5"/> <m> = </m> <var name="$multians" width="5"/>
</p>
</statement>
</webwork>

It renders like I would expect, but counts everything as correct.

Alex Jordan

unread,
Aug 6, 2024, 10:13:53 PM8/6/24
to pretext...@googlegroups.com

Oscar Levin

unread,
Aug 6, 2024, 10:48:08 PM8/6/24
to PreTeXt support
Oh wow, yeah, I see that now.  <face-palm/>  

Thank you so much!  Your simplification is great as well.

One strange thing with the singleResult set to true, in the pretext display, it will only mark the first box as "correct" or not, without providing feedback on the other boxes.  And revealing the solution shows the pair of answers in place of the first box.  Not a big deal at all, but thought I'd mention it.

Alex Jordan

unread,
Aug 6, 2024, 11:01:12 PM8/6/24
to pretext...@googlegroups.com
The AIM server is still running 2.17. With 2.19 coming out today (but announcement postponed until the release notes are finished), the AIM server will be upgraded this month to 2.19. And in 2.19, Glenn has done some excellent work for things like this. So whereas currently, PTX-WW javascript is responsible for the feedback thingies that are adjacent to answer blanks, now in 2.19 that is done at the source, with PG. And it is done well, not hacked together on the surface at the end of the rendering.

So I think you'll be happier with that after the upgrade. With two answer blanks and singleResult true, there will be only one feedback button. By default, placed by the last (or is it first?) answer blank. But there is a way for you to control it yourself if it works better somewhere else.


Reply all
Reply to author
Forward
0 new messages