@if (is_array($result) && !empty($result) && isset($result['scoring'][$subject.'_final_score'])) @php $passageCount = isset($passageCount) ? $passageCount : ($subject === 'listening' ? 4 : 3); // 각 passage의 정답 개수는 이미 컨트롤러에서 계산되어 $correctPassages로 전달됨 // 내 정답률 계산 $totalAnswered = $result['scoring'][$subject.'_answered_questions']; $totalCorrect = $result['scoring'][$subject.'_correct_count']; $totalPer = $totalAnswered > 0 ? ($totalCorrect / $totalAnswered) * 100 : 0; // 점수표 데이터 생성 if ($subject == 'reading') { if ($enrollmentCdtSet->cdtSet->module == "academic") { $scoreTable = [ ['9', '39~40'], ['8.5', '37~38'], ['8', '35~36'], ['7.5', '33~34'], ['7', '30~32'], ['6.5', '27~29'], ['6', '23~26'], ['5.5', '19~22'], ['5', '15~18'], ['4.5', '13~14'], ['4', '10~12'], ['3.5', '8~9'], ['3', '6~7'], ['2.5', '4~5'] ]; } else { // GT 모듈 $scoreTable = [ ['9', '40'], ['8.5', '39'], ['8', '37~38'], ['7.5', '36'], ['7', '34~35'], ['6.5', '32~33'], ['6', '30~31'], ['5.5', '27~29'], ['5', '23~26'], ['4.5', '19~22'], ['4', '15~18'], ['3.5', '12~14'], ['3', '9~11'], ['2.5', '6~9'] ]; } } else { // listening용 점수 테이블 $scoreTable = [ ['9', '39~40'], ['8.5', '37~38'], ['8', '35~36'], ['7.5', '32~34'], ['7', '30~31'], ['6.5', '26~29'], ['6', '23~25'], ['5.5', '18~22'], ['5', '16~17'], ['4.5', '13~15'], ['4', '10~12'], ['3.5', '8~9'], ['3', '6~7'], ['2.5', '4~5'] ]; } // 현재 점수에 해당하는 밴드 스코어 찾기 $currentBandScore = ''; foreach ($scoreTable as $score) { $range = $score[1]; // 범위 검사 if (strpos($range, '~') !== false) { list($min, $max) = explode('~', $range); if ($totalCorrect >= (int)$min && $totalCorrect <= (int)$max) { $currentBandScore = $score[0]; break; } } else { // 단일 값 if ($totalCorrect == (int)$range) { $currentBandScore = $score[0]; break; } } } @endphp @if ($subject == 'listening') @endif

Test Result {{ ucfirst($subject) }}

Band Score

{{ number_format($result['scoring'][$subject.'_final_score'], 1) }}

{{ ucfirst($subject) }} 채점기준 및 점수표

@foreach ($scoreTable as $item) @endforeach @foreach ($scoreTable as $item) @endforeach
Band Score $item[0] == $currentBandScore])>{{ $item[0] }}
Score/40 $item[0] == $currentBandScore])>{{ $item[1] }}

문제 다시보기

@if ($subject == 'listening') @endif
@if(isset($showContent) && $showContent) @include($contentPartial) @endif

정답 확인하기

@for ($p = 1; $p <= $passageCount; $p++) @php // 패시지 시작 문제 번호와 끝 문제 번호 계산 $startQuestion = 1; $endQuestion = 0; // 이전 패시지의 문항 수를 더해서 시작 번호 계산 for ($prev = 1; $prev < $p; $prev++) { $prevCountKey = "passage{$prev}_count"; $startQuestion += isset($config[$prevCountKey]) ? $config[$prevCountKey] : ($subject === 'listening' ? 10 : floor(40/$passageCount)); } // 현재 패시지의 문항 수를 더해서 마지막 번호 계산 $countKey = "passage{$p}_count"; $questionsInPassage = isset($config[$countKey]) ? $config[$countKey] : ($subject === 'listening' ? 10 : floor(40/$passageCount)); $endQuestion = $startQuestion + $questionsInPassage - 1; @endphp {{ $subject === 'listening' ? 'Section' : 'Passage' }}{{ $p }}

(Q. {{ $startQuestion }}~{{ $endQuestion }})

@endfor
@for ($p = 1; $p <= $passageCount; $p++) @php // 패시지 시작 문제 번호와 끝 문제 번호 계산 $startQuestion = 1; $endQuestion = 0; // 이전 패시지의 문항 수를 더해서 시작 번호 계산 for ($prev = 1; $prev < $p; $prev++) { $prevCountKey = "passage{$prev}_count"; $startQuestion += isset($config[$prevCountKey]) ? $config[$prevCountKey] : ($subject === 'listening' ? 10 : floor(40/$passageCount)); } // 현재 패시지의 문항 수를 더해서 마지막 번호 계산 $countKey = "passage{$p}_count"; $questionsInPassage = isset($config[$countKey]) ? $config[$countKey] : ($subject === 'listening' ? 10 : floor(40/$passageCount)); $endQuestion = $startQuestion + $questionsInPassage - 1; @endphp
@for ($i = $startQuestion; $i <= $endQuestion; $i++) @php $isCorrect = isset($result['scoring'][$subject.$i.'_correct']) && $result['scoring'][$subject.$i.'_correct'] ? true : false; $responseField = $subject.'_response'.$i; $userAnswer = $enrollmentCdtSet->$responseField ?? null; $correctAnswer = $result['correct_answers'][$subject.$i] ?? '-'; @endphp
문제 정답 내답안 정답여부

{{ $i }}

@if (preg_match('/\|/', $correctAnswer)) {{ str_replace("|", " 또는 ", $correctAnswer) }} @elseif (preg_match('/\;/', $correctAnswer)) {{ str_replace(";", " 그리고 ", $correctAnswer) }} @else {{ $correctAnswer }} @endif

{{ !empty($userAnswer) ? $userAnswer : '없음' }}

{{ $isCorrect ? "O" : "X" }}

@if (isset($result['explanations']) && isset($result['explanations'][$subject.$i]))
해설

{{ $result['explanations'][$subject.$i] }}

@endif
@endfor
@endfor
@else

시험 결과 없음

아직 제출된 결과가 없거나 데이터 형식이 올바르지 않습니다.

@endif