Search code examples
r-exams

Adding skipped/ungraded open-ended questions


Is there a way to include open-ended/free-form questions that are ungraded or skipped by r-exams?

Use case: we want to have an exam with mostly multiple choice questions using the package and its grading capability, but also have 5-10 open ended questions that are printed in the same exam. Ideally, r-exams would provide the grade for the first MCQ section, and we could manually add the grade of the open-ended questions.


Solution

  • I forked the package and made some small changes that allows one to control how many questions are printed on the first page and to remove the string-question pages.

    The new parameters are number_of_closed_questions and include_string_pages. It is far away from being ideal, but works for me.

    As an example let us have 6 mpc/single-choice questions and one essay question (essayreg):

    # install devtools if you do not have it!
    # install the fork
    devtools::install_github("johannes-titz/exams")
    
    library("exams")
    myexam <- list(
      "tstat2.Rnw",
      "ttest.Rnw",
      "relfreq.Rnw",
      "anova.Rnw",
      c("boxplots.Rnw", "scatterplot.Rnw"),
      "cholesky.Rnw",
      "essayreg.Rnw"
    )
    
    set.seed(403)
    ex1 <- exams2nops(myexam, n = 2,
      dir = "nops_pdf", name = "demo", date = "2015-07-29",
      number_of_closed_questions = 6, include_string_pages = FALSE)
    

    This will produce only 6 questions on the front page (instead of 7) and will also exclude the string-question pages.

    enter image description here

    If you want normal behavior, just exclude the new parameters. Obviously, one will have to set the number of closed questions manually, so one should be really careful.

    I guess one could automatically detect how many string questions are loaded and from this determine the number of open-ended/closed-ended questions, but I currently do not have the time to write this and the presented solution is usable for my case.

    I am not 100% sure that the scans will work this way, but I assume there should not be any bigger problems as I did not really change much. Maybe Achim Zeileis could comment on that? See my commit: https://github.com/johannes-titz/exams/commit/def044e7e171ea032df3553acec0ea0590ae7f5e