-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
740 additions
and
588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) 2013-2014 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* Copyright (c) 2013-2016 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* | ||
* @author Jérôme Bogaerts <[email protected]> | ||
* @license GPLv2 | ||
|
@@ -30,13 +30,7 @@ | |
*/ | ||
abstract class AtomicBlock extends BodyElement implements BlockStatic, FlowStatic | ||
{ | ||
/** | ||
* The base URI of the AtomicBlock. | ||
* | ||
* @var string | ||
* @qtism-bean-property | ||
*/ | ||
private $xmlBase = ''; | ||
use FlowTrait; | ||
|
||
/** | ||
* The collection of Inline components contained by the AtomicBlock. | ||
|
@@ -89,35 +83,4 @@ public function getComponents() | |
{ | ||
return $this->getContent(); | ||
} | ||
|
||
/** | ||
* Set the base URI of the AtomicBlock. | ||
* | ||
* @param string $xmlBase A URI. | ||
* @throws \InvalidArgumentException if $base is not a valid URI nor an empty string. | ||
*/ | ||
public function setXmlBase($xmlBase = '') | ||
{ | ||
if (is_string($xmlBase) && (empty($xmlBase) || Format::isUri($xmlBase))) { | ||
$this->xmlBase = $xmlBase; | ||
} else { | ||
$msg = "The 'xmlBase' argument must be an empty string or a valid URI, '" . $xmlBase . "' given"; | ||
throw new InvalidArgumentException($msg); | ||
} | ||
} | ||
|
||
/** | ||
* Get the base URI of the AtomicBlock. | ||
* | ||
* @return string An empty string or a URI. | ||
*/ | ||
public function getXmlBase() | ||
{ | ||
return $this->xmlBase; | ||
} | ||
|
||
public function hasXmlBase() | ||
{ | ||
return $this->getXmlBase() !== ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) 2013-2014 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* Copyright (c) 2013-2016 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* | ||
* @author Jérôme Bogaerts <[email protected]> | ||
* @license GPLv2 | ||
|
@@ -34,13 +34,8 @@ | |
*/ | ||
abstract class AtomicInline extends BodyElement implements FlowStatic, InlineStatic | ||
{ | ||
/** | ||
* The base URI of the AtomicInline. | ||
* | ||
* @var string | ||
* @qtism-bean-property | ||
*/ | ||
private $xmlBase = ''; | ||
|
||
use FlowTrait; | ||
|
||
/** | ||
* Create a new AtomicInline object. | ||
|
@@ -65,35 +60,4 @@ public function getComponents() | |
{ | ||
return new QtiComponentCollection(); | ||
} | ||
|
||
/** | ||
* Set the base URI of the AtomicInline. | ||
* | ||
* @param string $XmlBase A URI. | ||
* @throws \InvalidArgumentException if $base is not a valid URI nor an empty string. | ||
*/ | ||
public function setXmlBase($xmlBase = '') | ||
{ | ||
if (is_string($xmlBase) && (empty($xmlBase) || Format::isUri($xmlBase))) { | ||
$this->xmlBase = $xmlBase; | ||
} else { | ||
$msg = "The 'xmlBase' argument must be an empty string or a valid URI, '" . $xmlBase . "' given"; | ||
throw new InvalidArgumentException($msg); | ||
} | ||
} | ||
|
||
/** | ||
* Get the base URI of the AtomicInline. | ||
* | ||
* @return string An empty string or a URI. | ||
*/ | ||
public function getXmlBase() | ||
{ | ||
return $this->xmlBase; | ||
} | ||
|
||
public function hasXmlBase() | ||
{ | ||
return $this->getXmlBase() !== ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) 2013-2014 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* Copyright (c) 2013-2016 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* | ||
* @author Jérôme Bogaerts <[email protected]> | ||
* @license GPLv2 | ||
|
@@ -34,13 +34,7 @@ | |
*/ | ||
class FeedbackBlock extends BodyElement implements FlowStatic, BlockStatic, FeedbackElement | ||
{ | ||
/** | ||
* The base URI. | ||
* | ||
* @var string | ||
* @qtism-bean-property | ||
*/ | ||
private $xmlBase = ''; | ||
use FlowTrait; | ||
|
||
/** | ||
* The components composing the FeedbackBlock content. | ||
|
@@ -218,40 +212,4 @@ public function getQtiClassName() | |
{ | ||
return 'feedbackBlock'; | ||
} | ||
|
||
/** | ||
* Set the base URI of the TemplateBlock. | ||
* | ||
* @param string $xmlBase A URI. | ||
* @throws \InvalidArgumentException if $base is not a valid URI nor an empty string. | ||
*/ | ||
public function setXmlBase($xmlBase = '') | ||
{ | ||
if (is_string($xmlBase) && (empty($xmlBase) || Format::isUri($xmlBase))) { | ||
$this->xmlBase = $xmlBase; | ||
} else { | ||
$msg = "The 'base' argument must be an empty string or a valid URI, '" . $xmlBase . "' given"; | ||
throw new InvalidArgumentException($msg); | ||
} | ||
} | ||
|
||
/** | ||
* Get the base URI of the TemplateBlock. | ||
* | ||
* @return string An empty string or a URI. | ||
*/ | ||
public function getXmlBase() | ||
{ | ||
return $this->xmlBase; | ||
} | ||
|
||
/** | ||
* Whether a value is defined for the base URI of the TemplateBlock. | ||
* | ||
* @return boolean | ||
*/ | ||
public function hasXmlBase() | ||
{ | ||
return $this->getXmlBase() !== ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,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) 2013-2014 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* Copyright (c) 2013-2016 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* | ||
* @author Jérôme Bogaerts <[email protected]> | ||
* @license GPLv2 | ||
*/ | ||
|
||
namespace qtism\data\content; | ||
|
||
use \InvalidArgumentException; | ||
|
||
/** | ||
* From IMS QTI: | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?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) 2013-2016 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* | ||
* @author Jérôme Bogaerts <[email protected]> | ||
* @license GPLv2 | ||
*/ | ||
|
||
namespace qtism\data\content; | ||
|
||
use \InvalidArgumentException; | ||
use qtism\common\utils\Format; | ||
|
||
/** | ||
* The Flow trait. | ||
* | ||
* @authorJérôme Bogaerts <[email protected]> | ||
* @see \qtism\data\content\Flow | ||
*/ | ||
trait FlowTrait | ||
{ | ||
private $xmlBase = ''; | ||
|
||
/** | ||
* setXmlBase method implementation. | ||
* | ||
* @see \qtism\data\content\Flow::setXmlBase() | ||
*/ | ||
public function setXmlBase($xmlBase = '') | ||
{ | ||
if (is_string($xmlBase) && (empty($xmlBase) || Format::isUri($xmlBase))) { | ||
$this->xmlBase = $xmlBase; | ||
} else { | ||
$msg = "The 'xmlBase' argument must be an empty string or a valid URI, '" . $xmlBase . "' given"; | ||
throw new InvalidArgumentException($msg); | ||
} | ||
} | ||
|
||
/** | ||
* getXmlBase method implementation. | ||
* | ||
* @see \qtism\data\content\Flow::getXmlBase() | ||
*/ | ||
public function getXmlBase() | ||
{ | ||
return $this->xmlBase; | ||
} | ||
|
||
/** | ||
* hasXmlBase method implementation. | ||
* | ||
* @see \qtism\data\content\Flow::hasXmlBase() | ||
*/ | ||
public function hasXmlBase() | ||
{ | ||
return $this->getXmlBase() !== ''; | ||
} | ||
} |
Oops, something went wrong.