Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
| AbstractQtiItemRunner | |
0.00% |
0 / 12 |
|
0.00% |
0 / 6 |
42 | |
0.00% |
0 / 1 |
| setInitialVariableElements | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getContentVariableElements | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| getPrivateFolder | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getRubricBlocks | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| getTemplateElements | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getFeedbacks | |
0.00% |
0 / 2 |
|
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) 2014 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\taoQtiItem\controller; |
| 23 | |
| 24 | use oat\taoQtiItem\helpers\QtiRunner; |
| 25 | use qtism\runtime\tests\AssessmentItemSession; |
| 26 | use taoItems_actions_ItemRunner; |
| 27 | |
| 28 | /** |
| 29 | * Abstract QTI Item Runner Controller |
| 30 | * |
| 31 | * @author Jérôme Bogaerts <jerome@taotesting.com> |
| 32 | * @author Joel Bout <joel@taotesting.com> |
| 33 | * @author Somsack Sipasseuth <sam@taotesting.com> |
| 34 | * @package taoQTI |
| 35 | |
| 36 | * @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php |
| 37 | */ |
| 38 | abstract class AbstractQtiItemRunner extends taoItems_actions_ItemRunner |
| 39 | { |
| 40 | protected $variableContents = null; |
| 41 | |
| 42 | protected function setInitialVariableElements() |
| 43 | { |
| 44 | // get initial content variable elements to be displayed: rubricBlocks, feedbacks, variable math, |
| 45 | // template elements, template variable |
| 46 | $this->setData('contentVariableElements', $this->getRubricBlocks()); |
| 47 | } |
| 48 | |
| 49 | protected function getContentVariableElements() |
| 50 | { |
| 51 | |
| 52 | $dir = $this->getDirectory($this->getRequestParameter('itemDataPath')); |
| 53 | $this->variableContents = QtiRunner::getContentVariableElements($dir); |
| 54 | |
| 55 | return $this->variableContents; |
| 56 | } |
| 57 | |
| 58 | protected function getPrivateFolder() |
| 59 | { |
| 60 | $dir = $this->getDirectory($this->getRequestParameter('itemDataPath')); |
| 61 | return QtiRunner::getPrivateFolderPath($dir); |
| 62 | } |
| 63 | |
| 64 | protected function getRubricBlocks() |
| 65 | { |
| 66 | //@todo : pass the right view from item/service api? |
| 67 | $view = 'candidate'; |
| 68 | $dir = $this->getDirectory($this->getRequestParameter('itemDataPath')); |
| 69 | return QtiRunner::getRubricBlocks($dir, $view); |
| 70 | } |
| 71 | |
| 72 | protected function getTemplateElements() |
| 73 | { |
| 74 | |
| 75 | //process templateRules |
| 76 | //return the template values |
| 77 | } |
| 78 | |
| 79 | protected function getFeedbacks(AssessmentItemSession $itemSession) |
| 80 | { |
| 81 | $dir = $this->getDirectory($this->getRequestParameter('itemDataPath')); |
| 82 | return QtiRunner::getFeedbacks($dir, $itemSession); |
| 83 | } |
| 84 | } |