Skip to content

Commit

Permalink
feat(skill/mbti): questions mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
louistiti committed Jul 2, 2022
1 parent 7f1f887 commit ae4f69f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion skills/social_communication/mbti/nlu/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

"17": ["%question%/20<br>In company do you:<ul><li>a. Initiate conversation</li><li>b. Wait to be approached</li></ul>"],
"18": ["%question%/20<br>Children often do not:<ul><li>a. Make themselves useful enough</li><li>b. Exercise their fantasy enough</li></ul>"],
"19": ["%question%/20<br>Are you more:<ul><li>a. Firm than gentle</li><li>b. Gentle than firm</li></ul>"],
"19": ["%question%/20<b r>Are you more:<ul><li>a. Firm than gentle</li><li>b. Gentle than firm</li></ul>"],
"20": ["%question%/20<br>Do you put more value on:<ul><li>a. Infinite</li><li>b. Open-minded</li></ul>"]
}
}
24 changes: 24 additions & 0 deletions skills/social_communication/mbti/src/actions/quiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,34 @@
import utils
from ..lib import db

counters = {
'mind': {
'E': 0, # Extraverted
'I': 0, # Introverted
'questions': [1, 5, 9, 13, 17]
},
'energy': {
'N': 0, # Intuitive
'S': 0, # Sensing
'questions': [2, 6, 10, 14, 18]
},
'nature': {
'T': 0, # Thinking
'F': 0, # Feeling
'questions': [3, 7, 11, 15, 19]
},
'tactics': {
'J': 0, # Judjing
'P': 0, # Perceiving
'questions': [4, 8, 12, 16, 20]
}
}

def quiz(params):
"""Loop over the questions and track choices"""

resolvers = params['resolvers']
choice = None

for resolver in resolvers:
if resolver['name'] == 'form':
Expand Down

0 comments on commit ae4f69f

Please sign in to comment.