diff --git a/html/index3D.html b/html/index3D.html index 8825539..0717a1a 100644 --- a/html/index3D.html +++ b/html/index3D.html @@ -28,6 +28,7 @@ + diff --git a/static/MAIN.js b/static/MAIN.js index 287596a..5d0651c 100644 --- a/static/MAIN.js +++ b/static/MAIN.js @@ -34,7 +34,7 @@ function init_variable(premier_appel){ skiped = false // Au premier appel on init : les interactions - if (premier_appel){interactions = [{"time" : new Date().getTime(), "type": "start"}]} + if (premier_appel){interactions = [{"time" : new Date().getTime(), "type": get_message("debut_etude", [])}]} // Couleur alpha_survol = 0.3 @@ -43,7 +43,7 @@ function init_variable(premier_appel){ indice_mesh = 0 // indice du premier mesh à visionner mesh_courant = "nope" // nom des mesh // nombre de mesh a visionner AU TOTAL - nb_mesh = 2 //3 + nb_mesh = 4 // random nom mesh obj_file = shuffle(['dragon_update_user_study_normed.obj', 'camel_update_user_study_normed.obj', 'gorgoile_update_user_study_centered_normed.obj', 'horse_update_user_study_normed.obj']) @@ -255,8 +255,8 @@ function setUp_3D(idx_mesh, idx_i_init, idx_j_init, explication=false){ choix_courant['delta_init'] = delta_init // pour savoir quel mesh on affiche - interactions.push({"time": new Date().getTime(), "type": "Affichage Mesh random : "+mesh_courant+" en idx_i, idx_j : ("+idx_i_init+", "+idx_j_init+")"}) - interactions.push({"time": new Date().getTime(), "type": "Affichage Mesh random : "+mesh_courant+" en theta, delta : ("+theta_init+", "+delta_init+")"}) + interactions.push({"time": new Date().getTime(), "type": get_message('affichage_mesh_IJ', [mesh_courant, idx_i_init, idx_j_init])}) + interactions.push({"time": new Date().getTime(), "type": get_message('affichage_mesh_TD', [mesh_courant, theta_init, delta_init])})//"Affichage Mesh random : "+mesh_courant+" en theta, delta : ("+theta_init+", "+delta_init+")"}) } //////////////////////////////////////// @@ -425,7 +425,8 @@ function animate() { // page de choix if (page_vues && num_tache <= nb_mesh){ //console.log("boucle choix") - if (skiped){document.removeEventListener("keydown", action_clavier_inscription)} + if (skiped){document.removeEventListener("keydown", action_clavier_inscription) + document.removeEventListener("keydown", action_clavier_explication)} else{ // on enlève les touches du clavier associé à la page inscription document.removeEventListener("keydown", action_clavier_explication)} @@ -436,6 +437,7 @@ function animate() { // affichage ecran 3D de manière aléatoire idx_i_init = Math.floor(Math.random()*8) idx_j_init = Math.floor(Math.random()*5) + interactions.push({"time": new Date().getTime(), "type": get_message('debut_tache_i', [num_tache])}) setUp_3D(indice_mesh, idx_i_init, idx_j_init) premier_tour_page_vues = false } @@ -499,7 +501,7 @@ function animate() { document.removeEventListener("keydown", action_clavier_explication_analyse) // inti clavier if(premier_tour_page_analyse){ - interactions.push({"time": new Date().getTime(), "type": "debut analyse n°1"}) + interactions.push({"time": new Date().getTime(), "type": get_message("debut_analyse", [])}) init_clavier_analyse() init_variable_analyse() old_renderer = document.getElementById('renderer') @@ -539,13 +541,14 @@ function animate() { xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); // Ajout du listener pour déclencer la suite lorsque la requête sera terminée. xhr.onreadystatechange = function() { + //interactions.push({"time": new Date().getTime(), "type": get_message("fin_eetude", [])}) // Si la requête est terminée, et que la réponse n'est pas une erreur. if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { console.log(xhr.responseText); message_fin = "> It's done. You can close the web page." envoie_termine = true update_texte_fin(message_fin) - interactions.push({"time": new Date().getTime(), "type": "fin etude"}) + interactions.push({"time": new Date().getTime(), "type": get_message("fin_etude", [])}) return; } } diff --git a/static/fonctions_analyse.js b/static/fonctions_analyse.js index 1865668..a5059f0 100644 --- a/static/fonctions_analyse.js +++ b/static/fonctions_analyse.js @@ -39,7 +39,7 @@ function affichage_legende(pos){ function affichage_texte(){ // Texte //draw_rectangle(0,0,canvas.width, canvas.height, "rgb(3, 26, 33)", 1) // ou + clair 4, 38, 48 - affichage_titre("Analysis your selections: why did you choose these viewpoints?", (0.015*window.innerWidth)+"pt Courier", "#EF476F", yt = 0.1*window.innerHeight) + affichage_titre("Analysis your selections: Why did you choose these viewpoints?", (0.015*window.innerWidth)+"pt Courier", "#EF476F", yt = 0.1*window.innerHeight) } // idx_tache est la num de la tache à aller chercher dans all_ctxMins @@ -106,7 +106,7 @@ function condition_valider(){ } function action_bouton_valider_analyse(){ - interactions.push({"time": new Date().getTime(), "type": "bouton valider analyse"}) + interactions.push({"time": new Date().getTime(), "type": get_message("bouton_valider_analyse", []) }) // si au moins un mot est coché et qu'il reste des analyse à faire if (condition_valider()){ // sauvegarde des checkbox clikée et les mesh @@ -126,7 +126,7 @@ function action_bouton_valider_analyse(){ // indice mesh da l'analyse suivante idx_tache = idx_tache + 1 if (num_analyse 0){ liste_poses.pop() @@ -401,12 +402,12 @@ function action_bouton_retirer(){ else { //console.log("Il n'y a pas de pose à retirer.") texte_temporaire = {"text": "There are no selected viewpoints to remove.", "x": x_pop_up, "y": y_pop_up, "t_end": new Date().getTime()+temps_pop} - interactions.push({"time": new Date().getTime(), "type": "Affichage error pas de pose a retirer"}) + interactions.push({"time": new Date().getTime(), "type": get_message("erreur_pas_de_pose", [])}) } } function action_bouton_reinitialiser(){ - interactions.push({"time": new Date().getTime(), "type": "bouton renitialiser"}) + interactions.push({"time": new Date().getTime(), "type": get_message("bouton_reset", [num_tache, nb_choix_fait])}) if (liste_poses.length>0){ liste_poses = [] nb_choix_fait = 0 @@ -417,11 +418,11 @@ function action_bouton_reinitialiser(){ } else {//console.log("Il n'y a pas de pose à reintialiser.") texte_temporaire = {"text": "There are no selected viewpoints to resart.", "x":x_pop_up, "y": y_pop_up, "t_end": new Date().getTime()+temps_pop} - interactions.push({"time": new Date().getTime(), "type": "Affichage error aucun choix fait donc pas de reinitialisation possible"})} + interactions.push({"time": new Date().getTime(), "type": get_message("erreur_reset_impossible", [])})} } function action_bouton_valider(){ - interactions.push({"time": new Date().getTime(), "type": "bouton valider"}) + interactions.push({"time": new Date().getTime(), "type": get_message("bouton_valider", [num_tache, nb_choix_fait])}) // Si tous les mesh ont été vu if (num_tache == nb_mesh && nb_choix_demande==nb_choix_fait){ choix_courant['choix_poses'] = liste_poses @@ -434,7 +435,8 @@ function action_bouton_valider(){ //page_analyse = true page_explication_analyse = true page_vues = false - interactions.push({"time": new Date().getTime(), "type": "fin choix vues - debut explication analyse"}) + interactions.push({"time": new Date().getTime(), "type": get_message('fin_tache_i', [num_tache-1])}) + interactions.push({"time": new Date().getTime(), "type": get_message("fin_choix", [])}) } // Si le nombre de vue demandé a été fait et que ce n'est pas le dernier mesh à voir @@ -455,14 +457,17 @@ function action_bouton_valider(){ indice_mesh = indice_mesh + 1 num_tache = num_tache+1 idx_i_init = Math.floor(Math.random()*8); idx_j_init = Math.floor(Math.random()*5) - setUp_3D(indice_mesh, idx_i_init, idx_j_init) + interactions.push({"time": new Date().getTime(), "type": get_message('fin_tache_i', [num_tache-1])}) + interactions.push({"time": new Date().getTime(), "type": get_message('debut_tache_i', [num_tache])}) + setUp_3D(indice_mesh, idx_i_init, idx_j_init) + } // Error : il reste des vues à sélectionner else if (nb_choix_fait < nb_choix_demande){ //console.log("Tu n'as pas fait tes 3 choix") texte_temporaire = {"text": "You did not select your "+nb_choix_demande+" viewpoints.", "x": x_pop_up, "y": y_pop_up, "t_end": new Date().getTime()+temps_pop} - interactions.push({"time": new Date().getTime(), "type": "Affichage error a cause du bouton valider"}) + interactions.push({"time": new Date().getTime(), "type": get_message("erreur_valider", [])}) } // Error : un pbl à identifier else{ @@ -486,11 +491,11 @@ function action_bouton_raz(){ init_variable(false); idx_i_init = Math.floor(Math.random()*8); idx_j_init = Math.floor(Math.random()*5) setUp_3D(indice_mesh, idx_i_init, idx_j_init) - interactions.push({"time": new Date().getTime(), "type": "bouton raz check"})} + interactions.push({"time": new Date().getTime(), "type": get_message("bouton_raz_check", [num_tache, nb_choix_fait])})} // click sur la croix ou ailleurs : on clear if(clicked){ bouton_raz_clicked = false - interactions.push({"time": new Date().getTime(), "type": "bouton raz croix"})} + interactions.push({"time": new Date().getTime(), "type": get_message("bouton_raz_croix", [num_tache, nb_choix_fait])})} } diff --git a/static/fonctions_contexte.js b/static/fonctions_contexte.js index ece980b..72222a7 100644 --- a/static/fonctions_contexte.js +++ b/static/fonctions_contexte.js @@ -21,7 +21,7 @@ function action_bouton_commencer_contexte(){ page_contexte = false page_inscription = true //page_vues = true - interactions.push({"time": new Date().getTime(), "type": "fin contexte - debut inscription"}) + interactions.push({"time": new Date().getTime(), "type": get_message("fin_contexte", [])}) } function afficher_bouton_commencer_contexte(){ @@ -179,7 +179,7 @@ function action_revenir_page_avant_contexte(){ num_avertissement = avertissements_a_afficher.length-1 init_clavier_avertissement() document.removeEventListener("keydown", action_clavier_contexte) - interactions.push({"time": new Date().getTime(), "type": "retour avertissement"}) + interactions.push({"time": new Date().getTime(), "type": get_message("retour_avertissement", [])}) } //////////////////////////////////////////////////////////////////// diff --git a/static/fonctions_explication_analyse.js b/static/fonctions_explication_analyse.js index 0460f9d..313a09c 100644 --- a/static/fonctions_explication_analyse.js +++ b/static/fonctions_explication_analyse.js @@ -19,7 +19,7 @@ function action_bouton_commencer_explication_analyse(){ page_explication_analyse = false page_analyse = true //page_vues = true - interactions.push({"time": new Date().getTime(), "type": "fin explication analyse - debut analyse"}) + interactions.push({"time": new Date().getTime(), "type": get_message("fin_explication_analyse", [])}) } function afficher_bouton_commencer_explication_analyse(){ diff --git a/static/fonctions_explications.js b/static/fonctions_explications.js index c6d2706..26b4d0c 100644 --- a/static/fonctions_explications.js +++ b/static/fonctions_explications.js @@ -485,7 +485,7 @@ function action_fin_explication(){ page_explication = false //page_explication_bis = true page_warning = true - interactions.push({"time": new Date().getTime(), "type": "fin tutorial - debut warning"}) + interactions.push({"time": new Date().getTime(), "type": get_message("fin_tutorial", [])}) } function action_previous_explication(){ @@ -629,7 +629,7 @@ function afficher_bouton_commencer_explication(){ function action_bouton_commencer_explication(){ page_explication_bis = false page_vues = true - interactions.push({"time": new Date().getTime(), "type": "debut choix vues"}) + interactions.push({"time": new Date().getTime(), "type": get_message("debut_choix", []) }) } diff --git a/static/fonctions_inscription.js b/static/fonctions_inscription.js index 206d246..c51d374 100644 --- a/static/fonctions_inscription.js +++ b/static/fonctions_inscription.js @@ -53,7 +53,7 @@ function action_bouton_commencer_inscription(){ page_inscription = false //page_vues = true page_explication = true - interactions.push({"time": new Date().getTime(), "type": "debut tutorial"}) + interactions.push({"time": new Date().getTime(), "type": get_message("debut_tutorial", [])}) //gestion des données personnelle de l'utilisateur //gestion_donnees_personnelles() @@ -83,7 +83,7 @@ function action_bouton_skip_inscription(){ page_warning = true //page_vues = true skiped = true - interactions.push({"time": new Date().getTime(), "type": "skip tutorial - debut warning"}) + interactions.push({"time": new Date().getTime(), "type": get_message("skip", []) }) document.removeEventListener("keydown", action_clavier_inscription) num_action = 0 nb_action = 1 @@ -114,7 +114,7 @@ function action_bouton_suivant_inscription(){ inscription_finie = true gestion_donnees_personnelles() ctx.clearRect(0, 0, canvas.width, canvas.height) - interactions.push({"time": new Date().getTime(), "type": "fin inscription - choix tutorial"}) + interactions.push({"time": new Date().getTime(), "type":get_message("fin_inscription", []) }) } diff --git a/static/fonctions_warnings.js b/static/fonctions_warnings.js index 8630e39..ce5cb6c 100644 --- a/static/fonctions_warnings.js +++ b/static/fonctions_warnings.js @@ -28,7 +28,7 @@ function action_bouton_commencer_warning(){ page_warning = false page_explication_bis = true //page_vues = true - interactions.push({"time": new Date().getTime(), "type": "fin warning - bouton commencer choix vues"}) + interactions.push({"time": new Date().getTime(), "type": get_message("fin_warning", [])}) } function afficher_bouton_commencer_warning(){ diff --git a/static/interaction_messages.js b/static/interaction_messages.js new file mode 100644 index 0000000..259acb1 --- /dev/null +++ b/static/interaction_messages.js @@ -0,0 +1,57 @@ +function get_message(message_nom, arguments){ + let interaction_messages = {} + interaction_messages['debut_etude'] = 'start' + interaction_messages['fin_avertissement'] = "fin avertissement - debut contexte" + interaction_messages['retour_avertissement'] = "retour avertissement" + interaction_messages['fin_contexte'] = "fin contexte - debut inscription" + interaction_messages['fin_inscription'] = "fin inscription - choix tutorial" + interaction_messages['skip'] = "skip tutorial - debut warning" + interaction_messages['debut_tutorial'] = "debut tutorial" + interaction_messages['fin_tutorial'] = "fin tutorial - debut warning" + interaction_messages['fin_warning'] = "fin warning - bouton commencer choix vues" + interaction_messages['debut_choix'] = "debut choix vues" + interaction_messages['debut_tache_i'] = "debut tache n°"+(arguments[0]) + interaction_messages['fin_tache_i'] = "fin tache n°"+(arguments[0]) + interaction_messages['fin_choix'] = "fin choix vues - debut explication analyse" + + interaction_messages['affichage_mesh_IJ'] = "Affichage Mesh random : "+arguments[0]+" en idx_i, idx_j : ("+arguments[1]+", "+arguments[2]+")" + interaction_messages['affichage_mesh_TD'] = "Affichage Mesh random : "+arguments[0]+" en theta, delta : ("+arguments[1]+", "+arguments[2]+")" + + interaction_messages['FG'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" fleche gauche ("+arguments[2]+","+arguments[3]+')' + interaction_messages['FD'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" fleche droite ("+arguments[2]+","+arguments[3]+')' + interaction_messages['FH'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" fleche haut ("+arguments[2]+","+arguments[3]+')' + interaction_messages['FB'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" fleche bas ("+arguments[2]+","+arguments[3]+')' + + interaction_messages['erreur_FH'] = "Affichage error a cause de fleche haut" + interaction_messages['erreur_FB'] = "Affichage error a cause de fleche bas" + + interaction_messages['switch_haut_i'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" fleche switch haut de la pose n°"+(arguments[2]+1) + interaction_messages['switch_bas_i'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" fleche switch bas de la pose n°"+(arguments[2]+1) + interaction_messages['supp_pose_i'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" suppression de la pose n°"+(arguments[2]+1) + + interaction_messages['bouton_select'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" choix n°"+(arguments[2]+1)+" bouton pose :("+arguments[3]+", "+arguments[4]+")" + interaction_messages['bouton_remove'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" bouton retirer" + interaction_messages['bouton_reset'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" bouton reinitialiser" + interaction_messages['bouton_valider'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" bouton valider" + interaction_messages['bouton_raz'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" bouton raz" + interaction_messages['bouton_raz_check'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" bouton raz check" + interaction_messages['bouton_raz_croix'] = "T"+arguments[0]+" Ch_fait"+arguments[1]+" bouton raz croix" + + interaction_messages['erreur_reset_impossible'] = "Affichage error aucun choix fait donc pas de reinitialisation possible" + interaction_messages['erreur_pas_de_pose'] = "Affichage error pas de pose a retirer" + interaction_messages['erreur_choix_fait'] = "Affichage error "+arguments[0]+" deja fait" + interaction_messages['erreur_pose_selectionnee'] = "Affichage error pose deja sélectionnee" + interaction_messages['erreur_valider'] = "Affichage error a cause du bouton valider" + + interaction_messages['fin_explication_analyse'] = "fin explication analyse - debut analyse" + interaction_messages['debut_analyse'] = "debut analyse n°1" + interaction_messages['bouton_valider_analyse'] = "bouton valider analyse" + interaction_messages['debut_analyse_i'] = "debut analyse n°"+(arguments[0]+1) + interaction_messages['ajout_check'] = "ajout check sur : analyse n°"+(arguments[0]+1)+", mot "+arguments[1] + interaction_messages['retrait_check'] = "retrait check sur : analyse n°"+(arguments[0]+1)+", mot "+arguments[1] + interaction_messages['fin_analyse'] = "fin analyse" + interaction_messages['fin_etude'] = "envoie des donnees - fin etude" + + return interaction_messages[message_nom] + +} \ No newline at end of file