I'm trying to make gamification Q&A platform where users can earn xp and level up with doing some tasks given by system.
Requirements
- When user level up, new tasks must given this user and user earns xp for completing each given task.
- If user level up and has still some tasks from previous level, user can do prev tasks with new ones.
My Db Design
Tasks
id | xp | level
id : task id
xp : xp amount
level: lower limit to show this task
user_tasks
user_id | task_id | compeleted | created_at
From this design I can handle which tasks user have or will have.
Problem
How can I check task if completed or not ? Let's say one task is that " Ask 5 questions and earn 50 xp ". How can I check that ? This is only one example. I need a dynamic db design and I can't create it. How games specially MMORG games handle this stiuation ?
Thanks for any advice.