match_exams_call: Query Last xexams/exams2xyz Call

Description Usage Arguments Details Examples

Description

Query the last call made to xexams (typically through some exams2xyz interface).

Usage

1

Arguments

which

integer. Specifies the hierarchy level at which the exams2xyz call should be extracted.

deparse

logical. Should only the deparsed function name be computed (or the entire call)?

Details

The function match_exams_call is useful for determining within an exercise which exams2xyz interface is used in order to behave slightly differently, e.g., for PDF vs. HTML output.

This feature only works from R 3.2.0 onwards.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## call exams2nops
tdir <- tempdir()
exams2nops("tstat2.Rnw", dir = tdir)
match_exams_call()

## exams2nops called exams2pdf called xexams:
match_exams_call(which = NULL)

## get full exams2nops call
match_exams_call(deparse = FALSE)

## but note that convenience wrappers etc. are included
e2n <- function(...) exams2nops(...)
e2n("tstat2.Rnw", dir = tdir)
match_exams_call(which = NULL)

flaviobarros/exams documentation built on May 28, 2019, 8:39 p.m.