generated from your-land/yl_template
108 lines
3.4 KiB
Plaintext
108 lines
3.4 KiB
Plaintext
This file holds a couple of editors notes regarding the mod.
|
|
|
|
https://gitea.your-land.de/your-land/bugtracker/issues/7371
|
|
|
|
Approximate plan:
|
|
|
|
Playerfacing, we need a way to take part in a specific survey.
|
|
|
|
yl_survey.answer(playername, surveyid)
|
|
|
|
This should create a book of the answers of the survey and place it in the player's inv. Or take a book from the player and write the results in.
|
|
|
|
yl_survey.create_book(playername, surveyid)
|
|
|
|
Creating the survey is a bit more complex:
|
|
|
|
create_survey(owner, allow_names, allow_anonymous, allow_changes, timestamp_start, timestamp_end) return s_id
|
|
edit_survey(s_id, owner, allow_names, allow_anonymous, allow_changes, timestamp_start, timestamp_end, delete_responses)
|
|
remove_survey(s_id)
|
|
list_surveys()
|
|
evaluate(s_id)
|
|
|
|
create_question(s_id, question, category, sort, {options}, {answers}) return q_id
|
|
edit_question(s_id, q_id, question, sort, category, {options}, {answers}, delete_responses)
|
|
remove_question(q_id)
|
|
list_questions()
|
|
|
|
validate_questions(s_id)
|
|
|
|
###
|
|
|
|
This is the planned data structure:
|
|
|
|
{
|
|
"metadata": {
|
|
"id": 0,
|
|
"owner": "Alias",
|
|
"title" : "My Awesome Survey",
|
|
"description" : "The @owner@ would like to know some things until @end_date@.",
|
|
"allow_names": true,
|
|
"allow_anonymous": true,
|
|
"allow_changes": true,
|
|
"creation_date": 3475345,
|
|
"modification_date": 3475346,
|
|
"start_date": 3475347
|
|
"end_date": 3475348
|
|
},
|
|
"1": {
|
|
"id": 1,
|
|
"category": "Getting Started",
|
|
"sort": 99,
|
|
"question": "How did you find out about Minetest in general?",
|
|
"enabled" : true,
|
|
"has_freetext" : true,
|
|
"min_responses" : 1,
|
|
"max_responses" : 5,
|
|
"answers": {
|
|
"1": "Friend dragged me over",
|
|
"2": "I came here of my own free will"
|
|
},
|
|
"responses": {
|
|
"AliasAlreadyTaken": {
|
|
"q": "How did you find out about Minetest in general?",
|
|
"1": "Friend dragged me over"
|
|
},
|
|
"Boris": {
|
|
"q": "How did you find out about Minetest in general?",
|
|
"1": "Friend dragged me over"
|
|
},
|
|
"Violetta": {
|
|
"q": "How did you find out about Minetest in general?",
|
|
"1": "Friend dragged me over"
|
|
}
|
|
}
|
|
},
|
|
"2": {
|
|
"id": 2,
|
|
"category": "Getting Started",
|
|
"sort": 2,
|
|
"question": "What do you think about the current state of the server?",
|
|
"enabled" : true,
|
|
"has_freetext" : true,
|
|
"min_responses" : 1,
|
|
"max_responses" : 0
|
|
"answers": {
|
|
"0": "Write your answer here",
|
|
"1": "Terrible",
|
|
"2": "Not soo bad"
|
|
},
|
|
"responses": {
|
|
"AliasAlreadyTaken": {
|
|
"q": "What do you think about the current state of the server?",
|
|
"0": "Neither nor"
|
|
},
|
|
"Boris": {
|
|
"q": "What do you think about the current state of the server?",
|
|
"0": "I get to test stuff!",
|
|
"1": "Terrible"
|
|
},
|
|
"Violetta": {
|
|
"q": "What do you think about the current state of the server?",
|
|
"0": "I write here and check all boxes",
|
|
"1": "Terrible",
|
|
"2": "Not soo bad"
|
|
}
|
|
}
|
|
}
|
|
} |