From e936c58f37ebc9925d82c61361fb1ce28d71e6ff Mon Sep 17 00:00:00 2001 From: Adrien Ufferte Date: Mon, 23 Jun 2025 09:10:18 +0200 Subject: [PATCH] Cleaning double spaces --- sources/gardens/gardens_edit_tool.gd | 2 +- .../gp_image_and_sound_descriptions.gd | 2 +- sources/language_tool/prof_tool_menu.gd | 8 +++---- sources/lesson_screen/lesson_button.gd | 2 +- sources/look_and_learn/look_and_learn.gd | 2 +- sources/look_and_learn/tracing_manager.gd | 2 +- sources/menus/register/register.gd | 2 +- sources/menus/settings/teacher_settings.gd | 2 +- sources/minigames/frog/lilypad_track.gd | 2 +- .../minigames/parakeets/parakeets_minigame.gd | 2 +- sources/utils/autoloads/database.gd | 22 +++++++++---------- sources/utils/autoloads/logger.gd | 2 +- sources/utils/autoloads/server_manager.gd | 2 +- sources/utils/autoloads/user_data_manager.gd | 2 +- .../autoloads/user_database_synchronizer.gd | 6 ++--- sources/utils/dynamic_font_size_label.gd | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sources/gardens/gardens_edit_tool.gd b/sources/gardens/gardens_edit_tool.gd index 3a32ec38..c1609dc3 100644 --- a/sources/gardens/gardens_edit_tool.gd +++ b/sources/gardens/gardens_edit_tool.gd @@ -92,7 +92,7 @@ func _process(delta: float) -> void: var garden_layout: GardenLayout = gardens_layout.gardens[drag_data.garden_ind] var garden: Garden = garden_parent.get_child(drag_data.garden_ind as int) - garden_layout.lesson_buttons[drag_data.sub_ind].path_out_position = garden.get_local_mouse_position() - Vector2(garden_layout.lesson_buttons[drag_data.sub_ind].position) + garden_layout.lesson_buttons[drag_data.sub_ind].path_out_position = garden.get_local_mouse_position() - Vector2(garden_layout.lesson_buttons[drag_data.sub_ind].position) garden.set_lesson_buttons(garden_layout.lesson_buttons) set_up_path() diff --git a/sources/language_tool/gp_image_and_sound_descriptions.gd b/sources/language_tool/gp_image_and_sound_descriptions.gd index e18f2ccc..a0d837fc 100644 --- a/sources/language_tool/gp_image_and_sound_descriptions.gd +++ b/sources/language_tool/gp_image_and_sound_descriptions.gd @@ -3,7 +3,7 @@ class_name GPImageAndSoundDescriptions @onready var description_container: VBoxContainer = %DescriptionsContainer -const DESCRIPTION_LINE_SCENE: PackedScene = preload("res://sources/language_tool/image_and_sound_gp_description.tscn") +const DESCRIPTION_LINE_SCENE: PackedScene = preload("res://sources/language_tool/image_and_sound_gp_description.tscn") func _ready() -> void: diff --git a/sources/language_tool/prof_tool_menu.gd b/sources/language_tool/prof_tool_menu.gd index f0d3951a..50f939f3 100644 --- a/sources/language_tool/prof_tool_menu.gd +++ b/sources/language_tool/prof_tool_menu.gd @@ -207,7 +207,7 @@ func _check_db_integrity() -> void: if !log_message("Word " + (new_word.Word as String) + " with unknown GP (ID " + str(gp.ID) + ") at lesson ID " + str(lesson_id) + " and word ID " + str(new_word.ID)): return if known_words_list.has(new_word.Word): - if !log_message('Word "' + (new_word.Word as String) + '" is introduced in lesson ID ' + str(lesson_id) + " but it already was introduced in lesson ID " + str(known_words_list[new_word.Word])): + if !log_message('Word "' + (new_word.Word as String) + '" is introduced in lesson ID ' + str(lesson_id) + " but it already was introduced in lesson ID " + str(known_words_list[new_word.Word])): return known_words_list[new_word.Word] = lesson_id @@ -584,7 +584,7 @@ func create_book() -> void: var filler: PackedStringArray filler.resize(current_row_count) for index: int in range(current_row_count): - filler[index] = "" # Valeur vide pour rattraper + filler[index] = "" # Valeur vide pour rattraper columns[normalized] = filler # Init colonne "Categorie" si pas encore @@ -640,7 +640,7 @@ func create_book() -> void: output_file.store_line(escape_csv_line(PackedStringArray(ordered_headers))) - var row_count: int = (columns["Categorie"] as PackedStringArray).size() # Toutes les colonnes sont synchronisées + var row_count: int = (columns["Categorie"] as PackedStringArray).size() # Toutes les colonnes sont synchronisées for index: int in range(row_count): var row: PackedStringArray = [] for header: String in ordered_headers: @@ -691,7 +691,7 @@ func parse_csv_line(line: String) -> PackedStringArray: var character: String = line[index] if character == "\"": if in_quotes and index + 1 < line.length() and line[index + 1] == "\"": - current += "\"" # escaped quote + current += "\"" # escaped quote index += 1 else: in_quotes = !in_quotes diff --git a/sources/lesson_screen/lesson_button.gd b/sources/lesson_screen/lesson_button.gd index 3bc9d383..18dd47cb 100644 --- a/sources/lesson_screen/lesson_button.gd +++ b/sources/lesson_screen/lesson_button.gd @@ -26,7 +26,7 @@ func show_placeholder(is_shown: bool) -> void: label.visible = !is_shown -func right() -> void: +func right() -> void: right_fx.play() await right_fx.finished diff --git a/sources/look_and_learn/look_and_learn.gd b/sources/look_and_learn/look_and_learn.gd index 22934ddc..9cc68542 100644 --- a/sources/look_and_learn/look_and_learn.gd +++ b/sources/look_and_learn/look_and_learn.gd @@ -95,7 +95,7 @@ func play_videos() -> void: current_video += 1 -func play_images_and_sounds() -> void: +func play_images_and_sounds() -> void: if current_image_and_sound >= images.size() or current_image_and_sound >= sounds.size(): animation_player.play("end_images_and_sounds") else: diff --git a/sources/look_and_learn/tracing_manager.gd b/sources/look_and_learn/tracing_manager.gd index 29cd43db..2b715a97 100644 --- a/sources/look_and_learn/tracing_manager.gd +++ b/sources/look_and_learn/tracing_manager.gd @@ -20,7 +20,7 @@ func _process(_delta: float) -> void: func place_segments(labels: Array) -> void: for label: Label in labels: for segment: LetterSegment in label.get_children(): - segment.global_position = label.global_position + label.size / 2.0 + Vector2(0.0, 72.0) + segment.global_position = label.global_position + label.size / 2.0 + Vector2(0.0, 72.0) func reset() -> void: diff --git a/sources/menus/register/register.gd b/sources/menus/register/register.gd index 4d7eda99..6d4aeb55 100644 --- a/sources/menus/register/register.gd +++ b/sources/menus/register/register.gd @@ -79,7 +79,7 @@ func _on_step_completed(step: Step) -> void: # Adds students steps for teachers _remove_future_steps() for device: int in register_data.devices_count: - var students_step_scene: Node = students_step.instantiate() + var students_step_scene: Node = students_step.instantiate() if students_step_scene is StudentsCountStep: (students_step_scene as StudentsCountStep).question = tr((students_step_scene as StudentsCountStep).question).format({"number": (device + 1)}) (students_step_scene as StudentsCountStep).device_id = device + 1 diff --git a/sources/menus/settings/teacher_settings.gd b/sources/menus/settings/teacher_settings.gd index 1543f617..993ce6bb 100644 --- a/sources/menus/settings/teacher_settings.gd +++ b/sources/menus/settings/teacher_settings.gd @@ -135,7 +135,7 @@ func _on_add_student_popup_accepted() -> void: if not current_tab: Logger.error("SettingsTeacherSettings: DeviceTab not found") return - var res: Dictionary = await ServerManager.add_student({"device": current_tab.device_id}) + var res: Dictionary = await ServerManager.add_student({"device": current_tab.device_id}) if res.code == 200: UserDataManager.update_configuration(res.body as Dictionary) current_tab.students = UserDataManager.teacher_settings.students[current_tab.device_id] diff --git a/sources/minigames/frog/lilypad_track.gd b/sources/minigames/frog/lilypad_track.gd index 5af45a56..3b596a7f 100644 --- a/sources/minigames/frog/lilypad_track.gd +++ b/sources/minigames/frog/lilypad_track.gd @@ -6,7 +6,7 @@ signal lilypad_in_center(lilypad: Lilypad) const LILYPAD_SCENE: PackedScene = preload("res://sources/minigames/frog/lilypad.tscn") @onready var audio_player: AudioStreamPlayer2D = $AudioStreamPlayer2D -@onready var spawn_timer: Timer = $SpawnTimer +@onready var spawn_timer: Timer = $SpawnTimer var top_to_bottom: bool = false var is_stopped: bool = false diff --git a/sources/minigames/parakeets/parakeets_minigame.gd b/sources/minigames/parakeets/parakeets_minigame.gd index 15ff814d..7617a296 100644 --- a/sources/minigames/parakeets/parakeets_minigame.gd +++ b/sources/minigames/parakeets/parakeets_minigame.gd @@ -36,7 +36,7 @@ const AUDIO_STREAMS: Array[AudioStreamMP3] = [ @onready var fly_away_position_1: Control = $GameRoot/FlyAway/Position1 @onready var fly_away_position_2: Control = $GameRoot/FlyAway/Position2 @onready var fly_away_positions: Array[Vector2] = [ - fly_away_position_1.global_position, + fly_away_position_1.global_position, fly_away_position_2.global_position ] diff --git a/sources/utils/autoloads/database.gd b/sources/utils/autoloads/database.gd index 5ad7a9e5..e4d60827 100644 --- a/sources/utils/autoloads/database.gd +++ b/sources/utils/autoloads/database.gd @@ -9,7 +9,7 @@ const _SYMBOLS_TO_STRING: Dictionary[String, String] = { "%": "pcent", "§": "para" } -const BASE_PATH: String = "user://language_resources/" +const BASE_PATH: String = "user://language_resources/" const TRACING_DATA_FOLDER: String = "tracing_data/" const LOOK_AND_LEARN_IMAGES: String = "/look_and_learn/images/" const LOOK_AND_LEARN_SOUNDS: String = "/look_and_learn/sounds/" @@ -186,13 +186,13 @@ func get_syllables_for_lesson(lesson_nb: int, only_new: bool = false) -> Array[D INNER JOIN (SELECT SyllableID, count() as Count, max(LessonNb) AS LessonNb FROM GPsInSyllables INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInSyllables.GPID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? GROUP BY SyllableID ) VerifiedCount ON VerifiedCount.SyllableID = Syllables.ID AND VerifiedCount.Count = TotalCount.Count" if only_new: query += " INNER JOIN GPsInSyllables ON GPsInSyllables.SyllableID = Syllables.ID INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInSyllables.GPID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb = ?" + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb = ?" db.query_with_bindings(query, [lesson_nb, lesson_nb]) else: db.query_with_bindings(query, [lesson_nb]) @@ -220,7 +220,7 @@ FROM Words INNER JOIN (SELECT WordID, count() as Count, max(LessonNb) as MaxLessonNb, group_concat(GPsInWords.GPID) as gpsid FROM GPsInWords INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInWords.GPID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? GROUP BY WordID ) VerifiedCount ON VerifiedCount.WordID = Words.ID AND VerifiedCount.Count = TotalCount.Count" parameters.append(lesson_nb) @@ -228,7 +228,7 @@ FROM Words if only_new: query += " INNER JOIN GPsInWords ON GPsInWords.WordID = Words.ID INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInWords.GPID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb = ?" + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb = ?" parameters.append(lesson_nb) query += " WHERE TotalCount.Count <= ? and TotalCount.Count >= ?" @@ -267,7 +267,7 @@ FROM Words INNER JOIN (SELECT WordID, count() as Count, max(LessonNb) as MaxLessonNb, group_concat(GPs.Phoneme) as gpphoneme FROM GPsInWords INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInWords.GPID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? INNER JOIN GPs ON GPs.ID = GPsInWords.GPID GROUP BY WordID ) VerifiedCount ON VerifiedCount.WordID = Words.ID AND VerifiedCount.Count = TotalCount.Count" @@ -276,7 +276,7 @@ FROM Words if only_new: query += " INNER JOIN GPsInWords ON GPsInWords.WordID = Words.ID INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInWords.GPID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb = ?" + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb = ?" parameters.append(lesson_nb) query += " WHERE TotalCount.Count <= ? and TotalCount.Count >= ? @@ -334,7 +334,7 @@ INNER JOIN INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInWords.GPID INNER JOIN WordsInSentences ON GPsInWords.WordID = WordsInSentences.WordID INNER JOIN Sentences ON WordsInSentences.SentenceID = Sentences.ID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? INNER JOIN GPs ON GPs.ID = GPsInWords.GPID GROUP BY SentenceID ) VerifiedCount ON VerifiedCount.SentenceID = Sentences.ID AND VerifiedCount.Count = TotalCount.Count @@ -365,7 +365,7 @@ INNER JOIN INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInWords.GPID INNER JOIN WordsInSentences ON GPsInWords.WordID = WordsInSentences.WordID INNER JOIN Sentences ON WordsInSentences.SentenceID = Sentences.ID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? INNER JOIN GPs ON GPs.ID = GPsInWords.GPID GROUP BY SentenceID ) VerifiedCount ON VerifiedCount.SentenceID = Sentences.ID AND VerifiedCount.Count = TotalCount.Count @@ -389,7 +389,7 @@ func get_pseudowords_for_lesson(p_lesson_nb: int) -> Array[Dictionary]: INNER JOIN (SELECT WordID, count() as Count FROM GPsInWords INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInWords.GPID - INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? + INNER JOIN Lessons ON Lessons.ID = GPsInLessons.LessonID AND Lessons.LessonNb <= ? GROUP BY WordID ) VerifiedCount ON VerifiedCount.WordID = Words.ID AND VerifiedCount.Count = TotalCount.Count" db.query_with_bindings(query, [p_lesson_nb]) @@ -406,7 +406,7 @@ func get_distractors_for_grapheme(id: int, lesson_nb: int) -> Array[Dictionary]: AND distractor.Grapheme != stimuli.Grapheme AND distractor.Phoneme != stimuli.Phoneme AND CASE WHEN length(distractor.Grapheme) < length(stimuli.Grapheme) - THEN stimuli.Grapheme NOT LIKE distractor.Grapheme || '%' + THEN stimuli.Grapheme NOT LIKE distractor.Grapheme || '%' ELSE true END AND GPsInLessons.GPID = distractor.ID diff --git a/sources/utils/autoloads/logger.gd b/sources/utils/autoloads/logger.gd index f397e7b0..d9fd1d9f 100644 --- a/sources/utils/autoloads/logger.gd +++ b/sources/utils/autoloads/logger.gd @@ -24,7 +24,7 @@ func _ready() -> void: elif OS.has_feature("debug"): current_level = LogLevel.DEBUG # Exported: debug mode else: - current_level = LogLevel.INFO # Exported: release mode + current_level = LogLevel.INFO # Exported: release mode initialized = true _log_internal(LogLevel.INFO, "--- Logging started at " + Time.get_datetime_string_from_system() + " ---") _log_internal(LogLevel.INFO, "--- Logging set at level " + str(current_level) + " ---") diff --git a/sources/utils/autoloads/server_manager.gd b/sources/utils/autoloads/server_manager.gd index 0d57cd6f..cffd6252 100644 --- a/sources/utils/autoloads/server_manager.gd +++ b/sources/utils/autoloads/server_manager.gd @@ -17,7 +17,7 @@ func _ready() -> void: var env: int = int(config.get_value("environment", "current", 0) as int) set_environment(env) else: - set_environment(1) # fallback PROD + set_environment(1) # fallback PROD func set_environment(env: int) -> void: diff --git a/sources/utils/autoloads/user_data_manager.gd b/sources/utils/autoloads/user_data_manager.gd index d38061c0..f10829f4 100644 --- a/sources/utils/autoloads/user_data_manager.gd +++ b/sources/utils/autoloads/user_data_manager.gd @@ -631,7 +631,7 @@ func move_user_device_folder(old_device: String, new_device: String, student_cod var parent_dir: DirAccess = DirAccess.open(parent_dir_path) var old_child_dir: String = old_device.path_join(_device_settings.language).path_join(str(student_code)) var new_child_dir: String = new_device.path_join(_device_settings.language).path_join(str(student_code)) - var new_parent_dir: String = new_child_dir.get_base_dir() # = "2/fr_FR" + var new_parent_dir: String = new_child_dir.get_base_dir() # = "2/fr_FR" if not parent_dir.dir_exists(new_parent_dir): var err: Error = parent_dir.make_dir_recursive(new_parent_dir) if err != OK: diff --git a/sources/utils/autoloads/user_database_synchronizer.gd b/sources/utils/autoloads/user_database_synchronizer.gd index 54bc977c..fa652877 100644 --- a/sources/utils/autoloads/user_database_synchronizer.gd +++ b/sources/utils/autoloads/user_database_synchronizer.gd @@ -342,7 +342,7 @@ func _apply_server_response(response_body: Dictionary) -> void: # TODO SEPARATE EACH ELEMENT AND ADD LOGGER ERROR IF MISSING OF STUDENT DATA if response_student_data.has("device_id") && response_student_data.has("name") && response_student_data.has("age") && response_student_data.has("updated_at"): UserDataManager.teacher_settings.set_data_student_with_code(int(response_student_code), int(response_student_data.device_id as float), response_student_data.name as String, int(response_student_data.age as float), response_student_data.updated_at as String) - if response_student_data.has("remediation_gp") && (response_student_data.remediation_gp as Dictionary).has("score_remediation") && (response_student_data.remediation_gp as Dictionary).has("updated_at"): + if response_student_data.has("remediation_gp") && (response_student_data.remediation_gp as Dictionary).has("score_remediation") && (response_student_data.remediation_gp as Dictionary).has("updated_at"): # TODO ADD SECURITY var new_array: Array = JSON.parse_string(response_student_data.remediation_gp.score_remediation as String) as Array var new_gp_scores: Dictionary[int, int] = {} @@ -350,7 +350,7 @@ func _apply_server_response(response_body: Dictionary) -> void: # TODO ADD SECURITY new_gp_scores[int(new_array[index][0] as float)] = int(new_array[index][1] as float) UserDataManager.set_student_remediation_gp_data(int(response_student_code), new_gp_scores, response_student_data.remediation_gp.updated_at as String) - if response_student_data.has("remediation_syllables") && (response_student_data.remediation_syllables as Dictionary).has("score_remediation") && (response_student_data.remediation_syllables as Dictionary).has("updated_at"): + if response_student_data.has("remediation_syllables") && (response_student_data.remediation_syllables as Dictionary).has("score_remediation") && (response_student_data.remediation_syllables as Dictionary).has("updated_at"): # TODO ADD SECURITY var new_array: Array = JSON.parse_string(response_student_data.remediation_syllables.score_remediation as String) as Array var new_syllables_scores: Dictionary[int, int] = {} @@ -358,7 +358,7 @@ func _apply_server_response(response_body: Dictionary) -> void: # TODO ADD SECURITY new_syllables_scores[int(new_array[index][0] as float)] = int(new_array[index][1] as float) UserDataManager.set_student_remediation_syllables_data(int(response_student_code), new_syllables_scores, response_student_data.remediation_syllables.updated_at as String) - if response_student_data.has("remediation_words") && (response_student_data.remediation_words as Dictionary).has("score_remediation") && (response_student_data.remediation_words as Dictionary).has("updated_at"): + if response_student_data.has("remediation_words") && (response_student_data.remediation_words as Dictionary).has("score_remediation") && (response_student_data.remediation_words as Dictionary).has("updated_at"): # TODO ADD SECURITY var new_array: Array = JSON.parse_string(response_student_data.remediation_words.score_remediation as String) as Array var new_words_scores: Dictionary[int, int] = {} diff --git a/sources/utils/dynamic_font_size_label.gd b/sources/utils/dynamic_font_size_label.gd index b55d4f65..0ca48181 100644 --- a/sources/utils/dynamic_font_size_label.gd +++ b/sources/utils/dynamic_font_size_label.gd @@ -50,8 +50,8 @@ func _calculate_best_font_size() -> int: # Si le texte rentre, on essaie de l'augmenter if text_size.x <= available_width and text_size.y <= available_height: best_size = mid - low = mid + 1 # On essaie une taille plus grande + low = mid + 1 # On essaie une taille plus grande else: - high = mid - 1 # On essaie une taille plus petite + high = mid - 1 # On essaie une taille plus petite return best_size