Forum Discussion

AnickChoquette-'s avatar
AnickChoquette-
Community Member
5 years ago

Décompte d'objets

Bonjour,

Je tente de faire un décompte des éléments devant être trouvés dans une slide à l'aide de HotSpot. Quand l'utilisateur clique sur un hotspot, il est dirigé vers un calque de rétroaction et, lorsqu'il clique sur le marqueur fermé, cela ajoute 1 à la variable décompte. 

Ensuite, sur mon calque de base, j'ai mis une boite de texte avec différents états (0 à 6) et je veux que l'état change quand l'utilisateur revient au calque de base en fonction de la valeur de la variable décompte (si c'est 2, le décompte affiche 2, etc.). J'ai donc ajouté un déclencheur par état sur le calque de base qui dit : change l'état de la boite de texte en 1 quand la chronologie de la diapo commence, si la variable décompte est égale à 1 (pour 0 à 6). Ça ne fonctionne pas. J'ai donc essayé quand la chronologie se termine ou atteint un point précis, ça ne fonctionne pas non plus. J'ai également ajouté un déclencheur sur les calques pour dire d'aller à 0 seconde du calque de base quand l'utilisateur ferme les calques de rétroaction pour que la chronologie recommence chaque fois, ça ne fonctionne toujours pas. Je suis à court d'idée. Quelqu'un peut m'aider avec cela?

Merci beaucoup!

8 Replies

  • Bonjour, Anick!

    Thank you for reaching out!

    If I understood correctly, you are trying to create a variable that counts the number of times the user clicks one or more hotspots, which would change the state of a textbox.

    My suggestion would be to use the trigger When the variable changes for the different states:

    Windows 10 (1) 2021-04-23 at 12.52.22 PM

    I'm attaching a sample .story file here. While I used a shape with states instead of a textbox, it should work the same way.

    Let me know if this works!

  • NBSNestle's avatar
    NBSNestle
    Community Member

    Hi Maria,

    your example is very good, however, could you please suggest how to create a trigger that will allow a user to click on the object only once?

    Because, now I can click on 1 person four time and the count will be 4/4, but it is not correct, as I need to click once per each person.

    Thanks,

    Liubov

  • Hi, NBS.

    I'm happy to help! Do you have a sample .story file you can share so I can see your setup so far?

    There are a few different ways to do this. For example, will the user be allowed to unselect a character (therefore lowering the count)?

  • NBSNestle's avatar
    NBSNestle
    Community Member

    Maria, the story in the attach.

    I have an issue on the slide 3, the user need to click on the each icon only once to account the score correct. 

  • Hi, NBS.

    Thank you for sharing the .story file!

    I believe adding a condition (If the state of Marker 1 is different than visited) to your trigger should do the trick:

    Windows 10 (1) 2022-03-17 at 11.07.05 AM

    As you can see below, the layer still shows up when the user clicks on an option again, but the counter doesn't increase:

    Screen Recording 2022-03-17 at 11.05.56 AM

    I'm attaching the edited file with my suggestion.

    I hope this helps!

  • Hi, NBS.

    I'm so happy it worked, and thank you for the super kind words! You made my day!

    As for the other post you linked, unfortunately, my knowledge in Javascript is very limited, and it's not something we offer support on. I'm hoping others in the community will be able to help you troubleshoot the code or provide you with another workaround.