add output of the percentage of correct answers
This commit is contained in:
@ -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