Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 547d6c4

Browse files
authored
fix(gui): treat annotations with reviewer but no review result as correct in quality view (#960)
1 parent 9024396 commit 547d6c4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

api-editor/gui/src/features/statistics/QualityStatistics.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ const QualityPieChart: React.FC<QualityPieChartProps> = function ({ annotationTy
5555

5656
const autogeneratedAnnotations = annotations.filter((it) => (it.authors ?? []).includes('$autogen$'));
5757
const numberOfCorrectAnnotations = autogeneratedAnnotations.filter(
58-
(it) => !it.isRemoved && it.reviewResult === ReviewResult.Correct && (it.authors ?? []).length <= 1,
58+
(it) => !it.isRemoved && isCorrect(it) && (it.authors ?? []).length <= 1,
5959
).length;
6060
const numberOfChangedAnnotations = autogeneratedAnnotations.filter(
61-
(it) => !it.isRemoved && it.reviewResult === ReviewResult.Correct && (it.authors ?? []).length > 1,
61+
(it) => !it.isRemoved && isCorrect(it) && (it.authors ?? []).length > 1,
6262
).length;
6363
const numberOfWrongOrRemovedAnnotations = autogeneratedAnnotations.filter(
6464
(it) => it.isRemoved || it.reviewResult === ReviewResult.Wrong,
@@ -104,3 +104,10 @@ const QualityPieChart: React.FC<QualityPieChartProps> = function ({ annotationTy
104104
</Box>
105105
);
106106
};
107+
108+
const isCorrect = function (annotation: Annotation): boolean {
109+
return (
110+
annotation.reviewResult === ReviewResult.Correct ||
111+
((annotation.reviewers?.length ?? 0) > 0 && !annotation.reviewResult)
112+
);
113+
};

0 commit comments

Comments
 (0)