klausur.report: Generate individual reports on multipe choice test results

View source: R/klausur.report.R

klausur.reportR Documentation

Generate individual reports on multipe choice test results

Description

klausur.report takes (at least) an object of class klausuR (or klausuR.mult) and a matriculation number to generate personal test results in LaTeX and/or PDF format.

Usage

klausur.report(
  klsr,
  matn,
  save = FALSE,
  pdf = FALSE,
  path = NULL,
  file.name = "matn",
  hist = list(points = FALSE, marks = FALSE),
  hist.merge = list(),
  hist.points = "hist_points.pdf",
  hist.marks = "hist_marks.pdf",
  descr = list(title = NULL, name = NULL, date = NULL),
  marks.info = list(points = FALSE, percent = FALSE),
  lang = "en",
  alt.candy = TRUE,
  anon.glob.file = "anon.tex",
  decreasing = TRUE,
  sort.by = "Points",
  NRET.legend = FALSE,
  table.size = "auto",
  merge = FALSE,
  quiet = FALSE,
  fancyhdr = TRUE
)

Arguments

klsr

An object of class klausuR or klausuR.mult. To create reports from more than one object with the same configuration, you can also give them in one list here, which will cause the function to call itself recursively.

matn

Matriculation number, "all" (produces individuall documents for all subjects), "anon" (produces anonymous feedback) or "glob" (produces a global results document).

save

Logical: If TRUE, files are saved to disk (scheme: "path/matn.tex").

pdf

Logical: If TRUE, LaTeX reports will be converted to PDF automatically, using texi2dvi. If save is FALSE, a temporary directory is used, that is only the PDF files will be saved.

path

Path for save and hist files.

file.name

File name scheme for the reports, either "matn" (matriculation number) or "name" (name and firstname).

hist

A list with the logical elements points and marks: If TRUE, the reports will include histograms of the distribution of points and/or marks. The needed PDF files will be created by plot and saved as well. (see path, hist.points and hist.marks).

hist.merge

If you need/want to combine results from several klausuR class objects for the histograms, provide them all in a list here.

hist.points

File name for the histogram of points.

hist.marks

File name for the histogram of marks.

descr

Details on the test: List with the elements title (title of the test), name (your name) and date.

marks.info

A list with the logical elements points and percent: If TRUE, the reports will include a table showing how marks were assigned to points achieved and/or percent solved, respectively.

lang

Set to "de" for reports in German, English is the default.

alt.candy

If TRUE, a comma will be inserted for items with multiple alternatives ("235" becomes "2, 3, 5" in the printout)

anon.glob.file

If matn="anon" or matn="glob", you can specify a filename for this particular report.

decreasing

Logical, whether sorting of output should be done increasing or decreasing (only relevant for matn="anon" or matn="glob").

sort.by

Character string naming a variable to sort the results by. Defaults to "Marks" (only relevant for matn="anon" or matn="glob").

NRET.legend

Logical, If ET/NRET data is reported, you can demand a legend in the table caption by setting this to true.

table.size

Character string to shrink the tables, must be one of "auto", "normalsize", "small", "footnotesize", "scriptsize" or "tiny". The default table.size="auto" tries to decide between "normalsize" and "footnotesize" to avoid pages with only one or two rows. If that fails, try to manually set the size.

merge

Logical, if TRUE no individual PDFs will be saved, but one large file with all reports. Uses the "pdfpages" package, and only useful if pdf=TRUE as well.

quiet

Logical, if TRUE no feedback messages on the current status are given.

fancyhdr

Logical, if TRUE additional information is printed in the header and footer of the LaTeX/PDF files.

Details

The report contains, next to the individual results, a table with all given and correct answers (using xtable), as well as nice histograms showing the distribution of the test results (points and/or marks are supportet). If the matriculation numer is set to "all", reports for all subjects are produced. Setting it to "anon" will get you a printable version of the anonymized results.

By default output is sent to standard out. To save them to disk in LaTeX format a "save" parameter is provided. Alternatively, the reports can be converted to PDF format as well. klausur.report is calling texi2dvi from the tools package for that.

If the object is of class klausuR.mult, only the global results for tests with several test forms are evaluated. In case you'd rather like reports on each test form, call klausur.report with the single slots from that object accordingly.

Value

One or several LaTeX and/or PDF documents. If defined two histograms will be plotted.

Author(s)

m.eik michalke meik.michalke@uni-duesseldorf.de

See Also

klausur, xtable, texi2dvi

Examples

data(antworten)

# vector with correct answers:
richtig <- c(Item01=3, Item02=2, Item03=2, Item04=2, Item05=4,
 Item06=3, Item07=4, Item08=1, Item09=2, Item10=2, Item11=4,
 Item12=4, Item13=2, Item14=3, Item15=2, Item16=3, Item17=4,
 Item18=4, Item19=3, Item20=5, Item21=3, Item22=3, Item23=1,
 Item24=3, Item25=1, Item26=3, Item27=5, Item28=3, Item29=4,
 Item30=4, Item31=13, Item32=234)

# vector with assignement of marks:
notenschluessel <- c()
# scheme of assignments: marks[points_from:to] <- mark
notenschluessel[0:12]  <- 5.0
notenschluessel[13:15] <- 4.0
notenschluessel[16:18] <- 3.7
notenschluessel[19:20] <- 3.3
notenschluessel[21]    <- 3.0
notenschluessel[22]    <- 2.7
notenschluessel[23]    <- 2.3
notenschluessel[24]    <- 2.0
notenschluessel[25:26] <- 1.7
notenschluessel[27:29] <- 1.3
notenschluessel[30:32] <- 1.0

data.obj <- klausur.data(answ=antworten, corr=richtig, marks=notenschluessel)
klsr.obj <- klausur(data.obj)

## Not run: 
klausur.report(klsr=klsr.obj, matn="all", descr=list(title="Klausur Tatort",
  name="Dr. T. Aeter", date="24.09.2010"))

## End(Not run)

klausuR documentation built on April 5, 2022, 1:15 a.m.