Best practice for books using modified WeBWorK OPL problems

14 views
Skip to first unread message

Sean Fitzpatrick

unread,
Mar 10, 2023, 7:57:49 PM3/10/23
to PreTeXt support
On a different thread, Alex is trying to help with some problems in Active Calc that use a type of randomization that works in an assignment, but not when those problems are used individually.

My first thought was, well, just edit those problems!

Then I realized why this is not good: if you have problems that live in the local/ folder of the WeBWorK course you use to build your book, it is no longer possible for someone else to build your book using their own WeBWorK server.

This becomes a potential problem for me: I've been working on adding WeBWorK problems to a book. (I used to assign these on WeBWorK, but I decided it would be nice to fold them into the book.) Probably 80-90% of these problems are not PTX-compatible.
(This might drop to 30-40% in the next version of WeBWorK, once there's support for answer arrays.)

Most of these are older problems written in PG. I've rewritten them all in PGML, and made some other changes to make the static output look better in PreTeXt, along with changing answer arrays to answer blanks. (I understand that this is a temporary workaround since a fix is already in place in the development branch of WeBWorK, but my students are comfortable with the matrix syntax used by WeBWorK.)

The new versions live in a local folder on my WeBWorK server.

That means that my book is now dependent on having access to that folder.

Since some of my changes are made to support PreTeXt, they are unlikely to be accepted into the OPL.

Should I include a folder of PG files in the assets folder for my book?
Or try to write these problems directly into my ptx source?

Either way, these are based on other people's problems. Everything is available under an open license, but I'm not sure how to best acknowledge copyright when using them.

Alex Jordan

unread,
Mar 10, 2023, 8:34:31 PM3/10/23
to pretext...@googlegroups.com
Not directly answering you, but I think within a year PTX will be able to use the standalone PG renderer. You'll use that to build representations locally, and then have it running on your web server to support the embedded exercises.

At that point there is no host course with folders. Having PG files in an assets folder will make sense.

About copyright on opl problems. My opinion is if you recoded them into pgml it is a significant rebuild. And these are mostly math exercises, the statement of which is public domain. So unless there is especially clever setup code or noteworthy creativity in the question statement, I'd say if you recoded to pgml, it's yours now. You could use your judgment of course. And I'm not a lawyer, so all that above is only my opinion.

--
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/bea4573c-9045-4c27-a441-be12362d5a6fn%40googlegroups.com.

Sean Fitzpatrick

unread,
Mar 10, 2023, 8:45:32 PM3/10/23
to pretext...@googlegroups.com
Most of the exercises are fairly routine, but it takes effort to come up with good problems, so I think even if recognition isn't legally required, morally one should at least recognize the original authors, perhaps in the acknowledgements.
(This seems better than putting the acknowledgement in the source code where nobody will see it.)

I think updating the question to use PGML is worth sending back to the OPL, except that changes to get rid of things like answer blanks that look ugly in static are not.

Now that I have the hang of PGML conversion it is pretty straightforward, and it probably wouldn't take too much more effort to translate things directly into ptx source.

Alex Jordan

unread,
Mar 11, 2023, 1:20:48 AM3/11/23
to pretext...@googlegroups.com
> answer blanks that look ugly in static

Can you give some examples? I may have advice to offer. Or even
changes to make to PG to make the PTX look better.


On Fri, Mar 10, 2023 at 5:45 PM Sean Fitzpatrick
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPaSA4y4tfygr58NJDt9We06DUOkRsJxsV%3DV4du4vkWtRA%40mail.gmail.com.

Sean Fitzpatrick

unread,
Mar 11, 2023, 10:45:22 AM3/11/23
to pretext...@googlegroups.com
Most of the time these were questions that were structured (after conversion to PGML) along the lines of:

A vector in the kernel of [`A`] is given by

[`X=`] [___________]

I rewrote these to do something like:

Find a vector in the kernel of [`A`].

[__________]

This is based on my understanding that a paragraph containing only an answer blank is ignored by PreTeXt, and for print/static, I think the latter wording is more natural.

The ones I was not sure about were things like this:

A basis for the subspace [`U`] is given by:

[`\left\{\right.`] [_________], [_________], [__________] [`\left.\right\}`]

I can change the text to "Find a basis for the subspace" but I'm not sure about the answer blanks.

If I put three consecutive answer blanks in a <p>, I think they all get ignored? But if I separate them by commas, then they show up?

What I did was to use three answer blanks, which is maybe not ideal once the problem is activated, but also add an instruction line (ignored by PreTeXt in static) saying something like, "enter one vector in each answer blank below".

Probably it would be better to reprogram the question to use a single answer blank that expects a comma separated list, to avoid giving away the dimension in advance.

Alex Jordan

unread,
Mar 11, 2023, 11:57:49 AM3/11/23
to pretext...@googlegroups.com
> Find a vector in the kernel of [`A`].
> [__________]

That seems like good for OPL too. Are you using ANS() though I might
do this like:

Find a vector in the kernel of [`A`].
[_]{$X}{20}

where $X is the answer checker and 20 is the width of the answer
blank. If say $B had been one example of a basis vector, then you
could do
$X = $B->cmp(checker=>{...});
(Won't work with array answer blank as you know, but will for 2.18.)

> A basis for the subspace [`U`] is given by:
> Probably it would be better to reprogram the question to use a single answer blank that expects a comma separated list, to avoid giving away the dimension in advance.

That is what I was thinking, except then you would really have to give
up on array answer input. The linear algebra problems I wrote once
upon a time work this way. Are you counting any valid basis as
correct? OR just one that comes from some standard approach?

On Sat, Mar 11, 2023 at 7:45 AM Sean Fitzpatrick
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPZkb7ZHjZvcYMv-PkdTR3z2kVeNig0wzcz9BgQJsECwOg%40mail.gmail.com.

Sean Fitzpatrick

unread,
Mar 11, 2023, 12:30:43 PM3/11/23
to pretext...@googlegroups.com
I would want any valid basis to work, although I am generally defaulting to how the problem was programmed originally, to avoid significant work on the pg code.

In some cases I was lazy, and since there was already an ANS field at the bottom, I just used it.

In many other cases, problems were programmed using multi answer or custom checkers where I wasn't sure how to rewrite things.

Reply all
Reply to author
Forward
0 new messages