2021-10-22 17:02:28 +03:00
|
|
|
<?php
|
|
|
|
|
2021-11-08 12:41:39 +03:00
|
|
|
use backend\modules\questionnaire\models\Question;
|
2021-11-09 17:41:44 +03:00
|
|
|
use common\helpers\AnswerHelper;
|
|
|
|
use common\models\User;
|
2021-10-22 17:02:28 +03:00
|
|
|
use kartik\select2\Select2;
|
|
|
|
use yii\helpers\Html;
|
|
|
|
use yii\widgets\ActiveForm;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $model backend\modules\questionnaire\models\UserResponse */
|
|
|
|
/* @var $form yii\widgets\ActiveForm */
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="user-response-form">
|
|
|
|
|
|
|
|
<?php $form = ActiveForm::begin(); ?>
|
|
|
|
|
2021-11-09 17:41:44 +03:00
|
|
|
<?= $form->field($model, 'user_id')->widget(Select2::className(),
|
|
|
|
[
|
|
|
|
'data' => User::find()->select(['username', 'id'])->indexBy('id')->column(),
|
|
|
|
'options' => ['placeholder' => 'Выберите пользователя','class' => 'form-control'],
|
|
|
|
'pluginOptions' => [
|
|
|
|
'placeholder' => 'Выберите',
|
|
|
|
'allowClear' => true
|
|
|
|
],
|
|
|
|
]) ?>
|
|
|
|
|
|
|
|
<?= $form->field($model, 'question_id')->widget(Select2::className(),
|
|
|
|
[
|
|
|
|
'data' => Question::find()->select(['question_body', 'id'])->indexBy('id')->column(),
|
|
|
|
'options' => ['placeholder' => 'Выберите пользователя','class' => 'form-control'],
|
|
|
|
'pluginOptions' => [
|
|
|
|
'placeholder' => 'Выберите',
|
|
|
|
'allowClear' => true
|
|
|
|
],
|
|
|
|
]) ?>
|
|
|
|
|
|
|
|
<?= $form->field($model, 'response_body')->textInput(['maxlength' => true]) ?>
|
|
|
|
|
2022-03-16 14:27:01 +03:00
|
|
|
<?= $form->field($model, 'answer_flag')->dropDownList([
|
|
|
|
'0.0' => 'Ошибочный',
|
|
|
|
'0.1' => '10%',
|
|
|
|
'0.2' => '20%',
|
|
|
|
'0.3' => '30%',
|
|
|
|
'0.4' => '40%',
|
|
|
|
'0.5' => '50%',
|
|
|
|
'0.6' => '60%',
|
|
|
|
'0.7' => '70%',
|
|
|
|
'0.8' => '80%',
|
|
|
|
'0.9' => '90%',
|
|
|
|
'1' => '100%',
|
|
|
|
]); ?>
|
2021-10-22 17:02:28 +03:00
|
|
|
|
2021-11-09 17:41:44 +03:00
|
|
|
<?= $form->field($model, 'user_questionnaire_uuid')->textInput(['maxlength' => true]) ?>
|
2021-10-22 17:02:28 +03:00
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php ActiveForm::end(); ?>
|
|
|
|
|
|
|
|
</div>
|