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
|
|
@ -119,13 +119,15 @@
|
|||
}
|
||||
|
||||
// Get Character answers
|
||||
if($this->request->getGetParam('show-answer') == 'true')
|
||||
if($this->request->getGetParam('show-answer') == 'true' || !$this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']))
|
||||
{
|
||||
foreach($choiceLists as &$list) {
|
||||
$list['answer'] = $this->Choiceinput->getCharacterSubmission($list['id'], $character['id']);
|
||||
}
|
||||
}
|
||||
|
||||
print_r($choiceLists);
|
||||
|
||||
|
||||
// Pass data to view
|
||||
$this->set('texts', $textParts);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<?php if($i > 0) : ?>
|
||||
<select name="answers[<?=$i-1?>]">
|
||||
<?php foreach($choiceLists[$i-1]['values'] as &$choice) : ?>
|
||||
<option value="<?=$choice['id']?>" <?php if(array_key_exists('answer', $choiceLists[$i-1]) && $choiceLists[$i-1] == $choice['id']) : ?>selected="selected"<?php endif ?>><?=$choice['text']?></option>
|
||||
<option value="<?=$choice['id']?>" <?php if(array_key_exists('answer', $choiceLists[$i-1]) && $choiceLists[$i-1]['answer'] == $choice['id']) : ?>selected="selected"<?php endif ?>><?=$choice['text']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue