Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
64fae795
Commit
64fae795
authored
Feb 26, 2016
by
Шакарим Сапа
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
6d31f7fc
c0ab0ad0
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
173 additions
and
92 deletions
+173
-92
common/modules/school/controllers/LessonController.php
common/modules/school/controllers/LessonController.php
+13
-1
common/modules/school/views/lesson/view.php
common/modules/school/views/lesson/view.php
+60
-14
common/modules/testings/controllers/SessionAdminController.php
...n/modules/testings/controllers/SessionAdminController.php
+1
-19
common/modules/testings/controllers/TestController.php
common/modules/testings/controllers/TestController.php
+25
-26
common/modules/testings/models/Passing.php
common/modules/testings/models/Passing.php
+14
-0
common/modules/testings/models/SearchPassing.php
common/modules/testings/models/SearchPassing.php
+4
-2
common/modules/testings/models/Session.php
common/modules/testings/models/Session.php
+1
-1
common/modules/testings/models/Test.php
common/modules/testings/models/Test.php
+6
-0
common/modules/testings/views/passing-admin/view.php
common/modules/testings/views/passing-admin/view.php
+4
-4
common/modules/testings/views/session-admin/manage.php
common/modules/testings/views/session-admin/manage.php
+1
-1
common/modules/testings/views/session-admin/view.php
common/modules/testings/views/session-admin/view.php
+1
-7
common/modules/testings/views/test-admin/manage.php
common/modules/testings/views/test-admin/manage.php
+2
-0
common/modules/testings/views/test-admin/view.php
common/modules/testings/views/test-admin/view.php
+2
-0
common/modules/testings/views/test/error.php
common/modules/testings/views/test/error.php
+13
-4
common/modules/testings/views/test/statistics.php
common/modules/testings/views/test/statistics.php
+12
-2
common/modules/testings/views/test/test.php
common/modules/testings/views/test/test.php
+0
-3
frontend/web/js/testing.js
frontend/web/js/testing.js
+14
-8
No files found.
common/modules/school/controllers/LessonController.php
View file @
64fae795
...
@@ -2,9 +2,12 @@
...
@@ -2,9 +2,12 @@
namespace
common\modules\school\controllers
;
namespace
common\modules\school\controllers
;
use
Yii
;
use
common\components\BaseController
;
use
common\components\BaseController
;
use
common\modules\school\models\Lessons
;
use
common\modules\school\models\Lessons
;
use
common\modules\testings\models\Passing
;
class
LessonController
extends
BaseController
class
LessonController
extends
BaseController
{
{
...
@@ -18,10 +21,19 @@ class LessonController extends BaseController
...
@@ -18,10 +21,19 @@ class LessonController extends BaseController
public
function
actionView
(
$id
)
public
function
actionView
(
$id
)
{
{
$model
=
Lessons
::
findOne
(
$id
);
$model
=
Lessons
::
findOne
(
$id
);
\Yii
::
$app
->
view
->
registerMetaTag
([
\Yii
::
$app
->
view
->
registerMetaTag
([
'property'
=>
'og:title'
,
'property'
=>
'og:title'
,
'content'
=>
$model
->
title
'content'
=>
$model
->
title
]);
]);
return
$this
->
render
(
'view'
,
[
'model'
=>
$model
]);
// Ищим прохождение теста
$passing
=
null
;
if
(
$model
->
test
)
{
$passing
=
Passing
::
find
()
->
where
([
'test_id'
=>
$model
->
test_id
,
'user_id'
=>
Yii
::
$app
->
user
->
id
])
->
one
();
}
return
$this
->
render
(
'view'
,
compact
(
'model'
,
'passing'
));
}
}
}
}
common/modules/school/views/lesson/view.php
View file @
64fae795
...
@@ -4,6 +4,7 @@ use yii\helpers\Url;
...
@@ -4,6 +4,7 @@ use yii\helpers\Url;
use
common\modules\users\widgets\UserBoxWidget
;
use
common\modules\users\widgets\UserBoxWidget
;
use
common\modules\school\assets\WidgetAssetBundle
;
use
common\modules\school\assets\WidgetAssetBundle
;
use
common\modules\testings\models\Passing
;
WidgetAssetBundle
::
register
(
$this
);
WidgetAssetBundle
::
register
(
$this
);
?>
?>
...
@@ -75,7 +76,11 @@ WidgetAssetBundle::register($this);
...
@@ -75,7 +76,11 @@ WidgetAssetBundle::register($this);
</section>
</section>
<section
class=
"vc-cont"
>
<section
class=
"vc-cont"
>
<div
class=
"container"
>
<div
class=
"container"
>
<?php
if
(
$model
->
test
)
:
?>
<?php
if
(
$model
->
test
)
:
?>
<?php
if
(
!
$passing
)
:
?>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4 col-xs-5 col-sm-12"
>
<div
class=
"col-md-4 col-xs-5 col-sm-12"
>
<a
href=
"
<?=
Url
::
to
([
'/testing/info/'
.
$model
->
test_id
])
?>
"
class=
"vc_bt_quit_less"
>
Завершить урок
</a>
<a
href=
"
<?=
Url
::
to
([
'/testing/info/'
.
$model
->
test_id
])
?>
"
class=
"vc_bt_quit_less"
>
Завершить урок
</a>
...
@@ -84,14 +89,55 @@ WidgetAssetBundle::register($this);
...
@@ -84,14 +89,55 @@ WidgetAssetBundle::register($this);
<div
class=
"vc_quit_txt"
>
Чтобы завершить урок, выполните задание.
</div>
<div
class=
"vc_quit_txt"
>
Чтобы завершить урок, выполните задание.
</div>
</div>
</div>
</div>
</div>
<?php
endif
;
?>
<!-- <div class="row">
<?php
else
:
?>
<?php
if
(
$passing
->
status
==
Passing
::
STARTED
&&
strtotime
(
$passing
->
start_date
)
+
(
$passing
->
test
->
minutes
*
60
)
>
time
()
&&
$passing
->
attempt
<
$passing
->
test
->
attempt
)
:
?>
<div
class=
"row"
>
<div
class=
"col-md-4 col-xs-5 col-sm-12"
>
<a
href=
"
<?=
Url
::
to
([
'/testing/pass/'
.
$passing
->
id
])
?>
"
class=
"vc_bt_quit_less"
>
Продолжить
</a>
</div>
<div
class=
"col-md-8 col-xs-7 col-sm-12"
>
<div
class=
"vc_quit_txt"
>
Пожалуйста, завершите начатое тестирование.
</div>
</div>
</div>
<?php
elseif
(
$passing
->
passed
==
Passing
::
PASSED
)
:
?>
<div
class=
"row"
>
<div
class=
"col-md-4 col-xs-5 col-sm-12"
>
<a
href=
"
<?=
Url
::
to
([
'/testing/statistic/'
.
$passing
->
id
])
?>
"
class=
"vc_bt_quit_less"
>
Результаты
</a>
</div>
<div
class=
"col-md-8 col-xs-7 col-sm-12"
>
<div
class=
"vc_quit_txt"
>
Вы можете посмотреть результаты теста.
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"vc_green_inf"
>
<div
class=
"vc_green_inf"
>
<span>Тестирование успешно пройдено. Вы набрали 99 999 балов.<br> Оставляйте комментарии, что бы увеличить Ваш рейтинг.</span>
<span>
Тестирование успешно пройдено. Вы набрали
<?=
$passing
->
points
?>
баллов.
<br>
Оставляйте комментарии, что бы увеличить Ваш рейтинг.
</span>
</div>
</div>
</div>
</div>
</div>
</div> -->
<?php
else
:
?>
<div
class=
"row"
>
<div
class=
"col-md-4 col-xs-5 col-sm-12"
>
<a
href=
"
<?=
Url
::
to
([
'/testing/info/'
.
$model
->
test_id
])
?>
"
class=
"vc_bt_quit_less"
>
Пересдать
</a>
</div>
<div
class=
"col-md-8 col-xs-7 col-sm-12"
>
<div
class=
"vc_quit_txt"
>
Может быть повезет на этот раз?
</div>
</div>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
if
(
$model
->
text
)
:
?>
<?php
if
(
$model
->
text
)
:
?>
<div
class=
"row"
>
<div
class=
"row"
>
...
...
common/modules/testings/controllers/SessionAdminController.php
View file @
64fae795
...
@@ -35,26 +35,8 @@ class SessionAdminController extends AdminController
...
@@ -35,26 +35,8 @@ class SessionAdminController extends AdminController
{
{
$model
=
$this
->
findModel
(
$id
);
$model
=
$this
->
findModel
(
$id
);
$test_ids
=
array_keys
(
\yii\helpers\ArrayHelper
::
map
(
$model
->
tests
,
'id'
,
'name'
));
$query
=
Passing
::
find
()
->
joinWith
(
'user'
)
->
where
([
'test_id'
=>
$test_ids
,
]);
$query
->
andWhere
([
'<>'
,
'end_date'
,
""
]);
$users
=
[];
foreach
(
$query
->
all
()
as
$passing
)
{
$users
[
$passing
->
end_date
]
=
$passing
->
user
;
}
return
$this
->
render
(
'view'
,
[
return
$this
->
render
(
'view'
,
[
'model'
=>
$model
,
'model'
=>
$model
'users'
=>
$users
]);
]);
}
}
...
...
common/modules/testings/controllers/TestController.php
View file @
64fae795
...
@@ -31,12 +31,18 @@ class TestController extends \common\components\BaseController
...
@@ -31,12 +31,18 @@ class TestController extends \common\components\BaseController
{
{
$model
=
$this
->
findModel
(
$id
);
$model
=
$this
->
findModel
(
$id
);
if
(
if
(
$model
)
$model
// && $model->user_id == Yii::app()->request->cookies[self::AUTH_COOKIE]->value
// && $model->status == TestingPassing::NOT_STARTED
)
{
{
$passing
=
Passing
::
find
()
->
where
([
'user_id'
=>
Yii
::
$app
->
user
->
identity
->
id
,
'test_id'
=>
$id
])
->
one
();
if
(
$passing
&&
$passing
->
passed
==
Passing
::
PASSED
)
{
return
$this
->
redirect
([
'/testing/statistic/'
.
$passing
->
id
]);
}
return
$this
->
render
(
'info'
,
[
return
$this
->
render
(
'info'
,
[
'model'
=>
$model
'model'
=>
$model
]);
]);
...
@@ -68,18 +74,21 @@ class TestController extends \common\components\BaseController
...
@@ -68,18 +74,21 @@ class TestController extends \common\components\BaseController
$passing
->
status
=
Passing
::
NOT_STARTED
;
$passing
->
status
=
Passing
::
NOT_STARTED
;
}
}
if
(
$passing
&&
$passing
->
passed
==
Passing
::
PASSED
)
{
return
$this
->
redirect
([
'/testing/statistic/'
.
$passing
->
id
]);
}
// Проверяем статус прохождения
// Проверяем статус прохождения
switch
(
$passing
->
status
)
switch
(
$passing
->
status
)
{
{
case
Passing
::
FAILED
:
case
Passing
::
PASSED
:
case
Passing
::
NOT_STARTED
:
case
Passing
::
NOT_STARTED
:
case
Passing
::
ENDED
:
$passing
->
start_date
=
date
(
'd.m.Y H:i:s'
);
$passing
->
start_date
=
date
(
'd.m.Y H:i:s'
);
$passing
->
passed
=
Passing
::
FAILED
;
$passing
->
passed
=
Passing
::
FAILED
;
$passing
->
end_date
=
null
;
$passing
->
end_date
=
null
;
$passing
->
percent
=
0
;
$passing
->
percent
=
0
;
$passing
->
attempt
=
0
;
$passing
->
attempt
=
0
;
$passing
->
points
=
0
;
break
;
break
;
case
Passing
::
STARTED
:
case
Passing
::
STARTED
:
...
@@ -281,12 +290,10 @@ class TestController extends \common\components\BaseController
...
@@ -281,12 +290,10 @@ class TestController extends \common\components\BaseController
if
(
$passing
->
end_date
===
null
)
if
(
$passing
->
end_date
===
null
)
{
{
$passing
->
end_date
=
date
(
'd.m.Y H:i:s'
);
$passing
->
end_date
=
date
(
'd.m.Y H:i:s'
);
$passing
->
status
=
Passing
::
ENDED
;
$passing
->
status
=
Passing
::
ENDED
;
$passing
->
recountPassResult
();
$passing
->
recountPassResult
();
$passing
->
percent
=
$passing
->
getPercentRight
();
$passing
->
percent
=
$passing
->
getPercentRight
();
$passing
->
addPoints
();
$passing
->
save
();
$passing
->
save
();
...
@@ -307,26 +314,18 @@ class TestController extends \common\components\BaseController
...
@@ -307,26 +314,18 @@ class TestController extends \common\components\BaseController
{
{
$passing
=
$this
->
findPassing
(
$id
);
$passing
=
$this
->
findPassing
(
$id
);
if
(
$passing
->
attempt
>=
$passing
->
test
->
attempt
||
strtotime
(
$passing
->
start_date
)
+
(
$passing
->
test
->
minutes
*
60
)
<
time
())
if
(
$passing
->
attempt
>=
$passing
->
test
->
attempt
||
(
$passing
->
end_date
&&
strtotime
(
$passing
->
start_date
)
+
(
$passing
->
test
->
minutes
*
60
)
<
strtotime
(
$passing
->
end_date
))
||
(
!
$passing
->
end_date
&&
strtotime
(
$passing
->
start_date
)
+
(
$passing
->
test
->
minutes
*
60
)
<
time
()))
{
{
return
$this
->
render
(
'error'
,
[
return
$this
->
render
(
'error'
,
[
'model'
=>
$passing
,
'model'
=>
$passing
,
]);
]);
}
}
switch
(
$passing
->
passed
)
{
case
Passing
::
FAILED
:
case
Passing
::
PASSED
:
return
$this
->
render
(
'statistics'
,
[
return
$this
->
render
(
'statistics'
,
[
'model'
=>
$passing
,
'model'
=>
$passing
,
]);
]);
break
;
default
:
throw
new
NotFoundHttpException
(
'The requested page does not exist.'
);
break
;
}
}
}
/**
/**
...
...
common/modules/testings/models/Passing.php
View file @
64fae795
...
@@ -196,4 +196,18 @@ class Passing extends \common\components\ActiveRecordModel
...
@@ -196,4 +196,18 @@ class Passing extends \common\components\ActiveRecordModel
return
true
;
return
true
;
}
}
public
function
addPoints
()
{
if
(
$this
->
passed
==
Passing
::
PASSED
)
{
$this
->
points
=
$this
->
test
->
passed_scores
;
}
else
{
$this
->
points
=
$this
->
test
->
notpassed_scores
;
}
return
true
;
}
}
}
common/modules/testings/models/SearchPassing.php
View file @
64fae795
...
@@ -23,8 +23,8 @@ class SearchPassing extends Passing
...
@@ -23,8 +23,8 @@ class SearchPassing extends Passing
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'id'
,
'user_id'
,
'test_id'
,
'status'
],
'integer'
],
[[
'id'
,
'user_id'
,
'test_id'
,
'status'
,
'passed'
],
'integer'
],
[[
'id'
,
'user_id'
,
'test_id'
,
'status'
,
'end_date'
,
'filter_user_email'
,
'filter_user_last_name'
],
'safe'
],
[[
'id'
,
'user_id'
,
'test_id'
,
'status'
,
'
passed'
,
'
end_date'
,
'filter_user_email'
,
'filter_user_last_name'
],
'safe'
],
];
];
}
}
...
@@ -78,6 +78,8 @@ class SearchPassing extends Passing
...
@@ -78,6 +78,8 @@ class SearchPassing extends Passing
$query
->
andFilterWhere
([
$query
->
andFilterWhere
([
'id'
=>
$this
->
id
,
'id'
=>
$this
->
id
,
'user_id'
=>
$this
->
user_id
,
'user_id'
=>
$this
->
user_id
,
'status'
=>
$this
->
status
,
'passed'
=>
$this
->
passed
,
'test_id'
=>
$this
->
test_id
,
'test_id'
=>
$this
->
test_id
,
'start_date'
=>
$this
->
start_date
,
'start_date'
=>
$this
->
start_date
,
Test
::
tableName
()
.
'.session_id'
=>
Yii
::
$app
->
request
->
get
(
'session'
),
Test
::
tableName
()
.
'.session_id'
=>
Yii
::
$app
->
request
->
get
(
'session'
),
...
...
common/modules/testings/models/Session.php
View file @
64fae795
...
@@ -106,7 +106,7 @@ class Session extends \common\components\ActiveRecordModel
...
@@ -106,7 +106,7 @@ class Session extends \common\components\ActiveRecordModel
$query
->
andWhere
([
$query
->
andWhere
([
Test
::
tableName
()
.
'.session_id'
=>
$this
->
id
,
Test
::
tableName
()
.
'.session_id'
=>
$this
->
id
,
'
status
'
=>
Passing
::
PASSED
,
'
passed
'
=>
Passing
::
PASSED
,
]);
]);
$query
->
groupBy
([
'user_id'
,
'test_id'
]);
$query
->
groupBy
([
'user_id'
,
'test_id'
]);
...
...
common/modules/testings/models/Test.php
View file @
64fae795
...
@@ -10,6 +10,7 @@ use yii\helpers\ArrayHelper;
...
@@ -10,6 +10,7 @@ use yii\helpers\ArrayHelper;
use
common\modules\testings\models\Passing
;
use
common\modules\testings\models\Passing
;
use
common\modules\testings\models\Session
;
use
common\modules\testings\models\Session
;
use
common\modules\testings\models\Question
;
use
common\modules\testings\models\Question
;
use
common\modules\school\models\Lessons
;
class
Test
extends
\common\components\ActiveRecordModel
class
Test
extends
\common\components\ActiveRecordModel
{
{
...
@@ -105,6 +106,11 @@ class Test extends \common\components\ActiveRecordModel
...
@@ -105,6 +106,11 @@ class Test extends \common\components\ActiveRecordModel
return
$this
->
hasOne
(
Question
::
className
(),
[
'id'
=>
'test_id'
]);
return
$this
->
hasOne
(
Question
::
className
(),
[
'id'
=>
'test_id'
]);
}
}
public
function
getLesson
()
{
return
$this
->
hasOne
(
Lessons
::
className
(),
[
'test_id'
=>
'id'
]);
}
public
static
function
getTestsList
(
$session_id
)
public
static
function
getTestsList
(
$session_id
)
{
{
return
ArrayHelper
::
map
(
self
::
find
()
->
where
([
'session_id'
=>
$session_id
]),
'id'
,
'name'
);
return
ArrayHelper
::
map
(
self
::
find
()
->
where
([
'session_id'
=>
$session_id
]),
'id'
,
'name'
);
...
...
common/modules/testings/views/passing-admin/view.php
View file @
64fae795
...
@@ -28,7 +28,7 @@ use common\modules\testings\models\Passing;
...
@@ -28,7 +28,7 @@ use common\modules\testings\models\Passing;
'attributes'
=>
[
'attributes'
=>
[
[
[
'attribute'
=>
'user_id'
,
'attribute'
=>
'user_id'
,
'value'
=>
(
$model
->
user
)
?
Html
::
a
(
$model
->
user
->
fio
,
[
"/testings/user-admin/view"
,
"id"
=>
$model
->
user
->
id
])
:
"Пользователь удалён"
,
'value'
=>
(
$model
->
user
)
?
$model
->
user
->
surname
.
' '
.
$model
->
user
->
name
:
"Пользователь удалён"
,
'format'
=>
'html'
,
'format'
=>
'html'
,
],
],
[
[
...
@@ -42,11 +42,11 @@ use common\modules\testings\models\Passing;
...
@@ -42,11 +42,11 @@ use common\modules\testings\models\Passing;
'format'
=>
'html'
,
'format'
=>
'html'
,
],
],
[
[
'attribute'
=>
'
is_
passed'
,
'attribute'
=>
'passed'
,
'format'
=>
'raw'
,
'format'
=>
'raw'
,
'value'
=>
Passing
::
$
state_list
[
$model
->
is_passed
]
.
" (
{
$model
->
CountPassedQuestions
}
-
{
$model
->
percent_rights
}
%)"
,
'value'
=>
Passing
::
$
passed_list
[
$model
->
passed
]
.
" (
{
$model
->
CountPassedQuestions
}
-
{
$model
->
percent
}
%)"
,
],
],
'
pass
_date'
,
'
end
_date'
,
],
],
])
?>
])
?>
...
...
common/modules/testings/views/session-admin/manage.php
View file @
64fae795
...
@@ -30,7 +30,7 @@ use \common\components\zii\AdminGrid;
...
@@ -30,7 +30,7 @@ use \common\components\zii\AdminGrid;
'start_date'
,
'start_date'
,
'end_date'
,
'end_date'
,
[
[
'header'
=>
'
Назначено тестов
'
,
'header'
=>
'
Прохождений
'
,
'value'
=>
function
(
$model
)
'value'
=>
function
(
$model
)
{
{
return
$model
->
usersOverall
;
return
$model
->
usersOverall
;
...
...
common/modules/testings/views/session-admin/view.php
View file @
64fae795
...
@@ -14,7 +14,7 @@ use yii\widgets\DetailView;
...
@@ -14,7 +14,7 @@ use yii\widgets\DetailView;
<p>
<p>
<?=
Html
::
a
(
Yii
::
t
(
'content'
,
'Update'
),
[
'update'
,
'id'
=>
$model
->
id
],
[
'class'
=>
'btn btn-primary'
])
?>
<?=
Html
::
a
(
Yii
::
t
(
'content'
,
'Update'
),
[
'update'
,
'id'
=>
$model
->
id
],
[
'class'
=>
'btn btn-primary'
])
?>
<
?=
Html
::
a
(
"Экспорт результатов"
,
[
'testings/session-admin/export-session-result'
,
'id'
=>
$model
->
id
],
[
'class'
=>
'btn btn-info'
])
?
>
<
!--
<?=
Html
::
a
(
"Экспорт результатов"
,
[
'testings/session-admin/export-session-result'
,
'id'
=>
$model
->
id
],
[
'class'
=>
'btn btn-info'
])
?>
--
>
</p>
</p>
<?=
DetailView
::
widget
([
<?=
DetailView
::
widget
([
...
@@ -27,10 +27,4 @@ use yii\widgets\DetailView;
...
@@ -27,10 +27,4 @@ use yii\widgets\DetailView;
],
],
])
?>
])
?>
<?php
echo
'<br/><br/><h2>Продленные сессии</h2>'
;
?>
<?php
foreach
(
$users
as
$time
=>
$user
)
{
echo
$user
->
first_name
.
' '
.
$user
->
last_name
.
' '
.
$user
->
patronymic
.
' до '
.
$time
.
'<br/>'
;
}
?>
</div>
</div>
\ No newline at end of file
common/modules/testings/views/test-admin/manage.php
View file @
64fae795
...
@@ -44,6 +44,8 @@ if($session)
...
@@ -44,6 +44,8 @@ if($session)
'minutes'
,
'minutes'
,
'questions'
,
'questions'
,
'pass_percent'
,
'pass_percent'
,
'passed_scores'
,
'notpassed_scores'
,
'attempt'
,
'attempt'
,
[
[
'header'
=>
'Список вопросов'
,
'header'
=>
'Список вопросов'
,
...
...
common/modules/testings/views/test-admin/view.php
View file @
64fae795
...
@@ -29,6 +29,8 @@ use yii\widgets\DetailView;
...
@@ -29,6 +29,8 @@ use yii\widgets\DetailView;
'minutes'
,
'minutes'
,
'questions'
,
'questions'
,
'pass_percent'
,
'pass_percent'
,
'passed_scores'
,
'notpassed_scores'
,
'attempt'
,
'attempt'
,
'create_date'
,
'create_date'
,
],
],
...
...
common/modules/testings/views/test/error.php
View file @
64fae795
<?php
<?php
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\helpers\Url
;
use
yii\widgets\ActiveForm
;
use
yii\widgets\ActiveForm
;
use
common\models\Settings
;
use
common\models\Settings
;
...
@@ -21,14 +22,21 @@ use common\models\Settings;
...
@@ -21,14 +22,21 @@ use common\models\Settings;
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<h1
class=
"successfully_title"
>
Тестирование не завершено.
</h1>
<h1
class=
"successfully_title"
>
Сожалеем, но у вас закончилось время.
</h1>
<h6>
Для переназначения теста позвоните в службу поддержки по телефону
<?=
Settings
::
getValue
(
'content-phone'
);
?>
</h6>
<div
class=
"successfully_subtitle"
style=
"color: #4A6377;font-size: 36px;margin-top:10px;"
>
Вам начислено
<?=
$model
->
points
?>
баллов
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"list_back"
style=
"padding-bottom: 0;"
>
<a
href=
"
<?=
Url
::
to
([
'/testing/gen-pass/'
.
$model
->
test_id
])
?>
"
>
Попробуйте пройти тест еще раз
</a>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"error_fedback clearfix"
>
<div
class=
"error_fedback clearfix"
>
<h6>
Обратная связь
</h6>
<h6>
Скажите, какие вопросы вызывали трудности?
</h6>
<?php
$form
=
ActiveForm
::
begin
([
<?php
$form
=
ActiveForm
::
begin
([
'id'
=>
'error-testing-form'
,
'id'
=>
'error-testing-form'
,
'action'
=>
[
'/testing/send-not-attempt/'
.
$model
->
id
]
'action'
=>
[
'/testing/send-not-attempt/'
.
$model
->
id
]
...
@@ -46,7 +54,8 @@ use common\models\Settings;
...
@@ -46,7 +54,8 @@ use common\models\Settings;
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"list_back"
>
<div
class=
"list_back"
>
<a
href=
"#"
>
Вернуться к списку тестов
<span>
↑
</span></a>
<a
href=
"
<?=
Url
::
to
([
'/school/course/'
.
$model
->
test
->
lesson
->
course
->
id
])
?>
"
>
Вернуться к списку уроков
<span>
↑
</span></a>
<a
href=
"
<?=
Url
::
to
([
'/school/lesson/'
.
$model
->
test
->
lesson
->
id
])
?>
"
>
Вернуться к уроку
<span>
↑
</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
common/modules/testings/views/test/statistics.php
View file @
64fae795
<?php
<?php
use
yii\helpers\Url
;
use
common\modules\testings\models\Passing
;
use
common\modules\testings\models\Passing
;
?>
?>
...
@@ -20,11 +22,11 @@ use common\modules\testings\models\Passing;
...
@@ -20,11 +22,11 @@ use common\modules\testings\models\Passing;
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<?php
if
(
$model
->
passed
==
Passing
::
PASSED
)
:
?>
<?php
if
(
$model
->
passed
==
Passing
::
PASSED
)
:
?>
<h1
class=
"successfully_title"
>
Поздравляем, Вы сдали тест
</h1>
<h1
class=
"successfully_title"
>
Поздравляем, Вы сдали тест
</h1>
<div
class=
"successfully_subtitle"
>
Тестирование завершено
</div>
<?php
elseif
(
$model
->
passed
==
Passing
::
FAILED
)
:
?>
<?php
elseif
(
$model
->
passed
==
Passing
::
FAILED
)
:
?>
<h1
class=
"successfully_title"
>
Тест не сдан!
</h1>
<h1
class=
"successfully_title"
>
Тест не сдан!
</h1>
<div
class=
"successfully_subtitle"
>
Тестирование завершено
</div>
<?php
endif
;
?>
<?php
endif
;
?>
<div
class=
"successfully_subtitle"
style=
"color: #404146;font-size: 20px;"
>
Количество набранных баллов:
</div>
<div
class=
"successfully_subtitle"
style=
"color: #4A6377;font-size: 36px;margin-top:-15px;"
>
<?=
$model
->
points
?>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
...
@@ -41,6 +43,14 @@ use common\modules\testings\models\Passing;
...
@@ -41,6 +43,14 @@ use common\modules\testings\models\Passing;
<div
class=
"succes_block_cont"
>
<?=
$minutesText
?>
<?=
$secondsText
?>
</div>
<div
class=
"succes_block_cont"
>
<?=
$minutesText
?>
<?=
$secondsText
?>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-12 col-xs-12 col-sm-12"
>
<div
class=
"list_back"
>
<a
href=
"
<?=
Url
::
to
([
'/school/course/'
.
$model
->
test
->
lesson
->
course
->
id
])
?>
"
>
Вернуться к списку уроков
<span>
↑
</span></a>
<a
href=
"
<?=
Url
::
to
([
'/school/lesson/'
.
$model
->
test
->
lesson
->
id
])
?>
"
>
Вернуться к уроку
<span>
↑
</span></a>
</div>
</div>
</div>
<!-- <div class="row">
<!-- <div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="col-md-12 col-xs-12 col-sm-12">
<ul class="stat_testing">
<ul class="stat_testing">
...
...
common/modules/testings/views/test/test.php
View file @
64fae795
...
@@ -52,7 +52,6 @@ use common\modules\testings\models\Question;
...
@@ -52,7 +52,6 @@ use common\modules\testings\models\Question;
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
$
(
function
(){
$
(
function
(){
countDown
.
init
({
countDown
.
init
({
continue
:
<?=
(
$model
->
start_date
?
'true'
:
'false'
)
?>
,
continue
:
<?=
(
$model
->
start_date
?
'true'
:
'false'
)
?>
,
startDate
:
'
<?=
date
(
"d F Y H:i:s"
,
strtotime
(
$model
->
start_date
))
?>
'
,
startDate
:
'
<?=
date
(
"d F Y H:i:s"
,
strtotime
(
$model
->
start_date
))
?>
'
,
...
@@ -73,8 +72,6 @@ use common\modules\testings\models\Question;
...
@@ -73,8 +72,6 @@ use common\modules\testings\models\Question;
finishUrl
:
'
<?=
Url
::
to
([
"/testing/finish-test/"
.
$model
->
id
])
?>
'
,
finishUrl
:
'
<?=
Url
::
to
([
"/testing/finish-test/"
.
$model
->
id
])
?>
'
,
passUrl
:
'
<?=
Url
::
to
([
"/testing/pass/"
.
$model
->
id
])
?>
'
passUrl
:
'
<?=
Url
::
to
([
"/testing/pass/"
.
$model
->
id
])
?>
'
});
});
$
(
'
#answerBox
'
).
on
(
'
change
'
,
'
*
'
,
tester
.
answersChangeStatus
);
});
});
</script>
</script>
...
...
frontend/web/js/testing.js
View file @
64fae795
...
@@ -145,7 +145,7 @@ tester = {
...
@@ -145,7 +145,7 @@ tester = {
}
}
if
(
q
[
'
type
'
]
==
tester
.
options
.
user_answer
)
{
if
(
q
[
'
type
'
]
==
tester
.
options
.
user_answer
)
{
tester
.
answerBox
.
html
(
''
);
tester
.
answerBox
.
html
(
''
);
tester
.
answerBox
.
append
(
'
<div class="input_bg"><input type="text" value="" placeholder="Ваш ответ" /></div>
'
);
tester
.
answerBox
.
append
(
'
<div class="input_bg"><input type="text"
class="textarea"
value="" placeholder="Ваш ответ" /></div>
'
);
}
}
tester
.
answerBox
.
append
(
'
<div class="clear"></div>
'
);
tester
.
answerBox
.
append
(
'
<div class="clear"></div>
'
);
});
});
...
@@ -184,7 +184,7 @@ tester = {
...
@@ -184,7 +184,7 @@ tester = {
if
(
q
[
'
type
'
]
==
this
.
options
.
user_answer
)
if
(
q
[
'
type
'
]
==
this
.
options
.
user_answer
)
{
{
this
.
answerBox
.
find
(
'
textarea
'
).
each
(
function
(){
this
.
answerBox
.
find
(
'
input.
textarea
'
).
each
(
function
(){
answer
.
push
(
$
(
this
).
val
());
answer
.
push
(
$
(
this
).
val
());
});
});
}
}
...
@@ -308,6 +308,7 @@ tester = {
...
@@ -308,6 +308,7 @@ tester = {
var
clickNext
=
$
(
'
#clickNext
'
);
var
clickNext
=
$
(
'
#clickNext
'
);
var
sendInfoBox
=
$
(
'
#sendInfoBox
'
);
var
sendInfoBox
=
$
(
'
#sendInfoBox
'
);
clickNext
.
css
(
'
display
'
,
'
none
'
);
clickNext
.
css
(
'
display
'
,
'
none
'
);
this
.
questionNumberBox
.
remove
();
this
.
resetQuestion
();
this
.
resetQuestion
();
$
(
'
p.uploading_info
'
).
remove
();
$
(
'
p.uploading_info
'
).
remove
();
...
@@ -338,14 +339,19 @@ tester = {
...
@@ -338,14 +339,19 @@ tester = {
answersChangeStatus
:
function
()
{
answersChangeStatus
:
function
()
{
var
clickNext
=
$
(
'
#clickNext
'
);
var
clickNext
=
$
(
'
#clickNext
'
);
if
((
$
(
'
#answerBox input:radio:checked
'
).
length
>
0
)
if
(
$
(
'
#answerBox input:radio:checked
'
).
length
>
0
||
$
(
'
#answerBox input:checkbox:checked
'
).
length
>
0
||
$
(
'
#answerBox input[type="text"]
'
).
val
()
!=
''
)
||
(
$
(
'
#answerBox input:checkbox:checked
'
).
length
>
0
)
{
||
(
$
(
'
#answerBox input[type="text"]
'
).
length
>
0
)
)
{
clickNext
.
removeAttr
(
'
disabled
'
);
clickNext
.
removeAttr
(
'
disabled
'
);
}
else
{
}
else
{
clickNext
.
attr
(
'
disabled
'
,
'
disabled
'
);
clickNext
.
attr
(
'
disabled
'
,
'
disabled
'
);
}
}
}
}
}
}
$
(
function
(){
$
(
'
#answerBox
'
).
on
(
'
change
'
,
'
*
'
,
tester
.
answersChangeStatus
);
$
(
document
).
delegate
(
'
#answerBox input[type="text"]
'
,
'
keydown
'
,
tester
.
answersChangeStatus
);
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment