Go to file
Riceball LEE 090216cf3a
chore: remove debug print
2022-08-28 09:05:00 +08:00
locale build: update locale 2022-08-19 18:55:18 +08:00
spec test: add tests 2022-07-20 11:49:31 +08:00
.gitignore chore: ignore zip file 2021-08-20 21:22:49 +08:00
.luacheckrc feat: add immediateQuiz option 2021-08-23 20:22:21 +08:00
README.md docs: update readme 2022-07-20 14:09:51 +08:00
array.lua feat: add array shuffle func 2022-07-20 11:49:05 +08:00
calc_type.lua feat: add multiple choice questions supported(`type: select`) 2022-07-19 15:51:55 +08:00
call_chat_cmd.lua fix(callChatCmd): callChatCmd func can not work if params is table 2021-06-20 21:27:36 +08:00
chat_cmds.lua feat(chat_cmd): add left chat command to display left play time 2022-08-19 18:54:44 +08:00
config.yml chore: add new default options to config.yml 2021-08-24 13:32:21 +08:00
defaults_table.lua feat: add defaults func for table merge 2021-06-18 22:21:02 +08:00
giveme_item.lua feat: add mineclone support basically(can extends the quiz_mineclone_items.yml) 2021-07-18 22:06:17 +08:00
init.lua chore: remove debug print 2022-08-28 09:05:00 +08:00
is_online.lua chore: remove print debug 2021-06-21 11:40:07 +08:00
merge_table.lua feat: add mergeTable func 2021-06-21 19:11:07 +08:00
mineclone_items.yml feat: add mineclone support basically(can extends the quiz_mineclone_items.yml) 2021-07-18 22:06:17 +08:00
mod.conf build: add min_minetest_version 2021-09-02 10:28:25 +08:00
pack.sh build: add pack.sh 2021-08-20 21:23:19 +08:00
player_attrs.lua fix: the global name should be the same with mod name 2021-07-16 18:12:39 +08:00
quizzes.lua fix: trim func forget to return value 2022-08-28 09:04:50 +08:00
split.lua feat: add string split funcs 2021-06-22 16:58:23 +08:00
to_bool.lua feat: add to_bool function 2021-06-18 17:47:10 +08:00

README.md

Quiz - Play Challenge

ContentDB

This mod requires players to answer question before they can play. If you answer correctly, you will get a award and continue to play, otherwise you will not be able to play.

Players are required to answer questions at regular intervals(idleInterval), and the answer is correct to continue playing.

When the game time(totalPlayTime) is up, kick the player out.

When logging in, check whether you have enough rest time, based on the recorded last time you left. If you do not have enough rest, you will be kicked out.

  • Chat Commands to mange quiz(need quiz privilege)
    • loadQuiz: reload quizzes from config file.
    • quiz <list>: list all quiz
    • quiz <del> <Index|Id>: delete a quiz
    • quiz <set> <Index|Id> title="Title" answer="Answer": edit/add the quiz
    • quiz reset [<playerName>]: reset the game time of a player
    • quizAward <list>: list all awards
    • quizAward <del> <Index|name>: delete a award
    • quizAward <set> <Id> title="Title" [mod="default"] [count=<Number>]: edit/add the award
    • saveQuiz: save quizzes to config file.
    • totalPlayTime [<minutes>]: get or set the total play time at most.
    • restTime [<min>]: get or set the rest time at least.
    • skipAnswered [true|false]: get or set whether skip the correct answered.
    • idleInterval [<minutes>]: get or set the time between answering quiz.
    • forceAdminRest [true|false]: get or set the whether force the administrator reset too.
    • kickDelay [<seconds>]: get or set the delay time to kick off.
    • checkInterval [<seconds>]: get or set the interval time to check quiz.
    • forceAdminQuiz [true|false]: get or set the whether force the administrator answer the quiz too. defaults to false.
    • immediateQuiz [true|false]: get or set the whether ask the quiz immediately after joining the game. defaults to true.

Put the quiz_config.yml file in world folder:

# the revoke or grant privileges, defaults to "interact,shout"
grant: interact,shout
# totalPlayTime unit is minute, 0 means disable totalPlayTime
totalPlayTime: 30
# the rest time after playing, unit is minute, 0 means disable resetTime
restTime: 20
# Whether skip the question which has already be answered correctly.
# The number is answered count correctly to skip
skipAnswered: 1
# checkInterval unit is second
checkInterval: 5
# idleInterval unit is minute
idleInterval: 5
# the delay time to kick off, unit is second
kickDelay: 2
# the awards to give
awards:
  # the item name to give
  # minetest_game/mods/default/nodes.lua
  - id: coalblock
    # optional, for translation
    title: Coal Block
    # optional, the defaults to default mod
    mod: default
    # the item count, optional the defaults to 1
    count: 1
  - id: wood
    title: Apple Wood Planks
    count: 3
  - id: stone
    title: Stone
    count: 3
  - id: torch
    title: Torch
  - id: steel_ingot
    title: Steel Ingot
    count: 3
# the quiz list
quiz:
  - id: favorColor
    title: "What's my favor color?"
    answer: red
  - id: theYear
    title: "What's the year?"
    answer: 2021
  - title: "18/7=?"
    answer: "/^2%.%.%.+4/" # the lua string pattern: 2...4 (three dots and more)
  - title: "$calc=?"
    type: calc
    forceInt: true         # the result must be an integer
    answer: "(Nn*n+n)/(Nn-n)"
  - title: "What is the part of the plant that uses light to make food?"
    type: "select"
    options:
      - leaves
      - roots
      - stem
      - flowers
    answer: 1
  1. The answer supports the Lua string pattern enclosed in "/" slashes.(0.6.0)
  2. The answer supports generate simple four arithmetic expressions randomly(type: calc)(0.7.0)
    • The division operation must be the last one
    • forceInt means the result of the expression is integer only.
    • N: generate a none-zero number(1-9)
    • n: generate a number(0-9)
    • [1-39]: the set(range) of numbers(from 1 to 3) and number 9
    • [+-*/]: the set(range) of operations.
      • Note: The division operation must be the last!
  3. Multiple choice questions supported(type: select)(0.8.0)
    • options: list items to be selected.
    • answer: the sequence number of the correct option.
      • Note: must sort from small to large