@@ -152,18 +152,25 @@ class PredefenceEightToTenMinutesNoSlideCheckFeedbackEvaluator(FeedbackEvaluator
152152 FEEDBACK_EVALUATOR_ID = 6
153153
154154 def __init__ (self , weights = None ):
155+ self .ssd_criterion = None
155156 if weights is None :
156157 weights = {
157- "PredefenceStrictSpeechDurationCriterion " : 0.6 ,
158+ "StrictSpeechDurationCriterion " : 0.6 ,
158159 "DEFAULT_SPEECH_PACE_CRITERION" : 0.2 ,
159160 "DEFAULT_FILLERS_NUMBER_CRITERION" : 0.2 ,
160161 }
161162
162163 super ().__init__ (name = PredefenceEightToTenMinutesNoSlideCheckFeedbackEvaluator .CLASS_NAME , weights = weights )
163164
165+ def find_strict_speech_duration_criterion (self , criteria_keys , suffix = 'StrictSpeechDurationCriterion' ):
166+ for criteria in criteria_keys :
167+ if suffix in criteria :
168+ return criteria
169+
164170 def evaluate_feedback (self , criteria_results ):
165- if not criteria_results .get ("PredefenceStrictSpeechDurationCriterion" ) or \
166- criteria_results ["PredefenceStrictSpeechDurationCriterion" ].result == 0 :
171+ self .ssd_criterion = self .find_strict_speech_duration_criterion (criteria_results .keys ())
172+ if not criteria_results .get (self .ssd_criterion ) or \
173+ criteria_results [self .ssd_criterion ].result == 0 :
167174 return Feedback (0 )
168175 if not criteria_results .get ("DEFAULT_SPEECH_PACE_CRITERION" ) or \
169176 criteria_results ["DEFAULT_SPEECH_PACE_CRITERION" ].result == 0 :
@@ -172,7 +179,7 @@ def evaluate_feedback(self, criteria_results):
172179
173180 def get_result_as_sum_str (self , criteria_results ):
174181 if criteria_results is None or self .weights is None or \
175- criteria_results .get ("PredefenceStrictSpeechDurationCriterion" , {}).get ('result' , 0 ) == 0 or \
182+ criteria_results .get (self . ssd_criterion , {}).get ('result' , 0 ) == 0 or \
176183 criteria_results .get ("DEFAULT_SPEECH_PACE_CRITERION" , {}).get ('result' , 0 ) == 0 :
177184 return None
178185 return super ().get_result_as_sum_str (criteria_results )
0 commit comments