public function getItemPublicUrl(RunnerServiceContext $context, $itemRef){
        if ($context instanceof QtiRunnerServiceContext) {
            $directoryIds = explode('|', $itemRef);

            $userDataLang = \common_session_SessionManager::getSession()->getDataLanguage();

            $directory = \tao_models_classes_service_FileStorage::singleton()->getDirectoryById($directoryIds[1]);
            // do fallback in case userlanguage is not default language
            if ($userDataLang != DEFAULT_LANG && !$directory->has($userDataLang) && $directory->has(DEFAULT_LANG)) {
                $userDataLang = DEFAULT_LANG;
            }
            return $directory->getPublicAccessUrl().$userDataLang.'/';
        } else {
            throw new \common_exception_InvalidArgumentType(
                'QtiRunnerService',
                'getItemPublicUrl',
                0,
                'oat\taoQtiTest\models\runner\QtiRunnerServiceContext',
                $context
            );
        }
    }
public function getItemPublicUrl(RunnerServiceContext $context, $itemRef){
        if ($context instanceof QtiRunnerServiceContext) {
            $directoryIds = explode('|', $itemRef);

            $userDataLang = \common_session_SessionManager::getSession()->getDataLanguage();

            $directory = \tao_models_classes_service_FileStorage::singleton()->getDirectoryById($directoryIds[1]);
            // do fallback in case userlanguage is not default language
            if ($userDataLang != DEFAULT_LANG && !$directory->has($userDataLang) && $directory->has(DEFAULT_LANG)) {
                $userDataLang = DEFAULT_LANG;
            }
            return $directory->getPublicAccessUrl().$userDataLang.'/';
        } else {
            throw new \common_exception_InvalidArgumentType(
                'QtiRunnerService',
                'getItemPublicUrl',
                0,
                'oat\taoQtiTest\models\runner\QtiRunnerServiceContext',
                $context
            );
        }
    }
public function getItemPublicUrl ( RunnerServiceContext $ context , $ itemRef ) { if ( $ context instanceof QtiRunnerServiceContext ) { $ directoryIds = explode ( '|' , $ itemRef ) ; $ userDataLang = \ common_session_SessionManager :: getSession ( ) -> getDataLanguage ( ) ; $ directory = \ tao_models_classes_service_FileStorage :: singleton ( ) -> getDirectoryById ( $ directoryIds [ 1 ] ) ; // do fallback in case userlanguage is not default language if ( $ userDataLang != DEFAULT_LANG && ! $ directory -> has ( $ userDataLang ) && $ directory -> has ( DEFAULT_LANG ) ) { $ userDataLang = DEFAULT_LANG ; } return $ directory -> getPublicAccessUrl ( ) . $ userDataLang . '/' ; } else { throw new \ common_exception_InvalidArgumentType ( 'QtiRunnerService' , 'getItemPublicUrl' , 0 , 'oat\taoQtiTest\models\runner\QtiRunnerServiceContext' , $ context ) ; } }
Get the base url to the item public directory
@param RunnerServiceContext $context
@param $itemRef
@return string
@throws \common_Exception
@throws \common_exception_Error
@throws \common_exception_InvalidArgumentType
Get the base url to the item public directory