|
@@ -237,23 +237,25 @@ class ExamService
|
|
|
$right_score = 0;
|
|
|
$answer_score = [];
|
|
|
foreach ($answer_config['config'] as $answer_item) {
|
|
|
- if ($right_score < $score) {
|
|
|
+
|
|
|
|
|
|
if (strpos($user_answers, $answer_item['answer']) !== false) {
|
|
|
- $right_score += $answer_item['score'];
|
|
|
+
|
|
|
|
|
|
$answer_score[] = [
|
|
|
'answer' => $answer_item['answer'],
|
|
|
- 'score' => min($score, $answer_item['score']),
|
|
|
+
|
|
|
+ 'score' => $score,
|
|
|
'keyword_score' => $answer_item['score'],
|
|
|
'max_score' => $score,
|
|
|
];
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
- $right_score = min($right_score, $score);
|
|
|
+
|
|
|
+ $right_score = $score;
|
|
|
|
|
|
|
|
|
if ($right_score > 0) {
|
|
@@ -281,7 +283,7 @@ class ExamService
|
|
|
|
|
|
$paper->setInc('join_count');
|
|
|
|
|
|
- return [
|
|
|
+ $result = [
|
|
|
'total_score' => $paper['total_score'],
|
|
|
'score' => $total_score,
|
|
|
'is_pass' => $total_score >= $paper['pass_score'],
|
|
@@ -297,6 +299,7 @@ class ExamService
|
|
|
'configs' => json_encode($paper['configs']),
|
|
|
'mode' => $paper['mode'],
|
|
|
];
|
|
|
+ return $result;
|
|
|
}
|
|
|
|
|
|
|