update form for creating Qusets
This commit is contained in:
parent
2fbea36e12
commit
bf9df40b5f
3 changed files with 10 additions and 5 deletions
|
|
@ -445,6 +445,7 @@
|
||||||
// TODO Validation
|
// TODO Validation
|
||||||
$name = $this->request->getPostParam('name');
|
$name = $this->request->getPostParam('name');
|
||||||
$xps = $this->request->getPostParam('xps');
|
$xps = $this->request->getPostParam('xps');
|
||||||
|
$entrytext = $this->request->getPostParam('entrytext');
|
||||||
$wrongtext = $this->request->getPostParam('wrongtext');
|
$wrongtext = $this->request->getPostParam('wrongtext');
|
||||||
$task = $this->request->getPostParam('task');
|
$task = $this->request->getPostParam('task');
|
||||||
|
|
||||||
|
|
@ -483,6 +484,7 @@
|
||||||
$questgroups[$questgroupIndex]['id'],
|
$questgroups[$questgroupIndex]['id'],
|
||||||
$questtypes[$questtypeIndex]['id'],
|
$questtypes[$questtypeIndex]['id'],
|
||||||
$xps,
|
$xps,
|
||||||
|
$entrytext,
|
||||||
$wrongtext,
|
$wrongtext,
|
||||||
$task
|
$task
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -414,21 +414,22 @@
|
||||||
* @param int $questgroupId ID of Questgroup
|
* @param int $questgroupId ID of Questgroup
|
||||||
* @param int $questtypeId ID of Questtype
|
* @param int $questtypeId ID of Questtype
|
||||||
* @param int $xps XPs for new Quest
|
* @param int $xps XPs for new Quest
|
||||||
|
* @param string $entrytext Entrytext for new Quest
|
||||||
* @param string $wrongtext Wrongtext for new Quest
|
* @param string $wrongtext Wrongtext for new Quest
|
||||||
* @param string $task Task for new Quest
|
* @param string $task Task for new Quest
|
||||||
* @return int ID of new Quest
|
* @return int ID of new Quest
|
||||||
*/
|
*/
|
||||||
public function createQuest($userId, $name, $questgroupId, $questtypeId, $xps, $wrongtext, $task)
|
public function createQuest($userId, $name, $questgroupId, $questtypeId, $xps, $entrytext, $wrongtext, $task)
|
||||||
{
|
{
|
||||||
$this->db->query(
|
$this->db->query(
|
||||||
'INSERT INTO quests '.
|
'INSERT INTO quests '.
|
||||||
'(created_user_id, questgroup_id, questtype_id, title, url, xps, wrong_text, task) '.
|
'(created_user_id, questgroup_id, questtype_id, title, url, xps, entry_text, wrong_text, task) '.
|
||||||
'VALUES '.
|
'VALUES '.
|
||||||
'(?, ?, ?, ?, ?, ?, ?, ?)',
|
'(?, ?, ?, ?, ?, ?, ?, ?, ?)',
|
||||||
'iiississ',
|
'iiississs',
|
||||||
$userId, $questgroupId, $questtypeId,
|
$userId, $questgroupId, $questtypeId,
|
||||||
$name, \nre\core\Linker::createLinkParam($name),
|
$name, \nre\core\Linker::createLinkParam($name),
|
||||||
$xps, $wrongtext, $task
|
$xps, $entrytext, $wrongtext, $task
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
</select><br />
|
</select><br />
|
||||||
<label for="name">XPs:</label>
|
<label for="name">XPs:</label>
|
||||||
<input type="number" name="xps" value="" placeholder="<?=_('XPs')?>" /><br />
|
<input type="number" name="xps" value="" placeholder="<?=_('XPs')?>" /><br />
|
||||||
|
<label for="entrytext"><?=('Entry text')?>:</label><br />
|
||||||
|
<textarea name="entrytext" placeholder="<?=_('Entry text')?>"></textarea><br />
|
||||||
<label for="wrongtext"><?=('Wrong text')?>:</label><br />
|
<label for="wrongtext"><?=('Wrong text')?>:</label><br />
|
||||||
<textarea name="wrongtext" placeholder="<?=_('Wrong text')?>"></textarea><br />
|
<textarea name="wrongtext" placeholder="<?=_('Wrong text')?>"></textarea><br />
|
||||||
<label for="task"><?=_('Task')?>:</label><br />
|
<label for="task"><?=_('Task')?>:</label><br />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue