WeBWorK answers

2,325 views
Skip to first unread message

Alex Jordan

unread,
Sep 4, 2016, 1:24:38 AM9/4/16
to MathBook XML Support
For background, a non-WeBWorK exercise can have a statement,
hint, answer, solution, and I think it is clear what is the purpose of
each.

Currently, a WeBWorK exercise has a "webwork", and then that can
have statement, hint, solution. "hint" and "solution" have special roles
in WeBWorK, but "answer" does not. A single "answer" doesn't even
make sense when you consider a WeBWorK problem with several
answer blanks. Each blank has an answer, not the problem as a
whole.

And to complicate matters, if the problem was written outside of MBX,
then it might have more than one hint and more than one solution, with
statements interspersed.

All of this so far is handled fairly well by WeBWorK in MBX, but I would
like to consider doing something for "answer". Because what if you want
a book with some or all exercises in WeBWorK, and you want some
short answers in an appendix as is tradition? Exercises that are actually
used in online homework probably use randomization. But there is still
the one version of the exercise that is in the printed book and appears
live in the ebook, and its answer can be given without calling on anything
algorithmic in WeBWorK.

To make my questions more concrete, consider:
<exercise>
 
<webwork>
    ....
   
<statement>
       
<p><m>\int_0^x t\,dt=</m> <var name="$answera"/></p>
       <p><m>\int_0^x t^2\,dt=</m> <var name="$answerb"/></p>
   
</statement>
 
</webwork>
</exercise>

A "hint" would give a hint and a "solution" would give a full walkthrough solution.
Keeping in mind that (as far as I can tell) an "answer" here is pretty much only
going to be for the purposes of an answer list in the back of the book,
  1. should there be just one "answer" that maybe uses a comma, or two answers?
    Two may feel more natural when there are two answer blanks, but only using
    one would mean less modification to the XSL for answer lists, and also
    relieve an author of any burden to get the number of blanks to match the
    number of "answer"s.
  2. should "answer(s)" be peers of "statement"? (I would say yes, but just being
    thorough with questioning.)
  3. what should actually be the content of "answer"? Focusing on the first part
    of the exercise, I could see either of:
    • <m>\frac{1}{2}x^2</m>
      which is a nice looking typeset piece of math, and could be mixed with
      regular text
    • 1/2 x<circumflex />2
      which would output in monospace font as "1/2 x^2", literally a string
      you could feed to WeBWorK to get the answer right.

    I kind of like the second option, but then answers in the back of the book will
    look like this a lot of the time: "(0,inf)", "sqrt(1+x^2)", etc. Not pretty typeset.
    And if anyone is using the book and choosing not to use WeBWorK, that
    might be really undesirable.

  4. thoughts on "answer" having both an "input" (1/2 x<circumflex />2) and an "output"
    (<m>\frac{1}{2}x^2</m>) children? Different situations/different processing flags
    could use one or the other.

Rob Beezer

unread,
Sep 4, 2016, 3:14:09 PM9/4/16
to mathbook-x...@googlegroups.com
Comments, mostly opinion.


1. I would not overly-structure such an "answer." In other words, I'd not try
to match answers to sub-questions, and leave it more free-form for authors to
organize as they wish.

2. Code for how answers move to the appendix needs serious work. I'd rather
not bolt something on now, to just have to redo it later. That won't stop
designing the markup, though, and perhaps presenting them adjacent as knowls for
the time being.

3. WW problems are obviously tied to WW in many ways. But for "simple"
questions (with no, or little, pg-code setup) it would be nice to be able
convert them to other systems (is that a pipe dream?). So I'm not wild about
the utility of answers in WW syntax, nor the complexity of handling "different
situations/different processing flags." I think students figure out syntax
pretty quickly, so after a while it might have even less benefit. An author
could provide both styles early on, if they wished.

4. No end of trouble avoiding confusion in the code with hint, solution, etc.
Be sure to "protect" the WW ones from the others.


Now derailing the thread slightly. Move this to a new thread if you wish. When
we started the WW work I imagined the HTML versions to function much like "Show
Me Another" - a reader could get many different versions. I realize that may
diminish the value of the problems to those who only allow limited number of
tries for graded versions. But if I have a killer reduced row-echelon form
problem, why write several more? Let the randomization features make new ones.

Is this (optionally) technically possible? Am I missing/forgetting something
philosophical?

