CRAN Package Check Results for Package RndTexExams

Last updated on 2019-12-10 18:51:44 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.5 2.70 38.55 41.25 ERROR
r-devel-linux-x86_64-debian-gcc 1.5 2.34 30.08 32.42 NOTE
r-devel-linux-x86_64-fedora-clang 1.5 50.57 NOTE
r-devel-linux-x86_64-fedora-gcc 1.5 49.84 NOTE
r-devel-windows-ix86+x86_64 1.5 6.00 110.00 116.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.5 7.00 83.00 90.00 OK
r-patched-linux-x86_64 1.5 1.85 36.45 38.30 OK
r-patched-solaris-x86 1.5 66.20 OK
r-release-linux-x86_64 1.5 2.35 36.63 38.98 OK
r-release-windows-ix86+x86_64 1.5 5.00 81.00 86.00 OK
r-release-osx-x86_64 1.5 OK
r-oldrel-windows-ix86+x86_64 1.5 3.00 76.00 79.00 OK
r-oldrel-osx-x86_64 1.5 OK

Check Details

Version: 1.5
Check: examples
Result: ERROR
    Running examples in 'RndTexExams-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: rte.grade.exams
    > ### Title: Grade exams built using rte.grade.exams
    > ### Aliases: rte.grade.exams
    >
    > ### ** Examples
    >
    > # define some options
    > latex.dir.out = 'latexOut' # Name of folder where latex files are going (will create if not exists)
    > pdf.dir.out = 'PdfOut' # Name of folder where resulting pdf files are going
    > f.out <- 'MyRandomTest_' # Name of pdfs (MyRandomTest_1.pdf, MyRandomTest_2.pdf, ... )
    > n.test <- 1 # Number of tests to build
    > n.question <- 2 # Number of questions in each test
    >
    > # Get latex example from package
    > f.in <- system.file("extdata", "MyRandomTest_examdesign.tex", package = "RndTexExams")
    >
    > # Break latex file into a R list
    > list.out <- rte.analyze.tex.file(f.in,
    + latex.dir.out = latex.dir.out,
    + pdf.dir.out = pdf.dir.out)
    
    rte: Changing LaTeX file into dataframe... Done>
    > # Build pdfs
    > list.build.rdn.exam <- rte.build.rdn.test(list.in = list.out,
    + f.out = f.out,
    + n.test = n.test,
    + n.question = n.question,
    + latex.dir.out = latex.dir.out,
    + pdf.dir.out = pdf.dir.out,
    + do.randomize.questions=TRUE,
    + do.randomize.answers=TRUE,
    + do.clean.up = TRUE)
    
    rte: Checking for error in inputs... Done
    rte: pdflatex flavor: texlive
    rte: Type of OS: Linux
    rte: Latex compile function: custom
    rte: Type of exam template: examdesign
    rte: Number of mchoice questions: 4
    rte: Building Test #1...This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    Done
    rte: FINISHED - Check folder PdfOut for pdf files>
    > # Grade it!
    > #' # create some (almost) random names
    > my.names <- c('John', 'Max','Marcelo')
    >
    > # version of the test for each student
    > ver.test <- sample(seq(n.test),size = length(my.names),replace=TRUE)
    >
    > # Get the correct answer sheet from previous code
    > correct.answer.sheet <- list.build.rdn.exam$answer.matrix
    >
    > # create simulated answers from students (cheat a little bit!)
    > q.to.cheat <- 1 # get at least 1 question right!
    > my.answers <- cbind(correct.answer.sheet[ver.test,1:q.to.cheat],
    + matrix(sample(letters[1:5],
    + replace = TRUE,
    + size = length(my.names)*(n.question-q.to.cheat)),
    + ncol = n.question-q.to.cheat ))
    >
    > # grade exams with rte.grade.exams
    > list.grade <- rte.grade.exams(exam.names = my.names,
    + exam.version = ver.test,
    + exam.answer.matrix = my.answers,
    + list.build.rdn.exam = list.build.rdn.exam)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    RndTexExams
     --- call from context ---
    rte.grade.exams(exam.names = my.names, exam.version = ver.test,
     exam.answer.matrix = my.answers, list.build.rdn.exam = list.build.rdn.exam)
     --- call from argument ---
    if (class(exam.answer.matrix) != "matrix") {
     stop("Input exam.answer.matrix should be a matrix")
    }
     --- R stacktrace ---
    where 1: rte.grade.exams(exam.names = my.names, exam.version = ver.test,
     exam.answer.matrix = my.answers, list.build.rdn.exam = list.build.rdn.exam)
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (exam.names, exam.version, exam.answer.matrix, list.build.rdn.exam,
     question.points = NULL)
    {
     if (length(exam.version) != length(exam.names)) {
     stop("Length of inputs exam.version DO NOT match with the length of exam.names")
     }
     if (nrow(exam.answer.matrix) != length(exam.names)) {
     stop("The number of rows in exam.answer.matrix DO NOT match with the length of exam.names")
     }
     correct.answer.sheet <- list.build.rdn.exam$answer.matrix
     rnd.idx.questions <- list.build.rdn.exam$df.answer.long$rnd.idx.questions
     idx.questions <- list.build.rdn.exam$df.answer.long$n.test
     if (class(exam.names) != "character") {
     stop("Input exam.names should be a character class")
     }
     if (!any(class(exam.version) != c("numeric", "integer"))) {
     stop("Input exam.version should be a numeric class")
     }
     if (class(exam.answer.matrix) != "matrix") {
     stop("Input exam.answer.matrix should be a matrix")
     }
     if (class(correct.answer.sheet) != "matrix") {
     stop("Input correct.answer.sheet should be a matrix")
     }
     n.question <- ncol(correct.answer.sheet)
     if (is.null(question.points)) {
     question.points <- rep(1/n.question, n.question)
     }
     if (length(question.points) != n.question) {
     stop("Input question.points should have number of elements equal to the number of questions in exam.answer.matrix")
     }
     size.names <- length(exam.names)
     size.version <- length(exam.version)
     if (size.names != size.version) {
     stop("The number of elements in input exam.names does not match the number of elements in exam.version")
     }
     if (size.names != nrow(exam.answer.matrix)) {
     stop("The number of rows in exam.answer.matrix should match the number of elements in size.names")
     }
     df.grade <- data.frame()
     for (i.std in seq(1, size.names)) {
     name.now <- exam.names[i.std]
     ver.now <- exam.version[i.std]
     answers.now <- exam.answer.matrix[i.std, ]
     correct.answer.now <- correct.answer.sheet[ver.now, ]
     logical.correct <- (answers.now == correct.answer.now)
     names(logical.correct) <- paste0("Q.", seq(1:length(logical.correct)))
     names(logical.correct) <- NULL
     temp.df <- data.frame(exam.names = name.now, exam.ver = ver.now,
     n.question = seq(1:n.question), rnd.idx.questions = rnd.idx.questions[idx.questions ==
     ver.now], question.score = question.points, grade.logical = logical.correct)
     df.grade <- rbind(df.grade, temp.df)
     }
     df.final.score <- with(df.grade, aggregate(question.score *
     grade.logical, by = list(exam.names), FUN = sum))
     colnames(df.final.score) <- c("exam.names", "final.score")
     df.correction.wide <- data.table::dcast(data = data.table::data.table(df.grade),
     formula = exam.names ~ rnd.idx.questions, fun.aggregate = function(x) return(x),
     value.var = "grade.logical", fill = NA)
     grade.l.out <- list(df.grade = df.grade, df.final.score = df.final.score,
     df.correction.wide = df.correction.wide)
     return(grade.l.out)
    }
    <bytecode: 0x2944330>
    <environment: namespace:RndTexExams>
     --- function search by body ---
    Function rte.grade.exams in namespace RndTexExams has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(exam.answer.matrix) != "matrix") { :
     the condition has length > 1
    Calls: rte.grade.exams
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.5
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building 'rte-vignette_creating_exams.Rmd' using rmarkdown
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    RndTexExams
     --- call from context ---
    rte.grade.exams(exam.names = my.names, exam.version = ver.test,
     exam.answer.matrix = my.answers, list.build.rdn.exam = list.build.rdn.exam)
     --- call from argument ---
    if (class(exam.answer.matrix) != "matrix") {
     stop("Input exam.answer.matrix should be a matrix")
    }
     --- R stacktrace ---
    where 1: rte.grade.exams(exam.names = my.names, exam.version = ver.test,
     exam.answer.matrix = my.answers, list.build.rdn.exam = list.build.rdn.exam)
    where 2: eval(expr, envir, enclos)
    where 3: eval(expr, envir, enclos)
    where 4: withVisible(eval(expr, envir, enclos))
    where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 8: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 9: evaluate::evaluate(...)
    where 10: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 11: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 12: block_exec(params)
    where 13: call_block(x)
    where 14: process_group.block(group)
    where 15: process_group(group)
    where 16: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 17: process_file(text, output)
    where 18: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet,
     encoding = encoding)
    where 19: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(),
     ...)
    where 20: vweave_rmarkdown(...)
    where 21: engine$weave(file, quiet = quiet, encoding = enc)
    where 22: doTryCatch(return(expr), name, parentenv, handler)
    where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 24: tryCatchList(expr, classes, parentenv, handlers)
    where 25: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 26: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/RndTexExams.Rcheck/vign_test/RndTexExams",
     ser_elibs = "/tmp/Rtmp4Ku1Xk/file288624c44895.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (exam.names, exam.version, exam.answer.matrix, list.build.rdn.exam,
     question.points = NULL)
    {
     if (length(exam.version) != length(exam.names)) {
     stop("Length of inputs exam.version DO NOT match with the length of exam.names")
     }
     if (nrow(exam.answer.matrix) != length(exam.names)) {
     stop("The number of rows in exam.answer.matrix DO NOT match with the length of exam.names")
     }
     correct.answer.sheet <- list.build.rdn.exam$answer.matrix
     rnd.idx.questions <- list.build.rdn.exam$df.answer.long$rnd.idx.questions
     idx.questions <- list.build.rdn.exam$df.answer.long$n.test
     if (class(exam.names) != "character") {
     stop("Input exam.names should be a character class")
     }
     if (!any(class(exam.version) != c("numeric", "integer"))) {
     stop("Input exam.version should be a numeric class")
     }
     if (class(exam.answer.matrix) != "matrix") {
     stop("Input exam.answer.matrix should be a matrix")
     }
     if (class(correct.answer.sheet) != "matrix") {
     stop("Input correct.answer.sheet should be a matrix")
     }
     n.question <- ncol(correct.answer.sheet)
     if (is.null(question.points)) {
     question.points <- rep(1/n.question, n.question)
     }
     if (length(question.points) != n.question) {
     stop("Input question.points should have number of elements equal to the number of questions in exam.answer.matrix")
     }
     size.names <- length(exam.names)
     size.version <- length(exam.version)
     if (size.names != size.version) {
     stop("The number of elements in input exam.names does not match the number of elements in exam.version")
     }
     if (size.names != nrow(exam.answer.matrix)) {
     stop("The number of rows in exam.answer.matrix should match the number of elements in size.names")
     }
     df.grade <- data.frame()
     for (i.std in seq(1, size.names)) {
     name.now <- exam.names[i.std]
     ver.now <- exam.version[i.std]
     answers.now <- exam.answer.matrix[i.std, ]
     correct.answer.now <- correct.answer.sheet[ver.now, ]
     logical.correct <- (answers.now == correct.answer.now)
     names(logical.correct) <- paste0("Q.", seq(1:length(logical.correct)))
     names(logical.correct) <- NULL
     temp.df <- data.frame(exam.names = name.now, exam.ver = ver.now,
     n.question = seq(1:n.question), rnd.idx.questions = rnd.idx.questions[idx.questions ==
     ver.now], question.score = question.points, grade.logical = logical.correct)
     df.grade <- rbind(df.grade, temp.df)
     }
     df.final.score <- with(df.grade, aggregate(question.score *
     grade.logical, by = list(exam.names), FUN = sum))
     colnames(df.final.score) <- c("exam.names", "final.score")
     df.correction.wide <- data.table::dcast(data = data.table::data.table(df.grade),
     formula = exam.names ~ rnd.idx.questions, fun.aggregate = function(x) return(x),
     value.var = "grade.logical", fill = NA)
     grade.l.out <- list(df.grade = df.grade, df.final.score = df.final.score,
     df.correction.wide = df.correction.wide)
     return(grade.l.out)
    }
    <bytecode: 0x4b00d48>
    <environment: namespace:RndTexExams>
     --- function search by body ---
    Function rte.grade.exams in namespace RndTexExams has this body.
     ----------- END OF FAILURE REPORT --------------
    Quitting from lines 176-203 (rte-vignette_creating_exams.Rmd)
    Error: processing vignette 'rte-vignette_creating_exams.Rmd' failed with diagnostics:
    the condition has length > 1
    --- failed re-building 'rte-vignette_creating_exams.Rmd'
    
    SUMMARY: processing the following file failed:
     'rte-vignette_creating_exams.Rmd'
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.5
Check: for non-standard things in the check directory
Result: NOTE
    Found the following files/directories:
     'PdfOut' 'latexOut'
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc