IEEE-VIT / enigma8-backend

Backend for Enigma 8.0

Home Page:https://enigma8-api.ieeevit.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

update: checkIfRoomUnlocked

aaryankotharii opened this issue · comments

the current response is

{
unlock: true,
stars:3635
}

change to:

{
status: locked / unlocked/  complete/ canUnlock,
stars:3635
}
  • canUnlock if roomUnlocked is false and stars == 0
  • locked if roomUnlocked is false and stars > 0
  • complete is journey.questionsStatus == ["solved","solved","solved"]
  • else unlocked

stars: logic remains same.

@IEEE-VIT/enigma-backend @IEEE-VIT/enigma-ios @IEEE-VIT/enigma-android

@IEEE-VIT/enigma-ios @IEEE-VIT/enigma-android

when user taps on a room

if status == complete {
show "ROOM COMPLETE" popup
} 

if status == canUnlock {
show selectPowerupView
}

if status == complete {
show "ROOM COMPLETE" popup
}

if status == locked {
show {star} stars required to unlock room
}

@IEEE-VIT/enigma-frontend ⬆️

@aaryankotharii problem w this is... when the room is "locked", the journey wont exist and thats the error message we would get

if journey does not exist then send locked

image
image
image

Another case where the room is unlocked but the user hasn't selected the powerup, we would be returning "canUnlock"

@varunmurpani

13:05:36.463 💙 INFO APIClient.handleJSON():35 - {
  "success" : true,
  "data" : {
    "status" : "locked",
    "starsNeeded" : 0
  }
}

@varun I shall be getting canUnlock in this case. please check ASAP

@IEEE-VIT/enigma-backend I beleive #180 will solve this. this very imp, please look into it.

Will be merged by #180