From f644d5c6dec3af8a3649d359682e2262492ebdb6 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Wed, 27 Mar 2019 15:43:02 +0100 Subject: [PATCH] Fix #24 - Timeout parameter whether to count it as a silence. --- hugvey/story.py | 7 ++++--- www/js/hugvey_console.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hugvey/story.py b/hugvey/story.py index 613713a..1570248 100644 --- a/hugvey/story.py +++ b/hugvey/story.py @@ -259,9 +259,10 @@ class Condition(object): # update stats: story.stats['timeouts'] +=1 - if story.currentReply is None or not story.currentReply.hasUtterances(): - story.stats['silentTimeouts'] +=1 - story.stats['consecutiveSilentTimeouts'] += 1 + if 'noReplyNeeded' not in self.vars or self.vars['noReplyNeeded'] is False: + if story.currentReply is None or not story.currentReply.hasUtterances(): + story.stats['silentTimeouts'] +=1 + story.stats['consecutiveSilentTimeouts'] += 1 return True diff --git a/www/js/hugvey_console.js b/www/js/hugvey_console.js index 0e4fa17..6419d3f 100644 --- a/www/js/hugvey_console.js +++ b/www/js/hugvey_console.js @@ -926,7 +926,8 @@ class Graph { return { 'timeout': { 'seconds': { 'type': 'number', 'value': 10, 'min': 0, 'step': 0.1, 'unit': "s" }, - 'onlyIfNoReply': { 'type': 'checkbox', label: "Only if no reply", "title": "This timeout is only used if the participant doesn't say a word. If the participant starts speaking within the time of this timeout condition, only other conditions are applicable." } + 'onlyIfNoReply': { 'type': 'checkbox', label: "Only if no reply", "title": "This timeout is only used if the participant doesn't say a word. If the participant starts speaking within the time of this timeout condition, only other conditions are applicable." }, + 'noReplyNeeded': { 'type': 'checkbox', label: "No reply needed", "title": "If checked, the timeout is not counted for consecutive-timeouts (for diversions)." }, }, 'replyContains': { 'delays.0.minReplyDuration': { 'type': 'number', 'value': 0, 'min': 0, 'step': 0.1, 'label': 'Delay 1 - reply duration', 'unit': "s", 'readonly': 'readonly' },