Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 38 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| GuiSettingsService | |
0.00% |
0 / 38 |
|
0.00% |
0 / 1 |
182 | |
0.00% |
0 / 1 |
| asArray | |
0.00% |
0 / 38 |
|
0.00% |
0 / 1 |
182 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2017 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | * @author Alexander Zagovorichev <zagovorichev@1pt.com> |
| 21 | */ |
| 22 | |
| 23 | namespace oat\taoProctoring\model; |
| 24 | |
| 25 | use oat\oatbox\service\ConfigurableService; |
| 26 | |
| 27 | /** |
| 28 | * Settings for the user interface of the proctoring |
| 29 | * |
| 30 | * Class GuiSettings |
| 31 | * @package oat\taoProctoring\model |
| 32 | */ |
| 33 | class GuiSettingsService extends ConfigurableService |
| 34 | { |
| 35 | public const SERVICE_ID = 'taoProctoring/GuiSettings'; |
| 36 | |
| 37 | /** |
| 38 | * Refresh button can be configured as available or unavailable |
| 39 | */ |
| 40 | public const PROCTORING_REFRESH_BUTTON = 'refreshBtn'; |
| 41 | |
| 42 | /** |
| 43 | * Time between auto refresh in milliseconds |
| 44 | * 0 - don't refresh |
| 45 | * Note: it is recommended to avoid having the auto-refresh rate less then 30 seconds. |
| 46 | */ |
| 47 | public const PROCTORING_AUTO_REFRESH = 'autoRefresh'; |
| 48 | |
| 49 | /** |
| 50 | * Allow or not proctor to pause a delivery |
| 51 | */ |
| 52 | public const PROCTORING_ALLOW_PAUSE = 'canPause'; |
| 53 | |
| 54 | /** |
| 55 | * Settings: message and icon for different actions will be displayed in dialog (bulkActionPopup) |
| 56 | * !!!only for one language |
| 57 | * TODO: add translation for message |
| 58 | * example: |
| 59 | * [ |
| 60 | * 'terminate' => [ |
| 61 | * 'message' => 'Some text...', |
| 62 | * 'icon' => 'danger' |
| 63 | * ], |
| 64 | * 'authorize' => [ |
| 65 | * 'message' => 'Some text...', |
| 66 | * 'icon' => 'warning' |
| 67 | * ], |
| 68 | * ] |
| 69 | */ |
| 70 | public const OPTION_DIALOG_SETTINGS = 'dialogSettings'; |
| 71 | |
| 72 | public const OPTION_SHOW_COLUMN_FIRST_NAME = 'showColumnFirstName'; |
| 73 | public const OPTION_SHOW_COLUMN_LAST_NAME = 'showColumnLastName'; |
| 74 | public const OPTION_SHOW_COLUMN_AUTHORIZE = 'showColumnAuthorize'; |
| 75 | public const OPTION_SHOW_COLUMN_REMAINING_TIME = 'showColumnRemainingTime'; |
| 76 | public const OPTION_SHOW_COLUMN_EXTENDED_TIME = 'showColumnExtendedTime'; |
| 77 | public const OPTION_SHOW_COLUMN_CONNECTIVITY = 'onlineStatus'; |
| 78 | |
| 79 | public const OPTION_SHOW_ACTION_SHOW_HISTORY = 'showActionShowHistory'; |
| 80 | |
| 81 | public const OPTION_SET_START_DATA_ONE_DAY = 'setStartDataOneDay'; |
| 82 | |
| 83 | /** |
| 84 | * @return array |
| 85 | */ |
| 86 | public function asArray() |
| 87 | { |
| 88 | return [ |
| 89 | self::PROCTORING_REFRESH_BUTTON => $this->hasOption(self::PROCTORING_REFRESH_BUTTON) |
| 90 | ? $this->getOption(self::PROCTORING_REFRESH_BUTTON) |
| 91 | : true, |
| 92 | self::PROCTORING_AUTO_REFRESH => $this->hasOption(self::PROCTORING_AUTO_REFRESH) |
| 93 | ? $this->getOption(self::PROCTORING_AUTO_REFRESH) |
| 94 | : 0, |
| 95 | self::PROCTORING_ALLOW_PAUSE => $this->hasOption(self::PROCTORING_ALLOW_PAUSE) |
| 96 | ? $this->getOption(self::PROCTORING_ALLOW_PAUSE) |
| 97 | : true, |
| 98 | self::OPTION_DIALOG_SETTINGS => $this->hasOption(self::OPTION_DIALOG_SETTINGS) |
| 99 | ? $this->getOption(self::OPTION_DIALOG_SETTINGS) |
| 100 | : [], |
| 101 | self::OPTION_SHOW_COLUMN_FIRST_NAME => $this->hasOption(self::OPTION_SHOW_COLUMN_FIRST_NAME) |
| 102 | ? $this->getOption(self::OPTION_SHOW_COLUMN_FIRST_NAME) |
| 103 | : true, |
| 104 | self::OPTION_SHOW_COLUMN_LAST_NAME => $this->hasOption(self::OPTION_SHOW_COLUMN_LAST_NAME) |
| 105 | ? $this->getOption(self::OPTION_SHOW_COLUMN_LAST_NAME) |
| 106 | : true, |
| 107 | self::OPTION_SHOW_COLUMN_AUTHORIZE => $this->hasOption(self::OPTION_SHOW_COLUMN_AUTHORIZE) |
| 108 | ? $this->getOption(self::OPTION_SHOW_COLUMN_AUTHORIZE) |
| 109 | : true, |
| 110 | self::OPTION_SHOW_COLUMN_REMAINING_TIME => $this->hasOption(self::OPTION_SHOW_COLUMN_REMAINING_TIME) |
| 111 | ? $this->getOption(self::OPTION_SHOW_COLUMN_REMAINING_TIME) |
| 112 | : true, |
| 113 | self::OPTION_SHOW_COLUMN_EXTENDED_TIME => $this->hasOption(self::OPTION_SHOW_COLUMN_EXTENDED_TIME) |
| 114 | ? $this->getOption(self::OPTION_SHOW_COLUMN_EXTENDED_TIME) |
| 115 | : true, |
| 116 | self::OPTION_SHOW_COLUMN_CONNECTIVITY => $this->hasOption(self::OPTION_SHOW_COLUMN_CONNECTIVITY) |
| 117 | ? $this->getOption(self::OPTION_SHOW_COLUMN_CONNECTIVITY) |
| 118 | : false, |
| 119 | self::OPTION_SHOW_ACTION_SHOW_HISTORY => $this->hasOption(self::OPTION_SHOW_ACTION_SHOW_HISTORY) |
| 120 | ? $this->getOption(self::OPTION_SHOW_ACTION_SHOW_HISTORY) |
| 121 | : true, |
| 122 | self::OPTION_SET_START_DATA_ONE_DAY => $this->hasOption(self::OPTION_SET_START_DATA_ONE_DAY) |
| 123 | ? $this->getOption(self::OPTION_SET_START_DATA_ONE_DAY) |
| 124 | : true, |
| 125 | ]; |
| 126 | } |
| 127 | } |