From b15bb406f77852092248ed7d3274dcb063591b1c Mon Sep 17 00:00:00 2001 From: coderkun Date: Tue, 15 Apr 2014 00:06:43 +0200 Subject: [PATCH] correct display of numbers for Questtype ?crossword? (submission) and mark orientation --- locale/de_DE/LC_MESSAGES/The Legend of Z.mo | Bin 6583 -> 6655 bytes locale/de_DE/LC_MESSAGES/The Legend of Z.po | 16 +++++++++++++--- .../CrosswordQuesttypeController.inc | 14 ++++++-------- questtypes/crossword/html/quest.tpl | 9 ++++++++- questtypes/crossword/html/submission.tpl | 11 +++++++++-- 5 files changed, 36 insertions(+), 14 deletions(-) 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 72d6af0819a72b71a2210732d170260f1ffba150..fa698bc48281f88a940eac09a8d284b7352f5554 100644 GIT binary patch delta 1864 zcmYk*S!_&E9LMo9)y`s@E|!j#s%eWFl#)^+=FL)q2cec4)kzx-Ql-(9n-CERmAEM- zq}oIXVyoEVL5tLq2o)ae!IR)gBoa~IUmc0b%>A4*_nh5VY&V!kV)2x-K*QptKD&_)eC%3Q&yHGprL7nb2I(p3_sD2a` zs1yldDpBjyBRLvp4-LNNFcpek05O0dfI zYf&4kN3DMp6}T0toMSH0(1e?)XLHZ?AEHYC997~^I1ImHKKh9&3sHx1H7c<<>d`df zSUhd*MkV+Ql|TZ!@e<#p($I|%sx(=sl0|w4@VZ%}$k)u_qVZ*@#4B(TZo*=0LsjmL z^&4sfJvava8~|-(66O=%l&FDqsGYQ-&cGSeYxWWq@HeXDi9A>(nv4+~jw5g$PQWT_ zGb(TwYR6A-GQPL{G|J@YG>2)(@kn({5o+QB)DD-T9!<;|N9}Mu>QFVH<~O3AaWg8x z7Sx8$q0ZD5>l4)YFCm62&<}UHwWqH=PCw=2QE8M5dE_1*7MyIUg-Xeagk5a2>&-MTG_O0AlQ&qol zLv5_u9UiRrZ>^}QttzK;C>Zrk9a&INTrkCb8_fRKZucf<2L7Lv9Xb@~owPnyZTUZZ3R|rWuog$1n@eU?%qBEPQ}daR5v34bH?=??gWrL-cDf8~32b zpTu-ylI8-97&m%R6Az;TjpB41LqBFPTIS&tEVV90AN`fcP_rHWcxp{kp66DRf3f`4XaTJZAJxdKm}|;zGfE}jqkQ5 zQ58Ops*1TpLxHYi8TMfWKOiwpHuY7;K~#cKRD#P;&(+(02P(lHR3iNt#HUzi<2j`*!)!6=KRAmmK9=wLy<6EdR^8l5=D5?TKtiMoaCxt(Ce--kMp1^^>T# z3T)i(!GTXYJSpo3c3AnG)~L%mjGw(sLl1u89#!=K+@DWWb44^7ihDxy9_N!1U zt3d_WfePG#s@P%F_!G#MBu$UKaRF8GUev(*I2#{h2@YHTq7GpRStzj>YD;QyA$D1> zq7rJWdkj$<2(HYwCk4+c=L$vkT@YGtLU!?YYV!CF*>wxSYiL~Th2>MZTE z_Mpb!bGqG2CfCt2&O`TJSG}{)lj~}BsyzjPM&0G33hAQ)C}xXu%#-VFqNU7?bHg*o zwcUB?3At*W?>yb$_|l4}ZR4+X{8SEQ)Y?~_Htu#-`MaG#e^psL7%fl4BB4k$5=mdT pHoU%VfBW9{-JRi;OTDbYfhzFOiw&b(#X_{{f0Gsty1E 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 @@
    -
  1. +
  2. + + : + + : + + +
diff --git a/questtypes/crossword/html/submission.tpl b/questtypes/crossword/html/submission.tpl index 00b8a4dc..c47e414d 100644 --- a/questtypes/crossword/html/submission.tpl +++ b/questtypes/crossword/html/submission.tpl @@ -6,7 +6,7 @@ - + 0) : ?> @@ -17,7 +17,14 @@
    -
  1. +
  2. + + : + + : + + +