<?php use app\components\QuestionHelper; ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>预览</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black"> 
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  
  <link rel="stylesheet" href="/plugins/layui/css/layui.css">
  <link rel="stylesheet" href="/plugins/fontawesome/css/font-awesome.min.css" />
  <link rel="stylesheet" href="/public/css/global.css">

  <script src="/public/js/jquery-1.11.3.min.js"></script>
  <script src="/public/js/jquery.form-3.36.0.min.js"></script>
  
</head>
<body>

<div class="layui-fluid" style="padding-left: 10px; padding-right: 10px; margin-top: 10px;">

<form class="layui-form" id="exstems_form" method="post">
<?php $totalpoints = 0; ?>
<?php foreach ($exstems as $onekey => $onestem) { ?>
  <div style="margin: 10px 0;">
  <div style="float:left;"><span class="layui-badge"><?php echo $onekey+1; ?>.</span>
  <span class="layui-badge layui-bg-blue"><?php echo QuestionHelper::ShowStemtypeName($onestem->typechild); ?></span>&nbsp;</div>
  <div class="quest-stem-content" style="float:left;"><?php echo htmlspecialchars_decode($onestem->content); ?></div>
  </div>
  <p style="clear:both;height:4px;"></p>
  <?php if($onestem->typeid==1 || $onestem->typeid==2){ ?>
    <div style="margin: 10px 0;">
    <?php foreach ($onestem->options as $oneoption) {
      echo '<div style="float:left;"><span class="layui-badge layui-bg-blue">'. $oneoption->code .'</span>&nbsp;</div>';
      echo '<div class="quest-option-content" style="float:left;">'. htmlspecialchars_decode($oneoption->content) .'</div>';
      echo '<p style="clear:both;height:4px;"></p>';
    }?>
    </div>
  <?php } ?>
  <div class="quest-answer-content" style="margin: 10px 0;">
  答案：
  <?php if($onestem->typeid==1 || $onestem->typeid==2 || $onestem->typeid==5){ ?>
  <?php echo htmlspecialchars_decode($onestem->answer); ?>
  <?php }elseif($onestem->typeid==3){ ?>
  <?php if($onestem->answer=="1"){echo '正确';}else{echo '错误';} ?>
  <?php }elseif($onestem->typeid==4){ ?>
  <?php foreach ($onestem->options as $oneoption) {
    echo '<span class="layui-badge layui-bg-blue">'. $oneoption->content .'</span>&nbsp;';
  }?>
  <?php } ?>
  </div>
  <div style="margin: 10px 0;">
  分值：<?php echo $onestem->points; ?>
  </div>
  <hr>
  <?php $totalpoints += $onestem->points; ?>
<?php } ?>
</form>
<div>总分：<?php echo $totalpoints; ?></div>
<br>
</div>

<div style="height: 30px;"></div>

<script src="/plugins/layui/layui.all.js"></script>
</body>
</html>