Exercise Student File Uploads?

16 views
Skip to first unread message

Alex Hagopian

unread,
Aug 25, 2025, 12:09:39 PM (11 days ago) Aug 25
to PreTeXt support
Hi there!

I'm trying to add an input field to an exercise that allows students to upload their work as a PDF. I've been referencing this section of the documentation: https://pretextbook.org/doc/guide/html/topic-interactive-exercises.html#short-answer-exercises

I've had no success so far adding the @attachment attribute. 

Could anyone share the correct syntax for this, or provide a link to a working example? 

Thank you for your help!
Alex


Andrew Scholer

unread,
Aug 25, 2025, 12:16:19 PM (11 days ago) Aug 25
to PreTeXt support

Alex Hagopian

unread,
Aug 25, 2025, 1:36:50 PM (11 days ago) Aug 25
to PreTeXt support
Is there any way to locally render the file input button or is this only possible with Runestone hosting? 
I'm only able to view a text area. 

Screenshot 2025-08-25 at 1.35.28 PM.png

<exercise label="test-question" attachment="yes">
<statement>
<p>
Testing file upload.
</p>
</statement>
<response />
</exercise>

Andrew Scholer

unread,
Aug 25, 2025, 1:50:42 PM (11 days ago) Aug 25
to PreTeXt support
The button is not rendered in a non-Runestone HTML build because the option makes no sense if there is no server infrastructure to handle the upload.

Unfortunately, yes, that means there is no way to preview the page outside of setting up a Runestone server to build it on.

Alex Hagopian

unread,
Aug 25, 2025, 1:53:20 PM (11 days ago) Aug 25
to PreTeXt support
Ah, I see. 
Thanks for your help!

Reply all
Reply to author
Forward
0 new messages