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 72d6af08..fa698bc4 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 cc8234f3..ddc5748c 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-04-14 15:20+0100\n" -"PO-Revision-Date: 2014-04-14 15:21+0100\n" +"POT-Creation-Date: 2014-04-15 00:04+0100\n" +"PO-Revision-Date: 2014-04-15 00:04+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: de_DE\n" @@ -17,13 +17,23 @@ msgstr "" "X-Poedit-SearchPath-1: questtypes\n" #: questtypes/choiceinput/html/quest.tpl:14 -#: questtypes/crossword/html/quest.tpl:25 +#: 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:10 msgid "solve" msgstr "lösen" +#: questtypes/crossword/html/quest.tpl:22 +#: questtypes/crossword/html/submission.tpl:22 +msgid "vertical" +msgstr "vertikal" + +#: questtypes/crossword/html/quest.tpl:24 +#: questtypes/crossword/html/submission.tpl:24 +msgid "horizontal" +msgstr "horizontal" + #: questtypes/multiplechoice/html/quest.tpl:3 #, php-format msgid "Question %d of %d" diff --git a/questtypes/crossword/CrosswordQuesttypeController.inc b/questtypes/crossword/CrosswordQuesttypeController.inc index 04e7efc1..65833c87 100644 --- a/questtypes/crossword/CrosswordQuesttypeController.inc +++ b/questtypes/crossword/CrosswordQuesttypeController.inc @@ -282,15 +282,14 @@ foreach(range($startY, $endY) as $y) { - $oldValue = (array_key_exists($x, $matrix) && array_key_exists($y, $matrix[$x]) && !is_null($matrix[$x][$y])) ? $matrix[$x][$y] : null; $matrix[$x][$y] = array( 'char' => mb_substr($word['word'], $y-$startY, 1, 'UTF-8'), - 'indices' => array($index), + 'indices' => (array_key_exists($x, $matrix) && array_key_exists($y, $matrix[$x]) && !is_null($matrix[$x][$y]) && array_key_exists('indices', $matrix[$x][$y])) ? $matrix[$x][$y]['indices'] : array(), 'answer' => null, 'right' => false ); - if(!is_null($oldValue)) { - $matrix[$x][$y]['indices'] = array_merge($matrix[$x][$y]['indices'], $oldValue['indices']); + if($y == $startY) { + $matrix[$x][$y]['indices'][] = $index; } if(!is_null($word['answer'])) @@ -318,15 +317,14 @@ { $matrix[$x] = array_pad($matrix[$x], $y+1, null); - $oldValue = (array_key_exists($x, $matrix) && array_key_exists($y, $matrix[$x]) && !is_null($matrix[$x][$y])) ? $matrix[$x][$y] : null; $matrix[$x][$y] = array( 'char' => mb_substr($word['word'], $x-$startX, 1, 'UTF-8'), - 'indices' => array($index), + 'indices' => (array_key_exists($x, $matrix) && array_key_exists($y, $matrix[$x]) && !is_null($matrix[$x][$y]) && array_key_exists('indices', $matrix[$x][$y])) ? $matrix[$x][$y]['indices'] : array(), 'answer' => null, 'right' => false ); - if(!is_null($oldValue)) { - $matrix[$x][$y]['indices'] = array_merge($matrix[$x][$y]['indices'], $oldValue['indices']); + if($x == $startX) { + $matrix[$x][$y]['indices'][] = $index; } if(!is_null($word['answer'])) { diff --git a/questtypes/crossword/html/quest.tpl b/questtypes/crossword/html/quest.tpl index 59068547..d202eb8f 100644 --- a/questtypes/crossword/html/quest.tpl +++ b/questtypes/crossword/html/quest.tpl @@ -17,7 +17,14 @@