Skip to content

Commit

Permalink
Merge branch 'release-11.33.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed May 4, 2023
2 parents c1b67a2 + d2d1f62 commit eeddbac
Show file tree
Hide file tree
Showing 75 changed files with 568 additions and 345 deletions.
23 changes: 16 additions & 7 deletions actions/class.ItemExport.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -14,9 +15,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg
* (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung
* (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor
* (under the project TAO-SUSTAIN & TAO-DEV);
* 2012-2018 (update and modification) Open Assessment Technologies SA;
*/

Expand Down Expand Up @@ -59,10 +63,12 @@ protected function getAvailableExportHandlers(): array

$instances = $this->getClassInstances();
if (!count($instances)) {
$returnValue = array_filter($returnValue,
$returnValue = array_filter(
$returnValue,
static function (tao_models_classes_export_ExportHandler $handler) {
return $handler instanceof tao_models_classes_export_RdfExporter;
});
}
);
}


Expand All @@ -89,14 +95,17 @@ protected function getFormFactory(
$formFactory = parent::getFormFactory($handlers, $exporter, $selectedResource, $formData);
$instances = $this->getClassInstances();
if (!count($instances)) {
$formFactory->setInfoBox(__('<b>Note</b>: For empty classes, the RDF format<br />is the only available format.'));
$formFactory->setInfoBox(
__('<b>Note</b>: For empty classes, the RDF format<br />is the only available format.')
);
}
return $formFactory;
}

/**
* Function returns items to export.
* Items that has no content (<b>QTI items</b> without <i>qti.xml</i> file or empty <b>Open Web Items</b>) will be filtered
* Items that has no content (<b>QTI items</b> without <i>qti.xml</i> file or empty <b>Open Web Items</b>) will be
* filtered
*
* @return core_kernel_classes_Resource[] An array of items.
*/
Expand Down
15 changes: 11 additions & 4 deletions actions/class.ItemImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg
* (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung
* (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor
* (under the project TAO-SUSTAIN & TAO-DEV);
* 2012-2021 (update and modification) Open Assessment Technologies SA;
*/

Expand Down Expand Up @@ -74,7 +77,11 @@ private function replaceAvailableImportHandlers(): array

foreach (array_keys($returnValue) as $key) {
if ($returnValue[$key] instanceof \tao_models_classes_import_CsvImporter) {
if ($this->getFeatureFlagChecker()->isEnabled(FeatureFlagCheckerInterface::FEATURE_FLAG_TABULAR_IMPORT)) {
$tabularImportEnabled = $this
->getFeatureFlagChecker()
->isEnabled(FeatureFlagCheckerInterface::FEATURE_FLAG_TABULAR_IMPORT);

if ($tabularImportEnabled) {
$importer = new CsvItemImporter($this->getPsrRequest());
$importer->setServiceLocator($this->getServiceLocator());
$returnValue[$key] = $importer;
Expand Down
13 changes: 9 additions & 4 deletions actions/class.ItemPreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg
* (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung
* (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor
* (under the project TAO-SUSTAIN & TAO-DEV);
* 2013-2018(update and modification) Open Assessment Technologies SA;
*/

Expand Down Expand Up @@ -102,7 +105,9 @@ public function render()

protected function getRenderedItem($item)
{
$itemModel = $item->getOnePropertyValue($this->getProperty(taoItems_models_classes_ItemsService::PROPERTY_ITEM_MODEL));
$itemModel = $item->getOnePropertyValue(
$this->getProperty(taoItems_models_classes_ItemsService::PROPERTY_ITEM_MODEL)
);
$impl = taoItems_models_classes_ItemsService::singleton()->getItemModelImplementation($itemModel);
if (is_null($impl)) {
throw new common_Exception('preview not supported for this item type ' . $itemModel->getUri());
Expand Down
12 changes: 6 additions & 6 deletions actions/class.ItemRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public function index()
$lang = $this->getSession()->getDataLanguage();

if ($this->hasRequestParameter('serviceCallId')) {
$serviceCallId = $this->getRequestParameter('serviceCallId');
$variableData = $this->getServiceLocator()->get(StateStorage::SERVICE_ID)->get($userId, $serviceCallId);
$this->setData('storageData', [
'serial' => $serviceCallId,
'data' => is_null($variableData) ? [] : $variableData
]);
$serviceCallId = $this->getRequestParameter('serviceCallId');
$variableData = $this->getServiceLocator()->get(StateStorage::SERVICE_ID)->get($userId, $serviceCallId);
$this->setData('storageData', [
'serial' => $serviceCallId,
'data' => is_null($variableData) ? [] : $variableData
]);
}

$directory = $this->getDirectory($this->getRequestParameter('itemPath'));
Expand Down
12 changes: 6 additions & 6 deletions actions/class.Items.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

// phpcs:disable Generic.Files.LineLength
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -16,13 +15,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg
* (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung
* (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor
* (under the project TAO-SUSTAIN & TAO-DEV);
* 2012-2018 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*
*/
// phpcs:enable

declare(strict_types=1);

Expand Down
11 changes: 7 additions & 4 deletions actions/class.Main.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -14,9 +15,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg
* (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung
* (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor
* (under the project TAO-SUSTAIN & TAO-DEV);
* 2012-2018 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*/

Expand All @@ -30,5 +34,4 @@

class taoItems_actions_Main extends tao_actions_Main
{

}
2 changes: 1 addition & 1 deletion actions/class.RestFormItem.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -24,7 +25,6 @@
*/
class taoItems_actions_RestFormItem extends \tao_actions_RestResource
{

/**
* Create only authorize for GET requests by now
* @throws \common_exception_Unauthorized
Expand Down
3 changes: 1 addition & 2 deletions actions/class.RestItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
*
*/

use \oat\tao\model\routing\AnnotationReader\security;
use oat\tao\model\routing\AnnotationReader\security;

/**
*
* @author plichart
*/
class taoItems_actions_RestItems extends tao_actions_CommonRestModule
{

/**
* taoItems_actions_RestItems constructor.
* @security("hide")
Expand Down
19 changes: 13 additions & 6 deletions actions/class.SaSItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg
* (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung
* (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor
* (under the project TAO-SUSTAIN & TAO-DEV);
*/

use oat\generis\model\OntologyRdfs;
Expand All @@ -34,7 +36,6 @@
*/
class taoItems_actions_SaSItems extends taoItems_actions_Items
{

/**
* overrided to prevent exception:
* if no class is selected, the root class is returned
Expand All @@ -60,7 +61,13 @@ public function sasEditInstance()
$clazz = $this->getCurrentClass();
$instance = $this->getCurrentInstance();

$formContainer = new tao_actions_form_Instance($clazz, $instance, [FormContainer::CSRF_PROTECTION_OPTION => true]);
$formContainer = new tao_actions_form_Instance(
$clazz,
$instance,
[
FormContainer::CSRF_PROTECTION_OPTION => true,
]
);
$myForm = $formContainer->getForm();

if ($myForm->isSubmited() && $myForm->isValid()) {
Expand Down
13 changes: 7 additions & 6 deletions actions/form/class.Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
*
* Copyright (c) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung
* (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor
* (under the project TAO-SUSTAIN & TAO-DEV);
*/

use oat\taoItems\model\ItemModelStatus;
Expand All @@ -39,12 +40,12 @@ class taoItems_actions_form_Item extends tao_actions_form_Instance
protected function initElements()
{
parent::initElements();

$elementId = tao_helpers_Uri::encode(taoItems_models_classes_ItemsService::PROPERTY_ITEM_MODEL);
$ele = $this->form->getElement($elementId);
$ele->feed();
$modelUri = $ele->getEvaluatedValue();

if (empty($modelUri)) {
// remove deprecated models
$statusProperty = new core_kernel_classes_Property(ItemModelStatus::CLASS_URI);
Expand All @@ -67,7 +68,7 @@ protected function initElements()
$itemModelElt = tao_helpers_form_FormFactory::getElement($elementId, 'Hidden');
$itemModelElt->setValue($modelUri);
$this->form->addElement($itemModelElt, true);

// display model label
$model = new core_kernel_classes_Resource($modelUri);
$itemModelLabelElt = tao_helpers_form_FormFactory::getElement('itemModelLabel', 'Label');
Expand Down
4 changes: 2 additions & 2 deletions actions/form/class.RestItemForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*
*/

use \Zend\ServiceManager\ServiceLocatorAwareTrait;
use \Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
use Zend\ServiceManager\ServiceLocatorAwareInterface;

/**
* Class tao_actions_form_RestItemForm
Expand Down
Loading

0 comments on commit eeddbac

Please sign in to comment.