Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 7480adb9cbd94d95ceb791f66b69f29e7c5ebe83 1 parent 70f3371
@gbateson gbateson authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 mod/hotpot/hotpot-full.js
View
13 mod/hotpot/hotpot-full.js
@@ -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();
-//-->
+//-->
Please sign in to comment.
Something went wrong with that request. Please try again.