<?php
	Assets::add( 'begin.min.js' );
	Assets::add( 'begin.css' );
	Assets::add( 'momentjs' );
	AMIB::add_js_translation( trans( 'begin.js-msgs' ) );
?>

<?php $__env->startSection( 'head' ); ?>
	<script>
		var exam_type = '<?php echo $exam_user->type; ?>';
		var questions = <?php echo AMIB::json_encode( $questions ); ?>;
		var saveUrl = '<?php echo route( "save-exam-results", array( $exam_user->id ) ); ?>';
		var serverTime = <?php echo time(); ?>;
		var serverStartTime = <?php echo $exam_user->start_timestamp; ?>;
		var endTime = <?php echo $exam_user->start_timestamp + $exam->minutes * 60; ?>;
		var login_token = '<?php echo $exam_user->login_token; ?>';
	</script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection( 'content' ); ?>
	<div id="main-content" class="cc">
		<span id="start-time">
			<?php echo trans( 'begin.start_timestamp' ); ?> :
			<?php echo unix_to_pdate_time( $exam_user->start_timestamp ); ?>

		</span>
		
		<?php if( $exam_user->type == 'exam' ): ?>
			<span id="remaining">...</span>
		<?php endif; ?>
		
		<span id="support">
            شماره پشتیبانی:
			<?php echo e(Setting::get( 'phone' )); ?>

		</span>
		
		<?php if( $show_lesson_name ): ?>
			<span id="lesson-name" title="<?php echo trans( 'question.lesson_id' ); ?>"><!-- fbjs --></span>
		<?php endif; ?>
		
		<h1>
			<?php echo e($exam->name); ?>

			<?php if( $exam_user->type == 'poll' ): ?>
				( <?php echo e($exam->poll_name); ?> )
			<?php endif; ?>
		</h1>
		
		<div class="pure-g" id="begin-container">
			<div class="pure-u-1 pure-u-lg-6-24 l-box">
				<div id="numbers"></div>
			</div>
			<div class="pure-u-1 pure-u-lg-18-24 l-box">
				<div class="q-meta">
					<?php echo HTML::link( '#', trans( 'begin.prev' ), array( 'class' => 'button prev' ) ); ?>

					<?php echo HTML::link( '#', trans( 'begin.mark' ), array( 'class' => 'button toggle-mark' ) ); ?>

					<?php echo HTML::link( '#', trans( 'begin.remove-answer' ), array( 'class' => 'button remove-answer' ) ); ?>

					<?php echo HTML::link( '#', trans( 'begin.next' ), array( 'class' => 'button next' ) ); ?>

				</div>
				
				<div id="question-container"></div>
				<div id="answer-container"></div>
			
				<script id="choice-template" type="amib/template">
					<div class="choice-row">
						<input type="radio" name="correct_answer">
						<input name="choice_ids[]" type="hidden" value="0">
						<div class="choice-text"></div>
					</div>
				</script>
				
				<script id="descriptive-template" type="amib/template">
					<div class="choice-row">
						<textarea name="answer" id="answer"></textarea>
					</div>
				</script>
				
				<script id="number-template" type="amib/template">
					<a class="number-row"href="#" data-question-id="%id%"><?php echo trans( 'question.number' ); ?> %num%</a>
				</script>
			</div>
		</div>
		
		<div id="meta">
			<div id="stats"><!-- fbjs --></div>
			<?php echo HTML::link( '#', trans( $exam_user->type == 'exam' ? 'exam.finalize' : 'exam.finalize-poll' ), array( 'id' => 'finalize', 'class' => 'button', 'data-href' => route( 'finalize-exam', array( $exam_user->id ) ) ) ); ?>

		</div>
	</div>
<?php $__env->stopSection(); ?>