diff --git a/src/core/AnswerButton.qml b/src/core/AnswerButton.qml --- a/src/core/AnswerButton.qml +++ b/src/core/AnswerButton.qml @@ -69,13 +69,19 @@ */ property color wrongStateColor: "#f66" + /** + * type: bool + * + * Set the external conditions to this variable during which the clicks on button are to be blocked. + */ + property bool blockClicksDuringExternalEvents: false + /** * type:bool * - * Set to true when to avoid misclicks or when correct/wrong answer - * animation are running. + * This variable holds the overall events during which the clicks on button will be blocked. */ - property bool blockClicks: false + readonly property bool blockClicks: correctAnswerAnimation.running || wrongAnswerAnimation.running || blockClicksDuringExternalEvents /** * type:int @@ -176,7 +182,6 @@ script: { if (typeof(feedback) === "object") feedback.playCorrectSound(); - blockClicks = true; if (typeof(particles) === "object") particles.burst(40); } @@ -197,7 +202,6 @@ } ScriptAction { script: { - blockClicks = false; correctlyPressed(); } }