Search code examples
rr-exams

Is possible to use the solution template in exams2nops?


When I try to generate the exams' solution with the exams2nops(...template="solution"...) I get the following error message:

Error in exams2pdf(file, n = n, nsamp = nsamp, dir = dir, name = name,  : 
  formal argument "template" matched by multiple actual arguments

How can I produce an exams' solution with the exams2nops?


Solution

  • You cannot do that in one go, you need two runs after setting the same seed, e.g.,

    set.seed(1)
    exams2nops(my_exam)
    set.seed(1)
    exams2pdf(my_exam, template = "my_solution.tex")      
    

    You can use the solution.tex provided within the package as a starting point for my_solution.tex. But you may want to translate it to your natural language, use the name of your university, possibly insert a logo, add your actual exam name, possibly some into text etc. In exams2pdf() you need to add these things in the template LaTeX file directly.