page analyse preque ok

This commit is contained in:
mpelissi 2023-03-18 20:26:13 +01:00
parent 417055a1f6
commit d9a863489f
4 changed files with 157 additions and 115 deletions

View File

@ -43,12 +43,12 @@ function init_variable(premier_appel){
indice_mesh = 0 // indice du premier mesh à visionner indice_mesh = 0 // indice du premier mesh à visionner
mesh_courant = "nope" // nom des mesh mesh_courant = "nope" // nom des mesh
// nombre de mesh a visionner AU TOTAL // nombre de mesh a visionner AU TOTAL
nb_mesh = 4 //3 nb_mesh = 2 //3
// random nom mesh // 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']) 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'])
// nb analyse demandé // nb analyse demandé
nb_analyse_demande = 3 nb_analyse_demande = 2
list_idx_tache =[] list_idx_tache =[]
for (let p=0; p<nb_mesh; p++){list_idx_tache.push(p+1)} for (let p=0; p<nb_mesh; p++){list_idx_tache.push(p+1)}
list_idx_tache = shuffle(list_idx_tache) list_idx_tache = shuffle(list_idx_tache)
@ -89,8 +89,8 @@ function init_variable(premier_appel){
page_explication = false page_explication = false
page_warning = false page_warning = false
page_explication_bis = false page_explication_bis = false
page_vues = false // false page_vues = true // false
page_explication_analyse = true page_explication_analyse = false
page_analyse = false page_analyse = false
// cas raz : on recommence juste la partie vues // cas raz : on recommence juste la partie vues
} else { } else {
@ -113,6 +113,7 @@ function init_variable(premier_appel){
premier_tour_page_explications = true premier_tour_page_explications = true
premier_tour_page_warning = true premier_tour_page_warning = true
premier_tour_page_vues = true premier_tour_page_vues = true
premier_tour_page_explication_analyse = true
premier_tour_page_analyse = true premier_tour_page_analyse = true
// message de fin // message de fin
@ -285,6 +286,7 @@ function init_data(){
boutons["choix_pose"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_pose.png') boutons["choix_pose"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_pose.png')
boutons["retirer"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_retirer.png') boutons["retirer"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_retirer.png')
boutons["commencer"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer.png') boutons["commencer"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer.png')
boutons["commencer_petit"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer_petit.png')
boutons["commencer_choix"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer_choix.png') boutons["commencer_choix"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer_choix.png')
boutons["commencer_tuto"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer_tuto.png') boutons["commencer_tuto"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer_tuto.png')
boutons["commencer_inscription"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer_inscription.png') boutons["commencer_inscription"] = new_image('https://raw.githubusercontent.com/PelissierCombescure/BVS-study/main/graphics/Boutons/bouton_commencer_inscription.png')
@ -461,11 +463,11 @@ function animate() {
// on enlève les touches du clavier associé à la page vues // on enlève les touches du clavier associé à la page vues
document.removeEventListener("keydown", action_clavier_vues) document.removeEventListener("keydown", action_clavier_vues)
// inti clavier // inti clavier
if(premier_tour_page_analyse){ if(premier_tour_page_explication_analyse){
interactions.push({"time": new Date().getTime(), "type": "Début analyse n°1"}) interactions.push({"time": new Date().getTime(), "type": "Début explication analyse"})
init_clavier_analyse() init_clavier_explication_analyse()
init_textes_explication_analyses() init_textes_explication_analyses()
premier_tour_page_analyse = false} premier_tour_page_explication_analyse = false}
ctx.clearRect(0, 0, canvas.width, canvas.height) ctx.clearRect(0, 0, canvas.width, canvas.height)
traitement_explication_analyses() traitement_explication_analyses()
@ -475,14 +477,16 @@ function animate() {
// page analyse // page analyse
if (page_analyse){ if (page_analyse){
console.log("boucle analyse") console.log("boucle analyse")
// // inti clavier // on enlève les touches du clavier associé à la page vues
// if(premier_tour_page_analyse){ document.removeEventListener("keydown", action_clavier_explication_analyse)
// interactions.push({"time": new Date().getTime(), "type": "Début analyse n°1"}) // inti clavier
// init_clavier_analyse() if(premier_tour_page_analyse){
// premier_tour_page_analyse = false} interactions.push({"time": new Date().getTime(), "type": "Début analyse n°1"})
init_clavier_analyse()
init_variable_analyse()
premier_tour_page_analyse = false}
//ctx.clearRect(0, 0, canvas.width, canvas.height) ctx.clearRect(0, 0, canvas.width, canvas.height)
init_variable_analyse()
traitement_fin() traitement_fin()
} }

View File

@ -1,56 +1,54 @@
// liste des checkbox clické pour chaque recap
checkbox_clicked_courant = {idx_checkbox:[], mots:[]}
// nuemro init de l'analyse // nuemro init de l'analyse
num_analyse = 0 num_analyse = 0
idx_tache = 0 // ATTENTION ça commence à 1 idx_tache = 0 // ATTENTION ça commence à 1
h_bouton_analyse = 0.1*window.innerHeight
// Variable // Variable
function init_variable_analyse(){ function init_variable_analyse(){
w_checkbox = 30 // liste des checkbox clické pour chaque recap
h_checkbox = 30 checkbox_clicked_courant = {}
y_checkbox = window.innerHeight*0.75 for (let p=0; p<nb_choix_demande; p++){
checkbox_clicked_courant["Viewpoint_"+(p+1)] = {idx_checkbox:[], mots:[]}
}
// Analayse des choix avec les checkboxs // Analayse des choix avec les checkboxs
keywords = ["1. De face", "2. De profil", "3. Debout", "4. Eyes contact", "5. toto"] keywords = ["1. De face", "2. De profil", "3. Debout", "4. Eyes contact", "5. toto"]
w_bouton = 50 y_recap = 0.2*window.innerHeight
h_bouton = 50 taille_texte_explication = 0.01*window.innerWidth
w_valider = w_bouton*1.2 x_recap_init = (window.innerWidth - nb_choix_demande*(H_3D/2))/(nb_choix_demande+1)
h_valider = h_bouton*1.2
x_valider = (window.innerWidth/2)-w_valider/2 // checkbox
y_valider = window.innerHeight-(h_valider*1.5) w_checkbox = 20
h_checkbox = 20
y_checkbox_init = y_recap + H_3D/2 + h_checkbox
} }
function affichage_legende(pos){ function affichage_legende(pos){
x_image = dx + (ecart_analyse+ W_3D/2.5)*pos x_image = (pos+1)*x_recap_init + pos*(H_3D/2)
ctx.strokeStyle = "rgb(255, 255, 255)"; ctx.fillStyle = "rgb(255, 255, 255)" ctx.strokeStyle = "rgb(255, 255, 255)"; ctx.fillStyle = "rgb(255, 255, 255)"
if (pos==0){print_text(handle_text("Best viewpoint:", x_image, 220, "20pt Courier", longueur_max_recap))} if (pos==0){print_text(handle_text("Best viewpoint:", x_image, y_recap-10, taille_texte_explication+"pt Courier", longueur_max_recap))}
if (pos==1){print_text(handle_text("2nd viewpoint:", x_image, 220, "20pt Courier", longueur_max_recap))} if (pos==1){print_text(handle_text("2nd viewpoint:", x_image, y_recap-10, taille_texte_explication+"pt Courier", longueur_max_recap))}
if (pos==2){print_text(handle_text("3rd viewpoint:", x_image, 220, "20pt Courier", longueur_max_recap))} if (pos==2){print_text(handle_text("3rd viewpoint:", x_image, y_recap-10, taille_texte_explication+"pt Courier", longueur_max_recap))}
} }
function affichage_texte(){ function affichage_texte(){
w_bouton_commencer = scale_bouton_commencer*boutons["commencer"].width
h_bouton_commencer = scale_bouton_commencer*boutons["commencer"].height
// Texte // Texte
draw_rectangle(0,0,canvas.width, canvas.height, "rgb(3, 26, 33)", 1) // ou + clair 4, 38, 48 draw_rectangle(0,0,canvas.width, canvas.height, "rgb(3, 26, 33)", 1) // ou + clair 4, 38, 48
ctx.strokeStyle = "rgb(255, 255, 255)" // Pour que le contour soit rouge affichage_titre("Analysis your choices", (0.018*window.innerWidth)+"pt Courier", "#EF476F", yt = 0.1*window.innerHeight)
ctx.fillStyle = "rgb(255, 255, 255)" // Pour que l'intérieur soit bleu
ctx.font = "bold 32pt Courier";
ctx.fillText("Analysis about your choices", (window.innerWidth/3), 70)
} }
// idx_tache est la num de la tache à aller chercher dans all_ctxMins // idx_tache est la num de la tache à aller chercher dans all_ctxMins
function affichage_analyse(idx_tache){ function affichage_analyse(idx_tache){
ecart_analyse = 50
dx = (window.innerWidth - canvasMins.length*(W_3D/2.5) - (canvasMins.length-1)*(ecart_analyse))*0.5
canvasMins = all_canvasMins['tache_N'+list_idx_tache[idx_tache]][1] canvasMins = all_canvasMins['tache_N'+list_idx_tache[idx_tache]][1]
for (let i=0; i<canvasMins.length; i++){ for (let i=0; i<nb_choix_demande; i++){
affichage_legende(i) affichage_legende(i)
ctx.drawImage(canvasMins[i], dx + (ecart_analyse+ W_3D/2.5)*i, 250, H_3D/2, H_3D/2) x_recap = (i+1)*x_recap_init + i*(H_3D/2)
//draw_contour(dx + (ecart_analyse+ W_3D/2.5)*i, 250, W_3D/2.5, H_3D/2.5, "rgb(255,0,0)") ctx.drawImage(canvasMins[i], x_recap, y_recap, H_3D/2, H_3D/2)
//draw_contour(dx + (ecart_analyse+ W_3D/2.5)*i, 250, H_3D/2.5, H_3D/2.5, "rgb(255,0,0)")
} }
} }
@ -73,27 +71,46 @@ function progress_bar_analyse(N_analyse, N_analyse_total){
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
///////////////////// Bouton ///////////////////// Bouton
function affichage_bouton_valider_analyse(){ function affichage_bouton_valider_analyse(m){
ratio_bouton_analyse = h_bouton_analyse/boutons["valider"].height
w_bouton_analyse = ratio_bouton_analyse*boutons["valider"].width
h_bouton_analyse = h_bouton_analyse
x_bouton_analyse = (window.innerWidth/2) - w_bouton_analyse/2
y_bouton_analyse = window.innerHeight - h_bouton_analyse - 20
// si au moins un mot est coché // si au moins un mot est coché
if (checkbox_clicked_courant.idx_checkbox.length>0){ if (condition_valider()){
// affichage bouton valider // affichage bouton valider
ctx.drawImage(boutons["valider"], x_valider, y_valider, w_valider, h_valider) if (m == "en_cours")
{ctx.drawImage(boutons["valider"], x_bouton_analyse, y_bouton_analyse, w_bouton_analyse, h_bouton_analyse)}
else{ctx.drawImage(boutons["envoie_data"], x_bouton_analyse, y_bouton_analyse, w_bouton_analyse, h_bouton_analyse)}
// survol // survol
if(is_inside(xyMouseMove, x_valider, y_valider, w_valider, h_valider)){ if(is_inside(xyMouseMove, x_bouton_analyse, y_bouton_analyse, w_bouton_analyse, h_bouton_analyse)){
draw_rectangle(x_valider, y_valider, w_valider, h_valider, "rgb(200, 200, 200)", 0.6) draw_rectangle(x_bouton_analyse, y_bouton_analyse, w_bouton_analyse, h_bouton_analyse, "rgb(200, 200, 200)", 0.6)
} }
} }
} }
function condition_valider(){
for(let k=0; k<nb_choix_demande;k++){
if (checkbox_clicked_courant['Viewpoint_'+(k+1)].idx_checkbox.length == 0){
return false
}
}
return true
}
function action_bouton_valider_analyse(){ function action_bouton_valider_analyse(){
interactions.push({"time": new Date().getTime(), "type": "Bouton valider analyse."}) interactions.push({"time": new Date().getTime(), "type": "Bouton valider analyse."})
// si au moins un mot est coché et qu'il reste des analyse à faire // si au moins un mot est coché et qu'il reste des analyse à faire
if (checkbox_clicked_courant.idx_checkbox.length>0){ if (condition_valider()){
// sauvegarde des checkbox clikée et les mesh // sauvegarde des checkbox clikée et les mesh
checkbox_clicked['analyse_N'+(num_analyse+1)] = {"mesh" : choix["tache_N"+list_idx_tache[idx_tache]].mesh ,"idx" : checkbox_clicked_courant.idx_checkbox, "mots": checkbox_clicked_courant.mots} checkbox_clicked['Analyse_N'+(num_analyse+1)] = {"mesh" : choix["tache_N"+list_idx_tache[idx_tache]].mesh ,"Checkbox" : checkbox_clicked_courant}
//RAZ pour la prochaine analyse //RAZ pour la prochaine analyse
checkbox_clicked_courant = {idx_checkbox:[], mots:[]} checkbox_clicked_courant = {}
for (let p=0; p<nb_choix_demande; p++){
checkbox_clicked_courant["Viewpoint_"+(p+1)] = {idx_checkbox:[], mots:[]}
}
// analyse suivant // analyse suivant
num_analyse = num_analyse + 1 num_analyse = num_analyse + 1
// indice mesh da l'analyse suivante // indice mesh da l'analyse suivante
@ -107,63 +124,52 @@ function action_bouton_valider_analyse(){
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
///////////////////// Checkbox ///////////////////// Checkbox
function traitement_empty_checkbox(num_analyse){ function traitement_empty_checkbox(){
for (let i = 0 ; i < keywords.length; i++){ for(let p=0; p<nb_choix_demande; p++){
// checkbox vide for (let i = 0 ; i < keywords.length; i++){
x_checkbox = 200 + 300*(i) // checkbox vide
ctx.drawImage(imgs["checkbox"], x_checkbox , y_checkbox, w_checkbox, h_checkbox) x_checkbox = (p+1)*x_recap_init + p*(H_3D/2)
// Texte y_checkbox = y_checkbox_init + (h_checkbox* 1.5)*i
print_text(handle_text(keywords[i], x_checkbox + w_checkbox + 30, y_checkbox + 20, "14pt Courier", longueur_max_error)) ctx.drawImage(imgs["checkbox"], x_checkbox , y_checkbox, w_checkbox, h_checkbox)
// survol // Texte
if (is_inside(xyMouseMove, x_checkbox, y_checkbox, w_checkbox, h_checkbox)){ print_text(handle_text(keywords[i], x_checkbox + w_checkbox + 30, y_checkbox + 20, taille_texte_explication+"pt Courier", longueur_max_error))
draw_rectangle(x_checkbox, y_checkbox, w_checkbox, h_checkbox, "rgb(0, 255, 0)", alpha_survol) // survol
} if (is_inside(xyMouseMove, x_checkbox, y_checkbox, w_checkbox, h_checkbox)){
// clicked draw_rectangle(x_checkbox, y_checkbox, w_checkbox, h_checkbox, "rgb(0, 255, 0)", alpha_survol)
if (clicked && is_inside(xyMouseMove, x_checkbox, y_checkbox, w_checkbox, h_checkbox)){ }
// s'il n'y a pas deja un check dessus // clicked
// if (checkbox_clicked_courant.idx_checkbox.indexOf(i) == -1){ if (clicked && is_inside(xyMouseMove, x_checkbox, y_checkbox, w_checkbox, h_checkbox)){
// checkbox_clicked_courant.idx_checkbox.push(i) check_ou_decheck(i,p)
// checkbox_clicked_courant.mots.push(keywords[i]) }
// interactions.push({"time": new Date().getTime(), "type": "ajout check sur : analyse n°"+(num_analyse+1)+", mot "+keywords[i]})
// console.log('ajout '+keywords[i])
// }
// else{
// position_i = checkbox_clicked_courant.idx_checkbox.indexOf(i)
// checkbox_clicked_courant.idx_checkbox.splice(position_i,1)
// checkbox_clicked_courant.mots.splice(position_i,1)
// console.log('retrait '+keywords[i])
// interactions.push({"time": new Date().getTime(), "type": "retrait check sur : analyse n°"+(num_analyse+1)+", mot "+keywords[i]})
// }
check_ou_decheck(i)
} }
} }
} }
function check_ou_decheck(pos){ function check_ou_decheck(i_mot, p_vue){
//s'il n'y a pas deja un check dessus //s'il n'y a pas deja un check dessus
if (checkbox_clicked_courant.idx_checkbox.indexOf(pos) == -1){ if (checkbox_clicked_courant["Viewpoint_"+(p_vue+1)].idx_checkbox.indexOf(i_mot) == -1){
checkbox_clicked_courant.idx_checkbox.push(pos) checkbox_clicked_courant["Viewpoint_"+(p_vue+1)].idx_checkbox.push(i_mot)
checkbox_clicked_courant.mots.push(keywords[pos]) checkbox_clicked_courant["Viewpoint_"+(p_vue+1)].mots.push(keywords[i_mot])
interactions.push({"time": new Date().getTime(), "type": "ajout check sur : analyse n°"+(num_analyse+1)+", mot "+keywords[pos]}) interactions.push({"time": new Date().getTime(), "type": "ajout check sur : analyse n°"+(num_analyse+1)+", mot "+keywords[i_mot]+" à "+(p_vue+1)+"e vues"})
console.log('ajout '+keywords[pos]) console.log("ajout "+keywords[i_mot]+" à "+(p_vue+1)+"e vues")
} }
else{ else{
position_i = checkbox_clicked_courant.idx_checkbox.indexOf(pos) position_i = checkbox_clicked_courant["Viewpoint_"+(p_vue+1)].idx_checkbox.indexOf(i_mot)
checkbox_clicked_courant.idx_checkbox.splice(position_i,1) checkbox_clicked_courant["Viewpoint_"+(p_vue+1)].idx_checkbox.splice(position_i,1)
checkbox_clicked_courant.mots.splice(position_i,1) checkbox_clicked_courant["Viewpoint_"+(p_vue+1)].mots.splice(position_i,1)
console.log('retrait '+keywords[pos]) console.log("retrait "+keywords[i_mot]+" à "+(p_vue+1)+"e vues")
interactions.push({"time": new Date().getTime(), "type": "retrait check sur : analyse n°"+(num_analyse+1)+", mot "+keywords[pos]}) interactions.push({"time": new Date().getTime(), "type": "retrait check sur : analyse n°"+(num_analyse+1)+", mot "+keywords[i_mot]+" à "+(p_vue+1)+"e vues"})
} }
} }
function draw_check(){ function draw_check(p_vue){
idx_check = checkbox_clicked_courant.idx_checkbox idx_check = checkbox_clicked_courant["Viewpoint_"+(p_vue+1)].idx_checkbox
// pour chacune de ces checkbox cliquée on affiche un check // pour chacune de ces checkbox cliquée on affiche un check
for (let i = 0 ; i < idx_check.length; i++){ for (let i = 0 ; i < idx_check.length; i++){
pos = idx_check[i] pos = idx_check[i]
x_checkbox = 200 + 300*(pos) x_checkbox = (p_vue+1)*x_recap_init + p_vue*(H_3D/2)
y_checkbox = y_checkbox_init + (h_checkbox* 1.5)*pos
ctx.drawImage(imgs["check"], x_checkbox-5 , y_checkbox-5, w_checkbox+10, h_checkbox+10) ctx.drawImage(imgs["check"], x_checkbox-5 , y_checkbox-5, w_checkbox+10, h_checkbox+10)
} }
} }
@ -175,17 +181,21 @@ function traitement_fin(){
// affiche les textes de la page sauf les ceheckbox // affiche les textes de la page sauf les ceheckbox
affichage_texte() affichage_texte()
// afficher les checkbox et gerer les click ou declick // afficher les checkbox et gerer les click ou declick
traitement_empty_checkbox(num_analyse) traitement_empty_checkbox()
// affiche les check vert en fonction de ce qu'il y a dans checkbox_clicked_courant // affiche les check vert en fonction de ce qu'il y a dans checkbox_clicked_courant
draw_check() for (let p =0; p<nb_choix_demande;p++){draw_check(p)}
// affiche les nb_demande_choix images recap // affiche les nb_demande_choix images recap
affichage_analyse(idx_tache) affichage_analyse(idx_tache)
// affiche progress bar // affiche progress bar
progress_bar_analyse(num_analyse, nb_analyse_demande) progress_bar_analyse(num_analyse, nb_analyse_demande)
// bouton valider if (num_analyse < nb_analyse_demande-1){
affichage_bouton_valider_analyse() // bouton valider
affichage_bouton_valider_analyse("en_cours")}
else{
affichage_bouton_valider_analyse("fin")
}
// action si bouton valider // action si bouton valider
if (clicked && is_inside(xyMouseMove, x_valider, y_valider, w_valider, h_valider)){ if (clicked && is_inside(xyMouseMove, x_bouton_analyse, y_bouton_analyse, w_bouton_analyse, h_bouton_analyse)){
action_bouton_valider_analyse() action_bouton_valider_analyse()
} }
} }

View File

@ -84,6 +84,9 @@ function action_clavier_vues(event){
} }
} }
function action_clavier_analyse(event){ function action_clavier_analyse(event){
switch (event.key){ switch (event.key){
// selectionner pose // selectionner pose
@ -91,21 +94,21 @@ function action_clavier_analyse(event){
case 'Enter': case 'Enter':
action_bouton_valider_analyse() action_bouton_valider_analyse()
break; break;
case '1': // case '1':
check_ou_decheck(0) // check_ou_decheck(0)
break; // break;
case '2': // case '2':
check_ou_decheck(1) // check_ou_decheck(1)
break; // break;
case '3': // case '3':
check_ou_decheck(2) // check_ou_decheck(2)
break; // break;
case '4': // case '4':
check_ou_decheck(3) // check_ou_decheck(3)
break; // break;
case '5': // case '5':
check_ou_decheck(4) // check_ou_decheck(4)
break; // break;
} }
} }
@ -127,6 +130,11 @@ function init_clavier_vues(){
document.addEventListener("keydown", action_clavier_vues) document.addEventListener("keydown", action_clavier_vues)
} }
function init_clavier_explication_analyse(){
document.addEventListener("keydown", action_clavier_explication_analyse)
}
function init_clavier_analyse(){ function init_clavier_analyse(){
document.addEventListener("keydown", action_clavier_analyse) document.addEventListener("keydown", action_clavier_analyse)
} }

View File

@ -19,7 +19,7 @@ function action_bouton_commencer_explication_analyse(){
page_explication_analyse = false page_explication_analyse = false
page_analyse = true page_analyse = true
//page_vues = true //page_vues = true
interactions.push({"time": new Date().getTime(), "type": "Fin warning"}) interactions.push({"time": new Date().getTime(), "type": "Fin explication analyse"})
} }
function afficher_bouton_commencer_explication_analyse(){ function afficher_bouton_commencer_explication_analyse(){
@ -28,7 +28,7 @@ function afficher_bouton_commencer_explication_analyse(){
x_bouton_commencer = x_bouton_suivant x_bouton_commencer = x_bouton_suivant
y_bouton_commencer = y_bouton_suivant y_bouton_commencer = y_bouton_suivant
// Bouton commencer // Bouton commencer
ctx.drawImage(boutons["commencer"], x_bouton_commencer, y_bouton_commencer , w_bouton_commencer, h_bouton_commencer) ctx.drawImage(boutons["commencer_petit"], x_bouton_commencer, y_bouton_commencer , w_bouton_commencer, h_bouton_commencer)
// Survol // Survol
if(xyMouseMove.x >= x_bouton_commencer && xyMouseMove.x <= x_bouton_commencer + w_bouton_commencer && xyMouseMove.y > y_bouton_commencer && xyMouseMove.y < y_bouton_commencer + h_bouton_commencer){ if(xyMouseMove.x >= x_bouton_commencer && xyMouseMove.x <= x_bouton_commencer + w_bouton_commencer && xyMouseMove.y > y_bouton_commencer && xyMouseMove.y < y_bouton_commencer + h_bouton_commencer){
@ -133,6 +133,26 @@ function traitement_explication_analyses(){
} }
function action_clavier_explication_analyse(event){
switch (event.key){
// selectionner pose
// valider
case 'Enter':
if (num_explication_analyse < (explications_analyse_page_1.length)-1){
action_bouton_suivant_explication_analyse()}
else{
action_bouton_commencer_explication_analyse()
}
break;
case 'Backspace':
if(num_explication_analyse > 0){
action_bouton_avant_explication_analyse()
}
break;
}
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
///// Textes ///// Textes