EIOS/inc/smarty/templates_c/6d6600e17ff5fe934dfdc2cb075...

185 lines
8.6 KiB
PHP

<?php /* Smarty version Smarty-3.1.13, created on 2022-04-11 20:35:54
compiled from "tpl/tpl_learn_tests.html" */ ?>
<?php /*%%SmartyHeaderCode:335113901625466fa4be494-19867244%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'6d6600e17ff5fe934dfdc2cb0752373d4ebed81f' =>
array (
0 => 'tpl/tpl_learn_tests.html',
1 => 1591363318,
2 => 'file',
),
),
'nocache_hash' => '335113901625466fa4be494-19867244',
'function' =>
array (
),
'variables' =>
array (
'regim' => 0,
'tests' => 0,
'test' => 0,
'k1' => 0,
'test1' => 0,
'quest' => 0,
'answ' => 0,
'i' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.13',
'unifunc' => 'content_625466fa4fb130_16864941',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_625466fa4fb130_16864941')) {function content_625466fa4fb130_16864941($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("tpl_messager.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
<?php if ($_smarty_tpl->tpl_vars['regim']->value=="tests"){?>
<h2>Список всех тестов</h2>
<table class="table">
<?php $_smarty_tpl->tpl_vars['test'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['test']->_loop = false;
$_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['tests']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['test']->key => $_smarty_tpl->tpl_vars['test']->value){
$_smarty_tpl->tpl_vars['test']->_loop = true;
$_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['test']->key;
?>
<?php if (count($_smarty_tpl->tpl_vars['test']->value['tests'])){?>
<tr style="background-color:#a5a5a5;">
<td colspan="2"><b><?php echo $_smarty_tpl->tpl_vars['test']->value['razdel']['name'];?>
</b></td>
<td colspan="2"><?php echo $_smarty_tpl->tpl_vars['test']->value['razdel']['descrip'];?>
</td>
</tr>
<?php $_smarty_tpl->tpl_vars['test1'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['test1']->_loop = false;
$_smarty_tpl->tpl_vars['k1'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['test']->value['tests']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['test1']->key => $_smarty_tpl->tpl_vars['test1']->value){
$_smarty_tpl->tpl_vars['test1']->_loop = true;
$_smarty_tpl->tpl_vars['k1']->value = $_smarty_tpl->tpl_vars['test1']->key;
?>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['k1']->value+1;?>
</td>
<td><?php echo $_smarty_tpl->tpl_vars['test1']->value['name'];?>
</td>
<td><?php echo $_smarty_tpl->tpl_vars['test1']->value['descrip'];?>
</td>
<td>
<?php if ($_smarty_tpl->tpl_vars['test1']->value['otvet']==1){?>
<hr>вы уже прошли тест <b><?php echo $_smarty_tpl->tpl_vars['test1']->value['otvet_data'];?>
</b>
<?php }else{ ?>
<?php if ($_smarty_tpl->tpl_vars['test1']->value['probnyj']==1){?><a href="/learn/tests/<?php echo $_smarty_tpl->tpl_vars['test1']->value['id'];?>
/">Пройти пробный тест</a><?php }?>
<?php if ($_smarty_tpl->tpl_vars['test1']->value['kontroln']==1){?><a href="/learn/tests/<?php echo $_smarty_tpl->tpl_vars['test1']->value['id'];?>
/">Пройти контрольный тест</a><?php }?>
<?php if ($_smarty_tpl->tpl_vars['test1']->value['kontroln']==-1){?><br>для контрольного теста не назначено время прохождения!<?php }?>
<?php }?>
</td>
</tr>
<?php } ?>
<?php }?>
<?php } ?>
</tr>
</table>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['regim']->value=="test"){?>
<form method="POST">
<h2>Название теста: <?php echo $_smarty_tpl->tpl_vars['test']->value['name'];?>
</h2>
<p><?php echo $_smarty_tpl->tpl_vars['test']->value['descrip'];?>
</p>
<div>
<?php $_smarty_tpl->tpl_vars['quest'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['quest']->_loop = false;
$_smarty_tpl->tpl_vars['k1'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['test']->value['questions']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['quest']->key => $_smarty_tpl->tpl_vars['quest']->value){
$_smarty_tpl->tpl_vars['quest']->_loop = true;
$_smarty_tpl->tpl_vars['k1']->value = $_smarty_tpl->tpl_vars['quest']->key;
?>
<div class="row-fluid">
<div class="span8 offset2">
<h3><span class="label label-info" style="font-size: 20px;"><?php echo $_smarty_tpl->tpl_vars['k1']->value+1;?>
.</span> <?php echo $_smarty_tpl->tpl_vars['quest']->value['text_q'];?>
</h3>
<?php if ($_smarty_tpl->tpl_vars['quest']->value['tip']==0){?>
<?php $_smarty_tpl->tpl_vars['answ'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['answ']->_loop = false;
$_smarty_tpl->tpl_vars['k2'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['quest']->value['answers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['answ']->key => $_smarty_tpl->tpl_vars['answ']->value){
$_smarty_tpl->tpl_vars['answ']->_loop = true;
$_smarty_tpl->tpl_vars['k2']->value = $_smarty_tpl->tpl_vars['answ']->key;
?>
<p><input type="RADIO" name="quest[<?php echo $_smarty_tpl->tpl_vars['quest']->value['id'];?>
]" value="<?php echo $_smarty_tpl->tpl_vars['answ']->value['id'];?>
" style="width:48px;">&nbsp;<?php echo $_smarty_tpl->tpl_vars['answ']->value['text_a'];?>
</p>
<?php } ?>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['quest']->value['tip']==1){?>
<?php $_smarty_tpl->tpl_vars['answ'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['answ']->_loop = false;
$_smarty_tpl->tpl_vars['k2'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['quest']->value['answers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['answ']->key => $_smarty_tpl->tpl_vars['answ']->value){
$_smarty_tpl->tpl_vars['answ']->_loop = true;
$_smarty_tpl->tpl_vars['k2']->value = $_smarty_tpl->tpl_vars['answ']->key;
?>
<p><input type="CHECKBOX" name="quest[<?php echo $_smarty_tpl->tpl_vars['quest']->value['id'];?>
][]" value="<?php echo $_smarty_tpl->tpl_vars['answ']->value['id'];?>
">&nbsp;<?php echo $_smarty_tpl->tpl_vars['answ']->value['text_a'];?>
</p>
<?php } ?>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['quest']->value['tip']==2){?>
Введите ответ: <input type="TEXT" name="quest[<?php echo $_smarty_tpl->tpl_vars['quest']->value['id'];?>
]" value="" style="width:48px;">
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['quest']->value['tip']==3){?>
<div class="row-fluid">
<?php $_smarty_tpl->tpl_vars['i'] = new Smarty_Variable;$_smarty_tpl->tpl_vars['i']->step = 1;$_smarty_tpl->tpl_vars['i']->total = (int)ceil(($_smarty_tpl->tpl_vars['i']->step > 0 ? $_smarty_tpl->tpl_vars['quest']->value['ocenka']+1 - (1) : 1-($_smarty_tpl->tpl_vars['quest']->value['ocenka'])+1)/abs($_smarty_tpl->tpl_vars['i']->step));
if ($_smarty_tpl->tpl_vars['i']->total > 0){
for ($_smarty_tpl->tpl_vars['i']->value = 1, $_smarty_tpl->tpl_vars['i']->iteration = 1;$_smarty_tpl->tpl_vars['i']->iteration <= $_smarty_tpl->tpl_vars['i']->total;$_smarty_tpl->tpl_vars['i']->value += $_smarty_tpl->tpl_vars['i']->step, $_smarty_tpl->tpl_vars['i']->iteration++){
$_smarty_tpl->tpl_vars['i']->first = $_smarty_tpl->tpl_vars['i']->iteration == 1;$_smarty_tpl->tpl_vars['i']->last = $_smarty_tpl->tpl_vars['i']->iteration == $_smarty_tpl->tpl_vars['i']->total;?>
<div class="span1" style="font-size:24px;"><input type="RADIO" name="quest[<?php echo $_smarty_tpl->tpl_vars['quest']->value['id'];?>
]" value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"> <?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</div>
<?php }} ?>
</div>
<?php }?>
</div>
</div>
<?php } ?>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<input type="SUBMIT" name="save_test" class="btn btn-warning" value="Сохранить">
<input type="HIDDEN" name="id_test" value="<?php echo $_smarty_tpl->tpl_vars['test']->value['id'];?>
">
</div>
</div>
</form>
<script type="text/javascript">$(document).ready(function () {
function f(){
$.ajax({
url: '/json.php', dataType:'json', type:'POST', async:false, data: 'ajdes=empty_post',
success: function(data){}
});
}
setInterval(f, 150000);
});</script>
<style>
#test-item {
margin: 20px auto;
width: 100%;
padding: 1em;
font-family: sans-serif;
font-weight: normal;
font-size: 1.5em;
color:#000;
}
</style>
<?php }?><?php }} ?>