<?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;">

<div class="layui-form">
<div class="layui-collapse" lay-accordion id="chapterlistbox">
<?php foreach($chapters as $chapterkey => $onechapter){ ?>
  <div class="layui-colla-item">
    <h2 class="layui-colla-title"><span><?php echo $onechapter->name; ?></span> <span class="layui-badge"><?php echo $onechapter->questinum; ?></span>
    <div class="layui-btn-group" style="float: right;">
      <a class="layui-btn layui-btn-sm" onclick="javascript:return chooseChapterOk(<?php echo $onechapter->id; ?>, '<?php echo $onechapter->name; ?>');">确定</a>
    </div>
    </h2>
    <div class="layui-colla-content<?php if(stripos($treepath, ','. $onechapter->id .',')!==false){echo ' layui-show';} ?>">
      <div class="layui-collapse" lay-accordion id="sectionlistbox_<?php echo $onechapter->id; ?>">
        <?php if(!empty($onechapter->sections)){ foreach($onechapter->sections as $sectionkey => $onesection){ ?>
        <div class="layui-colla-item">
          <h2 class="layui-colla-title"><span><?php echo $onesection->name; ?></span> <span class="layui-badge"><?php echo $onesection->questinum; ?></span>
            <div class="layui-btn-group" style="float: right;">
              <a class="layui-btn layui-btn-sm" onclick="javascript:return chooseChapterOk(<?php echo $onesection->id; ?>, '<?php echo $onesection->name; ?>');">确定</a>
            </div>
          </h2>
          <div class="layui-colla-content<?php if(stripos($treepath, ','. $onesection->id .',')!==false){echo ' layui-show';} ?>">
            <div class="layui-collapse" lay-accordion id="knowledlistbox_<?php echo $onesection->id; ?>">
              <?php if(!empty($onesection->knowledges)){ foreach($onesection->knowledges as $knowledkey => $oneknowled){ ?>
              <div class="layui-colla-item">
                <h2 class="layui-colla-title"><span><?php echo $oneknowled->name; ?></span> <span class="layui-badge"><?php echo $oneknowled->questinum; ?></span>
                  <div class="layui-btn-group" style="float: right;">
                    <a class="layui-btn layui-btn-sm" onclick="javascript:return chooseChapterOk(<?php echo $oneknowled->id; ?>, '<?php echo $oneknowled->name; ?>');">确定</a>
                  </div>
                </h2>
                <div class="layui-colla-content<?php if(stripos($treepath, ','. $oneknowled->id .',')!==false){echo ' layui-show';} ?>">
                </div>
              </div>
              <?php } } ?>
            </div>
          </div>
        </div>
        <?php } } ?>
      </div>
    </div>
  </div>
<?php } ?>
</div>
</div>

</div>

<script>
var courseid = <?php echo $courseid; ?>;
</script>

<script src="/public/modules/glexam/qucourse/tree.js"></script>

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