R/exams: A One-for-All Exams Generator
Written Exams, Online Tests, and Live Quizzes with R
R/exams: A One-for-All Exams Generator Written Exams, Online Tests, - - PowerPoint PPT Presentation
R/exams: A One-for-All Exams Generator Written Exams, Online Tests, and Live Quizzes with R Achim Zeileis http://www.R-exams.org/ R/exams: A One-for-All Exams Generator Written Exams, Online Tests, and Live Quizzes with R Achim Zeileis
Written Exams, Online Tests, and Live Quizzes with R
Written Exams, Online Tests, and Live Quizzes with R
Written Exams, Online Tests, and Live Quizzes with R
Written Exams, Online Tests, and Live Quizzes with R
1
2
2
2
3
4
Type Software Purpose Statistical computing ❘ Random data generation, computations Writing/reporting L
AT
EX, Markdown Text formatting, mathematical notation Reproducible research knitr, rmarkdown, Sweave Dynamically tie everything together Document conversion TtH/TtM, pandoc Conversion to HTML and beyond Image manipulation ImageMagick, magick, png Embedding graphics Web technologies base64enc, RCurl, ... Embedding supplementary files Learning management Moodle, OpenOLAT, ARSnova, ... E-learning infrastructure
5
1 Random data generation (optional). 2 Question. 3 Solution (optional). 4 Metainformation.
7
8
Question ======== Which of these institutions already hosted a useR! or eRum conference? Answerlist
* Agrocampus Ouest * Technische Universit¨ at Dortmund * Universit¨ at Wien * ETH Z¨ urich * Københavns Universitet
8
Solution ======== The list of useR!/DSC and eRum hosts can be found at <https://www.R-project.org/conferences.html> and <https://erum.io/>, respectively. Answerlist
* True. useR! 2009 was hosted at Agrocampus Ouest, Rennes. * True. useR! 2008 was hosted at TU Dortmund. * False. Universit¨ at Wien did not host an R conference yet (only TU Wien and WU Wien). * False. ETH Z¨ urich did not host an R conference yet. * False. Københavns Universitet hosted DSC but not useR! or eRum.
9
Solution ======== The list of useR!/DSC and eRum hosts can be found at <https://www.R-project.org/conferences.html> and <https://erum.io/>, respectively. Answerlist
* True. useR! 2009 was hosted at Agrocampus Ouest, Rennes. * True. useR! 2008 was hosted at TU Dortmund. * False. Universit¨ at Wien did not host an R conference yet (only TU Wien and WU Wien). * False. ETH Z¨ urich did not host an R conference yet. * False. Københavns Universitet hosted DSC but not useR! or eRum. Meta-information ================ exname: R conferences extype: mchoice exsolution: 111000 exshuffle: 5
9
10
<<echo=FALSE, results=hide>>= ## parameters a <- sample(2:9, 1) b <- sample(seq(2, 4, 0.1), 1) c <- sample(seq(0.5, 0.8, 0.01), 1) ## solution res <- exp(b * c) * (a * c^(a-1) + b * c^a) @
10
<<echo=FALSE, results=hide>>= ## parameters a <- sample(2:9, 1) b <- sample(seq(2, 4, 0.1), 1) c <- sample(seq(0.5, 0.8, 0.01), 1) ## solution res <- exp(b * c) * (a * c^(a-1) + b * c^a) @ \begin{question} What is the derivative of $f(x) = x^{\Sexpr{a}} e^{\Sexpr{b}x}$, evaluated at $x = \Sexpr{c}$? \end{question}
10
\begin{solution} Using the product rule for $f(x) = g(x) \cdot h(x)$, where $g(x) := x^{\Sexpr{a}}$ and $h(x) := e^{\Sexpr{b}x}$, we obtain \begin{eqnarray*} f✬(x) & = & [g(x) \cdot h(x)]✬ = g✬(x) \cdot h(x) + g(x) \cdot h✬(x) \\ & = & \Sexpr{a} x^{\Sexpr{a} - 1} \cdot e^{\Sexpr{b}x} + ... \end{eqnarray*} Evaluated at $x = \Sexpr{c}$, the answer is \[ e^{\Sexpr{b}\cdot \Sexpr{c}} \cdot \Sexpr{c}^\Sexpr{a-1} \cdot (\Sexpr{a} + \Sexpr{b}\cdot \Sexpr{c}) = \Sexpr{fmt(res, 6)}. \] Thus, rounded to two digits we have $f✬(\Sexpr{c}) = \Sexpr{fmt(res)}$. \end{solution}
11
\begin{solution} Using the product rule for $f(x) = g(x) \cdot h(x)$, where $g(x) := x^{\Sexpr{a}}$ and $h(x) := e^{\Sexpr{b}x}$, we obtain \begin{eqnarray*} f✬(x) & = & [g(x) \cdot h(x)]✬ = g✬(x) \cdot h(x) + g(x) \cdot h✬(x) \\ & = & \Sexpr{a} x^{\Sexpr{a} - 1} \cdot e^{\Sexpr{b}x} + ... \end{eqnarray*} Evaluated at $x = \Sexpr{c}$, the answer is \[ e^{\Sexpr{b}\cdot \Sexpr{c}} \cdot \Sexpr{c}^\Sexpr{a-1} \cdot (\Sexpr{a} + \Sexpr{b}\cdot \Sexpr{c}) = \Sexpr{fmt(res, 6)}. \] Thus, rounded to two digits we have $f✬(\Sexpr{c}) = \Sexpr{fmt(res)}$. \end{solution} \extype{num} \exsolution{\Sexpr{fmt(res)}} \exname{derivative exp} \extol{0.01}
11
12
Question What is the seat of the federal authorities in Switzerland (i.e., the de facto capi- tal)? (a) Bern (b) Lausanne (c) Zurich (d) St. Gallen (e) Basel
12
Question What is the derivative of f (x) = x3e3.3x, evaluated at x = 0.85? (a) 45.97 (b) 35.82 (c) 56.45 (d) 69.32 (e) 39.31
12
13
Question Which of these institutions already hosted a useR! or eRum conference? (a) Agrocampus Ouest (b) Universität Wien (c) ETH Zürich (d) Technische Universität Dortmund (e) Uniwersytet Ekonomiczny w Poznaniu
13
Question In the following figure the distributions of a variable given by two samples (A and B) are represented by parallel boxplots. Which of the following statements are correct? (Comment: The statements are either about correct or clearly wrong.)
A B −70 −65 −60 −55 −50 −45 −40 −35
(a) The location of both distributions is about the same. (b) Both distributions contain no outliers. (c) The spread in sample A is clearly bigger than in B.
13
14
Question Given the following information: + + = 585 + + = 144 + + = 177 Compute: + + = ?
14
15
Question What is the name of the R function for Poisson regression?
15
16
Question Using the data provided in regression.csv estimate a linear regression of y on x and answer the following questions. (a) x and y are not significantly correlated / y increases significantly with x / y decreases significantly with x (b) Estimated slope with respect to x:
16
18
R> myexam <- list( + "deriv2.Rnw", + "fruit2.Rnw", + c("ttest.Rnw", "boxplots.Rnw") + )
19
R> exams2nops(myexam, n = 3, dir = odir, + language = "hu", institution = "eRum 2018")
R> exams2moodle(myexam, n = 10, dir = odir)
R> exams2arsnova(myexam, n = 1, dir = odir)
20
22
Személyes adatok Vezetéknév: Keresztnév: Aláírás:
Ellen˝Regisztrációs szám 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9
eRum 2018
A vizsgalap szkennelése automatikusan történik, ezért kérjük, hogy ne hajtsa össze és a kitöltéshez használjon kék vagy fekete tollat. Kizárólag az egyértelm˝ uen és pontosan megjelölt válaszok kerülnek feldolgozásra! A válaszát jelölje egyértelm˝ u x-el: Jelöletlen cella: vagy
❅
❅
❅ Exam 2018-05-11 Válaszok 1 - 3 a b c d e a b c d e 1 2 3 Típus Dokumentum ID Ez a blokk adminisztrációs célokat szolgál, kérjük ide ne írjon, tartalmát ne módosítsa! Variáns
18051100001 005
Exam: 18051100001 1
(a) 49.35 (b) 87.17 (c) 71.00 (d) 72.46 (e) 55.20
+ + = 282 + + = 137 + + = 106 Compute: + + = ? (a) 106 (b) 313 (c) 161 (d) 232 (e) 454
systems is compared. The following statistical test was performed: Two Sample t-test data: Waiting by Supermarket t = -3.3, df = 90, p-value = 1 alternative hypothesis: true difference in means is greater than 0 95 percent confidence interval:
Inf sample estimates: mean in group Sparag mean in group Consumo 4.045 6.192 Which of the following statements are correct? (Significance level 5%) (a) The absolute value of the test statistic is larger than 1.96. (b) A one-sided alternative was tested. (c) The p value is larger than 0.05. (d) The test shows that the waiting time is longer at Sparag than at Consumo. (e) The test shows that the waiting time is shorter at Sparag than at Consumo.
23
24
24
25
26
26
27
29
30
30
31
32
33
35
9 This document is scanned automatically. Please keep clean and do please use a blue or black pen. Only clearly marked and positionally accurate crosses will be Please mark the boxes carefully: Not marked:
❅
❅
❅ Answers 1 - 15 a b c d e Answers 16 - 21 a b c d e 1 2 16 17 9 Cet examen sera corrigé par un système automatisé. Ne pas plier, bille bleu ou noir. Seul les marques lisibles et bien positionées seront evaluées! Merci de cocher soigneusement: Non coché:
❅
❅
❅ Réponses 1 - 15 a b c d e Réponses 16 - 21 a b c d e 1 2 16 17 9 A vizsgalap szkennelése automatikusan történik, ezért kérjük, hogy kék vagy fekete tollat. Kizárólag az egyértelm˝ uen és pontosan megjelölt válaszok kerülnek A válaszát jelölje egyértelm˝ u x-el: Jelöletlen cella: vagy
❅
❅
❅ Válaszok 1 - 15 a b c d e Válaszok 16 - 21 a b c d e 1 2 16 17
da Jensen, Messner More contributions de Zeileis welcome ... en Zeileis es Kogelnik fi Nordhausen fr Allignol gsw Stauffer hr Juraić hu Daróczi, Tóth it Zambella nl Smits pt Calvão, Dellinger, Petutschnig (pt-PT/pt-BR) ro Gatu sk Fabsic sr Kecojevic tr Er
36
R> s <- stresstest_exercise("deriv2.Rnw") R> plot(s)
Runtimes 0.026−0.034
Time Density 0.026 0.028 0.030 0.032 0.034 200 400 600 800
Histogram of numeric solutions
Solutions Density 50 100 150 0.000 0.010 0.020
37
R> s <- stresstest_exercise("deriv2.Rnw") R> plot(s)
1 2 3 4 5
Position of correct solution
Position n 5 10 15 20 25 1 2 3 4 5
Rank of correct solution
Rank n 5 10 15 20 25 30 35
38
39
40
R> library("psychotools") R> data("MathExam14W", package = "psychotools") R> mex <- subset(MathExam14W, nsolved > 0 & nsolved < 13)
41
R> plot(mex$solved, ...) R> mr <- raschmodel(mex$solved) R> plot(mr, ...)
1 0.0 0.2 0.4 0.6 0.8 1.0 q u a d d e r i v e l a s t i c i t y i n t e g r a l i n t e r e s t a n n u i t y p a y f l
m a t r i x p l a n n i n g e q u a t i
s h e s s e i m p l i c i t l a g r a n g e Item difficulty parameters −1.0 −0.5 0.0 0.5 1.0 1.5 2.0
u a d d e r i v e l a s t i c i t y i n t e g r a l i n t e r e s t a n n u i t y p a y f l
m a t r i x p l a n n i n g e q u a t i
s h e s s e i m p l i c i t l a g r a n g e 42
R> hist(MathExam14W$points, ...) R> piplot(mr)
Points Frequency −5 5 10 15 20 25 20 40 60 80 100 Latent trait
−2 −1 1 2 3 quad deriv elasticity integral interest annuity payflow matrix planning equations hesse implicit lagrange
43
R> pr <- prcomp(mex$solved, scale = TRUE) R> plot(pr, ...) R> biplot(pr, ...)
1 2 3 4 5 6 7 8 9 10 Number of components Variances 0.0 0.5 1.0 1.5 2.0 2.5 −0.06 −0.04 −0.02 0.00 −0.04 −0.02 0.00 0.02 0.04 0.06 PC1 PC2 −15 −10 −5 −10 −5 5 10 15 quad deriv elasticity integral interest annuity payflow matrix planning equations hesse implicit lagrange 44
R> ma <- anchortest(solved ~ group, data = mex, adjust = "single-step") R> plot(ma$final_tests, ...)
Item difficulty parameters −2 −1 1 2 3
u a d d e r i v e l a s t i c i t y i n t e g r a l i n t e r e s t a n n u i t y p a y f l
m a t r i x p l a n n i n g e q u a t i
s h e s s e i m p l i c i t l a g r a n g e
Group 2 −2 −1 1 lagrange implicit hesse planning matrix payflow annuity interest integral elasticity deriv quad ( ( ( ( ( ( ( ( ( ( ( ( ) ) ) ) ) ) ) ) ) ) ) )
45
46
Software: Zeileis A, Grün B, Leisch F, Umlauf N, Birbaumer M, Ernst D, Keller P, Smits N, Stauffer R (2018). R/exams: Automatic Generation of Exams in ❘. ❘ package version 2.3-1. Links: Web http://www.R-exams.org/ CRAN https://CRAN.R-project.org/package=exams Forum http://R-Forge.R-project.org/forum/?group_id=1337 StackOverflow https://stackoverflow.com/questions/tagged/exams References:
Moodle Quizzes, OLAT Assessments, and Beyond.” Journal of Statistical Software, 58(1), 1–36. doi:10.18637/jss.v058.i01
Software, 29(10), 1–14. doi:10.18637/jss.v029.i10
47