Automatic label/xml:id creation for exercises?

29 views
Skip to first unread message

Sean Fitzpatrick

unread,
May 30, 2023, 5:26:58 PM5/30/23
to PreTeXt support
I'm wondering if anyone is aware of a method for semi-automatically creating xml:ids (or more to the point, Runestone labels) for components that are currently missing them.

During the APEX conversion process, none of the exercises ever got an xml:id.

That hasn't been a problem, except now there's a copy of APEX on Runestone Academy, and none of the exercises have labels, which, it turns out, means they don't work on Runestone.

APEX has 2982 exercises, and just over half of those are coded for webwork. I would like to avoid manually writing 1500 labels if I can.

Rob Beezer

unread,
May 31, 2023, 11:39:29 AM5/31/23
to pretext...@googlegroups.com
Presently, the @label on an exercise is used to create an identifier in
Runestone's "assignment builder" area. This is the only clue an instructor has
about which exercise is which. Eventually, more helpful info from PreTeXt
source ("title") will migrate through the database to this are.

I expect any automatic @label will be next-to-useless for instructors.

PS: @label is not just a Runestone thing. It will slowly gain more prominence
in PreTeXt, in a backward-compatible way. But for Runestone exercises, there is
no backwards-compatibility to preserve, so you need to author them now as part
of moving onto Runestone Academy.
> --
> 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
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/d53306fc-058c-45dd-96c2-1a250009c651n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/d53306fc-058c-45dd-96c2-1a250009c651n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Chrissy Safranski

unread,
May 31, 2023, 12:06:46 PM5/31/23
to PreTeXt support
Alex did it automatically for AC with a script for all the WeBWorK problems that had a source address, which was almost all of them.  He did it so that the label is more or less the same as the address, except replacing problematic characters with non-problematic characters.

I thought the idea was to have the label be more about the problem content and that this was a stopgap measure, but having the label be the source was actually really helpful to me as an instructor because when a student reported a problem or issue with a problem in Runestone, I can see the label on the Runestone Instructor assignment tab and know what the source is.  Then I can open it up on my WeBWorK server to take a peek, or report an issue here (like with the weird randomization effect in a few problems) or to WeBWorK if there's actually a bug.

But I was also in the perhaps unusual situation that I knew ahead of time that I wanted to assign all the WeBWorK problems that existed in the sections, so I didn't care about the label telling me about the content.  

Although, when I was creating Runestone assignments I had to click on and preview each and every problem anyway, in order to confirm how many answer blanks there were to make the problems worth that many points, because Runestone didn't handle fractional points in the way I expected it to (it would round to the nearest whole number, so that a student who got 1 out of 2 answer blanks correct would get full credit for the problem if the problem was worth 1 point). I didn't experiment to see if that changed when the grading table changed to better handle WeBWorK problems, or if that's still the case.  

Matt created the labels non-automatically for the few problems that were written into the PreTeXt source.  So if APEX's problems are more of that kind, I have no ideas for you.

Chrissy

Sean Fitzpatrick

unread,
May 31, 2023, 12:32:58 PM5/31/23
to pretext...@googlegroups.com
Yeah, all of our exercises are written in source, so there's no ID or name to leverage.

To Rob: I'm not sure how descriptive the labels can be in APEX, since it's a more traditional book where you're going to find 20 exercises of the same type in an exercise group and several such groups in each section.

So I don't know if I'd do much better than chain_rule_deriv01, chain_rule_deriv02, ... , chain_rule_deriv82

You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/a4sQi8Z70yU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/85eba8cc-30bc-42b7-a17c-6ca99424c190n%40googlegroups.com.

Sean Fitzpatrick

unread,
May 31, 2023, 12:45:42 PM5/31/23
to pretext...@googlegroups.com
I guess I assumed that most instructors would approach things like I do, even if this is a holdover from physical books:

1. Go to the section from which you're assigning homework

2. Make a note of which questions you want to assign

3. Build assignment

The only difference is that step 3 now takes place in Runestone instead of a document editor.

I'll add this to the pile of things that should get done, but won't, because I'm one person with too many things that need to be done over the summer.

APEX either needs more volunteers, or money to hire minions.

Rob Beezer

unread,
May 31, 2023, 12:46:14 PM5/31/23
to pretext...@googlegroups.com
Understood.

Info from PreTeXt source flows through a "manifest" that the XSL creates. Most
of this (all of this?) goes in the Runestone database. For you, the number
might be the best/easiest thing for an instructor to use to match up the two
places an exercise shows up.

Question for Brad: suppose an author and instructor are identifying an exercise
simply by its number: say, 5.2.17. Then the author adds an early exercise in
the Exercises 5.2 division. The former Exercise 17 has the same @label, but now
is Exercise 5.2.18. The manifest will reflect this. Is that change going to
migrate to the database?

I ask, because it seems like the "shelf" only migrates to the database once.
How much of an author's changes to PreTeXt source get reflected in the Runestone
database, from build to build? Maybe that is just a rhetorical question...

Rob
> https://groups.google.com/d/msgid/pretext-support/d53306fc-058c-45dd-96c2-1a250009c651n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/d53306fc-058c-45dd-96c2-1a250009c651n%40googlegroups.com> <https://groups.google.com/d/msgid/pretext-support/d53306fc-058c-45dd-96c2-1a250009c651n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/pretext-support/d53306fc-058c-45dd-96c2-1a250009c651n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "PreTeXt support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/pretext-support/a4sQi8Z70yU/unsubscribe
> <https://groups.google.com/d/topic/pretext-support/a4sQi8Z70yU/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/85eba8cc-30bc-42b7-a17c-6ca99424c190n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/85eba8cc-30bc-42b7-a17c-6ca99424c190n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPbP%3DNVXCDStxsJP-KdBoSHPOL6c3VodtLZAsKVXfEKhqA%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPbP%3DNVXCDStxsJP-KdBoSHPOL6c3VodtLZAsKVXfEKhqA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Sean Fitzpatrick

unread,
May 31, 2023, 12:58:33 PM5/31/23
to pretext...@googlegroups.com
My plan for now, if I find time to do it, will be to add xml ids to all of the exercise groups (these should have been given ids before, probably...) and then create labels for the exercises using the exercise group id and number.

But I have higher priority items to tackle first.

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/MTAwMDAxOC5iZWV6ZXI.1685551571%40quikprotect.
Reply all
Reply to author
Forward
0 new messages