Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| DeliveryLinks | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| index | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
6 | |||
| 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) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | namespace oat\ltiDeliveryProvider\controller; |
| 24 | |
| 25 | use core_kernel_classes_Class; |
| 26 | use core_kernel_classes_Resource; |
| 27 | use oat\ltiDeliveryProvider\model\LTIDeliveryTool; |
| 28 | use oat\taoLti\models\classes\ConsumerService; |
| 29 | use tao_actions_CommonModule; |
| 30 | use tao_helpers_Uri; |
| 31 | |
| 32 | /** |
| 33 | * |
| 34 | * @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu} |
| 35 | * @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php |
| 36 | * @package filemanager |
| 37 | */ |
| 38 | class DeliveryLinks extends tao_actions_CommonModule |
| 39 | { |
| 40 | /** |
| 41 | * Displays the LTI link for the consumer with respect to the currently selected delviery |
| 42 | * at tdelviery level, checks if the delviery is related to a resultserver cofnigured with the correct outcome |
| 43 | * service impelmentation |
| 44 | * @author patrick <patrick@taotesting.com> |
| 45 | */ |
| 46 | public function index() |
| 47 | { |
| 48 | $feedBackMessage = ''; |
| 49 | //checks the constraint for the results handling, depends on taoResultServer, taoLtiBasicOutcome |
| 50 | $selectedDelivery = new core_kernel_classes_Resource( |
| 51 | tao_helpers_Uri::decode($this->getRequestParameter('uri')) |
| 52 | ); |
| 53 | |
| 54 | $this->setData( |
| 55 | 'launchUrl', |
| 56 | $this->getServiceLocator()->get(LTIDeliveryTool::class)->getLaunchUrl( |
| 57 | ['delivery' => $selectedDelivery->getUri()] |
| 58 | ) |
| 59 | ); |
| 60 | |
| 61 | if (!empty($feedBackMessage)) { |
| 62 | $this->setData('warning', $feedBackMessage); |
| 63 | } |
| 64 | $class = new core_kernel_classes_Class(ConsumerService::CLASS_URI); |
| 65 | $this->setData('consumers', $class->getInstances()); |
| 66 | $this->setData('deliveryLabel', $selectedDelivery->getLabel()); |
| 67 | $this->setView('linkManagement.tpl', 'ltiDeliveryProvider'); |
| 68 | } |
| 69 | } |