Пример #1
0
<?php

/** 练习页面 */
/** @var $testLibraries common\models\TestLibrary[] */
$this->title = "模拟考试";
$session = Yii::$app->session;
$questionNumber = 1;
?>
<div class="load-container loading">
    <div class="loader">Loading...</div>
    <p>题库资源载入中,请耐心等待。。。</p>
</div>
<input type="hidden" name="examFlag" value="examFlag">
<?php 
foreach ($testLibraries as $i => $testLibrary) {
    ?>
    <div class="test_library test_library_<?php 
    echo $i;
    ?>
 my_hide">
        <?php 
    echo \frontend\widgets\TestTypeWidget::widget(['testLibrary' => $testLibrary, 'questionNumber' => $i + 1, 'examFlag' => true]);
    ?>
    </div>
<?php 
}
Пример #2
0
<?php

/** 通过ajax向页面添加的题目 */
/** @var $testLibraries */
/** @var $startNumber */
foreach ($testLibraries as $i => $testLibrary) {
    ?>
    <div class="test_library test_library_<?php 
    echo $startNumber + $i + 1;
    ?>
 my_hide id_<?php 
    echo $testLibrary['testLibraryId'];
    ?>
">
        <!--<div>标准题号:<?/*=$testLibrary['testLibraryId']*/?></div>-->
        <?php 
    echo \frontend\widgets\TestTypeWidget::widget(['testLibrary' => $testLibrary, 'questionNumber' => $startNumber + $i + 1]);
    ?>
    </div>
<?php 
}