#925 - Создать каркас модуля тестирования

parent 9a707a6d
<?php
namespace common\modules\testings\controllers;
use Yii;
use common\components\AdminController;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\modules\testings\models\Mistake;
use common\modules\testings\models\Passing;
class MistakeAdminController extends AdminController
{
public $errorSummaryCssClass = 'error-summary';
public $encodeErrorSummary = true;
public static function actionsTitles()
{
return array(
'View' => 'Просмотр ошибки',
'Create' => 'Создание ошибки',
'Update' => 'Редактирование ошибки',
);
}
public function actionView($passing)
{
return $this->render('view', [
'model' => Mistake::find()->where(['passing_id' => $passing])->one(),
]);
}
public function actionCreate($passing)
{
$model = new Mistake;
Yii::$app->controller->page_title = 'Добавить ошибку';
Yii::$app->controller->breadcrumbs = [
['Список прохождений' => '/testings/passing-admin/manage', 'session' => $model->passing->test->session_id],
'Добавить ошибку'
];
$model->load(Yii::$app->request->post());
$model->passing_id = $passing;
if (Yii::$app->request->isPost && $model->save())
{
if ($model->retest)
{
$pass = new Passing;
$oldpass = Passing::findOne($model->passing_id);
$pass->attributes = $oldpass->attributes;
$pass->is_passed = null;
$pass->pass_date = null;
$pass->attempt = 0;
$pass->pass_date_start = '';
$pass->save();
}
return $this->redirect(['/testings/passing-admin/manage', 'session' => $model->passing->test->session_id]);
}
else
{
$form = new \common\components\BaseForm('/common/modules/testings/forms/MistakeForm', $model);
return $this->render('create', [
'model' => $model,
'form' => $form->out
]);
}
}
public function actionUpdate($passing)
{
Yii::$app->controller->page_title = 'Редактировать ошибку';
Yii::$app->controller->breadcrumbs = [
['Список прохождений' => '/testings/passing-admin/manage', 'session' => $model->passing->test->session_id],
'Редактировать ошибку'
];
$model = Mistake::find()->where(['passing_id' => $passing])->one();
$model->load(Yii::$app->request->post());
$model->passing_id = $passing;
if (Yii::$app->request->isPost && $model->save())
{
if ($model->retest)
{
$pass = new Passing;
$pass->attributes = $model->passing->attributes;
$pass->is_passed = null;
$pass->pass_date = null;
$pass->attempt = 0;
$pass->pass_date_start = '';
$pass->save();
}
return $this->redirect(['/testings/passing-admin/manage', 'session' => $model->passing->test->session_id]);
}
else
{
$form = new \common\components\BaseForm('/common/modules/testings/forms/MistakeForm', $model);
return $this->render('update', [
'model' => $model,
'form' => $form->out
]);
}
}
/**
* Finds the Faq model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Faq the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Answer::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
<?php
namespace common\modules\testings\models;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\Expression;
class Mistake extends \common\components\ActiveRecordModel
{
const PAGE_SIZE = 10;
const NOT_AGREED = 0;
const AGREED = 1;
public $company;
public $managerField;
public $mistakeField;
public $retest = 0;
public static $state_list = [
self::NOT_AGREED => 'Не согласовано',
self::AGREED => 'Согласовано',
];
public static function tableName()
{
return 'testings_mistakes';
}
public function name()
{
return 'Сообщения об ошибках';
}
public function attributeLabels()
{
return [
'passing_id' => 'Прохождение',
'description' => 'Описание ошибки',
'is_expert_agreed' => 'Согласовано ли с экспертом',
'create_date' => 'Время создания',
];
}
/**
* @inheritdoc
*/
public function behaviors()
{
// $behaviors['FileManager'] = array(
// 'class' => 'application.components.activeRecordBehaviors.FileManagerBehavior'
// );
return [
[
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'create_date',
'updatedAtAttribute' => 'create_date',
'value' => new Expression('NOW()'),
],
];
}
public function rules()
{
return [
[['passing_id', 'description', 'is_expert_agreed'], 'required'],
[['passing_id', 'is_expert_agreed'], 'integer'],
[['description'], 'string', 'max' => 3000],
[['retest'], 'safe']
];
}
public function getPassing()
{
return $this->hasOne(Passing::className(), ['id' => 'passing_id']);
}
// public function getFiles()
// {
// return $this->hasMany(FileManager::className(), ['object_id' => 'id'])
// ->andWhere([
// 'files.model_id' => get_class($this),
// 'files.tag' => 'files'
// ])
// ->orderBy(['files.order DESC']);
// }
}
\ No newline at end of file
......@@ -12,24 +12,30 @@ class Passing extends \common\components\ActiveRecordModel
{
const PAGE_SIZE = 10;
const STARTED = 0;
const NOT_STARTED = 0;
const STARTED = 11;
const ENDED = 1;
const FAILED = 0;
const PASSED = 1;
const MISTAKE = 8;
const FAILED = 9;
const PASSING_PERCENT_RIGHT_CENTER = 50;
const PASSING_PERCENT_RIGHT_ALMOST = 75;
const PASSING_PERCENT_RIGHT_ALL = 100;
public static $state_list = [
self::STARTED => 'Начал тестирование',
self::NOT_STARTED => 'Не сдавал',
self::STARTED => 'Тестирование',
self::ENDED => 'Завершено',
];
public static $passed_list = [
self::FAILED => 'Не сдал',
self::PASSED => 'Сдал',
self::MISTAKE => 'Ошибка',
];
public static $answer_list = [
self::STARTED => 'Не верно',
self::FAILED => 'Не верно',
self::PASSED => 'Верно',
];
......@@ -57,8 +63,8 @@ class Passing extends \common\components\ActiveRecordModel
{
return [
[['user_id', 'test_id'], 'required'],
[['user_id', 'test_id', 'is_passed'], 'integer'],
[['pass_date', 'pass_date_start', 'attempt'], 'safe'],
[['user_id', 'test_id', 'status', 'passed', 'percent', 'points'], 'integer'],
[['start_date', 'attempt'], 'safe'],
[['end_date'], 'required', 'on' => 'extend'],
];
}
......@@ -66,14 +72,14 @@ class Passing extends \common\components\ActiveRecordModel
public function attributeLabels()
{
return [
'is_passed' => 'Состояние',
'test_id' => 'Tест',
'user_id' => 'ФИО',
'create_date' => 'Дата создания',
'pass_date' => 'Дата прохождения теста',
'passed' => 'Сдал/Не сдал',
'status' => 'Статус',
'start_date' => 'Дата создания',
'end_date' => 'Дата прохождения теста',
'session_id' => 'Сессия',
'filter_user_email' => 'Email',
'filter_user_company_name' => 'Наименование компании',
'filter_user_last_name' => 'ФИО',
];
}
......@@ -113,7 +119,7 @@ class Passing extends \common\components\ActiveRecordModel
return $count;
}
public function getPercent()
public function getPercentRight()
{
$all = 0;
$right = 0;
......@@ -156,17 +162,18 @@ class Passing extends \common\components\ActiveRecordModel
public function getTime()
{
if($this->pass_date_start && $this->pass_date)
if($this->start_date && $this->end_date)
{
return (strtotime($this->pass_date) - strtotime($this->pass_date_start));
return (strtotime($this->end_date) - strtotime($this->start_date));
}
else
{
$timeSummary = 0;
foreach ($this->questions as $q) {
$timeSummary += $q->answer_time;
$time = 0;
foreach ($this->questions as $q)
{
$time += $q->answer_time;
}
return $timeSummary;
return $time;
}
}
......@@ -175,4 +182,18 @@ class Passing extends \common\components\ActiveRecordModel
$cases = array (2, 0, 1, 1, 1, 2);
return $number." ".$titles[ ($number%100 > 4 && $number %100 < 20) ? 2 : $cases[min($number%10, 5)] ];
}
public function recountPassResult()
{
if ($this->percent >= $this->test->pass_percent)
{
$this->passed = self::PASSED;
}
else
{
$this->passed = self::FAILED;
}
return true;
}
}
......@@ -169,7 +169,7 @@ class Question extends \common\components\ActiveRecordModel
break;
case self::USER_ANSWER:
$models = $query->one();
$model = $query->one();
if ($model)
{
$answer = trim(preg_replace('/\s+/', ' ', $model->text));
......
......@@ -46,17 +46,15 @@ class QuestionPassing extends \common\components\ActiveRecordModel
{
return [
[['passing_id', 'question_id'], 'required'],
[['passing_id', 'answer_time'], 'integer'],
[['question_id'], 'string', 'max' => 11],
[['passing_id', 'question_id', 'answer_time'], 'integer'],
[['user_answer'], 'string', 'max' => 3000],
// array('id, passing_id, question_id, user_answer, answer_time', 'safe', 'on' => 'search'),
];
}
public function attributeLabels()
{
return [
'question_id' => 'Наименование вопроса',
'question_id' => 'Вопрос',
'user_answer' => 'Ответ пользователя',
'answer_time' => 'Время прохождения, секунд',
'create_date' => 'Дата создания',
......@@ -72,7 +70,7 @@ class QuestionPassing extends \common\components\ActiveRecordModel
public function getPassing()
{
return $this->hasOne(Passing::className(), ['passing_id' => 'id']);
return $this->hasOne(Passing::className(), ['id' => 'passing_id']);
}
public function search($passing = null)
......
......@@ -15,7 +15,6 @@ use common\modules\testings\models\Mistake;
class SearchPassing extends Passing
{
public $filter_user_email;
public $filter_user_company_name;
public $filter_user_last_name;
/**
......@@ -24,8 +23,8 @@ class SearchPassing extends Passing
public function rules()
{
return [
[['id', 'user_id', 'test_id', 'is_passed'], 'integer'],
[['id', 'user_id', 'test_id', 'is_passed', 'pass_date', 'filter_user_email', 'filter_user_company_name', 'filter_user_last_name'], 'safe'],
[['id', 'user_id', 'test_id', 'status'], 'integer'],
[['id', 'user_id', 'test_id', 'status', 'end_date', 'filter_user_email', 'filter_user_last_name'], 'safe'],
];
}
......@@ -53,7 +52,7 @@ class SearchPassing extends Passing
'query' => $query,
'pagination' => ['pageSize' => self::PAGE_SIZE],
'sort' => [
'defaultOrder'=>'create_date DESC',
'defaultOrder'=>'start_date DESC',
],
]);
......@@ -80,7 +79,7 @@ class SearchPassing extends Passing
'id' => $this->id,
'user_id' => $this->user_id,
'test_id' => $this->test_id,
'create_date' => $this->create_date,
'start_date' => $this->start_date,
Test::tableName() . '.session_id' => Yii::$app->request->get('session'),
]);
......@@ -90,12 +89,6 @@ class SearchPassing extends Passing
$query->andFilterWhere(['like', User::tableName() . '.email', $this->filter_user_email]);
}
if($this->filter_user_company_name)
{
$with['user'] = true;
$query->andFilterWhere(['like', User::tableName() . '.company_name', $this->filter_user_company_name]);
}
if($this->filter_user_last_name)
{
$with['user'] = true;
......@@ -104,35 +97,35 @@ class SearchPassing extends Passing
// $tpassing = Yii::app()->request->getQuery('Passing');
// $pass_date = 'CONCAT( RIGHT( LEFT( pass_date, 10 ) , 4 ) , "-", TRIM(
// TRAILING CONCAT( ".", SUBSTRING_INDEX( LEFT( pass_date, 10 ) , ".", -1 ) )
// $end_date = 'CONCAT( RIGHT( LEFT( end_date, 10 ) , 4 ) , "-", TRIM(
// TRAILING CONCAT( ".", SUBSTRING_INDEX( LEFT( end_date, 10 ) , ".", -1 ) )
// FROM TRIM(
// LEADING CONCAT( SUBSTRING_INDEX( LEFT( pass_date, 10 ) , ".", 1 ) , "." )
// FROM LEFT( pass_date, 10 ) ) ) , "-", LEFT( pass_date, 2 ) )';
// LEADING CONCAT( SUBSTRING_INDEX( LEFT( end_date, 10 ) , ".", 1 ) , "." )
// FROM LEFT( end_date, 10 ) ) ) , "-", LEFT( end_date, 2 ) )';
// if (($tpassing['pass_date']) && (Yii::app()->request->getQuery('date_to'))) {
// if (($tpassing['end_date']) && (Yii::app()->request->getQuery('date_to'))) {
// $criteria->addCondition($pass_date.' BETWEEN "'.$tpassing['pass_date'].'" AND "'.Yii::app()->request->getQuery('date_to').'"');
// $criteria->addCondition($end_date.' BETWEEN "'.$tpassing['end_date'].'" AND "'.Yii::app()->request->getQuery('date_to').'"');
// }
// elseif(Yii::app()->request->getQuery('date_to')) {
// $criteria->addCondition($pass_date.' < "'.Yii::app()->request->getQuery('date_to').'"');
// $criteria->addCondition($end_date.' < "'.Yii::app()->request->getQuery('date_to').'"');
// }
// elseif($tpassing['pass_date']) {
// $criteria->addCondition($pass_date.' > "'.Yii::app()->request->getQuery('pass_date').'"');
// elseif($tpassing['end_date']) {
// $criteria->addCondition($end_date.' > "'.Yii::app()->request->getQuery('end_date').'"');
// }
// switch ($this->is_passed)
// switch ($this->status)
// {
// case Passing::AUTH:
// $with['user'] = true;
// $query->andFilterWhere(['>', 'ser.create_date', '2014-06-05 00:00:00']);
// $query->andFilterWhere(['>', 'ser.start_date', '2014-06-05 00:00:00']);
// $query->andFilterWhere([User::tableName() . '.is_auth' => 0]);
// break;
// case Passing::STARTED:
// $query->andFilterWhere([
// 'is_passed' => 0,
// 'pass_date' => null,
// 'status' => 0,
// 'end_date' => null,
// Mistake::tableName() . '.passing_id' => null
// ]);
// break;
......@@ -145,7 +138,7 @@ class SearchPassing extends Passing
// case Passing::PASSED:
// $with['mistake'] = true;
// $query->andFilterWhere([
// 'is_passed' => 1,
// 'status' => 1,
// Mistake::tableName() . '.passing_id' => null
// ]);
// break;
......@@ -153,16 +146,16 @@ class SearchPassing extends Passing
// case Passing::FAILED:
// $with['mistake'] = true;
// $query->andFilterWhere([
// 'is_passed' => 0,
// 'status' => 0,
// Mistake::tableName() . '.passing_id' => null
// ]);
// $query->andFilterWhere(['not', 'pass_date', null]);
// $query->andFilterWhere(['not', 'end_date', null]);
// break;
// case Passing::NOT_STARTED:
// $with['mistake'] = true;
// $query->andFilterWhere([
// 'is_passed' => null,
// 'status' => null,
// Mistake::tableName() . '.passing_id' => null
// ]);
// break;
......@@ -183,7 +176,7 @@ class SearchPassing extends Passing
{
$query = $this->query(Yii::$app->request->queryParams);
$query->andWhere(['is_passed' => 1]);
$query->andWhere(['status' => 1]);
return $query->count();
}
......@@ -192,7 +185,7 @@ class SearchPassing extends Passing
{
$query = $this->query(Yii::$app->request->queryParams);
$query->andWhere(['is_passed' => 0]);
$query->andWhere(['status' => 0]);
return $query->count();
}
......@@ -201,7 +194,7 @@ class SearchPassing extends Passing
{
$query = $this->query(Yii::$app->request->queryParams);
$query->andWhere(['is_passed' => 2]);
$query->andWhere(['status' => 2]);
return $query->count();
}
......@@ -210,7 +203,7 @@ class SearchPassing extends Passing
{
$query = $this->query(Yii::$app->request->queryParams);
$query->andWhere(['is_passed' => null]);
$query->andWhere(['status' => null]);
return $query->count();
}
......
......@@ -106,7 +106,7 @@ class Session extends \common\components\ActiveRecordModel
$query->andWhere([
Test::tableName() . '.session_id' => $this->id,
'is_passed' => Passing::PASSED,
'status' => Passing::PASSED,
]);
$query->groupBy(['user_id', 'test_id']);
......
<?php
/*
$this->tabs = array(
'добавить' => $this->createUrl('create')
);
*/
$this->widget('AdminGrid', array(
'id' => 'testing-mistake-grid',
'dataProvider' => $model->search(),
'filter' => $model,
'columns' => array(
array('name' => 'passing_id'),
array('name' => 'description'),
array(
'name' => 'is_expert_agreed',
'value' => 'TestingMistake::$state_list[$data->is_expert_agreed]',
),
array('name' => 'create_date'),
array(
'class' => 'CButtonColumn',
),
),
));
<?php
echo $form;
\ No newline at end of file
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use common\modules\testings\models\Mistake;
/* @var $this yii\web\View */
?>
<div class="faq-view">
<p>
<?= Html::a(Yii::t('content', 'Update'), ['update', 'passing' => $model->passing_id], ['class' => 'btn btn-primary']) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'description',
[
'attribute' => 'is_expert_agreed',
'value' => Mistake::$state_list[$model->is_expert_agreed],
],
'create_date',
],
]) ?>
</div>
<?php
// if ($model->files) {
// $this->widget('fileManager.portlets.FileList', array(
// 'model' => $model,
// 'tag' => 'files',
// 'tagName' => 'div',
// 'htmlOptions' => array(
// 'class' => 'file-list',
// 'style' => 'margin: 20px 10px 0 10px;'
// ),
// ));
// }
\ No newline at end of file
......@@ -62,14 +62,6 @@ use common\modules\testings\models\Passing;
return Html::a($model->user->email, "mailto:" . $model->user->email);
}
],
[
'attribute' => 'filter_user_company_name',
'format' => 'html',
'value' => function($model)
{
return $model->user->company_name;
}
],
[
'attribute' => 'test_id',
'format' => 'html',
......@@ -80,7 +72,7 @@ use common\modules\testings\models\Passing;
}
],
[
'attribute' => 'is_passed',
'attribute' => 'status',
'format' => 'html',
'filter' => Passing::$state_list,
'value' => function($model)
......@@ -88,46 +80,16 @@ use common\modules\testings\models\Passing;
return Html::tag("span", Passing::$state_list[$model->status], ["class" => "STATE" . $model->status]);
}
],
'pass_date',
[
'header' => 'Ответственный менеджер',
'format' => 'html',
'value' => function($model)
{
if($model->user && $model->user->manager)
{
return Html::a($model->user->manager->name, ["/users/user-admin/view", "id" => $model->user->manager->id]);
}
else
{
return "Пользователь удалён";
}
}
],
[
'header' => 'Загрузить сообщение об ошибке',
[
'attribute' => 'passed',
'format' => 'html',
'filter' => false,
'filter' => Passing::$passed_list,
'value' => function($model)
{
if($model->is_passed !== null)
{
if($model->mistake)
{
$text = "Сведения " . $model->mistake->create_date;
}
else
{
$text = "Загрузить";
}
return Html::a($text, ["/testings/passing-admin/mistake", "id" => $model->id]);
}
else
{
return "";
}
return Html::tag("span", Passing::$passed_list[$model->passed], ["class" => "STATE" . $model->passed]);
}
],
'end_date',
[
'class' => 'common\components\ColorActionColumn',
'template' => '{view} {delete}',
......
......@@ -66,14 +66,6 @@ use \common\components\zii\AdminGrid;
return Html::a("Список групп", ["/testings/user-admin/manage-group", "session" => $model->id]);
},
],
[
'header' => 'Список пользователей',
'format' => 'html',
'value' => function($model)
{
// return Html::a("Список пользователей", ["/testings/user-admin/manage", "session" => $model->id]);
},
],
[
'header' => 'Список прохождений',
'format' => 'html',
......@@ -82,14 +74,6 @@ use \common\components\zii\AdminGrid;
return Html::a("Список прохождений", ["/testings/passing-admin/manage", "session" => $model->id]);
},
],
// [
// 'header' => 'Статистика прохождений',
// 'format' => 'html',
// 'value' => function($model)
// {
// return Html::a("Статистика прохождений", ["/testings/passing-admin/statistics", "session" => $model->id]);
// },
// ],
[
'class' => 'common\components\ColorActionColumn',
'template' => '{view} {update}',
......
......@@ -90,4 +90,6 @@ $this->crumbs = array(
</div>
</div>
</div>
<br>
\ No newline at end of file
<br>
<?php echo $this->render('@app/views/layouts/footer-testing'); ?>
\ No newline at end of file
This diff is collapsed.
<?php
use common\modules\testings\models\Passing;
?>
<section class="top_line_testing">
<div class="container">
<div class="row">
......@@ -12,10 +18,10 @@
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<?php if ($model->is_passed == TestingPassing::PASSED) : ?>
<?php if ($model->passed == Passing::PASSED) : ?>
<h1 class="successfully_title">Поздравляем, Вы сдали тест</h1>
<div class="successfully_subtitle">Тестирование завершено</div>
<?php elseif ($model->is_passed == TestingPassing::FAILED) : ?>
<?php elseif ($model->passed == Passing::FAILED) : ?>
<h1 class="successfully_title">Тест не сдан!</h1>
<div class="successfully_subtitle">Тестирование завершено</div>
<?php endif; ?>
......@@ -61,4 +67,6 @@
</div>
</div>
</div>
</section>
\ No newline at end of file
</section>
<?php echo $this->render('@app/views/layouts/footer-testing'); ?>
\ No newline at end of file
<?php
use yii\helpers\Url;
use common\modules\testings\widgets\NotCloseTabsWidget;
use common\modules\testings\models\Question;
?>
<?php
$questions = [];
$count = 0;
foreach ($model->questions as $question)
{
$count++;
$pictures = [];
foreach ($question->question->files as $file)
{
$pictures[] = $file->url;
}
$answers = [];
// если ответ вводит сам пользователь, нельзя отправлять ответ - поскольку в нём указан верный ответ.
foreach ($question->question->answers as $answer)
{
if ($question->question->type <> Question::USER_ANSWER)
{
$answers[] = $answer->text;
}
else
{
$answers[] = 'тут должен быть ответ';
}
}
$questions[$count] = [
'id' => $question->question->id,
'text' => $question->question->text,
'type' => $question->question->type,
'pictures' => $pictures,
'answers' => $answers,
'userAnswer' => '',
'time' => 0,
'theme' => $question->question->theme->name,
];
}
?>
<script type="text/javascript">
$(function(){
countDown.init({
continue: <?=($model->start_date?'true':'false')?>,
startDate: '<?=date("d F Y H:i:s", strtotime($model->start_date))?>',
startDateTime: <?=strtotime($model->start_date)?>,
minutes: <?=$model->test->minutes;?>,
time: <?=time()?>
});
tester.init({
global_id: <?=$current_answer?>,
one_option: <?=Question::ONE_OPTION?>,
few_options: <?=Question::FEW_OPTIONS?>,
user_answer: <?=Question::USER_ANSWER?>,
delimiter: '<?=Question::DELIMITER?>',
questions_count: <?=count($questions)?>,
questions: <?=\yii\helpers\Json::encode($questions)?>,
answerUrl: '<?=Url::to(["/testing/set-answer/".$model->id])?>',
finishUrl: '<?=Url::to(["/testing/finish-test/".$model->id])?>',
passUrl: '<?=Url::to(["/testing/pass/".$model->id])?>'
});
$('#answerBox').on('change','*',tester.answersChangeStatus);
});
</script>
<section class="top_line_testing">
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<strong>Тест: </strong>
<p><?=$model->test->name?> | <span id="questionThemeBox"></span></p>
</div>
</div>
</div>
</section>
<section class="testing_block">
<div class="container">
<?= NotCloseTabsWidget::widget() ?>
<br>
<div class="row">
<div class="col-md-1 col-xs-1 col-sm-2">
<span class="testing_num questionNumber"></span>
</div>
<div class="col-md-11 col-xs-11 col-sm-10">
<h1 class="testing_block_title" id="questionTextBox"></h1>
</div>
</div>
<div class="row">
<div class="col-md-4 col-xs-4 col-sm-12">
<div class="number_questions_img_box" id="questionPictureBox"></div>
<!-- <div class="testing_img_block">
<img src="/images/testing_img.jpg" height="123" width="203" alt="">
</div> -->
</div>
</div>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<form class="testing_form">
<div class="questions" id="answerBox"></div>
<div class="answer" id="sendInfoBox"></div>
<!-- <div class="input_bg">
<input id="radio1" type="radio" name="radio" class="radio" checked>
<label for="radio1">Только макет в PSD</label>
</div>
<div class="input_bg">
<input id="checkbox1" type="checkbox" class="checkbox">
<label for="checkbox1">Макет и техническое задание по проекту</label>
</div>
<div class="input_bg">
<input id="radio2" type="radio" name="radio" class="radio">
<label for="radio2">Макет и задание описывающее краткий функционал front-end (дизайна)</label>
</div>
<div class="input_bg">
<input type="text" placeholder="Ваш ответ">
</div> -->
<button id="clickNext" class="testing_form_btn" onClick="tester.nextQuestion(); return false;">Подтвердить ответ</button>
</form>
</div>
</div>
<div class="row col-md-12 col-xs-12 col-sm-12">
<h4 class="testing_info_foot" id="messageStep50"></h4>
<h4 class="testing_info_foot" id="messageStep75"></h4>
<h4 class="testing_info_foot" id="messageStep100"></h4>
</div>
</div>
</section>
<section class="testing_foot">
<div class="container">
<div class="row">
<div class="test_ft clearfix">
<div class="col-md-6 col-xs-8 col-sm-12">
<div class="testing_votes">Вопрос <strong class="questionNumber">1</strong> из <strong><?=count($questions)?></strong></div>
<div class="testing_progress"><div class="testing_progress_proc" id="progressbar" style="width:0%;"></div></div>
</div>
<div class="col-md-6 col-xs-4 col-sm-12">
<div class="testing_time">До конца осталось: <span id="countdown_timer"></span></div>
</div>
</div>
</div>
</div>
</section>
<?php echo $this->render('@app/views/layouts/footer-testing'); ?>
\ No newline at end of file
......@@ -10,7 +10,7 @@ class NotCloseTabsWidget extends Widget
public function run()
{
return $this->render('NotCloseTabsWidget', [
'message' => Settings::getValue('not_close_tabs_message');
'message' => Settings::getValue('not_close_tabs_message')
]);
}
}
......
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160225_043622_fix_passing_table extends Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
$this->alterColumn('testings_passings', 'attempt', Schema::TYPE_INTEGER . '(3) NOT NULL DEFAULT 0');
$this->addColumn('testings_passings', 'percent', Schema::TYPE_INTEGER . '(11) NOT NULL DEFAULT 0 AFTER points');
$this->addColumn('testings_passings', 'passed', Schema::TYPE_INTEGER . '(1) NOT NULL DEFAULT 0 AFTER status');
$this->dropTable('testings_mistakes');
}
public function safeDown()
{
$this->alterColumn('testings_passings', 'attempt', Schema::TYPE_INTEGER . '(3) NOT NULL');
$this->dropColumn('testings_passings', 'percent');
$this->dropColumn('testings_passings', 'passed');
$this->createTable('testings_mistakes', [
'id' => Schema::TYPE_PK,
'passing_id' => Schema::TYPE_INTEGER . '(11) NOT NULL',
'description' => Schema::TYPE_STRING . '(3000) NOT NULL',
'is_expert_agreed' => 'tinyint(1) NOT NULL',
'create_date' => Schema::TYPE_TIMESTAMP . ' NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
]);
}
}
......@@ -7,7 +7,7 @@
<?php $this->registerJsFile('/js/modernizr.min.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/libs/bootstrap/js/bootstrap.min.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/libs/bootstrap/js/bootstrap.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/libs/waypoints/waypoints.min.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/libs/magnific/jquery.magnific-popup.min.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/libs/bxslider/jquery.bxslider.min.js', ['position' => yii\web\View::POS_END ]);?>
......
......@@ -48,6 +48,13 @@ section .container ol:not([class]) li {
section.reviews-block .row {
margin-bottom: 50px;
}
.input_bg {
padding: 6px 10px 13px;
line-height: 18px;
}
.input_bg label {
padding: 6px 0px 0px 35px !important;
}
a.login_form_link, a.login_form_popup_link, a.reg_popup_link, a.reg_form_link{
margin-top: 20px;
display: block;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment