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 2e434038..b1540fbf 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 06b05622..e3e14c8d 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: 2015-04-08 15:55+0100\n" -"PO-Revision-Date: 2015-04-08 15:56+0100\n" +"POT-Creation-Date: 2015-04-08 16:22+0100\n" +"PO-Revision-Date: 2015-04-08 16:22+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: de_DE\n" @@ -135,7 +135,7 @@ msgstr "Wählen" #: questtypes/crossword/html/quest.tpl:30 #: questtypes/dragndrop/html/quest.tpl:16 #: questtypes/multiplechoice/html/quest.tpl:19 -#: questtypes/submit/html/quest.tpl:23 questtypes/textinput/html/quest.tpl:12 +#: questtypes/submit/html/quest.tpl:23 questtypes/textinput/html/quest.tpl:13 msgid "solve" msgstr "lösen" @@ -339,6 +339,11 @@ msgstr "Der reguläre Ausdruck ist ungültig" msgid "Fields" msgstr "Felder" +#: questtypes/textinput/html/quest.tpl:12 +#, php-format +msgid "You filled %d of %d fields correctly" +msgstr "Du hast %d von %d Feldern korrekt ausgefüllt" + #: views/ajax/quests/index.tpl:9 views/html/quests/create.tpl:79 #: views/html/quests/edit.tpl:82 views/html/quests/index.tpl:27 #: views/html/quests/index.tpl:59 diff --git a/questtypes/textinput/TextinputQuesttypeController.inc b/questtypes/textinput/TextinputQuesttypeController.inc index 205e047b..a4b62267 100644 --- a/questtypes/textinput/TextinputQuesttypeController.inc +++ b/questtypes/textinput/TextinputQuesttypeController.inc @@ -124,9 +124,14 @@ $solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']); // Get Character answers - if(!$solved || $this->request->getGetParam('show-answer') == 'true' || $this->request->getGetParam('status') == 'solved') { - foreach($fields as &$field) { + $correctAnswersCount = null; + if(!$solved || $this->request->getGetParam('show-answer') == 'true' || $this->request->getGetParam('status') == 'solved') + { + $correctAnswersCount = 0; + foreach($fields as &$field) + { $field['answer'] = $this->Textinput->getCharacterSubmission($field['id'], $character['id']); + $correctAnswersCount += $this->isMatching($field['regex'], $field['answer']); } } @@ -134,6 +139,7 @@ // Pass data to view $this->set('task', $task); $this->set('fields', $fields); + $this->set('count', $correctAnswersCount); } diff --git a/questtypes/textinput/html/quest.tpl b/questtypes/textinput/html/quest.tpl index 9aaf010b..0e786e56 100644 --- a/questtypes/textinput/html/quest.tpl +++ b/questtypes/textinput/html/quest.tpl @@ -9,5 +9,6 @@ =$t->t(mb_substr($task['text'], $posStart, mb_strlen($task['text'], 'UTF-8')-$posStart, 'UTF-8'))?>
+=sprintf(_('You filled %d of %d fields correctly'), $count, count($fields))?>.