Import and export of <sage/> content for simple assigning and collection of student work

36 views
Skip to first unread message

Steven Clontz

unread,
Aug 26, 2026, 10:29:46 PMAug 26
to PreTeXt development
Colleague asked what's the best way to get students writing computationally-cheap Sagemath code in a Jupyter-like setting, but without having to install anything. I think this is a pretty simple use-case for vanilla PreTeXt HTML output and <sage> cells: there's something very nice about just clicking and link and doing the work, without having to spin up a Jupyter server somewhere.

But currently, while an instructor can author a PreTeXt document with whatever template they desire, there's no way for students to edit these code cells, export their work, and submit it to the instructor.

It was easy enough to prototype this: https://github.com/PreTeXtBook/pretext/pull/3183 But before I polish the PR, I wanted input from core contributors on any specifications they'd have for such a contribution.

Oscar Levin

unread,
Aug 26, 2026, 10:33:51 PMAug 26
to PreTeXt development
I've been daydreaming of a "print my work" or, now that you gave me the word, "export my work," button for non-sage pages.  Perhaps this would be worth carefully considering what a more robust and comprehensive solution.  Student does work on a PreTeXt page.  They are happy with it.  They click "Export work" and a file is generated for them to download that includes a representation of their work they can submit to their instructor in the LMS (or send by email).   

Steven Clontz

unread,
Aug 26, 2026, 10:41:40 PMAug 26
to PreTeXt development
Persisting this "work" to localStorage, or a hosted service like PreTeXt.Plus or Runestone (though obviously Runestone has its own concept of storing certain types of interactions), would also be lovely.

Though I'm not sure that task should block this first-pass concept for code cells; getting this into production would be informative on how the feature is used in practice.

Rob Beezer

unread,
Aug 27, 2026, 6:52:14 PMAug 27
to prete...@googlegroups.com
Dear Steven,

I have collected reading questions by email for classes of about 30 students.
There's a lot of friction there, passed from the student to the instructor. I
think folks want logins, accounts, gradebooks.

I assigned these sorts of Sage exercises for many years, to abstract algebra
classes with about 10 students.

Ooops, Tom's build of HTML AATA is missing the Sage exercises! So no link.

Anyway, five exercises, going from quick hitters ("computationally cheap"?) up
to rather elaborate, open-ended, explorations. I produced a Jupyter notebook
for each set with the questions and space to work, mostly just for their
convenience. They worked in CoCalc, and could always just open a fresh blank
notebook to work in. I was able to have them pay for accounts and I made a
"course". (I know not every institution allows that.) They worked there, and
grading and a return of comments went very well. (And this was four or five
years ago.) One note - for more involved exercises, I would suggest they
experiment in one notebook, then carefully copy their final solution, *in the
right order*, into what they submitted.

I didn't install anything - all in a student's browser. There was some time
spent in setup, but I think that paid for itself over the course of weekly
assignments.

My first thought is thinking about this is that students may want to add a new
cell near an existing one. Then maybe they want to delete one. I fear it would
not be long before you implemented a notebook server in all but name. Recall
that Brad never wanted to create an LMS for Runestone. Yes, myabe the original
request is for something dead simple, but I can guarantee folks will want more
and more over time.

The intent of PreTeXt is to help authors write open source materials.
Textbooks, of course, but more as well. Supporting publishing (self-, or
commercial) is unavoidable, as we have discovered. Student work and course
materials have never been our focus. We do think we are helping students, but
indirectly through quality, free, textbooks.

That all said, the work-in-progress at #3183 works great.

I wonder if this would be a better fit for Runestone, where a lot of necessary
infrastructure resides. Or maybe there could be an allied, but separate,
project for courses that want to collect student work, such as worksheets and
collections of Sage cells. Just like our collaboration with Runestone, we could
tailor HTML output for this purpose, and/or provide associated info like we do
in the Runestone manifest. Not sure if this would be a fit for PreTeXt Plus -
it feels a bit different.

Not trying to be negative, but rather pragmatic. There is a lot going on
already inside a PreTeXt HTML page, and I feel like we are pushing our limits.
So this just feels out-of-scope for PreTeXt proper.

Rob
> --
> 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 <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> da5d7ba0-4adb-4d3d-bce6-d38890e96928n%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-dev/da5d7ba0-4adb-4d3d-bce6-
> d38890e96928n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Oscar Levin

unread,
Aug 27, 2026, 10:16:36 PMAug 27
to PreTeXt development
>  The intent of PreTeXt is to help authors write open source materials.
>  Textbooks, of course, but more as well. Supporting publishing (self-, or
>  commercial) is unavoidable, as we have discovered. Student work and course
materials have never been our focus. We do think we are helping students, but
>  indirectly through quality, free, textbooks.
(emphasis mine, of course).

