@@ -162,13 +162,14 @@ def __init__(self, weights=None):
162162
163163 super ().__init__ (name = PredefenceEightToTenMinutesNoSlideCheckFeedbackEvaluator .CLASS_NAME , weights = weights )
164164
165- def find_strict_speech_duration_criterion (self , criteria_keys , suffix = 'StrictSpeechDurationCriterion' ):
165+ def rework_strict_speech_duration_criterion (self , criteria_keys , suffix = 'StrictSpeechDurationCriterion' ):
166166 for criteria in criteria_keys :
167167 if criteria .endswith (suffix ):
168+ self .weights [criteria ] = self .weights .pop ('StrictSpeechDurationCriterion' )
168169 return criteria
169170
170171 def evaluate_feedback (self , criteria_results ):
171- self .ssd_criterion = self .find_strict_speech_duration_criterion (criteria_results .keys ())
172+ self .ssd_criterion = self .rework_strict_speech_duration_criterion (criteria_results .keys ())
172173 if not criteria_results .get (self .ssd_criterion ) or \
173174 criteria_results [self .ssd_criterion ].result == 0 :
174175 return Feedback (0 )
@@ -178,15 +179,13 @@ def evaluate_feedback(self, criteria_results):
178179 return super ().evaluate_feedback (criteria_results )
179180
180181 def get_result_as_sum_str (self , criteria_results ):
181- self . ssd_criterion = self .find_strict_speech_duration_criterion ( criteria_results . keys ())
182-
182+ if not self .ssd_criterion :
183+ self . ssd_criterion = self . rework_strict_speech_duration_criterion ( criteria_results . keys ())
183184 if criteria_results is None or self .weights is None or \
184185 criteria_results .get (self .ssd_criterion , {}).get ('result' , 0 ) == 0 or \
185186 criteria_results .get ("DEFAULT_SPEECH_PACE_CRITERION" , {}).get ('result' , 0 ) == 0 :
186187 return None
187188
188- criteria_results ["StrictSpeechDurationCriterion" ] = criteria_results .pop (self .ssd_criterion )
189-
190189 return super ().get_result_as_sum_str (criteria_results )
191190
192191
0 commit comments