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 zcmdmP{NK3#o)F7a1_lO(GzJC+83qOhA7%!IP6h^s8a9w91H%Fi1_mAm28M+k3=BdH z3=Hcy7#IW?7#I$6FffQSFfd%=U|`^5U|@K~!N8!!z`*d6gMmSefq_AV6T-LVWMI$+ zna|0hi-AFcfq`KI z7XyPN0|UcJuzWoO!(%Rp4?(7KF)%RjazhM|;AUW8XJBBEgYwn5A?kFv85lr;W62Hn z0fPgS?+sNS#Ld9K!oa`~1yvu<&A`CHz`&3LrAxUX4yxm3U{I-NU|{IyW?)cdU|`q+ zHQ*LE1A{UH1H&V3h|k%0Abc?%1_l)d1_mo0hy&w!7#IW@7#LD{APy?$fmmF}1F^7~ z2jbu!sQQ^udOi;%gqQL#Fw}#5yn_c~(P17227LwwhRZw*3(*CWWlAj-hNFjo*_{$@c)t~nwINwjzB1sNE0LD@%;fk7UW+Jzud zU;(8wgdo{zh7cq!*9$>>vPX!4!JL7C;kXdQr~ic@saseWlFf94A$&(+h(%Gt5RYaE zL(HiXhJ;*wyD-Fn>B5j8TrJGNAkDzQut^x=;&Z|b3`z_P4EKd04q*~uU{GgZV2~7n zqzy+Ah!1^5A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Te0>Gk72tE#_fh&}U#^*v!MgV8Fn@@R$b@)FQkP7c1~W zd}zoEaiAqHL|-hFpUca@pu)hwFp(GHkZrsS3w9L~%KNdugG z4E5lkk>G=9ROEwLCs7?k-TA*aS)53$e!s=$*UVv!#|#DyVH1Cse67H9E85>E*~B#8U? z85j;QGB8Z%hnN!~$iN`Vz`&3x2;tWYLUPFjK}aH9A;`d>%fP^}O^|^>o`Hek2}l7b z$XSFSL2n`i$v!DUkhrTBf+VsIAqEC>1_p-7LJ*&w7J{Va`$CXx^#jW16^2-(CJgbR zi7><*H(^Lf1q(y;Ckr!x6LEdHFav`$0|P^yFvP{Pgc%r=7#J8<3qu@oPMCo~oq>Vj zsW2oh@QOfuC@BI7DSZ)$15KfP2N8(R+(aN2q=`T*&J}@#SS?h2n+P~c>KP_N1*VBW zf_x!V;RX=~1}O#xhMgjig5(O6{x1Sagj%8yhZ%`Nq9jU`fkBgjfuRIS&l80>@PsJD z0p~;^4!Q>we<}(JnR*6>*P@Uh`vFzJCI(T+D+UPx5iy8C+F}r&8j3M67=lVlF$M-J z1_p*aF-XX*gwngjAU-`U#=xM#z`$@t4C0Z$Vi1o=h(l;+aRvrWnj1?&cL9ZpB;xl_`lkc~LnGD|`7BUUpu*y&73s`RH01X%2v!6J6V%mnlWjzE4#8}0!S28s6lB^ z!3U~ek|#H^OLHbNKwQQ!c`3U*WBlZ!?AnY`lRvUcGsaEkb@+4*DhvhNf0V2HFOO1_oRK{<=Y_Wtqj9`FXl7i6yC43PuKoCb|YD Tx`q&ShMTPfWH=`$N=^j;iZ7}T 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. + + : + + : + + +