Skip to content

Commit

Permalink
Merge pull request #107 from oat-sa/release-5.1.0
Browse files Browse the repository at this point in the history
Release 5.1.0
  • Loading branch information
siwane authored Jan 12, 2018
2 parents b325d0a + 452c23d commit e8973b2
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 8 deletions.
5 changes: 3 additions & 2 deletions actions/structures.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
selectInstance="results-server-properties"
moveInstance="results-server-move"
delete="results-server-delete"
rootNode="http://www.tao.lu/Ontologies/TAOResultServer.rdf#ResultServer"
/>
</trees>
<actions>
Expand All @@ -28,7 +29,7 @@
</action>
<action id="results-server-new" name="New result server" js="instanciate" url="/taoResultServer/ResultServerMgt/addResultServer" context="class" group="content">
<icon id="icon-result-server"/>
</action>
</action>
<action id="results-server-delete" name="Delete" js="removeNode" url="/taoResultServer/ResultServerMgt/delete" context="resource" group="tree">
<icon id="icon-bin"/>
</action>
Expand All @@ -37,7 +38,7 @@
</action>
<action id="results-server-migrate" name="Migrate" url="/taoResultServer/ResultServerMgt/migrate" context="*" group="tree">
<icon id="icon-external"/>
</action>
</action>
</actions>
</section>
</sections>
Expand Down
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'label' => 'Result core extension',
'description' => 'Results Server management and exposed interfaces for results data submission',
'license' => 'GPL-2.0',
'version' => '5.0.0',
'version' => '5.1.0',
'author' => 'Open Assessment Technologies',
//taoResults may be needed for the taoResults taoResultServerModel that uses taoResults db storage
'requires' => array(
Expand Down
60 changes: 60 additions & 0 deletions models/classes/NoResultStorage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* 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) 2018 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*
*/

namespace oat\taoResultServer\models\classes;

use oat\oatbox\service\ConfigurableService;
use taoResultServer_models_classes_Variable;
use taoResultServer_models_classes_WritableResultStorage;

class NoResultStorage extends ConfigurableService implements taoResultServer_models_classes_WritableResultStorage
{
public function spawnResult()
{
}

public function storeRelatedTestTaker($deliveryResultIdentifier, $testTakerIdentifier)
{
}

public function storeRelatedDelivery($deliveryResultIdentifier, $deliveryIdentifier)
{
}

public function storeItemVariable($deliveryResultIdentifier, $test, $item, taoResultServer_models_classes_Variable $itemVariable, $callIdItem)
{
}

public function storeItemVariables($deliveryResultIdentifier, $test, $item, array $itemVariables, $callIdItem)
{
}

public function storeTestVariable($deliveryResultIdentifier, $test, taoResultServer_models_classes_Variable $testVariable, $callIdTest)
{
}

public function storeTestVariables($deliveryResultIdentifier, $test, array $testVariables, $callIdTest)
{
}

public function configure($callOptions = array())
{
}
}
31 changes: 31 additions & 0 deletions models/classes/NoResultStorageException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* 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) 2018 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*
*/

namespace oat\taoResultServer\models\classes;

class NoResultStorageException extends \common_exception_Error
{
const MESSAGE = 'No Results are available. The No Storage for the delivery is selected.';

public static function create()
{
return new \common_exception_Error(static::MESSAGE);
}
}
7 changes: 3 additions & 4 deletions models/classes/implementation/OntologyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

use oat\generis\model\OntologyAwareTrait;
use oat\taoResultServer\models\classes\AbstractResultService;
use oat\taoResultServer\models\classes\ResultServerService;

/**
* Class OntologyService
Expand All @@ -41,7 +40,7 @@ class OntologyService extends AbstractResultService
*
* @param string $deliveryId
* @throws \common_exception_Error
* @return \taoResultServer_models_classes_ReadableResultStorage|\taoResultServer_models_classes_WritableResultStorage|oat\taoResultServer\models\classes\ResultManagement
* @return \taoResultServer_models_classes_ReadableResultStorage
*/
public function getResultStorage($deliveryId = null)
{
Expand All @@ -56,7 +55,7 @@ public function getResultStorage($deliveryId = null)
if(is_null($deliveryResultServer)){
throw new \common_exception_Error(__('This delivery has no Result Server'));
}
$resultServerModel = $deliveryResultServer->getPropertyValues($this->getProperty(ResultServerService::PROPERTY_HAS_MODEL));
$resultServerModel = $deliveryResultServer->getPropertyValues($this->getProperty(static::PROPERTY_HAS_MODEL));

if(is_null($resultServerModel)){
throw new \common_exception_Error(__('This delivery has no readable Result Server'));
Expand All @@ -67,7 +66,7 @@ public function getResultStorage($deliveryId = null)
$model = $this->getClass($model);

/** @var $implementation \core_kernel_classes_Literal*/
$implementation = $model->getOnePropertyValue($this->getProperty(ResultServerService::PROPERTY_MODEL_IMPL));
$implementation = $model->getOnePropertyValue($this->getProperty(static::PROPERTY_MODEL_IMPL));

if ($implementation !== null) {
$implementations[] = $this->instantiateResultStorage($implementation->literal);
Expand Down
8 changes: 8 additions & 0 deletions models/ontology/taoResultServer.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@
<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
</rdf:Description>

<rdf:Description rdf:about="http://www.tao.lu/Ontologies/TAOResultServer.rdf#ResultNoStorageModel">
<rdfs:label xml:lang="en-US"><![CDATA[tao logger]]></rdfs:label>
<rdfs:comment xml:lang="en-US"><![CDATA[Data about the result storage is sent to the logger]]></rdfs:comment>
<resultserver:implementation><![CDATA[oat\taoResultServer\models\classes\NoResultStorage]]></resultserver:implementation>
<rdf:type rdf:resource="http://www.tao.lu/Ontologies/TAOResultServer.rdf#ResultNoStorageModel"/>
</rdf:Description>

<rdf:Description rdf:about="http://www.tao.lu/Ontologies/TAOResultServer.rdf#void">
<rdfs:label xml:lang="en-US"><![CDATA[No storage]]></rdfs:label>
<rdfs:comment xml:lang="en-US"><![CDATA[No storage ]]></rdfs:comment>
<resultserver:hasResultServerModel rdf:resource="http://www.tao.lu/Ontologies/TAOResultServer.rdf#ResultNoStorageModel" />
<rdf:type rdf:resource="http://www.tao.lu/Ontologies/TAOResultServer.rdf#ResultServer"/>
</rdf:Description>

Expand Down
8 changes: 7 additions & 1 deletion scripts/update/class.Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*
*/

use oat\tao\scripts\update\OntologyUpdater;
use oat\taoResultServer\models\classes\ResultServerService;
use oat\taoResultServer\models\classes\implementation\OntologyService;
use oat\taoResultServer\models\classes\QtiResultsService;
Expand Down Expand Up @@ -69,6 +70,11 @@ public function update($initialVersion) {
$this->setVersion('3.4.0');
}

$this->skip('3.4.0', '5.0.0');
$this->skip('3.4.0', '5.0.2');

if ($this->isVersion('5.0.2')) {
OntologyUpdater::syncModels();
$this->skip('5.0.2', '5.1.0');
}
}
}

0 comments on commit e8973b2

Please sign in to comment.