Comments corrections

This commit is contained in:
Adrien Ufferte
2026-01-26 13:34:07 +01:00
parent ed0239aa04
commit b227f1cb17
13 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ func extract(zip_path: String, extract_path: String, extract_in_subfolder: bool
var data: PackedByteArray = read_file(sub_path)
if data.is_empty():
# Zero-byte files can be valid files, so we warn but we don"t skip
# Zero-byte files can be valid files, so we warn but do not skip them.
Log.warn("FolderUnzipper: Empty data for %s" % sub_path)
if typeof(data) != TYPE_PACKED_BYTE_ARRAY:
Log.warn("FolderUnzipper: Invalid data for %s" % sub_path)
+4 -4
View File
@@ -61,7 +61,7 @@ func ensure_data_integrity(data: Dictionary[int, Dictionary]) -> Dictionary:
var is_init: bool = data.is_empty()
var result: Dictionary[int, Dictionary] = data.duplicate(true)
var number_of_lessons: int = Database.get_lessons_count()
# Check too much keys
# Check for extra keys
for key: int in result.keys():
if key > number_of_lessons:
result.erase(key)
@@ -124,7 +124,7 @@ func ensure_data_integrity(data: Dictionary[int, Dictionary]) -> Dictionary:
# First garden (key 1) is always unlocked
prev_completed = true
# Case : previous garden not completed
# Case: previous garden not completed
if not prev_completed:
for game_index: int in range(3):
if garden["games"][game_index] != Status.Locked or garden["look_and_learn"] != Status.Locked:
@@ -135,7 +135,7 @@ func ensure_data_integrity(data: Dictionary[int, Dictionary]) -> Dictionary:
break
continue
# Case : lesson completed → games unlocked if needed
# Case: lesson completed → unlock games if needed
if garden["look_and_learn"] == Status.Completed:
for game_index: int in range(3):
if garden["games"][game_index] == Status.Locked:
@@ -143,7 +143,7 @@ func ensure_data_integrity(data: Dictionary[int, Dictionary]) -> Dictionary:
if not is_init:
Log.warn("StudentProgression: Garden %d: game %d unlocked because lesson is completed" % [index, game_index + 1])
# Case : previous garden completed → lesson unlocked if needed
# Case: previous garden completed → unlock lesson if needed
elif garden["look_and_learn"] == Status.Locked:
garden["look_and_learn"] = Status.Unlocked
if not is_init:
+1 -1
View File
@@ -51,7 +51,7 @@ func get_gp_scores(id: int) -> PackedInt32Array:
return PackedInt32Array()
# Updates the confusion matrix from a minigame scores
# Updates the confusion matrix from a minigame's scores
func update_gp_scores(minigame_scores: Dictionary[int, PackedInt32Array]) -> void:
if not minigame_scores or minigame_scores.is_empty():
return
+3 -3
View File
@@ -29,7 +29,7 @@ func get_gp_score(id: int) -> int:
return 0
# Updates the gp scores from a minigame scores
# Updates the GP scores from a minigame's scores
func update_gp_scores(minigame_scores: Dictionary) -> void:
if not minigame_scores:
return
@@ -70,7 +70,7 @@ func get_syllable_score(id: int) -> int:
return 0
# Updates the syllables scores from a minigame scores
# Updates the syllable scores from a minigame's scores
func update_syllables_scores(minigame_scores: Dictionary) -> void:
if not minigame_scores:
return
@@ -111,7 +111,7 @@ func get_word_score(id: int) -> int:
return 0
# Updates the words scores from a minigame scores
# Updates the word scores from a minigame's scores
func update_words_scores(minigame_scores: Dictionary) -> void:
if not minigame_scores:
return
+1 -1
View File
@@ -92,7 +92,7 @@ func refresh_devices_tabs() -> void:
var device_tab: DeviceTab
device_tab = DEVICE_TAB_SCENE.instantiate()
devices_tab_container.add_child(device_tab)
await get_tree().process_frame # Not optional or an auto-rename bug will occur on the tabs (especiallly if there are a lot of them)
await get_tree().process_frame # Not optional or an auto-rename bug will occur on the tabs (especially if there are a lot of them)
device_tab.device_id = device
(device_tab as DeviceTab).students = UserDataManager.teacher_settings.students[device] as Array[StudentData]
device_tab.name = tr("DEVICE_NUMBER").format({"number": device})
+1 -1
View File
@@ -486,7 +486,7 @@ func _on_minigame_ui_restart_button_pressed() -> void:
func _on_current_progression_changed() -> void:
# Make Godot understands that this function is a coroutine even if it does nothing, to avoid warning
# Make Godot understand that this function is a coroutine even if it does nothing, to avoid warning
await get_tree().create_timer(0).timeout
#endregion
@@ -96,7 +96,7 @@ func _find_stimuli_and_distractions() -> void:
var stimulus_distractors: Array[Dictionary] = []
# Difficulty 1
# Any previously learned item w/ all letters different
# Any previously learned item with all letters different
for syllable: Dictionary in all_syllables:
if syllable.Phoneme != stimulus.Phoneme:
var gp_found_in_stimuli: bool = false
@@ -122,7 +122,7 @@ func _find_stimuli_and_distractions() -> void:
stimulus_distractors.append(syllable)
# Difficulty 4-5
# If the item has 2 GP, inversed TARGET, i.e., for 'il', 'li' is a distractor
# If the item has 2 GP, invert the target (e.g., for "il", "li" is a distractor)
if difficulty > 3 and syllable.GPs[0] == stimulus.GPs[1] and syllable.GPs[1] == stimulus.GPs[0]:
stimulus_distractors.append(syllable)
@@ -104,7 +104,7 @@ func _setup_minigame() -> void:
super()
# Setups the word progression for current progression
# Sets up the word progression for the current progression
func _setup_word_progression() -> void:
var stimulus: Dictionary = _get_current_stimulus()
var gps: Array = stimulus.GPs as Array
@@ -44,7 +44,7 @@ func _setup_minigame() -> void:
if index == int(settings.branches/2.0):
_on_branch_pressed(branch)
# Setups the timer
# Sets up the timer
berry_timer.wait_time = settings.spawn_rate
# Connects the caterpillar signals
@@ -84,7 +84,7 @@ func _start() -> void:
sentence_background.show()
# Setups the word progression for current progression
# Sets up the word progression for the current progression
func _setup_word_progression() -> void:
max_word_progression = 0
@@ -43,15 +43,15 @@ func _setup_minigame() -> void:
super._setup_minigame()
pick_random_color()
# Setups the current settings
# Sets up the current settings
settings = difficulty_settings[difficulty]
if not settings:
return
# Setups the island for the first word
# Sets up the island for the first word
island.stimulus = self._get_current_stimulus()
# Setups the timer
# Sets up the timer
spawn_timer.wait_time = settings.spawn_rate
for stimulus: Dictionary in stimuli:
+5 -5
View File
@@ -218,7 +218,7 @@ func _bump_rotation_index() -> void:
log_rotation_index += 1
# trace can be used everywhere, in order to have a full log of all that is hapenning
# trace can be used everywhere to log everything that is happening.
func trace(msg: String) -> void: _log_internal(LogLevel.TRACE, msg)
@@ -226,19 +226,19 @@ func trace(msg: String) -> void: _log_internal(LogLevel.TRACE, msg)
func debug(msg: String) -> void: _log_internal(LogLevel.DEBUG, msg)
# info can carry important information(s) that should always be logged but that are not problematic
# info can carry important information that should always be logged but that is not problematic.
func info(msg: String) -> void: _log_internal(LogLevel.INFO, msg)
# warning should be used when a behaviour is not normal, but this is not blocking or it could be ignored
# warning should be used when a behavior is not normal, but it is not blocking and can be ignored.
func warn(msg: String) -> void: _log_internal(LogLevel.WARNING, msg)
# error should be used everytime the program does something that is problematic and could potentially harm the user experience
# error should be used every time the program does something problematic that could harm the user experience.
func error(msg: String) -> void: _log_internal(LogLevel.ERROR, msg)
# alert will displays a modal dialog box using the host platform's implementation. The engine execution is blocked until the dialog is closed.
# alert will display a modal dialog box using the host platform's implementation. The engine execution is blocked until the dialog is closed.
func alert(msg: String) -> void: _log_internal(LogLevel.ALERT, msg)
+2 -2
View File
@@ -157,7 +157,7 @@ func login(infos: Dictionary) -> bool:
var path: String = get_teacher_settings_path()
# Create the folder locally if it doesn't exists
# Create the folder locally if it does not exist.
if not FileAccess.file_exists(path):
DirAccess.make_dir_recursive_absolute(get_teacher_folder())
teacher_settings = TeacherSettings.new()
@@ -513,7 +513,7 @@ func _delete_inexistants_students_saves() -> void:
if str(s_data.code) == p_student:
exists = true
break
# If the code doesn't exists in the configuration, delete the folder
# If the code does not exist in the configuration, delete the folder.
if not exists:
Utils.delete_directory_recursive(path.path_join(device).path_join(language).path_join(p_student))