Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TokyoR#84_Rexams
Search
nonki1974
April 04, 2020
Technology
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TokyoR#84_Rexams
nonki1974
April 04, 2020
More Decks by nonki1974
See All by nonki1974
GTFS with Tidytransit package
nonki1974
0
340
都道府県別焼き鳥屋ランキングの作成
nonki1974
1
920
Introduction to R
nonki1974
0
390
Introduction to dplyr
nonki1974
0
560
Introduction to ggplot2
nonki1974
1
540
Analyzing PSB tracks with R
nonki1974
0
620
introduction to fukuoka.R @ Fukuoka.LT
nonki1974
0
79
所要時間のヒートマップを作成する
nonki1974
0
590
gtfsr package @ fukuoka.R #11
nonki1974
0
360
Other Decks in Technology
See All in Technology
From Prompt Engineering to Loop Engineering
shibuiwilliam
1
250
現場のトークンマネジメント
dak2
1
190
Deep Data Security 機能解説
oracle4engineer
PRO
2
170
「ビジネスがわかるエンジニア」とは何か?
ryooob
0
330
アラート調査向けAIエージェントの本番導入とその後/AI Agents for Alert Investigation: Production Deployment and After
taddy_919
1
170
AWS Security Agent といっしょに脅威モデリングをやってみよう
amarelo_n24
1
210
不要なレビューをAIにまかせて AIコーディングの環境改善を加速した
shoota
1
270
Agile and AI Redmine Japan 2026
hiranabe
4
490
「軸足」は 固定しなくていい - 熱量と強みで描く、しなやかなキャリアの形
kakehashi
PRO
1
270
スタートアップにAmazon EKSは早すぎる? マルチプロダクト戦略を加速する Platform Engineeringの実践 / Is Amazon EKS Too Soon for Startups? Practical Platform Engineering to Accelerate a Multi-Product Strategy
elmodev09
1
1.8k
AI Agentをシステムに組み込む前にゆるく向き合ってみる
hayama17
0
160
5分でわかるDuckDB Quack
chanyou0311
4
250
Featured
See All Featured
Designing for Timeless Needs
cassininazir
1
260
The SEO Collaboration Effect
kristinabergwall1
1
490
Leo the Paperboy
mayatellez
7
1.9k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
400
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Navigating Team Friction
lara
192
16k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Six Lessons from altMBA
skipperchong
29
4.3k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Practical Orchestrator
shlominoach
191
11k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
450
エンジニアに許された特別な時間の終わり
watany
107
250k
Transcript
オンラインテストの作成 with R/exams @nonki1974 Tokyo.R #84
こんにちは
moodle Learning Management System(LMS) スライド、レジュメの配布 アンケート、出欠確認、URL、ページ作成 小テスト
小テスト(計算問題の作成) {a}はワイルドカードデータセット → 出題のたびに値が変わる
小テスト(解答の設定)
小テスト(値生成ルール設定)
小テスト(プレビュー)
統計の授業で使ってみよう!
・・・・ 階乗や組み合わせの関数がない・・・!
Rで問題を作る:examsパッケージ
Rで問題を作る:examsパッケージ Rmarkdownで問題&解答を作成 Moodleにインポート Moodle XMLフォーマットに出力 1 2 3
フォーマット ```{r echo = FALSE, results='hide'} # 問題中のパラメータ設定など a <-
round(runif(1, 1, 10), 2) b <- round(runif(1, 1, 10), 2) res <- a + b ``` Question ======== 以下の値を求めなさい。 $$ `r a` + `r b` $$ Solution ======== 答えは $$ `r a` + `r b` = `r res` $$ Meta-information ================ extype: num exsolution: `r fmt(res)` exname: 足し算のテスト extol: 0.01
とりあえずの確認 library(exams) exams2html("add_ex.Rmd")
結果
Moodle XMLフォーマットに出力 # add_ex.xmlが生成される exams2moodle(file = "add_ex.Rmd", n = 10,
name = "add_ex")
Moodleにインポート → プレビュー
実戦投入 ```{r echo = FALSE, results = "hide"} lambda <-
sample(seq(0.1, 5, 0.1), 1) x <- ceiling(lambda) res <- c(dpois(x, lambda), 1-dpois(0, lambda)) ``` Question ======== ある店舗の1分間あたりの来客数$X$は,$¥lambda=`r lambda`$の ポアソン分布に従うと仮定する。このとき,以下の確率を求めな さい。 Answerlist ---------- * 1分間にちょうど`r x`人の来客がある確率 * 1分間に少なくとも1人以上の来客がある確率 Solution ======== 1分間にちょうど`r x`人の来客がある確率は, ¥begin{align} P(X = `r ceiling(x)`) &= ¥frac{`r lambda`^`r x`}{`r x`!}e^ {-`r lambda`} ¥¥ &= `r fmt(res[1])` ¥end{align} 1分間に少なくとも1人以上の来客がある確率は, ¥begin{align} P(X¥geqq 1) &= 1 - P(X = 0) ¥¥ &= 1 - e^{-`r lambda`} ¥¥ &= 1 - `r exp(-lambda)` ¥¥ &= `r fmt(res[2])` ¥end{align} となる. Answerlist ---------- * 1分間にちょうど`r x`人の来客がある確率は `r fmt(res[1])`. * 1分間に少なくとも1人以上の来客がある確率は `r fmt(res[2])`. Meta-information ================ extype: cloze exclozetype: num|num exsolution: `r fmt(res[1])`|`r fmt(res[2])` exname: poisson_ex_word extol: 0.01
こんな感じ
未解決 Windows環境では×(UTF-8保存でもダメ) 日本語PDFは×
Enjoy!