<?php use app\components\ExamHelper; ?>
<?php foreach($exams as $oneexam){ ?>
    <tr>
      <td><?php echo $oneexam->title; ?></td>
      <td><?php echo ExamHelper::showCourseName($oneexam->courseid); ?></td>
      <td><?php echo $oneexam->begintime; ?></td>
      <td><?php echo $oneexam->endtime; ?></td>
      <td><?php if(empty($oneexam->doexam)){echo '未提交';}else{
        if($oneexam->doexam->isdone==0 || $oneexam->doexam->isdone==1){echo '未提交';}elseif($oneexam->doexam->isdone==2){echo '未批改';}elseif($oneexam->doexam->isdone==3){echo '已批改';}
      } ?></td>
      <td><?php if(empty($oneexam->doexam) || $oneexam->doexam->isdone<2){echo '暂无';}else{echo $oneexam->doexam->points; } ?></td>
      <td><?php if(empty($oneexam->doexam)){ ?><a class="layui-btn layui-btn-sm" href="/doexam/question<?php if($oneexam->questway==2){echo 'chou';} ?>/<?php echo $oneexam->id; ?>">进入答题</a><?php }else{
        if($oneexam->doexam->isdone==2 || $oneexam->doexam->isdone==3){ ?><a class="layui-btn layui-btn-sm" onclick="showDoexamResult(<?php echo $oneexam->doexam->id; ?>, <?php echo $oneexam->questway; ?>);">查看结果</a><?php }else{ ?><a class="layui-btn layui-btn-sm" href="/doexam/question<?php if($oneexam->questway==2){echo 'chou';} ?>/<?php echo $oneexam->id; ?>">进入答题</a><?php }
      } ?></td>
    </tr>
<?php } ?>