I think we (the PreTeXt community) need to get some clarity on this.  While I can't argue that course materials were the original intent of PreTeXt, and I know the first principle of PreTeXt says it is a markup language that captures the structure of textbooks and research articles (neither of which are course materials), I want to argue that failing to adapt to this new demand would be a big mistake.

First, even if the only goal was to provide a markup language for open source textbooks, it would be very strategic to make PreTeXT the tool of choice for course materials.  That's where the vast majority of open source textbooks start.  The overwhelmingly vast majority of OERs are not textbooks, but are exactly course materials that are shared openly.  Course materials are the gateway to textbooks, and PreTeXt has an opportunity to provide an easy path from one to the other.

Second, one of the main selling points of OER is that materials can be adapted and contributed back to.  I'm currently teaching out of Active Calculus, and because I know PreTeXt, I find it easy to take the source of the activities in the book to create my own custom note packets (course materials) for my students.  This makes the Active Calculus book even more valuable to me as an instructor.  (Relatedly, the worry that the source of DMOI would no longer be in LaTeX that would make taking bits for teaching easy for faculty, almost stopped me from switching to PreTeXt in the first place).  My point is that making PreTeXt an obvious choice for instructors instead of LaTeX makes the open source textbooks written in PreTeXt better and more useful.

Third, if there is any hope of getting people to write research articles in PreTeXt, they need to learn how to use it to see how great it really is.  What motivation do they have to do that?  For a research article, I don't think any!  But if they try PreTeXt because it is the easiest way to ensure their course materials are accessible, their fingers will learning <m> instead of $, and they will get super frustrated when they have to type up their research in LaTeX, and will convince their collaborators to make the switch.

Finally,  on a personal note, I have spent hundreds of hours (all very enjoyable hours; easily the best part of my professional life) to make PreTeXt more appealing to instructors, largely guided by the three parts of my argument above.  Some of that work has made it easier and better for authors of textbooks, but the vast majority has been focused on course materials.  I don't have much interest in continuing this work if it is only going to support a relative handful of textbook authors (although I'm sure we need another 20 or so linear algebra textbooks).

Oh, I should have started, not to hijak this thread, but....

:)

Steven Clontz

unread,
Aug 28, 2026, 1:05:53 PMAug 28
to PreTeXt development
Colleague told me they decided that teaching students to create actual code notebooks is a design goal, so there's no one waiting on the specific request that inspired the prototype.

I'm quite sympathic to avoiding scope creep. I would like to be in a conversation on what the scope should be.

Rob Beezer

unread,
Aug 28, 2026, 10:24:47 PMAug 28
to prete...@googlegroups.com
Handouts were initiated at a workshop in Austin in 2018. I never did a real
good job with them, since there is always so much to be done. So I am grateful
that Oscar has taken the lead into whipping them into shape, and more generally
championing instructional materials.

I agree that having bite-sized projects for starters is a great way to introduce
faculty to PreTeXt.

But I was trying to draw a line at *collecting* student work. And my point was
that this could start innocently (as in Steven's PR), but snowball to a place
I've never wanted to go.

I hope that is clearer than my first attempt.

Rob

On 8/27/26 19:16, Oscar Levin wrote:
> > The intent of PreTeXt is to help authors write open source materials.
> >  Textbooks, of course, *but more as well*. Supporting publishing (self-, or
> >  commercial) is unavoidable, as we have discovered. *Student work and course*
> > *materials have never been our focus.* We do think we are helping students, but
> pretext/ <https://github.com/PreTeXtBook/pretext/>
> > pull/3183 But before I polish the PR, I wanted input from core
> contributors on
> > any specifications they'd have for such a contribution.
> >
> > --
> > 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 <mailto:pretext-
> > dev+uns...@googlegroups.com>.
> > To view this discussion visit https://groups.google.com/d/msgid/pretext-
> dev/ <https://groups.google.com/d/msgid/pretext-dev/>
> > da5d7ba0-4adb-4d3d-bce6-d38890e96928n%40googlegroups.com
> <http://40googlegroups.com> <https://
> > groups.google.com/d/msgid/pretext-dev/da5d7ba0-4adb-4d3d-bce6- <http://
> groups.google.com/d/msgid/pretext-dev/da5d7ba0-4adb-4d3d-bce6->
> > d38890e96928n%40googlegroups.com?utm_medium=email&utm_source=footer
> <http://40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> 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 <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> dev/8b9e4680-23df-4602-bb45-602ee54657b5n%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-dev/8b9e4680-23df-4602-
> bb45-602ee54657b5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages