Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| SaSGroups | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
| getCurrentClass | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| selectSubjects | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| 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) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg |
| 19 | * (under the project TAO & TAO2); |
| 20 | * 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung |
| 21 | * (under the project TAO-TRANSFER); |
| 22 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
| 23 | * (under the project TAO-SUSTAIN & TAO-DEV); |
| 24 | * 2013-2023 (update and modification) Open Assessment Technologies SA |
| 25 | */ |
| 26 | |
| 27 | namespace oat\taoGroups\controller; |
| 28 | |
| 29 | use core_kernel_classes_Class; |
| 30 | use oat\taoGroups\models\GroupsService; |
| 31 | use tao_helpers_form_GenerisTreeForm; |
| 32 | |
| 33 | /** |
| 34 | * SaSGroups Controller provide process services |
| 35 | * |
| 36 | * @author Bertrand Chevrier, <taosupport@tudor.lu> |
| 37 | * |
| 38 | * @package taoGroups |
| 39 | * |
| 40 | * @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php |
| 41 | */ |
| 42 | class SaSGroups extends Groups |
| 43 | { |
| 44 | /** |
| 45 | * overrided to prevent exception: |
| 46 | * if no class is selected, the root class is returned |
| 47 | * |
| 48 | * @see TaoModule::getCurrentClass() |
| 49 | * |
| 50 | * @return core_kernel_classes_Class |
| 51 | */ |
| 52 | protected function getCurrentClass() |
| 53 | { |
| 54 | if ($this->hasRequestParameter('classUri')) { |
| 55 | return parent::getCurrentClass(); |
| 56 | } |
| 57 | |
| 58 | return $this->getRootClass(); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Render the tree to select the group related subjects |
| 63 | */ |
| 64 | public function selectSubjects() |
| 65 | { |
| 66 | $this->defaultData(); |
| 67 | |
| 68 | $memberProperty = $this->getProperty(GroupsService::PROPERTY_MEMBERS_URI); |
| 69 | $memberForm = tao_helpers_form_GenerisTreeForm::buildTree($this->getCurrentInstance(), $memberProperty); |
| 70 | $memberForm->setData('title', __('Select group test takers')); |
| 71 | $this->setData('tree', $memberForm->render()); |
| 72 | $this->setView('sas' . DIRECTORY_SEPARATOR . 'generisTreeSelect.tpl', 'tao'); |
| 73 | } |
| 74 | } |