Permalink
Browse files

fix detection of correct answers in JCross that is not case-sensitive

  • Loading branch information...
1 parent 70f3371 commit 7480adb9cbd94d95ceb791f66b69f29e7c5ebe83 @gbateson gbateson committed Apr 23, 2010
Showing with 9 additions and 4 deletions.
  1. +9 −4 mod/hotpot/hotpot-full.js
View
@@ -1092,7 +1092,7 @@ function GetJCrossQuestionDetails(hp, v) {
if (JCross[0]) {
qDetails += makeSeparator(Q);
}
- if (JCross[5]) {
+ if (JCross[3]) {
var x = (HP[_correct][AD] && HP[_correct][AD][q]) ? HP[_correct][AD][q] : '';
qDetails += hpHiddenField(Q+'correct', x);
}
@@ -1548,7 +1548,7 @@ function hpClickClue(hp, t, v, args) {
}
function hpClickCheck(hp, t, v, args) {
if (t==2) { // JCloze
- if (v==5 || v==6) {
+ if (v==5 || v==6) {
var r = hpRottmeier();
var already_correct = 'true';
if (r==0) {
@@ -1844,7 +1844,12 @@ function hpClickCheckJCrossV5V6(hp, v, AD, q, row, col) {
var check = false;
var guess = GetJCrossWord(G, row, col, (AD=='D'));
var correct = GetJCrossWord(L, row, col, (AD=='D'));
- if (guess==correct) {
+ if (window.CaseSensitive) {
+ var is_correct = (guess==correct);
+ } else {
+ var is_correct = (guess.toUpperCase()==correct.toUpperCase());
+ }
+ if (is_correct) {
HP[_correct][AD][q] = correct;
check = true;
} else if (guess) {
@@ -3004,4 +3009,4 @@ if (p && c) {
window.SendResults = SendAllResults;
// set start time
var Start_Time = new Date();
-//-->
+//-->

0 comments on commit 7480adb

Please sign in to comment.