-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
123 lines (98 loc) · 4.15 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Additional modules
import random
from time import time
# Functional Imports
from src.learning.translator import Translator
from src.learning.lesson import Lesson
from src.learning.quiz import Quiz
from src.learning.spelling_game import SpellingGame
from src.learning.content_selection import ContentSelection
from src.interaction.interaction_module import Interaction
from src.learning.learning_algorithm import LearningAlgorithm
# Lesson Content Imports
from src.lesson_content.content_map import initial_menu
from src.lesson_content.lesson_introduction import lesson_0_introduction
from src.lesson_content.lesson_tutorial import lesson_0_tutorial
from src.lesson_content.lesson_1 import lesson_1_timeline
from src.lesson_content.lesson_2 import lesson_2_timeline
from src.lesson_content.lesson_3 import lesson_3_timeline
from src.lesson_content.lesson_4 import lesson_4_timeline
from src.lesson_content.simple_spelling_words import spelling_words
TIME_UNTIL_HINT = 5
def main():
interaction_module = Interaction(testing=False)
# interaction_module.mute() #Mutes audio for faster testing
option = 1 # Option Override
# MAIN SEQUENCE
if option == 1:
# Dot tutorial and quiz
Lesson(interaction_object=interaction_module,
content=lesson_0_tutorial,
time_until_hint=TIME_UNTIL_HINT)
quiz_content = ["Dot 1", "Dot 2", "Dot 3", "Dot 4", "Dot 5", "Dot 6", ]
random.shuffle(quiz_content)
q = Quiz(interaction_object=interaction_module,
content=quiz_content,
time_until_hint=TIME_UNTIL_HINT)
q.start_quiz()
# A-J lesson and quiz
Lesson(interaction_object=interaction_module,
content=lesson_2_timeline,
time_until_hint=TIME_UNTIL_HINT)
q = Quiz(interaction_object=interaction_module,
content=["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"],
time_until_hint=TIME_UNTIL_HINT)
q.start_quiz()
spelling_game = SpellingGame(
interaction_object=interaction_module,
spelling_word="dad",
time_until_hint=TIME_UNTIL_HINT)
spelling_game.play()
# K-T lesson and quiz
Lesson(interaction_object=interaction_module,
content=lesson_3_timeline,
time_until_hint=TIME_UNTIL_HINT)
q = Quiz(interaction_object=interaction_module,
content=list("klmnopqrst"),
time_until_hint=TIME_UNTIL_HINT)
q.start_quiz()
spelling_game = SpellingGame(
interaction_object=interaction_module,
spelling_word="tail",
time_until_hint=TIME_UNTIL_HINT)
spelling_game.play()
# U-Z lesson and quiz
Lesson(interaction_object=interaction_module,
content=lesson_4_timeline,
time_until_hint=TIME_UNTIL_HINT)
q = Quiz(interaction_object=interaction_module,
content=list("uvwxyz"),
time_until_hint=TIME_UNTIL_HINT)
q.start_quiz()
# Spelling game using a new word
spelling_game = SpellingGame(
interaction_object=interaction_module,
spelling_word="umbrella",
time_until_hint=TIME_UNTIL_HINT)
spelling_game.play()
# Final Quiz using the learning algorithm
amount_of_characters = 10
learning_algorithm = LearningAlgorithm()
learning_algorithm.process_results()
user_tailored_content = learning_algorithm.get_weighted_n_characters(
amount_of_characters)
print("-"*100)
print("Quiz will be on the following characters: {}".format(
user_tailored_content))
print("-"*100)
if len(user_tailored_content) == 0:
interaction_module.speech.say(
"Try another quiz so I can tailor a quiz to your strenghts and weakenesses")
else:
q = Quiz(interaction_object=interaction_module,
content=user_tailored_content,
time_until_hint=TIME_UNTIL_HINT)
q.start_quiz()
# Main loop starts
if __name__ == "__main__":
main()