问题
When using the exams
package to produce PDF files for NOPS exams I want to edit the number of digits that are available to my students (reglength
). I am aware that the package only admits a minimum of 7 digits. However, our students only have 5 digits in their ID number. As so I would to know if it is possible to edit the template via PDF manipulation (I tried with the staplr::get_fields()
function, but it does not work) or any other way... I simply want to add 0
to the two first digits (i.e., 00xxxxx
).
回答1:
This is a good idea which I have implemented in exams 2.4-0 now (the current development version at the time of writing). If you specify a reglength < 7
now, it is still enforced to be 7 internally - and thus this length is necessary in the registration CSV file! But on the exam sheet the initial IDs are fixed to "0" and the corresponding boxes are ticked already.
For example, the following code will give you a warning but produce the output below:
exams2nops(..., reglength = 5)
## Warning message:
## In make_nops_page(n, nchoice = nchoice, reglength = reglength) :
## 'reglength = 5' too small, using 7 instead, but fixing initial IDs to 0
Notes:
- I haven't tested yet whether the scanning of these sheets actually works well enough because I'm in my home office for the foreseeable future without access to a suitable printer/scanner. I don't see sources for potential problems, though.
- I assumed that you referred to
exams2nops()
rather thanexams2pdf()
and hence have modified your question accordingly. Inexams2pdf()
you can need to provide your template anyway and can edit it in any way you like, adding the zeros where you need them.
回答2:
We added the XX manually to the exams2nops pdf generated file manually, and the scans did work fine. I see no reason why they should not work with your solution. Thanks for implementing it.
来源:https://stackoverflow.com/questions/65330228/fill-initial-student-ids-with-zeros-in-r-exams-exams2nops