implement dummy-QuesttypeAgent for testing basic QuesttypeAgent-functionality
This commit is contained in:
parent
eb9511103c
commit
28c7b6986d
4 changed files with 101 additions and 0 deletions
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue