add output of the percentage of correct answers
This commit is contained in:
@ -31,6 +31,8 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
<?php // echo $form->field($model, 'status') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'percent_correct_answers') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
|
@ -39,6 +39,13 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
],
|
||||
// 'UUID',
|
||||
'score',
|
||||
[
|
||||
'attribute' => 'percent_correct_answers',
|
||||
'value' => function($model) {
|
||||
$percent = $model->percent_correct_answers * 100;
|
||||
return $percent . '%';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'format' => 'raw',
|
||||
|
@ -20,6 +20,8 @@ YiiAsset::register($this);
|
||||
?>
|
||||
<div class="user-questionnaire-view">
|
||||
|
||||
<!-- --><?php //var_dump($model->setPercentCorrectAnswers(4)); die();?>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index'], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
@ -46,10 +48,17 @@ YiiAsset::register($this);
|
||||
],
|
||||
'uuid',
|
||||
'score',
|
||||
[
|
||||
'attribute' => 'percent_correct_answers',
|
||||
'value' => function($model) {
|
||||
$percent = $model->percent_correct_answers * 100;
|
||||
return $percent . '%';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
'value' => function($model) {
|
||||
return Html::tag(
|
||||
'span',
|
||||
$model->status ? 'Active' : 'Not Active',
|
||||
|
Reference in New Issue
Block a user