getUserName(); $questionnaire_title = $model->getQuestionnaireTitle(); $this->title = $user . ": " . $questionnaire_title; $this->params['breadcrumbs'][] = ['label' => 'User Questionnaires', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; YiiAsset::register($this); ?> registerJs( // '$("document").ready(function(){ // $("#new_note").on("pjax:end", function() { // $.pjax.reload({container:"#user_responses"}); //Reload GridView // }); // });' //); ?>
setPercentCorrectAnswers(4)); die();?>

'btn btn-primary']) ?> $model->id], ['class' => 'btn btn-primary']) ?> $model->id], [ 'class' => 'btn btn-danger', 'data' => [ 'confirm' => 'Are you sure you want to delete this item?', 'method' => 'post', ], ]) ?>

$model, 'attributes' => [ 'id', [ 'attribute' => 'questionnaires_id', 'value' => ArrayHelper::getValue($model, 'questionnaire.title'), ], [ 'attribute' => 'user_id', 'value' => ArrayHelper::getValue($model, 'user.username'), ], 'uuid', 'score', [ 'attribute' => 'percent_correct_answers', 'value' => function($model) { $percent = $model->percent_correct_answers * 100; return $percent . '%'; } ], [ 'attribute' => 'status', 'format' => 'raw', 'value' => StatusHelper::statusLabel($model->status), ], 'created_at', 'updated_at', 'testing_date', ], ]) ?>

$model->id], [ 'class' => 'btn btn-primary', 'data' => [ 'confirm' => 'Проверка ответов пользователя: ' . $user . ". Категория: " . $questionnaire_title, ], ]) ?> '

Подсчёт балов

', 'toggleButton' => [ 'label' => 'Посчитать баллы', 'tag' => 'button', 'class' => 'btn btn-success', ], ]); if(ScoreCalculatorHelper::checkAnswerFlagsForNull($model)) { echo 'Ответы проверены. Посчитать баллы?'; echo Html::a('Посчитать баллы', ['calculate-score', 'id' => $model->id], [ 'class' => 'btn btn-primary' ]); } else { echo 'Не все ответы проверены.'; } ?>

'user_responses']); ?> $responseDataProvider, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], 'response_body', [ 'attribute' => 'question_id', 'value' => 'question.question_body' ], [ 'attribute' => 'Тип вопроса', 'value' => 'questionType.question_type', ], [ 'attribute' => 'answer_flag', 'format' => 'raw', 'value' => function ($model) { return AnswerHelper::answerStatusLabel($model->answer_flag); }, ], [ 'class' => 'yii\grid\ActionColumn', 'template' => '{view} {update} {delete}', 'controller' => 'user-response', 'buttons' => [ 'update' => function ($url,$model) { return Html::a( '', ['user-response/update', 'id' => $model['id'], 'user_questionnaire_uuid' => $model['user_questionnaire_uuid']]); }, 'delete' => function ($url,$model) { return Html::a( '', ['user-response/delete', 'id' => $model['id'], 'user_questionnaire_uuid' => $model['user_questionnaire_uuid']], ['data' => ['confirm' => 'Вы уверены, что хотите удалить этот вопрос?', 'method' => 'post']] ); }, ], ], ], ]); ?>