Nomenclatures corrections
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
extends Resource
|
||||
class_name StudentData
|
||||
|
||||
extends Resource
|
||||
|
||||
enum Level {
|
||||
Beginner,
|
||||
@@ -14,6 +13,7 @@ enum Level {
|
||||
@export var age: int = 0
|
||||
@export var last_modified: String = ""
|
||||
|
||||
|
||||
func to_dict() -> Dictionary:
|
||||
return {
|
||||
"code": code,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends Resource
|
||||
class_name StudentProgression
|
||||
extends Resource
|
||||
|
||||
signal unlocks_changed()
|
||||
|
||||
@@ -17,6 +17,7 @@ enum Status{
|
||||
func _init() -> void:
|
||||
init_unlocks()
|
||||
|
||||
|
||||
# Make sure the unlocks are correct
|
||||
func init_unlocks() -> void:
|
||||
if not unlocks:
|
||||
@@ -73,6 +74,7 @@ func look_and_learn_completed(lesson_number: int) -> bool:
|
||||
unlocks_changed.emit()
|
||||
return true
|
||||
|
||||
|
||||
# Return true if the progression is saved or false if the game was already completed
|
||||
func game_completed(lesson_number: int, game_number: int) -> bool:
|
||||
# If the game is already completed, do nothing
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
extends Resource
|
||||
class_name TeacherSettings
|
||||
|
||||
const AVAILABLE_CODES: Array[int] = [123, 124, 125, 126, 132, 134, 135, 136, 142, 143, 145, 146, 152, 153, 154, 213, 214, 215, 216, 231, 234, 235, 236, 241, 243, 245, 246, 251, 253, 254, 321, 324, 325, 326, 312, 314, 315, 316, 342, 341, 345, 346, 352, 351, 354, 423, 421, 425, 426, 432, 431, 435, 436, 412, 413, 415, 416, 452, 453, 451, 523, 524, 521, 526, 532, 534, 531, 536, 542, 543, 541, 546, 512, 513, 514, 623, 624, 625, 621, 632, 634, 635, 631, 642, 643, 645, 641, 652, 653, 654]
|
||||
|
||||
extends Resource
|
||||
|
||||
enum AccountType {
|
||||
Teacher,
|
||||
Parent
|
||||
}
|
||||
|
||||
enum EducationMethod {
|
||||
AppOnly,
|
||||
Complete
|
||||
}
|
||||
|
||||
const AVAILABLE_CODES: Array[int] = [123, 124, 125, 126, 132, 134, 135, 136, 142, 143, 145, 146, 152, 153, 154, 213, 214, 215, 216, 231, 234, 235, 236, 241, 243, 245, 246, 251, 253, 254, 321, 324, 325, 326, 312, 314, 315, 316, 342, 341, 345, 346, 352, 351, 354, 423, 421, 425, 426, 432, 431, 435, 436, 412, 413, 415, 416, 452, 453, 451, 523, 524, 521, 526, 532, 534, 531, 536, 542, 543, 541, 546, 512, 513, 514, 623, 624, 625, 621, 632, 634, 635, 631, 642, 643, 645, 641, 652, 653, 654]
|
||||
|
||||
@export var account_type: AccountType
|
||||
@export var education_method: EducationMethod
|
||||
var devices_count: int
|
||||
@export var students: Dictionary[int, Array] = {} # int (device): Array[StudentData]
|
||||
@export var email: String
|
||||
var password: String
|
||||
@export var token: String
|
||||
@export var last_modified: String = ""
|
||||
|
||||
var devices_count: int
|
||||
var password: String
|
||||
|
||||
|
||||
func update_from_dict(dict: Dictionary) -> void:
|
||||
if dict.has("account_type"):
|
||||
account_type = dict.account_type
|
||||
@@ -104,6 +104,7 @@ func get_new_code() -> int:
|
||||
var code: int = codes.pick_random()
|
||||
return code
|
||||
|
||||
|
||||
func to_dict() -> Dictionary:
|
||||
var dict: Dictionary = {
|
||||
"account_type": account_type,
|
||||
@@ -122,6 +123,7 @@ func to_dict() -> Dictionary:
|
||||
|
||||
return dict
|
||||
|
||||
|
||||
func get_number_of_students() -> int:
|
||||
if not students:
|
||||
return 0
|
||||
@@ -130,12 +132,14 @@ func get_number_of_students() -> int:
|
||||
result += data.size()
|
||||
return result
|
||||
|
||||
|
||||
func get_all_students_data() -> Array[StudentData]:
|
||||
var result: Array[StudentData] = []
|
||||
for data: Array[StudentData] in students.values():
|
||||
result.append_array(data)
|
||||
return result
|
||||
|
||||
|
||||
func delete_student(student_code: int) -> void:
|
||||
for device: int in students.keys():
|
||||
for index: int in range(students[device].size()):
|
||||
@@ -146,12 +150,14 @@ func delete_student(student_code: int) -> void:
|
||||
return
|
||||
Logger.warn("TeacherSettings: Trying to delete student, but code %d not found" % student_code)
|
||||
|
||||
|
||||
func get_student_with_code(student_code: int) -> StudentData:
|
||||
for student_data: StudentData in get_all_students_data():
|
||||
if student_data.code == student_code:
|
||||
return student_data
|
||||
return null
|
||||
|
||||
|
||||
func get_student_device(student_code: int) -> int:
|
||||
for device: int in students.keys():
|
||||
for index: int in range(students[device].size()):
|
||||
@@ -159,6 +165,7 @@ func get_student_device(student_code: int) -> int:
|
||||
return device
|
||||
return -1
|
||||
|
||||
|
||||
func set_data_student_with_code(student_code: int, new_device_id: int, new_name: String, new_age: int, new_last_modified: String) -> void:
|
||||
update_student_device(student_code, new_device_id)
|
||||
for student_data: StudentData in students[new_device_id]:
|
||||
|
||||
@@ -39,11 +39,9 @@ func append_and_trim(target: Dictionary[int, PackedInt32Array], expected_id: int
|
||||
|
||||
# Key is the ID of the expected answer
|
||||
# Value is a PackedInt32Array whose entries are the IDs of the answers
|
||||
@export
|
||||
var gp_scores: Dictionary[int, PackedInt32Array] = {}
|
||||
@export var gp_scores: Dictionary[int, PackedInt32Array] = {}
|
||||
@export var gp_last_modified: String = ""
|
||||
|
||||
@export
|
||||
var gp_last_modified: String = ""
|
||||
|
||||
# Gets (a copy of) the data of a GP
|
||||
func get_gp_scores(id: int) -> PackedInt32Array:
|
||||
@@ -52,6 +50,7 @@ func get_gp_scores(id: int) -> PackedInt32Array:
|
||||
return PackedInt32Array(gp_scores[id])
|
||||
return PackedInt32Array()
|
||||
|
||||
|
||||
# Updates the confusion matrix from a minigame scores
|
||||
func update_gp_scores(minigame_scores: Dictionary[int, PackedInt32Array]) -> void:
|
||||
if not minigame_scores or minigame_scores.is_empty():
|
||||
@@ -63,6 +62,7 @@ func update_gp_scores(minigame_scores: Dictionary[int, PackedInt32Array]) -> voi
|
||||
set_gp_last_modified(Time.get_datetime_string_from_system(true))
|
||||
score_changed.emit()
|
||||
|
||||
|
||||
func set_gp_scores(new_scores: Dictionary[int, PackedInt32Array]) -> void:
|
||||
var cleaned: Dictionary[int, PackedInt32Array] = {}
|
||||
for expected_id: int in new_scores.keys():
|
||||
@@ -71,6 +71,7 @@ func set_gp_scores(new_scores: Dictionary[int, PackedInt32Array]) -> void:
|
||||
gp_scores = cleaned
|
||||
set_gp_last_modified(Time.get_datetime_string_from_system(true))
|
||||
|
||||
|
||||
func set_gp_last_modified(new_date: String) -> void:
|
||||
gp_last_modified = new_date
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
extends Resource
|
||||
class_name UserDifficulty
|
||||
extends Resource
|
||||
|
||||
signal difficulty_changed()
|
||||
|
||||
# Stores the user history for all the minigames
|
||||
# Key -> minigame_name: String
|
||||
# Value -> UserMinigameHistory
|
||||
@export
|
||||
var minigames_histories: Dictionary = {}
|
||||
@export var minigames_histories: Dictionary = {}
|
||||
|
||||
|
||||
# Gets the difficulty of the user for the given minigame
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
extends Resource
|
||||
class_name UserMinigameHistory
|
||||
extends Resource
|
||||
|
||||
const MIN_DIFFICULTY: int = 0
|
||||
const MAX_DIFFICULTY: int = 4
|
||||
const CONSECUTIVE_WINS_TO_PROMOTE: int = 2
|
||||
const CONSECUTIVE_LOSSES_TO_DEMOTE: int = 2
|
||||
|
||||
@export
|
||||
var difficulty: int = 0
|
||||
@export
|
||||
var consecutives_losses: int = 0
|
||||
@export
|
||||
var consecutives_wins: int = 0
|
||||
@export
|
||||
var history: Array[bool] = []
|
||||
@export var difficulty: int = 0
|
||||
@export var consecutives_losses: int = 0
|
||||
@export var consecutives_wins: int = 0
|
||||
@export var history: Array[bool] = []
|
||||
|
||||
|
||||
func add_game(is_won: bool) -> void:
|
||||
history.append(is_won)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class_name UserRemediation
|
||||
extends Resource
|
||||
|
||||
## A remediation score indicates how much extra practice an item needs.
|
||||
## It is a cumulative value that becomes more negative when the student struggles
|
||||
## and rises back toward 0 as they succeed. Items at or below a defined
|
||||
@@ -19,11 +18,9 @@ const REMEDIATION_SCORE: int = -2
|
||||
|
||||
# Key is the ID of the GP
|
||||
# Value is the score of the GP
|
||||
@export
|
||||
var gps_scores: Dictionary[int, int] = {}
|
||||
@export var gps_scores: Dictionary[int, int] = {}
|
||||
@export var gp_last_modified: String = ""
|
||||
|
||||
@export
|
||||
var gp_last_modified: String = ""
|
||||
|
||||
# Gets the score of a GP if it is below or equals to the remediation score
|
||||
func get_gp_score(id: int) -> int:
|
||||
@@ -31,6 +28,7 @@ func get_gp_score(id: int) -> int:
|
||||
return gps_scores[id] if gps_scores[id] <= REMEDIATION_SCORE else 0
|
||||
return 0
|
||||
|
||||
|
||||
# Updates the gp scores from a minigame scores
|
||||
func update_gp_scores(minigame_scores: Dictionary) -> void:
|
||||
if not minigame_scores:
|
||||
@@ -47,9 +45,11 @@ func update_gp_scores(minigame_scores: Dictionary) -> void:
|
||||
set_gp_last_modified(Time.get_datetime_string_from_system(true))
|
||||
score_changed.emit()
|
||||
|
||||
|
||||
func set_gp_scores(new_scores: Dictionary[int, int]) -> void:
|
||||
gps_scores = new_scores
|
||||
|
||||
|
||||
func set_gp_last_modified(new_date: String) -> void:
|
||||
gp_last_modified = new_date
|
||||
|
||||
@@ -59,11 +59,9 @@ func set_gp_last_modified(new_date: String) -> void:
|
||||
|
||||
# Key is the ID of the syllable
|
||||
# Value is the score of the syllable
|
||||
@export
|
||||
var syllables_scores: Dictionary[int, int] = {}
|
||||
@export var syllables_scores: Dictionary[int, int] = {}
|
||||
@export var syllables_last_modified: String = ""
|
||||
|
||||
@export
|
||||
var syllables_last_modified: String = ""
|
||||
|
||||
# Gets the score of a syllable if it is below or equals to the remediation score
|
||||
func get_syllable_score(id: int) -> int:
|
||||
@@ -71,6 +69,7 @@ func get_syllable_score(id: int) -> int:
|
||||
return syllables_scores[id] if syllables_scores[id] <= REMEDIATION_SCORE else 0
|
||||
return 0
|
||||
|
||||
|
||||
# Updates the syllables scores from a minigame scores
|
||||
func update_syllables_scores(minigame_scores: Dictionary) -> void:
|
||||
if not minigame_scores:
|
||||
@@ -87,9 +86,11 @@ func update_syllables_scores(minigame_scores: Dictionary) -> void:
|
||||
set_syllables_last_modified(Time.get_datetime_string_from_system(true))
|
||||
score_changed.emit()
|
||||
|
||||
|
||||
func set_syllables_scores(new_scores: Dictionary[int, int]) -> void:
|
||||
syllables_scores = new_scores
|
||||
|
||||
|
||||
func set_syllables_last_modified(new_date: String) -> void:
|
||||
syllables_last_modified = new_date
|
||||
|
||||
@@ -99,11 +100,9 @@ func set_syllables_last_modified(new_date: String) -> void:
|
||||
|
||||
# Key is the ID of the word
|
||||
# Value is the score of the word
|
||||
@export
|
||||
var words_scores: Dictionary[int, int] = {}
|
||||
@export var words_scores: Dictionary[int, int] = {}
|
||||
@export var words_last_modified: String = ""
|
||||
|
||||
@export
|
||||
var words_last_modified: String = ""
|
||||
|
||||
# Gets the score of a word if it is below or equals to the remediation score
|
||||
func get_word_score(id: int) -> int:
|
||||
@@ -111,6 +110,7 @@ func get_word_score(id: int) -> int:
|
||||
return words_scores[id] if words_scores[id] <= REMEDIATION_SCORE else 0
|
||||
return 0
|
||||
|
||||
|
||||
# Updates the words scores from a minigame scores
|
||||
func update_words_scores(minigame_scores: Dictionary) -> void:
|
||||
if not minigame_scores:
|
||||
@@ -127,9 +127,11 @@ func update_words_scores(minigame_scores: Dictionary) -> void:
|
||||
set_words_last_modified(Time.get_datetime_string_from_system(true))
|
||||
score_changed.emit()
|
||||
|
||||
|
||||
func set_words_scores(new_scores: Dictionary[int, int]) -> void:
|
||||
words_scores = new_scores
|
||||
|
||||
|
||||
func set_words_last_modified(new_date: String) -> void:
|
||||
words_last_modified = new_date
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
extends Resource
|
||||
class_name UserSpeeches
|
||||
extends Resource
|
||||
|
||||
signal speeches_changed
|
||||
signal speeches_changed()
|
||||
|
||||
# Contains the list of speeches already played
|
||||
@export var speeches_played: Array[String] = []
|
||||
|
||||
|
||||
func add_speech(speech: String) -> void:
|
||||
if not speeches_played.has(speech):
|
||||
speeches_played.append(speech)
|
||||
speeches_changed.emit()
|
||||
|
||||
|
||||
func is_speech_played(speech: String) -> bool:
|
||||
return speeches_played.has(speech)
|
||||
|
||||
Reference in New Issue
Block a user