Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| ContainerInteraction | |
0.00% |
0 / 7 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |||
| getBody | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getTemplateQti | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | namespace oat\taoQtiItem\model\qti\interaction; |
| 24 | |
| 25 | use oat\taoQtiItem\model\qti\interaction\ContainerInteraction; |
| 26 | use oat\taoQtiItem\model\qti\interaction\BlockInteraction; |
| 27 | use oat\taoQtiItem\model\qti\container\FlowContainer; |
| 28 | use oat\taoQtiItem\model\qti\Item; |
| 29 | use oat\taoQtiItem\model\qti\exception\QtiModelException; |
| 30 | |
| 31 | /** |
| 32 | * The QTI container interaction is a subclass of the QTI block interaction. |
| 33 | * It is not specifically described in the QTI standard as such, |
| 34 | * but is simply a way to group interactions that share the same content type, |
| 35 | * basically a oat\taoQtiItem\model\qti\container\ContainerStatic |
| 36 | * |
| 37 | * @access public |
| 38 | * @author Sam, <sam@taotesting.com> |
| 39 | * @package taoQTI |
| 40 | |
| 41 | */ |
| 42 | abstract class ContainerInteraction extends BlockInteraction implements FlowContainer |
| 43 | { |
| 44 | /** |
| 45 | * The body of such a ContainerInteraction is a QTI Container |
| 46 | * |
| 47 | * @var oat\taoQtiItem\model\qti\container\Container |
| 48 | */ |
| 49 | protected $body = null; |
| 50 | |
| 51 | /** |
| 52 | * Define the class of oat\taoQtiItem\model\qti\container\Container used |
| 53 | * |
| 54 | * @var string |
| 55 | */ |
| 56 | protected static $containerType = ''; |
| 57 | |
| 58 | public function __construct($attributes = [], Item $relatedItem = null, $serial = '') |
| 59 | { |
| 60 | |
| 61 | parent::__construct($attributes, $relatedItem, $serial); |
| 62 | |
| 63 | if (class_exists(static::$containerType)) { |
| 64 | $this->body = new static::$containerType('', $relatedItem); |
| 65 | } else { |
| 66 | throw new QtiModelException('The container class does not exist: ' . static::$containerType); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | public function getBody() |
| 71 | { |
| 72 | return $this->body; |
| 73 | } |
| 74 | |
| 75 | public static function getTemplateQti() |
| 76 | { |
| 77 | return static::getTemplatePath() . 'interactions/qti.containerInteraction.tpl.php'; |
| 78 | } |
| 79 | } |