Last active
February 21, 2021 16:26
-
-
Save christophergandrud/1fb1183a3ee1a3a1154001999871d65f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
ebt_sampler(total_questions::Int = 310) | |
Create question set to practice for the Deutscher Einbürgerungstest. | |
The official question set can be found at: <http://oet.bamf.de/pls/oetut/f?p=514:1:329473569276328:::::>. | |
The question set has 310 questions, but who knows, maybe this could change. | |
Adjust the total question set with `total_questions::Int`. | |
""" | |
function ebt_sampler(total_questions::Int = 310) | |
i::Int = -9; u::Int = 0 | |
out = zeros(Int, 0) | |
while u < total_questions | |
i += 10; u += 10 | |
if u == total_questions | |
x = StatsBase.sample(i:u, 3, replace = false) | |
else | |
x = StatsBase.sample(i:u) | |
end | |
out = append!(out, x) | |
end | |
return(out) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment