Cleaning double spaces

This commit is contained in:
Adrien Ufferte
2025-06-23 09:10:18 +02:00
parent fd821e7d7d
commit e936c58f37
16 changed files with 32 additions and 32 deletions
+1 -1
View File
@@ -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()
@@ -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:
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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]
+1 -1
View File
@@ -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
@@ -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
]
+11 -11
View File
@@ -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
+1 -1
View File
@@ -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) + " ---")
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
@@ -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] = {}
+2 -2
View File
@@ -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