restore Character answres for all Questtypes if Character has not already solved the Quest
This commit is contained in:
parent
d4c127d4dd
commit
aba2100fb3
6 changed files with 11 additions and 9 deletions
|
|
@ -118,9 +118,12 @@
|
|||
// Process text
|
||||
$textParts = preg_split('/(\$\$)/', ' '.$task['text'].' ', -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
// Has Character already solved Quest?
|
||||
$solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']);
|
||||
|
||||
// Get Character answers
|
||||
$regexs = null;
|
||||
if($this->request->getGetParam('show-answer') == 'true')
|
||||
if(!$solved || $this->request->getGetParam('show-answer') == 'true')
|
||||
{
|
||||
$regexs = $this->Textinput->getTextinputRegexs($quest['id']);
|
||||
foreach($regexs as &$regex) {
|
||||
|
|
@ -128,9 +131,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Has Character already solved Quest?
|
||||
$solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']);
|
||||
|
||||
|
||||
// Pass data to view
|
||||
$this->set('texts', $textParts);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue