diff --git a/controllers/QuestsController.inc b/controllers/QuestsController.inc index ca8622f7..3204bb7c 100644 --- a/controllers/QuestsController.inc +++ b/controllers/QuestsController.inc @@ -347,13 +347,15 @@ $questtypeAgent = $this->loadQuesttypeAgent($questtypeClassname, $request, $response); // Solve Quest - if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('submit')) && !$this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id'])) + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('submit'))) { // Get user answers $answers = $this->request->getPostParam('answers'); // Save answers in database - $questtypeAgent->saveAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers); + if(!$this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id'])) { + $questtypeAgent->saveAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers); + } // Match answers with correct ones $status = $questtypeAgent->matchAnswersofCharacter($seminary, $questgroup, $quest, $character, $answers); diff --git a/locale/de_DE/LC_MESSAGES/The Legend of Z.mo b/locale/de_DE/LC_MESSAGES/The Legend of Z.mo index b612a217..1192a653 100644 Binary files a/locale/de_DE/LC_MESSAGES/The Legend of Z.mo and b/locale/de_DE/LC_MESSAGES/The Legend of Z.mo differ diff --git a/locale/de_DE/LC_MESSAGES/The Legend of Z.po b/locale/de_DE/LC_MESSAGES/The Legend of Z.po index 390e7ef1..56d1ec82 100644 --- a/locale/de_DE/LC_MESSAGES/The Legend of Z.po +++ b/locale/de_DE/LC_MESSAGES/The Legend of Z.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: The Legend of Z\n" -"POT-Creation-Date: 2014-03-22 14:37+0100\n" -"PO-Revision-Date: 2014-03-22 14:37+0100\n" +"POT-Creation-Date: 2014-03-22 21:17+0100\n" +"PO-Revision-Date: 2014-03-22 21:18+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: de_DE\n" @@ -20,20 +20,6 @@ msgstr "" msgid "Error" msgstr "Fehler" -#: ../../../views/html/charactergroups/group.tpl:1 -#: ../../../views/html/charactergroups/groupsgroup.tpl:1 -#: ../../../views/html/charactergroups/index.tpl:1 -#: ../../../views/html/charactergroupsquests/quest.tpl:1 -#: ../../../views/html/menu/index.tpl:4 ../../../views/html/quests/quest.tpl:1 -#: ../../../views/html/quests/submission.tpl:1 -#: ../../../views/html/quests/submissions.tpl:1 -#: ../../../views/html/seminaries/create.tpl:1 -#: ../../../views/html/seminaries/delete.tpl:1 -#: ../../../views/html/seminaries/edit.tpl:1 -#: ../../../views/html/seminaries/index.tpl:1 -msgid "Seminaries" -msgstr "Kurse" - #: ../../../views/html/charactergroups/group.tpl:3 #: ../../../views/html/charactergroups/groupsgroup.tpl:3 #: ../../../views/html/charactergroups/index.tpl:3 @@ -103,6 +89,14 @@ msgstr "Einführung" msgid "Users" msgstr "Benutzer" +#: ../../../views/html/menu/index.tpl:4 +#: ../../../views/html/seminaries/create.tpl:1 +#: ../../../views/html/seminaries/delete.tpl:1 +#: ../../../views/html/seminaries/edit.tpl:1 +#: ../../../views/html/seminaries/index.tpl:1 +msgid "Seminaries" +msgstr "Kurse" + #: ../../../views/html/menu/index.tpl:10 ../../../views/html/users/login.tpl:2 #: ../../../views/html/users/login.tpl:11 msgid "Login" @@ -118,34 +112,38 @@ msgstr "Logout" msgid "locked" msgstr "gesperrt" -#: ../../../views/html/quests/quest.tpl:21 -#: ../../../views/html/quests/submissions.tpl:28 +#: ../../../views/html/quests/quest.tpl:20 +#: ../../../views/html/quests/submissions.tpl:27 msgid "solved" msgstr "gelöst" -#: ../../../views/html/quests/quest.tpl:23 -#: ../../../views/html/quests/submissions.tpl:19 +#: ../../../views/html/quests/quest.tpl:22 +#: ../../../views/html/quests/submissions.tpl:18 msgid "unsolved" msgstr "ungelöst" -#: ../../../views/html/quests/quest.tpl:60 +#: ../../../views/html/quests/quest.tpl:59 msgid "Task" msgstr "Aufgabe" -#: ../../../views/html/quests/quest.tpl:68 +#: ../../../views/html/quests/quest.tpl:67 msgid "Task successfully solved" msgstr "Du hast die Aufgabe erfolgreich gelöst" -#: ../../../views/html/quests/quest.tpl:69 +#: ../../../views/html/quests/quest.tpl:67 +msgid "Show correct answer" +msgstr "Richtige Lösung anzeigen" + +#: ../../../views/html/quests/quest.tpl:68 msgid "Go on" msgstr "Hier geht es weiter" -#: ../../../views/html/quests/quest.tpl:74 -#: ../../../views/html/quests/quest.tpl:76 +#: ../../../views/html/quests/quest.tpl:73 +#: ../../../views/html/quests/quest.tpl:75 msgid "Quest" msgstr "Quest" -#: ../../../views/html/quests/submission.tpl:11 +#: ../../../views/html/quests/submission.tpl:10 #, php-format msgid "Submission of %s" msgstr "Lösungen von %s" diff --git a/questtypes/dragndrop/DragndropQuesttypeController.inc b/questtypes/dragndrop/DragndropQuesttypeController.inc index f0a031f9..fa801be2 100644 --- a/questtypes/dragndrop/DragndropQuesttypeController.inc +++ b/questtypes/dragndrop/DragndropQuesttypeController.inc @@ -125,7 +125,6 @@ $this->set('field', $dndField); $this->set('drops', $drops); $this->set('drags', $drags); - $this->set('solved', $solved); } diff --git a/questtypes/dragndrop/html/quest.tpl b/questtypes/dragndrop/html/quest.tpl index 0f665414..74e497c7 100644 --- a/questtypes/dragndrop/html/quest.tpl +++ b/questtypes/dragndrop/html/quest.tpl @@ -13,5 +13,5 @@
- /> + diff --git a/questtypes/multiplechoice/MultiplechoiceQuesttypeController.inc b/questtypes/multiplechoice/MultiplechoiceQuesttypeController.inc index e70d4ae1..57f60e82 100644 --- a/questtypes/multiplechoice/MultiplechoiceQuesttypeController.inc +++ b/questtypes/multiplechoice/MultiplechoiceQuesttypeController.inc @@ -96,8 +96,13 @@ { // Get questions $questions = $this->Multiplechoice->getQuestionsOfQuest($quest['id']); - foreach($questions as &$question) { - $question['answer'] = $this->Multiplechoice->getCharacterSubmission($question['id'], $character['id']); + + // Get user answers + if($this->request->getGetParam('show-answer') == 'true') + { + foreach($questions as &$question) { + $question['answer'] = $this->Multiplechoice->getCharacterSubmission($question['id'], $character['id']); + } } // Has Character already solved Quest? diff --git a/questtypes/multiplechoice/html/quest.tpl b/questtypes/multiplechoice/html/quest.tpl index 15254ad9..59c1743d 100644 --- a/questtypes/multiplechoice/html/quest.tpl +++ b/questtypes/multiplechoice/html/quest.tpl @@ -2,10 +2,10 @@
    &$question) : ?>
  1. - /> + />
