https://github.com/maths/moodle-qtype_stack/blob/dev/doc/en/Installation/API.md
I’ve been getting to grips with both PreText and docker myself. I’ve not had a chance to look at how webwork integrated with PreText in detail yet, but there is a very good prospect of us being able to support STACK question use through the API. I’ll need help in getting this working, especially since I haven’t looked at the “player” website which includes webwork. Would someone be able to give me any pointers for how this works please?"
Many thanks
Thanks Chris, David, Michael. Rob could confirm or correct me, but I think that David's Task 2 would need to be in effect first before PTX developers would invest time in Task 1. Or maybe not. In the past with MOM we essentially had Task 1 first. But that was in the old days, before the CLI, and when it was easier to have an experimental, partly functional feature.
Task 2 sounds like something where there should be collaboration between STACK developers and someone familiar with the PTX XML vocabulary. Just to understand the mapping from STACK source to PTX well.
An aside for Michael: WeBWorK/PG does have the ability to give custom responses to answers. I'm not sure if that's what you mean. But for example the WeBWorK sample chapter has an exercise asking for x^3*x^5, and if you enter x^15 there is special feedback for that. For each "flavor" of incorrect answer, you have to code the response you want (it's not AI). Is that the kind of thing you mean by personalized feedback? If so, send me an example exercise and I can show you how to code it. Or if not, please describe that more so I can confirm WeBWorK/PG can't already do this.
That last paragraph is not to be construed as sidestepping STACK integration with PTX, which would be great to have.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/af63ad90-c1fa-4d21-ae5d-4598e83cec80n%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxMy5iZWV6ZXI.1742525759%40pnsh.
(Copied from the PR)
I've been working on generating static representations for STACK questions. I've written a function as a starting point (to be extended with error handling, etc), and you can test it on the example STACK question by running the stack_to_pretext.py
script I added. (Note: The public STACK API server used in this example is a bit temperamental, so if you get an error the first time around, try again.)
I'm trying to figure out how to integrate this into the larger asset generation process. I assume this should happen akin to the webwork_to_xml
function which generates the webwork_representations.xml
with static and PG versions of the webwork questions. In the STACK case we'll only have the static version (at this point anyway), as for the dynamic version a STACK question XML file will simply be referenced in the HTML. I guess those STACK question XML files would then be assets, e.g. like image files referenced in the text.
The part I don't have a good understanding of is the work done by the XSL templates. For example, in webwork_to_xml
, we apply extract-pg.xsl
to the input XML and then pick out the server parameters from the resulting XML file (e.g. to get the API URL, which must originate from the publication PTX file), so that we can call the server to retrieve the questions and/or generate the static versions. Obviously, a lot more is going on in that XSL template, most of which isn't applicable to STACK, but I don't understand what I'd need to mirror from there and what to ignore.
Similarly, I don't really understand the work the XSL templates are doing when building a target, such as HTML or pdf. For STACK, all that'd need to happen is either take the static version from the representations file that we generated (e.g. PDF target), or simply insert a single div
referencing the STACK question XML file (HTML target), something like
<div class="container-fluid que stack" data-qfile="questions/integrate.xml">
from the example where I embedded an interactive STACK question into HTML generated by pretext, as well as including the javascript headers. (I'll work on improving the actual Javascript logic to make it behave more closely to how webwork questions behave.)
Some pointers how to proceed from here would be really helpful, especially around the XSL templating. (I can make some sense of the pretext
and pretext-cli
python code if I dig into it a bit, but high-level guidance would still be helpful.)
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/gkZ4sSj8nVk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/582fca98-4132-4143-8ac4-5c57379ba234n%40googlegroups.com.
We'll need to protect #stack from the #stack already used in side-by-sides.
This should look like how #webwork is structured.
2. Use pretext-html.xsl to turn that into the #div.stack you describe
below, and get a problem to render in HTML output. Presumably the PreTeXt
#stack will have some sort of attribute that has "integrate" or
"questions/integrate" or "questions/integrate.xml", however little an author can
get away with (we provide the rest).
3. Then some XSL to extract whatever is needed to get the server to produce a
static version. I'd use the MyOpenMath (MOM) code as an example, the WeBWorK
(WW) has a lot of extra stuff going on that ight get in your way. Python
applies this XSL, makes requests of the server, packages up static. I think I'd
rather do this as one-file-per-problem, like MOM, not one huge file like WW.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/gkZ4sSj8nVk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDA0OC5iZWV6ZXI.1751484497%40pnsh.
I see in the PR that this is problem 17332? Is their a server hosted version?
Would source here diverge over time?
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/gkZ4sSj8nVk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAzMi5iZWV6ZXI.1752460906%40pnsh.
Uncaught TypeError: can't access property "input", MathJax._ is undefined
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/gkZ4sSj8nVk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxOS5iZWV6ZXI.1752504087%40pnsh.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/CAHDrpCe4NCjb74UcTKK_eCF%2BHtULQC2JSwhaPyPUHrbRFqqD4w%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/CAHDrpCfmiXL3VnKoWuOGsPSyhCVcYz_roRi0A2Q3T9E0YqqJfw%40mail.gmail.com.
* Is there a single canonical world-wide source-of-truth server? (This how we
use Runestone.) I think you would have sent me there if there were.
* If not, are there disparate versions in production use at different locations?
* Do the problem collections differ across server installations?
* Do problems have unique world-wide stable identifiers (17332,
"01_integration_with_feedback")?
* As an instructor can I author a STACK question, put it onto my server, and it
never leaves my institution?
* Maybe the Docker container for use generating static versions answers a lot
of these questions (and maybe you already told me that).
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/CAO-sG%2B2Dz9Uyrpf%3DZ%2BVmLFHpK8-3pZPt4bk74hbF29WnvSVW%2Bw%40mail.gmail.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/CAHDrpCcn%2BYQWz09kYMWgczurWFHFduzi7%3DW4Coa0PES_qa%3D4JQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAzNC5iZWV6ZXI.1755310321%40pnsh.
--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/51e4c1f0-7c90-482b-a655-c565bfe7e3e8n%40googlegroups.com.
Dueling MathJax.
Static: the #fillin created for an answer blank needs to be an empty element.
Invalid XML as it is now.
Figure out why we have to ask for a new question, and do not get an initial
version with the loaded page.
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/gkZ4sSj8nVk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAyNy5iZWV6ZXI.1755627004%40pnsh.
Some PreTeXt warnings about coincidental elements (#input for one) went away
when I added a namespace. The PreTeXt schema should get more attention than it
does, but I think we'll be able to separate a STACK schema from the PreTeXt one
via namespaces.
Georg provided two Javascript files, and I don't really have the skills to know
everything they are doing. But they interact with MathJax. For example,
"stackapicalls.js" has a line that looks like:
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
Not sure if this is re-purposed JS, or one-off JS for PreTeXt support. In any
event, maybe this is v2 syntax not supported by v3, or it is assuming a
different configuration, or I don't know what. We have an extensive
configuration - for example we output HTML where all the math/LaTeX is already
marked with spans and divs (since we know it comes only from #m, #me, #md,...)
and then we tell MJ that it does not have to parse the page any more than
looking for these spans and divs. When you show a preview of a student's input
for an answer, maybe you are inside an iframe doing mathJax rendering
on-the-fly? I'd guess that where maybe we need to coordinate?
YAML? That's new (or another thing I've forgotten about). Having questions as
XML is a huge plus. A text version gives us little room to maneuver. I already
have to fight the slow creep of JSON! In any event, it is easy to "see" that
the current version has a #question element (say) and know what sort of XML it
is. This is the sort of visibility we lose with plain text. The whole point of
choosing XML is in part so we don't have to parse LaTeX (yet anothr markup
language).
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/gkZ4sSj8nVk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAwMS5iZWV6ZXI.1755880387%40pnsh.
I have tidied up the publisher variable for the server. Within the XSL you
should now find the (global) variable $stack-server is available and is set
for the sample article.
--
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/gkZ4sSj8nVk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxNy5iZWV6ZXI.1755904445%40pnsh.