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
3bc45b56
Commit
3bc45b56
authored
Jan 28, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fields in Test
parent
afd1135e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
common/modules/testings/forms/TestForm.php
common/modules/testings/forms/TestForm.php
+2
-0
common/modules/testings/models/Test.php
common/modules/testings/models/Test.php
+4
-2
console/migrations/m160128_182951_add_columns_test.php
console/migrations/m160128_182951_add_columns_test.php
+19
-0
No files found.
common/modules/testings/forms/TestForm.php
View file @
3bc45b56
...
...
@@ -12,6 +12,8 @@ $elements = [
'minutes'
=>
[
'type'
=>
'text'
],
'questions'
=>
[
'type'
=>
'text'
],
'pass_percent'
=>
[
'type'
=>
'text'
],
'passed_scores'
=>
[
'type'
=>
'text'
],
'notpassed_scores'
=>
[
'type'
=>
'text'
],
'attempt'
=>
[
'type'
=>
'text'
]
];
...
...
common/modules/testings/models/Test.php
View file @
3bc45b56
...
...
@@ -57,9 +57,9 @@ class Test extends \common\components\ActiveRecordModel
public
function
rules
()
{
return
[
[[
'session_id'
,
'name'
],
'required'
,
'except'
=>
self
::
SCENARIO_UPLOAD
],
[[
'session_id'
,
'name'
,
'passed_scores'
,
'notpassed_scores'
],
'required'
,
'except'
=>
self
::
SCENARIO_UPLOAD
],
[[
'minutes'
,
'questions'
,
'pass_percent'
,
'attempt'
],
'requiredNotMix'
,
'except'
=>
self
::
SCENARIO_UPLOAD
],
[[
'session_id'
,
'minutes'
,
'questions'
,
'pass_percent'
,
'attempt'
,
'mix'
],
'integer'
,
'except'
=>
self
::
SCENARIO_UPLOAD
],
[[
'session_id'
,
'minutes'
,
'questions'
,
'pass_percent'
,
'attempt'
,
'mix'
,
'passed_scores'
,
'notpassed_scores'
],
'integer'
,
'except'
=>
self
::
SCENARIO_UPLOAD
],
[[
'name'
],
'string'
,
'max'
=>
200
,
'except'
=>
self
::
SCENARIO_UPLOAD
],
[[
'csv_file'
],
'file'
,
'skipOnEmpty'
=>
false
,
'extensions'
=>
'xls, xlsx'
,
'on'
=>
self
::
SCENARIO_UPLOAD
],
[[
'mix'
],
'safe'
],
...
...
@@ -85,6 +85,8 @@ class Test extends \common\components\ActiveRecordModel
'questions'
=>
'Количество вопросов в тесте'
,
'pass_percent'
=>
'Лимит прохождения, %'
,
'create_date'
=>
'Время создания'
,
'passed_scores'
=>
'Количество баллов за сданный тест'
,
'notpassed_scores'
=>
'Количество баллов за не сданный тест'
];
}
...
...
console/migrations/m160128_182951_add_columns_test.php
0 → 100644
View file @
3bc45b56
<?php
use
yii\db\Schema
;
use
yii\db\Migration
;
class
m160128_182951_add_columns_test
extends
Migration
{
public
function
safeUp
()
{
$this
->
addColumn
(
'testings_tests'
,
'passed_scores'
,
Schema
::
TYPE_INTEGER
.
'(11) NOT NULL'
);
$this
->
addColumn
(
'testings_tests'
,
'notpassed_scores'
,
Schema
::
TYPE_INTEGER
.
'(11) NOT NULL'
);
}
public
function
safeDown
()
{
$this
->
dropColumn
(
'testings_tests'
,
'passed_scores'
);
$this
->
dropColumn
(
'testings_tests'
,
'notpassed_scores'
);
}
}
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