diff --git a/application/common/TurnitinService.php b/application/common/TurnitinService.php index 0e1dc9aa..47542d94 100644 --- a/application/common/TurnitinService.php +++ b/application/common/TurnitinService.php @@ -218,15 +218,16 @@ class TurnitinService } foreach ($candidates as $n) { - if ($n > 0 && $n <= 1.0) { - $scaled = round($n * 100, 2); - if ($scaled > 1.0 || $n < 0.05) { - return $scaled; - } + if ($n < 0) { + continue; } - if ($n >= 0) { - return round($n, 2); + // Turnitin TCA 的 overall_match_percentage 是 0–100 整数,"1" 即代表 1%。 + // 仅当值是「严格小于 1 的非整数」(真正的 0–1 小数比例,如 0.12=12%)时才 ×100, + // 避免把整数 1(1%)误判成 100%。 + if ($n > 0 && $n < 1.0) { + return round(min($n * 100, 100), 2); } + return round(min($n, 100), 2); } return 0.0;