Enum structure in core for Automatic/Manual trigger for moving to next level
Open, Needs TriagePublic

Description

In many activities where we have to implement an option where a user can choose to either automatically switch to next level when a level is successfully completed, or manually trigger an event to move to next level.
Example activities;

  1. number_sequence and its derivatives
  2. erase activity and its derivatives (MR Link)

Here, we are using an integer value named 'mode' to store whether the activity should be running in Automatic / Manual trigger mode. This might lead to unexpected value in the variable 'mode', which might be difficult to debug later.

We propose to add a enum structure in the core activity dedicated for this purpose. In all future activities to be implemented, this would make it easy for us to add this option.
Originally proposed by @jjazeix here

hadron created this task.Feb 22 2021, 6:12 PM
hadron updated the task description. (Show Details)
hadron updated the task description. (Show Details)
jjazeix updated the task description. (Show Details)Feb 22 2021, 6:20 PM
hadron updated the task description. (Show Details)Feb 26 2021, 5:24 PM
hadron claimed this task.

According to https://stackoverflow.com/questions/34461378/how-can-we-declare-enumerations-in-qml-without-any-javascript, enum is a qml keyword since Qt5.10 but we want to handle previous versions so not an option.
Other solution is to use a singleton (except if there is something I don't see, the values should be readonly).
Third solution is to use a c++ enum: https://qml.guide/enums-in-qt-qml/

For this, we can now consider the minimal version is Qt6.5, so no need to try to be compatible with older versions. Maybe there are new solutions that have been implemented in Qt meanwhile