Skip to content

Commit

Permalink
Merge pull request #489 from oat-sa/release-2.36.0
Browse files Browse the repository at this point in the history
Release 2.36.0
  • Loading branch information
jsconan authored Jun 20, 2016
2 parents 1798489 + 0bb8bd5 commit 98c031f
Show file tree
Hide file tree
Showing 22 changed files with 126 additions and 109 deletions.
4 changes: 2 additions & 2 deletions actions/class.TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use qtism\runtime\common\ResponseVariable;
use qtism\common\enums\BaseType;
use qtism\common\enums\Cardinality;
use qtism\common\datatypes\String as QtismString;
use qtism\common\datatypes\QtiString as QtismString;
use qtism\runtime\storage\binary\BinaryAssessmentTestSeeker;
use qtism\runtime\storage\common\AbstractStorage;
use qtism\data\SubmissionMode;
Expand Down Expand Up @@ -862,4 +862,4 @@ protected function handleAssessmentTestSessionException(AssessmentTestSessionExc
break;
}
}
}
}
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
},
"minimum-stability": "dev",
"require": {
"oat-sa/lib-tao-qti": "~0.1.0",
"oat-sa/oatbox-extension-installer": "dev-master"
},
"autoload": {
Expand Down
6 changes: 3 additions & 3 deletions helpers/class.SessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use qtism\runtime\tests\AssessmentItemSession;
use qtism\data\AssessmentTest;
use qtism\data\IAssessmentItem;
use qtism\common\datatypes\Duration;
use qtism\common\datatypes\QtiDuration;

/**
* A TAO specific implementation of QTISM's AbstractSessionManager.
Expand Down Expand Up @@ -62,7 +62,7 @@ class taoQtiTest_helpers_SessionManager extends AbstractSessionManager {
*/
public function __construct(taoResultServer_models_classes_ResultServerStateFull $resultServer, core_kernel_classes_Resource $test) {
parent::__construct();
$this->setAcceptableLatency(new Duration(taoQtiTest_models_classes_QtiTestService::singleton()->getQtiTestAcceptableLatency()));
$this->setAcceptableLatency(new QtiDuration(taoQtiTest_models_classes_QtiTestService::singleton()->getQtiTestAcceptableLatency()));
$this->setResultServer($resultServer);
$this->setTest($test);
}
Expand Down Expand Up @@ -151,4 +151,4 @@ protected function instantiateAssessmentItemSession(IAssessmentItem $assessmentI
public function createAssessmentItemSessionFactory() {
return new AssessmentItemSessionFactory(false);
}
}
}
4 changes: 2 additions & 2 deletions helpers/class.TestRunnerUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use qtism\runtime\tests\Jump;
use qtism\runtime\tests\RouteItem;
use oat\taoQtiTest\models\ExtendedStateService;
use qtism\common\datatypes\String;
use qtism\common\datatypes\QtiString;

/**
* Utility methods for the QtiTest Test Runner.
Expand Down Expand Up @@ -134,7 +134,7 @@ public static function setInitialOutcomes(AssessmentTestSession $session, \oat\o
$values = $testTaker->getPropertyValues($rdfPropUri);
$outcome = $session->getVariable($outcomeId);
if(!is_null($outcome) && count($values)){
$outcome->setValue(new String($values[0]));
$outcome->setValue(new QtiString($values[0]));
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions helpers/class.TestSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
use qtism\data\expressions\NumberPresented;
use qtism\data\expressions\NumberCorrect;
use qtism\common\enums\BaseType;
use qtism\common\datatypes\Float;
use qtism\common\datatypes\Duration;
use qtism\common\datatypes\QtiFloat;
use qtism\common\datatypes\QtiDuration;
use qtism\data\AssessmentTest;
use qtism\runtime\tests\AssessmentTestSession;
use qtism\runtime\tests\AssessmentTestSessionException;
Expand Down Expand Up @@ -200,7 +200,7 @@ public function endTestSession() {
common_Logger::i('Ending test session.');
try {
// Compute the LtiOutcome variable for LTI support.
$this->setVariable(new OutcomeVariable('LtiOutcome', Cardinality::SINGLE, BaseType::FLOAT, new Float(0.0)));
$this->setVariable(new OutcomeVariable('LtiOutcome', Cardinality::SINGLE, BaseType::FLOAT, new QtiFloat(0.0)));
$outcomeProcessingEngine = new OutcomeProcessingEngine($this->buildLtiOutcomeProcessing(), $this);
$outcomeProcessingEngine->process();

Expand Down Expand Up @@ -582,7 +582,7 @@ public function closeTimer($identifier, $type = null)
if ($placeId === $identifier) {
if (($timeLimits = $source->getTimeLimits()) !== null && ($maxTime = $timeLimits->getMaxTime()) !== null) {
$constraintDuration = $constraint->getDuration();
if ($constraintDuration instanceof Duration) {
if ($constraintDuration instanceof QtiDuration) {
$constraintDuration->sub($constraintDuration);
$constraintDuration->add($maxTime);
}
Expand Down
2 changes: 1 addition & 1 deletion helpers/class.Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static public function emptyImsManifest() {
static public function buildAssessmentItemRefsTestMap(XmlDocument $test, taoQtiTest_models_classes_ManifestParser $manifestParser, $basePath) {
$assessmentItemRefs = $test->getDocumentComponent()->getComponentsByClassName('assessmentItemRef');
$map = array('items' => array(), 'dependencies' => array());
$itemResources = $manifestParser->getResources(array('imsqti_item_xmlv2p1', 'imsqti_apipitem_xmlv2p1'), taoQtiTest_models_classes_ManifestParser::FILTER_RESOURCE_TYPE);
$itemResources = $manifestParser->getResources(Resource::getItemTypes(), taoQtiTest_models_classes_ManifestParser::FILTER_RESOURCE_TYPE);
$allResources = $manifestParser->getResources();

// cleanup $basePath.
Expand Down
4 changes: 2 additions & 2 deletions manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
'version' => '2.32.0',
'version' => '2.36.0',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoTests' => '>=2.19.0',
'taoQtiItem' => '>=2.6'
'taoQtiItem' => '>=2.33'
),
'models' => array(
'http://www.tao.lu/Ontologies/TAOTest.rdf'
Expand Down
1 change: 0 additions & 1 deletion models/classes/class.CrudQtiTestsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* Copyright (c) 2013-2014 (original work) Open Assessment Technologies SA
*
*/
use \common_exception_UserReadableException;

