Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
TokyoR#84_Rexams
Search
nonki1974
April 04, 2020
Technology
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TokyoR#84_Rexams
nonki1974
April 04, 2020
Transcript
20 slides
オンラインテストの作成 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!
More Decks by nonki1974
See All by nonki1974
GTFS with Tidytransit package
nonki1974
0
350
都道府県別焼き鳥屋ランキングの作成
nonki1974
1
940
Introduction to R
nonki1974
0
410
Introduction to dplyr
nonki1974
0
580
Introduction to ggplot2
nonki1974
1
560
Analyzing PSB tracks with R
nonki1974
0
640
introduction to fukuoka.R @ Fukuoka.LT
nonki1974
0
86
所要時間のヒートマップを作成する
nonki1974
0
620
gtfsr package @ fukuoka.R #11
nonki1974
0
370
Other Decks in Technology
See All in Technology
高品質と高スピードを支える品質のシフトレフトのアプローチ
goyoki
4
1.6k
マネージャーをエスパーにしない マネジメントされる側から始める、働きやすい現場づくり
comi190327
1
750
Frontier Teams — Amazon は AI で「開発のやり方」をどう変えたのか
kmotohas
0
290
Claude Securityを使ってみた / claude-security-claude-code-meetup-nagoya
tnir
0
140
こんなに変わった! AWSネットワークの常識
shotashiratori
16
9.8k
常時稼働エージェントの作り方(Claude公式ブログを資料化)
minorun365
PRO
16
27k
Kansai WordPress Meetup@大阪『ブロックテーマを作る上で知っておくべきこと
torounit
0
230
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
120
Where Should Platform Complexity Live? Lessons from a Cross-Team PR Preview Platform
taiki45
0
140
[NW-JAWS DAY]「うちのAWS、インターネット出られないんで」― AWS外の自社サービスをPrivateLinkでシュッと公開する方法
ykimi
3
810
3文字略語に騙されない! 世界一わかりやすい『EDR』超入門
kamadamakoto
1
250
MCPでネットワーク障害調査を自動化する前に直すべき3つのこと
yama3133
1
580
Featured
See All Featured
It's Worth the Effort
3n
188
29k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Why Our Code Smells
bkeepers
PRO
340
58k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
640
Ethics towards AI in product and experience design
skipperchong
2
470
First, design no harm
axbom
PRO
2
1.4k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
Embracing the Ebb and Flow
colly
88
5.2k
Being A Developer After 40
akosma
PRO
92
590k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
GraphQLとの向き合い方2022年版
quramy
50
15k