Skip to content

Commit 4afbe54

Browse files
committed
fixing focus step
1 parent d139089 commit 4afbe54

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

autograder/services/focus_service.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,13 @@ def __process_category(self, category: CategoryResultNode) -> List[FocusedTest]:
6969

7070
# Initial Multiplier for a Category Root is 1.0 (100%)
7171
# Logic follows the same split as Subject if subjects_weight exists
72-
subj_mult = 1.0
73-
test_mult = 1.0
72+
initial_mult = category.weight / 100.0
73+
subj_mult = initial_mult
74+
test_mult = initial_mult
7475

7576
if category.subjects_weight is not None:
76-
subj_mult = category.subjects_weight / 100
77-
test_mult = (100 - category.subjects_weight) / 100
77+
subj_mult *= category.subjects_weight / 100.0
78+
test_mult *= (100.0 - category.subjects_weight) / 100.0
7879

7980
for subject in category.subjects:
8081
child_weight_factor = subject.weight / 100

autograder/steps/focus_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22

33
from autograder.models.abstract.step import Step
4-
from autograder.models.dataclass.step_result import StepResult, StepStatus
4+
from autograder.models.dataclass.step_result import StepName, StepResult, StepStatus
55
from autograder.models.pipeline_execution import PipelineExecution
66
from autograder.services.focus_service import FocusService
77

0 commit comments

Comments
 (0)