<h1 style="text-align:center">
آزمون های آزمایشی
آموزشگاه
میدیا
</h1>
<table>
 <tr class="h">
		<td class="h">شماره</td>
		<td class="h">نام و نام خانوادگی</td>
		<td class="h">آزمون</td>
		<td class="h">رتبه</td>
		<td class="h">تاریخ</td>
		<td class="h">تعداد شرکت کننده</td>
		<td class="h">سازمان</td>
	</tr>

	<tr>
		<td><?php echo e(en2fa( $exam_user->id )); ?></td>
		<td><?php echo e(en2fa( $exam_user->User->full_name )); ?></td>
		<td><?php echo e(en2fa( $exam->name )); ?></td>
		<td class="h"><?php echo e(en2fa( $raw_results->total_rank )); ?></td>
		<td><?php echo e(en2fa( unix_to_pdate_time( $exam_user->start_timestamp, false ) )); ?></td>
		<td><?php echo e(en2fa( $exam->extra_data_obj->users_count )); ?></td>
		<td><?php echo e($exam_user->User->Company ? $exam_user->User->Company->name : '--'); ?></td>
	</tr>
</table>
<br>
<table>
	<thead>
		<tr>
			<th class="h">نام درس</th>
			<th class="h">سوالات</th>
			<th class="h">ضریب</th>
			<th class="h">درست</th>
			<th class="h">غلط</th>
			<th class="h">نزده</th>
			<th class="h">درصد</th>
			<th class="h">درصد میانگین</th>
			<th class="h">بالاترین درصد</th>
			<th class="h">تراز</th>
			<th class="h">رتبه</th>
			<th class="h">رتبه سازمان</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach( $raw_results->lessons as $id => $lesson ): ?>
			<tr>
				<td><?php echo e(en2fa( $lesson->name )); ?></td>
				<td><?php echo e(en2fa( $lesson->count )); ?></td>
				<td><?php echo e(en2fa( $lesson->factor )); ?></td>
				<td><?php echo e(en2fa( $lesson->correct_answers )); ?></td>
				<td><?php echo e(en2fa( $lesson->incorrect_answers )); ?></td>
				<td><?php echo e(en2fa( $lesson->no_answers )); ?></td>
				<td style="direction: ltr"><?php echo e(en2fa( round( $lesson->mark, 2 ) )); ?></td>
				<td><?php echo e(en2fa( round( $exam->extra_data_obj->lessons_average[ $id ], 2 ) )); ?></td>
				<td><?php echo e(en2fa( round( $exam->extra_data_obj->lessons_maximum[ $id ], 2 ) )); ?></td>
				<td ><?php echo e(en2fa( $lesson->taraz )); ?></td>
				<td ><?php echo e(en2fa( $raw_results->{"lessons_{$id}_rank"} )); ?></td>
				<td ><?php echo e(en2fa( $raw_results->{"lessons_{$id}_rank_c"} )); ?></td>
			</tr>
		<?php endforeach; ?>
</table>
<br>
<table>
	<thead>
		<tr>
			<th class="h">حیطه</th>
			<th class="h">مجموع سوالات</th>
			<th class="h">مجموع درست</th>
			<th class="h">مجموع غلط</th>
			<th class="h">مجموع نزده</th>
			<th class="h">تراز</th>
			<th class="h">رتبه</th>
			<th class="h">رتبه سازمان</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td >نمره عمومی</td>
			<td ><?php echo e(en2fa( $raw_results->g_correct + $raw_results->g_incorrect + $raw_results->g_unanswered )); ?></td>
			<td><?php echo e(en2fa( $raw_results->g_correct )); ?></td>
			<td><?php echo e(en2fa( $raw_results->g_incorrect )); ?></td>
			<td><?php echo e(en2fa( $raw_results->g_unanswered )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->general_taraz )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->general_rank )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->general_rank_c )); ?></td>
		</tr>
		<tr>
			<td>نمره اختصاصی</td>
			<td><?php echo e(en2fa( $raw_results->e_correct + $raw_results->e_incorrect + $raw_results->e_unanswered )); ?></td>
			<td><?php echo e(en2fa( $raw_results->e_correct )); ?></td>
			<td><?php echo e(en2fa( $raw_results->e_incorrect )); ?></td>
			<td><?php echo e(en2fa( $raw_results->e_unanswered )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->expertize_taraz )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->expertize_rank )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->expertize_rank_c )); ?></td>
		</tr>
		<tr>
			<td>نمره کل</td>
			<td><?php echo e(en2fa( $exam_user->correct_answers + $exam_user->incorrect_answers + $exam_user->no_answers )); ?></td>
			<td><?php echo e(en2fa( $exam_user->correct_answers )); ?></td>
			<td><?php echo e(en2fa( $exam_user->incorrect_answers )); ?></td>
			<td><?php echo e(en2fa( $exam_user->no_answers )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->total_taraz )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->total_rank )); ?></td>
			<td class="h"><?php echo e(en2fa( $raw_results->total_rank_c )); ?></td>
		</tr>
	</tbody>
</table>

<?php if( property_exists( $exam->extra_data_obj, 'groups' ) && $exam->extra_data_obj->groups > 0 ): ?>
	<br>
	<table>
		<thead>
			<tr>
				<th class="h">زیر گروه</th>
				<th class="h">تراز عمومی</th>
				<th class="h">تراز اختصاصی</th>
				<th class="h">تراز کل</th>
				<th class="h">رتبه عمومی</th>
				<th class="h">رتبه اختصاصی</th>
				<th class="h">رتبه کل</th>
				<th class="h">رتبه اختصاصی سازمان</th>
				<th class="h">رتبه سازمان</th>
			</tr>
		</thead>
		<tbody>
			<?php foreach( range( 0, $exam->extra_data_obj->groups - 1 ) as $key => $factor ): ?>
				<tr>
					<th class="h">زیر گروه <?php echo en2fa( $key + 1 ); ?></th>
					<td><?php echo e(en2fa( $raw_results->general_taraz )); ?></td>
					<td><?php echo e(en2fa( $raw_results->group_e_taraz[ $key ] )); ?></td>
					<td><?php echo e(en2fa( $raw_results->group_taraz[ $key ] )); ?></td>
					<td><?php echo e(en2fa( $raw_results->general_rank )); ?></td>
					<td><?php echo e(en2fa( $raw_results->{"rank_e_{$key}"} )); ?></td>
					<td><?php echo e(en2fa( $raw_results->{"rank_{$key}"} )); ?></td>
					<td><?php echo e(en2fa( $raw_results->{"rank_e_{$key}_c"} )); ?></td>
					<td><?php echo e(en2fa( $raw_results->{"rank_{$key}_c"} )); ?></td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
<?php endif; ?>