Printable worksheet theme

37 views
Skip to first unread message

Jane Courtney

unread,
Oct 5, 2023, 9:24:12 AM10/5/23
to Numbas Users
Hi

I am a big fan of the printable worksheet theme as I use it for generating unique problems for labs. However, in the latest updates, the printing stage is not working as hoped.

It includes the scrollbar on the right in the page and the alignments are all off.

Also, I would like to remove the question number from the top of the sheet. I managed this before by editing the theme, but embarrassingly, cannot remember how I did it!

Any help much appreciated.

Jane.

PS I've attached a sample of what I managed before. This is what I would like to achieve again.

1.pdf

Christian Lawson-Perfect

unread,
Oct 5, 2023, 10:08:54 AM10/5/23
to numbas...@googlegroups.com
Hi Jane,
Can you give me a link to an exam that shows these problems? And can you tell me which browser you're using?

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/93d3f5b7-d7d4-4e79-912f-30234d7048e1n%40googlegroups.com.

Jane Courtney

unread,
Oct 6, 2023, 5:54:37 AM10/6/23
to numbas...@googlegroups.com
Hi

Thanks for getting back to me so quickly. This is the exam:

and I'm using Chrome.

Thanks again.

Jane.

You received this message because you are subscribed to a topic in the Google Groups "Numbas Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/numbas-users/feJbXLWWRcQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/CAEMHSOj4DPqxqLJ6s2Sz%3DHnz25_jeYV905drzvMnQMfQE1GGtw%40mail.gmail.com.

Christian Lawson-Perfect

unread,
Oct 18, 2023, 8:09:35 AM10/18/23
to numbas...@googlegroups.com
This took quite a while to resolve!
I think there are a couple of bugs in Chrome that affected this, or at least differences compared to Firefox, where I do most testing. I've managed to work around those and get the print output looking the same in Chrome and Firefox, with no scrollbars and the correct font size.

The question number/name is displayed in the file `templates/question.xslt` - see https://github.com/numbas/Numbas/blob/2197c43289aa6c8cacb55c5129b750f935159303/themes/worksheet/templates/question.xslt#L21.
You could use a custom theme to remove that, but your question then has what looks like a header directly underneath it in the statement. You could remove the header text from the statement, and change the question's name in the exam so that it's displayed instead of "Question 1".

Jane Courtney

unread,
Oct 19, 2023, 10:07:49 AM10/19/23
to numbas...@googlegroups.com
Hi

Thank you so much for this.

It looks a bit better alright but now I have a new problem. I can't edit the theme in either browser (I tried Firefox also). I get this screen:
image.png

I tried downloading the theme (in order to edit offline) and re-uploading it without changing anything. I get this:
image.png

Any help appreciated.

Jane.

Jane Courtney

unread,
Oct 19, 2023, 10:15:07 AM10/19/23
to numbas...@googlegroups.com
Btw, just tested with the "Worksheet" theme from Numbas Master and get the same error re templates and files.

However, I am now trying "Scratchy the from Scratch Theme!" and so far so good!

Jane Courtney

unread,
Oct 19, 2023, 10:36:46 AM10/19/23
to numbas...@googlegroups.com
Qapla'!!

Scratchy worked! Attached here if anyone wants to do the same.

Btw, one teeny tiny thing left... At the very top-left, there is the tail end of a comment bracket that shows up on the page. Any way of getting rid of it?
See below:
image.png

Thanks!

Jane.

scratchy-the-from-scratch-theme.zip

Christian Lawson-Perfect

unread,
Oct 20, 2023, 10:31:00 AM10/20/23
to numbas...@googlegroups.com
That's there because you opened an HTML comment before the <head> tag, which then includes the template "head.html", where there's another comment. Effectively, all of the content of head.html until the end of that comment is interpreted as being inside your comment.
The closing tag for your comment then doesn't match, so is rendered as plain text.
I think you'll just have to delete the <head> lines, instead of commenting them out.

I also get that error when trying to edit a theme - I think it'll be easy to fix.


Christian Lawson-Perfect

unread,
Oct 20, 2023, 10:50:30 AM10/20/23
to numbas...@googlegroups.com
It was indeed easy to fix!

Jane Courtney

unread,
Oct 24, 2023, 11:42:39 AM10/24/23
to numbas...@googlegroups.com
Hi

So it was all going so well and now there's even more information at the top of the exam.

Where would I find the code to generate the exam name (which now shows) and the number of questions? I want to remove those:
image.png

Otherwise, Scratchy is nearly done!

Thanks for all your help

Jane.



Christian Lawson-Perfect

unread,
Oct 25, 2023, 6:22:42 AM10/25/23
to numbas...@googlegroups.com
That's in templates/frontpage.html

Jane Courtney

unread,
Nov 21, 2023, 6:59:31 AM11/21/23
to numbas...@googlegroups.com
Hi Christian

Thanks again for all your help and apologies for the slow reply. Scratchy now does most of what I want (see readme attached). So a couple of tiny questions:

1. Is it possible to edit the defaults for the generator ("show Sheet id", etc)? Also the "standalone" warning?
2. Although the result is lovely, it doesn't show up on the screen, only when I click "Print these sheets". Any way of fixing that?
3. This one is embarrassing... how do I change Scratchy's name from Scratchy the From-Scratch Theme?? Hahaha.

image.png

Thanks again.

Jane.

README.md

Christian Lawson-Perfect

unread,
Dec 1, 2023, 10:37:42 AM12/1/23
to numbas...@googlegroups.com
I think the "standalone" box is there because you've copied frontpage.html from the default theme, not the worksheet theme. I think the editor only offers to copy files from the default theme. The corresponding files for the worksheet theme are on GitHub at https://github.com/numbas/Numbas/tree/master/themes/worksheet/templates.

You should be able to change the theme's name by clicking on the "Options" link, and filling in the form there.

Jane Courtney

unread,
1:44 PM (10 hours ago) 1:44 PM
to numbas...@googlegroups.com
Hi

Sorry for the slowest conversation ever, but back to this and my theme broke again. 

Is there any way to create a blank worksheet theme without breaking it? I just want to remove the exam name and question number to create a blank canvas. This has been an amazing application of Numbas (creating individualised assignments for labs and case studies) that not many are doing, but before I show it off to others, I want to be sure it will work.

The latest problem I'm having also happens with the default worksheet theme - I can't get rid of the sheet id.

Any help is much appreciated.

Jane.

 


Reply all
Reply to author
Forward
0 new messages