Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ResultServer | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 1 |
| initLtiResultServer | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
20 | |||
| 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 Open Assessment Technologies S.A. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\ltiDeliveryProvider\helper; |
| 23 | |
| 24 | use core_kernel_classes_Resource; |
| 25 | use common_session_SessionManager; |
| 26 | use oat\taoLti\models\classes\LtiLaunchData; |
| 27 | use oat\oatbox\service\ServiceManager; |
| 28 | |
| 29 | class ResultServer |
| 30 | { |
| 31 | public static function initLtiResultServer( |
| 32 | core_kernel_classes_Resource $delivery, |
| 33 | $executionIdentifier, |
| 34 | $launchData |
| 35 | ) { |
| 36 | $options = []; |
| 37 | if ($launchData->hasVariable("lis_result_sourcedid") && $launchData->hasVariable("lis_outcome_service_url")) { |
| 38 | $options = [ |
| 39 | [ |
| 40 | "implementation" => "taoLtiBasicOutcome_models_classes_LtiBasicOutcome", |
| 41 | "parameters" => [ |
| 42 | "result_identifier" => $launchData->getVariable("lis_result_sourcedid"), |
| 43 | "consumer_key" => $launchData->getOauthKey(), |
| 44 | "service_url" => $launchData->getVariable("lis_outcome_service_url"), |
| 45 | "user_identifier" => common_session_SessionManager::getSession()->getUserUri(), |
| 46 | "user_fullName" => ($launchData->hasVariable(LtiLaunchData::LIS_PERSON_NAME_FULL) |
| 47 | ? $launchData->getVariable(LtiLaunchData::LIS_PERSON_NAME_FULL) |
| 48 | : '') |
| 49 | ] |
| 50 | ] |
| 51 | ]; |
| 52 | } |
| 53 | ServiceManager::getServiceManager()->get(\oat\taoResultServer\models\classes\ResultServerService::SERVICE_ID) |
| 54 | ->initResultServer($delivery, $executionIdentifier, $options); |
| 55 | } |
| 56 | } |