- /> + diff --git a/questtypes/textinput/TextinputQuesttypeController.inc b/questtypes/textinput/TextinputQuesttypeController.inc index c502b424..580de65c 100644 --- a/questtypes/textinput/TextinputQuesttypeController.inc +++ b/questtypes/textinput/TextinputQuesttypeController.inc @@ -104,9 +104,13 @@ $textParts = preg_split('/(\$\$)/', $task['text'], -1, PREG_SPLIT_NO_EMPTY); // Get Character answers - $regexs = $this->Textinput->getTextinputRegexs($quest['id']); - foreach($regexs as &$regex) { - $regex['answer'] = $this->Textinput->getCharacterSubmission($regex['id'], $character['id']); + $regexs = null; + if($this->request->getGetParam('show-answer') == 'true') + { + $regexs = $this->Textinput->getTextinputRegexs($quest['id']); + foreach($regexs as &$regex) { + $regex['answer'] = $this->Textinput->getCharacterSubmission($regex['id'], $character['id']); + } } // Has Character already solved Quest? @@ -116,7 +120,6 @@ // Pass data to view $this->set('texts', $textParts); $this->set('regexs', $regexs); - $this->set('solved', $solved); } diff --git a/questtypes/textinput/html/quest.tpl b/questtypes/textinput/html/quest.tpl index c61bd50c..53b7bd08 100644 --- a/questtypes/textinput/html/quest.tpl +++ b/questtypes/textinput/html/quest.tpl @@ -1,11 +1,11 @@
&$text) : ?> 0) : ?> - /> +

- /> +
diff --git a/views/html/quests/quest.tpl b/views/html/quests/quest.tpl index 6cc357d4..70155c13 100644 --- a/views/html/quests/quest.tpl +++ b/views/html/quests/quest.tpl @@ -64,7 +64,7 @@
-

+

()

0) : ?>