/**
* Crud services implements basic CRUD services, orginally intended for
Expand Down
10 changes: 5 additions & 5 deletions models/classes/class.QtiTestConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use qtism\data\storage\xml\XmlDocument;
use qtism\data\QtiComponent;
use qtism\data\QtiComponentCollection;
use qtism\common\datatypes\Duration;
use qtism\common\datatypes\QtiDuration;
use qtism\common\collections\IntegerCollection;
use qtism\common\collections\StringCollection;
use qtism\data\ViewCollection;
Expand Down Expand Up @@ -139,7 +139,7 @@ private function componentToArray(QtiComponent $component)
if ($value instanceof QtiComponent) {
$array[$property->getName()] = $this->componentToArray($value);
} else
if ($value instanceof Duration) {
if ($value instanceof QtiDuration) {
$array[$property->getName()] = $value->getSeconds(true);
} else
if ($value instanceof IntegerCollection || $value instanceof StringCollection) {
Expand Down Expand Up @@ -310,16 +310,16 @@ private function arrayToComponent(array $testArray, QtiComponent $parent = null,
*
* @param mixed $value
* @param object $class
* @return \qtism\common\datatypes\Duration
* @return \qtism\common\datatypes\QtiDuration
*/
private function componentValue($value, $class)
{
if (! is_null($class)) {
if (is_array($value)) {
return $this->createComponentCollection(new ReflectionClass($class->name), $value);
} else
if ($class->name === 'qtism\common\datatypes\Duration') {
return new qtism\common\datatypes\Duration('PT' . $value . 'S');
if ($class->name === 'qtism\common\datatypes\QtiDuration') {
return new qtism\common\datatypes\QtiDuration('PT' . $value . 'S');
}
}
return $value;
Expand Down
4 changes: 2 additions & 2 deletions models/classes/runner/QtiRunnerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
use oat\taoTests\models\runner\time\TimePoint;
use qtism\common\enums\BaseType;
use qtism\common\enums\Cardinality;
use qtism\common\datatypes\String as QtismString;
use qtism\common\datatypes\QtiString as QtismString;
use qtism\data\NavigationMode;
use qtism\data\SubmissionMode;
use qtism\common\datatypes\Duration;
use qtism\common\datatypes\QtiDuration;
use qtism\runtime\common\ResponseVariable;
use qtism\runtime\common\State;
use qtism\runtime\tests\AssessmentItemSession;
Expand Down
4 changes: 2 additions & 2 deletions models/classes/runner/session/TestSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use oat\taoQtiTest\models\runner\time\QtiTimeStorage;
use oat\taoTests\models\runner\time\InconsistentRangeException;
use oat\taoTests\models\runner\time\TimePoint;
use qtism\common\datatypes\Duration;
use qtism\common\datatypes\QtiDuration;
use qtism\runtime\tests\AssessmentItemSession;
use qtism\runtime\tests\AssessmentTestPlace;
use qtism\runtime\tests\AssessmentTestSessionException;
Expand Down Expand Up @@ -240,7 +240,7 @@ public function getTimerDuration($identifier, $target = 0)

if (!isset($this->durationCache[$durationKey])) {
$duration = round($this->getTimer()->compute($identifier, $target), 6);
$this->durationCache[$durationKey] = new Duration('PT' . $duration . 'S');
$this->durationCache[$durationKey] = new QtiDuration('PT' . $duration . 'S');
}

return $this->durationCache[$durationKey];
Expand Down
4 changes: 2 additions & 2 deletions scripts/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* 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) 2015 (original work) Open Assessment Technologies SA;
* Copyright (c) 2015-2016 (original work) Open Assessment Technologies SA;
*/

namespace oat\taoQtiTest\scripts\update;
Expand Down Expand Up @@ -430,6 +430,6 @@ public function update($initialVersion) {

$this->setVersion('2.31.1');
}
$this->skip('2.31.1', '2.32.0');
$this->skip('2.31.1', '2.36.0');
}
}
2 changes: 1 addition & 1 deletion views/css/new-test-runner.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/css/test-runner.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/css/test-runner.css.map

Large diffs are not rendered by default.

139 changes: 70 additions & 69 deletions views/js/qtiTestRunner.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/qtiTestRunner.min.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions views/js/runner/plugins/controls/timer/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ define([
updateTimers(true);
})

.on('enableitem', function() {
self.enable();
})
.on('disableitem', function() {
self.disable();
})

.after('renderitem', function(){
//start timers
self.enable();
Expand Down
10 changes: 10 additions & 0 deletions views/js/runner/provider/qti.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,16 @@ define([
self.trigger('error', err);
});
})
.on('pause', function(){
self.setPersistentState('paused', true).then(function() {
self.trigger('leave', {
code: self.getTestData().states.suspended
});
})
.catch(function(err){
self.trigger('error', err);
});
})
.on('renderitem', function(itemRef){

var context = this.getTestContext();
Expand Down
16 changes: 8 additions & 8 deletions views/js/test/runner/plugins/controls/timerComponent/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ define([
remaining: 1 * 60 * 1000,
warnings: {
120: { type: 'warning', showed: false, point: 2 * 60 * 1000 },
300: { type: 'error', showed: true, point: 5 * 60 * 1000 }
300: { type: 'danger', showed: true, point: 5 * 60 * 1000 }
}
};

Expand All @@ -264,13 +264,13 @@ define([
.render($container)
.refresh();

assert.ok( ! $('.qti-timer', $container).hasClass('qti-timer__warning'), 'The element does not display in warning');
assert.ok( ! $('.qti-timer .qti-timer_time', $container).hasClass('txt-warning'), 'The element does not display in warning');

var result = timer.warn();
assert.equal(typeof result, 'object', 'The warn result is a object');
assert.equal(result.text, "Warning – You have a minute remaining to complete this item.", 'The warn message is a correct');
assert.equal(result.type, "warning", 'The warn type is a correct');
assert.ok($('.qti-timer', $container).hasClass('qti-timer__warning'), 'The element display in warning');
assert.ok($('.qti-timer .qti-timer_time', $container).hasClass('txt-warning'), 'The element display in warning');
});

QUnit.test('warn - red', function(assert) {
Expand All @@ -283,7 +283,7 @@ define([
remaining: 3 * 60 * 1000,
warnings: {
120: { type: 'warning', showed: false, point: 2 * 60 * 1000 },
300: { type: 'error', showed: false, point: 5 * 60 * 1000 }
300: { type: 'danger', showed: false, point: 5 * 60 * 1000 }
}
};

Expand All @@ -294,13 +294,13 @@ define([
.render($container)
.refresh();

assert.ok( ! $('.qti-timer', $container).hasClass('qti-timer__warning'), 'The element does not display in warning');
assert.ok( ! $('.qti-timer .qti-timer_time', $container).hasClass('txt-danger'), 'The element does not display in warning');

var result = timer.warn();
assert.equal(typeof result, 'object', 'The warn result is a object');
assert.equal(result.text, "Warning – You have 3 minutes remaining to complete this item.", 'The warn message is a correct');
assert.equal(result.type, "error", 'The warn type is a correct');
assert.ok($('.qti-timer', $container).hasClass('qti-timer__warning'), 'The element display in warning');
assert.equal(result.type, "danger", 'The warn type is a correct');
assert.ok($('.qti-timer .qti-timer_time', $container).hasClass('txt-danger'), 'The element display in warning');
});

QUnit.test('warn - empty', function(assert) {
Expand All @@ -321,7 +321,7 @@ define([
.render($container)
.refresh();

assert.ok( ! $('.qti-timer', $container).hasClass('qti-timer__warning'), 'The element does not display in warning');
assert.ok( ! $('.qti-timer .qti-timer_time', $container).hasClass('txt-warning'), 'The element does not display in warning');

var result = timer.warn();
assert.equal(typeof result, 'object', 'The warn result is a object');
Expand Down
1 change: 1 addition & 0 deletions views/scss/test-runner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
.content-panel {
height: auto !important;
#qti-content{
-webkit-overflow-scrolling: touch; // enable scrolling in iFrame on iOS devices
overflow-y:auto;
font-size: 0; //avoid white spaces to screw the height
#qti-rubrics {
Expand Down
2 changes: 1 addition & 1 deletion views/templates/test_runner.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use oat\tao\helpers\Template;
use oat\tao\helpers\Layout;
use oat\tao\model\theme\Theme;
?><!doctype html>
<html class="no-js" lang="<?= tao_helpers_I18n::getLangCode() ?>">
<html lang="<?= tao_helpers_I18n::getLangCode() ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down

0 comments on commit 98c031f

Please sign in to comment.