SCM

Forum: support

Monitor Forum | Start New Thread Start New Thread
RE: exams2pdf: Points for each question is not visible [ Reply ]
By: Achim Zeileis on 2020-09-03 10:23
[forum:48101]
Andrea, thanks for sharing this, the question also came up before on SO: https://stackoverflow.com/questions/61210271/how-to-display-points-per-exercise-when-printing-to-pdf-via-exams2pdf

I don't want to add this functionality to examspdf directly because exams2pdf (unlike exams2nops) is intended to be a completely modular and flexible engine for generating PDF exams. Hence I want to keep modifications through convenience arguments at a minimum.

As an alternative my idea is to allow a general post-transform (or pre-write) function that modifies the exercises. I have a rough idea of how I want to do it but didn't get round to doing it yet. As usual, devil is in the detail :-)

RE: exams2pdf: Points for each question is not visible [ Reply ]
By: Andrea Tarelli on 2020-09-03 09:58
[forum:48100]

exams2pdf.R (8) downloads
Hi Achim,

If this can be useful, I have modified the exams2pdf() code to display the question points provided with the argument points. You will find the modified code attached.

The format used to display the points is provided to exams2pdf() through the new input variable showpoints (which is passed to the function make_exams_write_pdf()).
For example, I use
showpoints <- "\\textit{(%d points)}"
and this can be adapted to different languages.

If showpoints is NULL, the code behaves as previously.

As in other functions of the package, quite at the beginning of exams2pdf(), I have also included a chunk of code that replicates the variable points if its length is not equal to the number of exercises.

The final result should be exactly as in exams2nops().

Perhaps this idea can be helpful to further develop the code on your side.

Thanks,
Andrea

RE: exams2pdf: Points for each question is not visible [ Reply ]
By: Achim Zeileis on 2020-02-26 19:53
[forum:47429]
There is currently no built-in solution to automatically display the number of points in exams2pdf(). The points= argument only stores the number of points in the R object that exams2pdf() creates (as in other exams2xyz interfaces) but _not_ in the individual PDF files.

Thus, if you want the points to be displayed you need to do it in some way yourself. A simple solution would be to include it in the individual exercises already. The downside is that this does not react to the exams2pdf(..., points=...) argument.

A more elaborate solution would be to create a suitable \newcommand in the .tex template you use. If all exercises have the same number of points, this is not hard to do. But if all the different exercises could have different numbers of points, it would need to be more involved.

exams2pdf: Points for each question is not visible [ Reply ]
By: Rushad Faridi on 2020-02-26 19:23
[forum:47428]
Hello,
I can not have points printed for each of the questions in exam2pdf() function. For example, if I issue the following code:

exams2pdf(midterm, template="exam.tex", points=5)

it does not produce any point against the questions (in midterm vector) printed in the PDF. But If I use the exams2nops() function, I get the points assigned.

But I need the exams2pdf() function to show the points for questions.

Thanks to:
Vienna University of Economics and Business Powered By FusionForge