implement dummy-QuesttypeAgent for testing basic QuesttypeAgent-functionality
This commit is contained in:
parent
1ef9b1d6e6
commit
256558e048
4 changed files with 101 additions and 0 deletions
24
questtypes/dummy/DummyQuesttypeAgent.inc
Normal file
24
questtypes/dummy/DummyQuesttypeAgent.inc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The Legend of Z
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
* @copyright 2014 Heinrich-Heine-Universität Düsseldorf
|
||||
* @license http://www.gnu.org/licenses/gpl.html
|
||||
* @link https://bitbucket.org/coderkun/the-legend-of-z
|
||||
*/
|
||||
|
||||
namespace hhu\z\questtypes;
|
||||
|
||||
|
||||
/**
|
||||
* Dummy-QuesttypeAgent for testing basic QuesttypeAgent-functionality.
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class DummyQuesttypeAgent extends \hhu\z\QuesttypeAgent
|
||||
{
|
||||
}
|
||||
|
||||
?>
|
||||
48
questtypes/dummy/DummyQuesttypeController.inc
Normal file
48
questtypes/dummy/DummyQuesttypeController.inc
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The Legend of Z
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
* @copyright 2014 Heinrich-Heine-Universität Düsseldorf
|
||||
* @license http://www.gnu.org/licenses/gpl.html
|
||||
* @link https://bitbucket.org/coderkun/the-legend-of-z
|
||||
*/
|
||||
|
||||
namespace hhu\z\questtypes;
|
||||
|
||||
|
||||
/**
|
||||
* Controller of the Dummy-QuesttypeAgent for testing basic
|
||||
* QuesttypeAgent-functionality.
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class DummyQuesttypeController extends \hhu\z\QuesttypeController
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Action: index.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// Check for submission
|
||||
if($this->request->getRequestMethod() == 'POST')
|
||||
{
|
||||
// Right answer (dummy)
|
||||
if(!is_null($this->request->getPostParam('submit'))) {
|
||||
$this->setQuestSolved();
|
||||
}
|
||||
// Wrong answer (dummy)
|
||||
else {
|
||||
$this->setQuestUnsolved();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
25
questtypes/dummy/DummyQuesttypeModel.inc
Normal file
25
questtypes/dummy/DummyQuesttypeModel.inc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The Legend of Z
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
* @copyright 2014 Heinrich-Heine-Universität Düsseldorf
|
||||
* @license http://www.gnu.org/licenses/gpl.html
|
||||
* @link https://bitbucket.org/coderkun/the-legend-of-z
|
||||
*/
|
||||
|
||||
namespace hhu\z\questtypes;
|
||||
|
||||
|
||||
/**
|
||||
* Model of the Dummy-QuesttypeAgent for testing basic
|
||||
* QuesttypeAgent-functionality.
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class DummyQuesttypeModel extends \hhu\z\QuesttypeModel
|
||||
{
|
||||
}
|
||||
|
||||
?>
|
||||
4
questtypes/dummy/html/index.tpl
Normal file
4
questtypes/dummy/html/index.tpl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<form method="post">
|
||||
<input type="submit" name="submit" value="richtige Antwort" />
|
||||
<input type="submit" name="wrong" value="falsche Antwort" />
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue