ihf-referee-rules
All stuff regarding IHF rules and regulations.
All materials taken from the Internation Handball Federation (IHF) offical website here.
Rules
Rules Questions
Rules Answers
Parsing the questions and answers PDF
I found the easiest way to handle the pdf is to simply render it in your browser then copy and paste the entire content into two separte text files, questions.txt and answers.txt.
With the two text files, we can attempt to parse them into workable formats, currently supporting csv
and json
.
# generate 2 csv files of questions and answers repectively
go run cmd/parse.go --f=csv
# generate a json array of all the questions, options and theirs answers
go run cmd/parse.go --f=json
json output example
[
{
"ID": 100,
"Text": "After receiving medical treatment on the court, BLACK 11 sits on the bench and complains about a decision of the referees. Therefore, he receives his first 2-minute suspension of the match. Following the second attack of BLACK team, BLACK 11 re-enters the court after serving his 2-minute suspension. Correct decision?",
"Choices": [
{
"ID": 0,
"QuestionID": 100,
"Option": "a",
"Text": "Time-out",
"IsAnswer": false
},
{
"ID": 0,
"QuestionID": 100,
"Option": "b",
"Text": "2-minute suspension of BLACK 11",
"IsAnswer": false
},
{
"ID": 0,
"QuestionID": 100,
"Option": "c",
"Text": "Play on",
"IsAnswer": true
},
{
"ID": 0,
"QuestionID": 100,
"Option": "d",
"Text": "Free throw for WHITE team",
"IsAnswer": false
}
],
"Rule": "4",
"QuestionNum": 44
}
]