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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
930
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
81
所要時間のヒートマップを作成する
nonki1974
0
600
gtfsr package @ fukuoka.R #11
nonki1974
0
360
Other Decks in Technology
See All in Technology
伝票作成AIエージェントを支える、LLMOpsとインフラの選択肢 / AICon2026_takeda
rakus_dev
0
260
テックカンファレンス三大ステークホルダーの文化人類学 ─ 違いを認め合う関係性作り
bash0c7
1
230
AI時代のYAGNI:「爆速で無駄になった機能」からの学び / 20260720 Naoki Takahashi
shift_evolve
PRO
3
530
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
1
740
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
480
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.5k
「顧客の声を聞かなければ何も始まらない」 ── 顧客の声から生まれた『AI返信補助機能』の開発プロセス / AICon2026_shikata_imai
rakus_dev
1
270
SRENEXT_2026_Chairs__Talks_in_Tamachi.sre.pdf
srenext
1
150
GoでCコンパイラを作った話
repunit
0
150
Webの技術とガジェットで子どもも大人も楽しめるワクワク体験を提供する / Qiita Tech Festa Day 2026
you
PRO
1
170
「守りたい体験」を渡すだけで E2E を生成させられるようになった話
hinac0
2
1k
AI x 開発生産性を取り巻く予算戦略と投資対効果
i35_267
7
2.9k
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
820
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
Odyssey Design
rkendrick25
PRO
2
730
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
How STYLIGHT went responsive
nonsquared
100
6.2k
Utilizing Notion as your number one productivity tool
mfonobong
4
450
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
460
Code Reviewing Like a Champion
maltzj
528
40k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Limits of Empathy - UXLibs8
cassininazir
1
530
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
510
Tell your own story through comics
letsgokoyo
1
1k
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!