Skip to content

Commit

Permalink
Merge branch 'master' into bug/17773-master--Code-name-change-while-w…
Browse files Browse the repository at this point in the history
…e-updated-from-Edit-Question-screen
  • Loading branch information
encuestabizdevgit committed Feb 28, 2022
2 parents e4f3990 + dceebac commit 711be8d
Show file tree
Hide file tree
Showing 636 changed files with 30,583 additions and 56,102 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/main.yml
Expand Up @@ -116,7 +116,15 @@ jobs:
# wget https://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip
# unzip chromedriver_linux64.zip

- name: Set up Selenium with firefox
- name: Run unit tests
env:
XDEBUG_MODE: coverage
run: php third_party/bin/phpunit --testdox --stop-on-failure tests/unit

- name: Check test coverage if cov.xml exists (won't work on PHP 8 with current phpunit version)
run: php tests/bin/check_coverage.php cov.xml 37

- name: Set up Selenium with firefox (needed for integrity tests)
run: |
echo `which firefox`
echo `firefox -v`
Expand All @@ -129,6 +137,11 @@ jobs:
export MOZ_HEADLESS_HEIGHT=1024
java -jar selenium-server-standalone-3.7.1.jar -enablePassThrough false > /dev/null 2> /dev/null &
- name: Run functional tests
env:
DOMAIN: localhost
run: php third_party/bin/phpunit --testdox --stop-on-failure tests/functional

# Prepare the packages that need to be tested and update the nvm
- name: Prepare the nvm with Node ${{ matrix.nodeJS-versions }}
run: |
Expand All @@ -141,7 +154,5 @@ jobs:
nvm use ${{ matrix.nodeJS-versions }}
node ./buildVueComponents.js -s adminbasics -p
- name: Run the test script
run: |
DOMAIN=localhost ./third_party/bin/phpunit --testdox --stop-on-failure
yarn --cwd ./assets/packages/adminbasics run test
- name: Run JS tests
run: yarn --cwd ./assets/packages/adminbasics run test
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -141,7 +141,6 @@ third_party/phpspec/
third_party/phpunit/
third_party/psr/
third_party/sebastian/
third_party/symfony/
third_party/theseer/
third_party/vimeo/
third_party/webmozart/
Expand Down
97 changes: 97 additions & 0 deletions application/commands/DbSeederCommand.php
@@ -0,0 +1,97 @@
<?php

use \tebazil\yii1seeder\Seeder;

class IdValidator
{
private $bag;
private $original;
public function __construct($bag)
{
$this->bag = $bag;
$this->original = $bag;
}
public function __invoke($nr)
{
if (!isset($this->bag[$nr - 1])) {
return false;
} else {
unset($this->bag[$nr - 1]);
return true;
}
}
}

class DbSeederCommand extends CConsoleCommand
{
/**
* @return void
*/
public function run($args)
{
$seeder = new Seeder();
$generator = $seeder->getGeneratorConfigurator();
$faker = $generator->getFakerConfigurator();

// Generate surveys
$sids = [1, 2, 3];
$sidValidator = new IdValidator($sids);
$seeder->table('{{surveys}}')->columns(
[
'sid' => $faker->unique()->numberBetween(1, 3),
'owner_id' => 1,
'language' => 'en'
]
)->rowQuantity(3);

// Generate survey text
$sidValidator = new IdValidator($sids);
$seeder->table('{{surveys_languagesettings}}')->columns(
[
'surveyls_survey_id' => $faker->unique(true)->numberBetween(1, 4),
'surveyls_language' => 'en',
'surveyls_title' => 'mo'
]
)->rowQuantity(3);

// Generate groups
$gids = [1, 2, 3, 4, 5];
$gidValidator = new IdValidator($gids);
$seeder->table('{{groups}}')->columns(
[
'gid' => $faker->unique(true)->numberBetween(1, 10),
'sid' => $faker->numberBetween(1, 3),
]
)->rowQuantity(10);
$seeder->refill();
return;

// Generate questions
$qids = [1, 2, 3, 4, 5, 6, 7];
$qidValidator = new IdValidator($qids);
$seeder->table('{{questions}}')->columns(
[
'qid' => $faker->valid($qidValidator)->randomElement($qids),
'sid' => $faker->randomElement($sids),
'gid' => $faker->randomElement($gids),
]
)->rowQuantity(count($qids));

$i = 0;
$seeder->table('{{answers}}')->columns(
[
'aid',
'qid' => function () use (&$i) {
return $i++;
},
'code' => $faker->uuid,
'sortorder' => function () use (&$i) {
return $i++;
},
'assessment_value' => function () { return rand(1, 10); }
]
)->rowQuantity(30);

$seeder->refill();
}
}
6 changes: 5 additions & 1 deletion application/config/config-defaults.php
Expand Up @@ -56,10 +56,14 @@
$config['adminthemeiconsize'] = 32; // This settings describes the icon size for a normal toolbar icon - default for gringegreen is 32


// If the user enters password incorrectly
// If the user (admins) enters password incorrectly
$config['maxLoginAttempt'] = 3; // Lock them out after 3 attempts
$config['timeOutTime'] = 60 * 10; // Lock them out for 10 minutes.

// If participant enters wrong access token
$config['maxLoginAttemptParticipants'] = 3; // Lock them out after 3 attempts
$config['timeOutParticipants'] = 60 * 10; // Lock them out for 10 minutes.

// Site Settings
$config['printanswershonorsconditions'] = 1; // If set to 1, only relevant answers to questions can be printed by user. If set to 0, also questions not shown are printed

Expand Down
3 changes: 2 additions & 1 deletion application/config/internal.php
Expand Up @@ -202,8 +202,9 @@
'secure' => ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443))
),
),
'sourceLanguage' => 'en',
'messages' => array(
'class' => 'CGettextMessageSource',
'class' => 'application.core.LSMessageSource',
'cachingDuration'=>3600,
'forceTranslation' => true,
'useMoFile' => true,
Expand Down
2 changes: 2 additions & 0 deletions application/config/routes.php
Expand Up @@ -37,7 +37,9 @@
//optout - optin
$route['optout/<_sid:\d+>/(:any)/(:any)'] = "optout/index/<_sid>/$2/$3";
$route['optout/tokens/<surveyid:\d+>'] = array('optout/tokens', 'matchValue'=>true);
$route['optout/participants/<surveyid:\d+>'] = array('optout/participants', 'matchValue'=>true);
$route['optin/tokens/<surveyid:\d+>'] = array('optin/tokens', 'matchValue'=>true);
$route['optin/participants/<surveyid:\d+>'] = array('optin/participants', 'matchValue'=>true);
$route['statistics_user/<surveyid:\d+>'] = array('statistics_user/action', 'matchValue'=>true);

$route['<_controller:\w+>/<_action:\w+>'] = '<_controller>/<_action>';
Expand Down
16 changes: 0 additions & 16 deletions application/config/third_party.php
Expand Up @@ -212,22 +212,6 @@
)
),

// qTip2
'qTip2' => array(
'basePath' => 'third_party.qTip2',
'position' => CClientScript::POS_BEGIN,
'js' => array(
'dist/jquery.qtip.min.js'
),
'css' => array(
'dist/jquery.qtip.min.css'
),
'depends' => array(
'jquery'
)

),

// jQuery Table Sorter
'jquery-tablesorter' => array(
'basePath' => 'third_party.jquery-tablesorter',
Expand Down
6 changes: 3 additions & 3 deletions application/config/version.php
Expand Up @@ -11,10 +11,10 @@
* See COPYRIGHT.php for copyright notices and details.
*/

$config['versionnumber'] = '5.2.14';
$config['dbversionnumber'] = 480;
$config['versionnumber'] = '5.3.0';
$config['dbversionnumber'] = 482;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['templateapiversion'] = 3;
$config['assetsversionnumber'] = '30259';
$config['assetsversionnumber'] = '30260';
return $config;

0 comments on commit 711be8d

Please sign in to comment.