Rob
> <p><m>\int_0^x t\,dt=</m><varname="$answera"/></p>
> | <p><m>\int_0^x t^2\,dt=</m><varname="$answerb"/></p>
> | </statement>
> </webwork>
> </exercise>
> |
>
> A "hint" would give a hint and a "solution" would give a full walkthrough solution.
> Keeping in mind that (as far as I can tell) an "answer" here is pretty much only
> going to be for the purposes of an answer list in the back of the book,
>
> 1. should there be just one "answer" that maybe uses a comma, or two answers?
> Two may feel more natural when there are two answer blanks, but only using
> one would mean less modification to the XSL for answer lists, and also
> relieve an author of any burden to get the number of blanks to match the
> number of "answer"s.
> 2. should "answer(s)" be peers of "statement"? (I would say yes, but just being
> thorough with questioning.)
> 3. what should actually be the content of "answer"? Focusing on the first part
> of the exercise, I could see either of:
> * <m>\frac{1}{2}x^2</m>
> which is a nice looking typeset piece of math, and could be mixed with
> regular text
> * 1/2 x<circumflex />2
> which would output in monospace font as "1/2 x^2", literally a string
> you could feed to WeBWorK to get the answer right.
>
> I kind of like the second option, but then answers in the back of the book will
> look like this a lot of the time: "(0,inf)", "sqrt(1+x^2)", etc. Not pretty
> typeset.
> And if anyone is using the book and choosing /not/ to use WeBWorK, that
> might be really undesirable.
>
> 4. thoughts on "answer" having both an "input" (1/2 x<circumflex />2) and an
> "output"
> (<m>\frac{1}{2}x^2</m>) children? Different situations/different processing
> flags
> could use one or the other.
>
> --
> You received this message because you are subscribed to the Google Groups
> "MathBook XML Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to mathbook-xml-sup...@googlegroups.com
> <mailto:mathbook-xml-sup...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Alex Jordan

unread,
Sep 4, 2016, 5:22:41 PM9/4/16
to MathBook XML Support, bee...@ups.edu

1.  I would not overly-structure such an "answer."  In other words, I'd not try
to match answers to sub-questions, and leave it more free-form for authors to
organize as they wish.

So just one "answer"? That would be my preference.

3.  WW problems are obviously tied to WW in many ways.  But for "simple"
questions (with no, or little, pg-code setup) it would be nice to be able
convert them to other systems (is that a pipe dream?).  

It depends how simple the answer is. Even with no PG/perl specifics, sometimes
the answer to even a static question is going to be something where the author cannot
avoid a language-specific way to write it. If Duane's project develops a high-level syntax,
then OK.
 
I think students figure out syntax
pretty quickly, so after a while it might have even less benefit.  

You and I deal with different levels of student :) And I'm typically on a shorter 10-week reset cycle.
 

Now derailing the thread slightly.  Move this to a new thread if you wish.  When
we started the WW work I imagined the HTML versions to function much like "Show
Me Another" - a reader could get many different versions.  I realize that may
diminish the value of the problems to those who only allow limited number of
tries for graded versions.  But if I have a killer reduced row-echelon form
problem, why write several more?  Let the randomization features make new ones.

A few ways to accomplish this. I think it should be something that can be turned on or off though.
I'm not sure who should be in charge of that. The author? An instructor using a local clone of the
book? Whoever manages the anonymous course on the server?

Literally using "Show Me Another" means something needs to be set in the anonymous course, and
at this stage may also require something more from Mike or Geoff. I'd need to see what the
status of the anonymous interface is now in 2.12.

There is another older way to enable re-randomization of a problem where you put some lines
of code into the .pg problem itself. Does the XSL allow us to insert such things only when
making html, and not when making archival pg?

In HTML, sure it is an efficient use of "space" to build in re-randomization. But for print, what if you
want several different versions of the same problem and don't want to copy/paste 100 lines of webwork
code over and over? I've had the idea for a while to reuse a "webwork" based on its xml:id, using a
new seed. Something like `<webwork reuse="some-other-webwork-xml:id" seed="2" />. Off the top
of your head does that seem technically possible?

Alex Jordan

unread,
Sep 17, 2016, 12:11:07 PM9/17/16
to MathBook XML Support, bee...@ups.edu
OK, with a few weeks more to think about this, I think there's (almost) nothing to do.
Rob likes the "answer"s being nicely typeset math as opposed to WeBWorK input syntax.
In that case, the "var"s from the statement that are the answer blanks (as indicated by a
"form" or "width" attribute) already can be extracted for answers, as long as the "setup"
section has these "var"s with "static" versions defined.

So things to do are:
  • check that there is a warning message for when you use an answer blank but haven't
    declared a static version.
  • appropriately modify the answer-list maker so that it probes webwork/statement//var[@form|@width]
    and includes the static versions in its list.

Does that all sound about right Rob?

Reply all
Reply to author
Forward
0 new messages