From a979a969ee8a924408ebeb767035b9e4f48f7efa Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 1 Feb 2021 13:14:30 +0900
Subject: acrotex (2021-02-01)

---
 texmf-dist/tex/latex/acrotex/aebjs.def | 62 ++++++++++++++++++++++------------
 1 file changed, 40 insertions(+), 22 deletions(-)

(limited to 'texmf-dist/tex/latex/acrotex/aebjs.def')

diff --git a/texmf-dist/tex/latex/acrotex/aebjs.def b/texmf-dist/tex/latex/acrotex/aebjs.def
index 2d01029f..9be63c22 100644
--- a/texmf-dist/tex/latex/acrotex/aebjs.def
+++ b/texmf-dist/tex/latex/acrotex/aebjs.def
@@ -18,7 +18,7 @@
 %% License, or (at your option) any later version.      %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \ProvidesFile{aebjs.def}
- [2020/03/14 v8.5.10 %
+ [2021/01/20 v8.6.2 %
  Exerquiz document level JavaScript (dps)]
 \def\aeb@array{new Array}
 \def\refac#1{\\(#1\\)}\def\regrp#1{(#1)}\def\rechrclass#1{[#1]}
@@ -28,7 +28,7 @@
 \def\preDenyForm{\Array(denyForm,\@gobble}
 \def\postDenyForm{\Array(requireFormNot,\@gobble}
 \newcommand{\noPeekArgs}[1]{%
-    \def\NoPeekAlert{eqAppAlert(#1)}}\def\newNoPeekArgs{}
+  \def\NoPeekAlert{eqAppAlert(#1)}}\def\newNoPeekArgs{}
 \def\NoPeekAlert{eqAppAlert(\noPeekMsg,3)}
 \newcommand{\dlLibSpecRespJS}{"none","undefined","empty"}
 \newif\ifSubstVars\SubstVarsfalse % dps17
@@ -777,6 +777,23 @@ function eqFilter(filterMethod) {
             return this.toString();
     }
 }
+function checkTheSpelling(targetFieldName) {
+  var spellChkCnt=0;
+  var f=this.getField(targetFieldName);
+  var value=f.value;
+  var valueStrip = value.replace(/\s+/g,"");
+  if ( valueStrip != "" ) {
+    aBrk=value.split(/\s+/);
+    for (var i=0; i<aBrk.length; i++){
+      var word=aBrk[i];
+      var aRetnSC=spell.checkWord(word);
+      if (aRetnSC!=null) spellChkCnt++;
+    }
+    var corrdStr=spell.checkText(value);
+    f.value=corrdStr;
+  }
+  return spellChkCnt;
+}
 \end{newsegment}
 \begin{newsegment}{Eq: Quiz Management}
 function InitMsg(msg) { return (\eqInitQuizMsg) }
@@ -849,12 +866,12 @@ function InitializeQuiz(qtfield,mark) {
     ProcessIt = false;
     aQuizControl[qtfield] = 1;
     this.resetForm(["ScoreField." + qtfield,"mc."+qtfield,
-        "obj."+qtfield,"mck."+qtfield,"Ans."+qtfield,
-        "PointsField."+qtfield,"PercentField."+qtfield,
-        "essay."+qtfield,"GradeField."+qtfield,
-        "grpobj."+qtfield,"qMark."+qtfield, qtfield+"SanityCheck",
-        qtfield+"SanityCheckPts",qtfield+"SanityCheckOOPts",
-        "rbmarkup."+qtfield]);
+      "obj."+qtfield,"mck."+qtfield,"Ans."+qtfield,
+      "PointsField."+qtfield,"PercentField."+qtfield,
+      "essay."+qtfield,"GradeField."+qtfield,
+      "grpobj."+qtfield,"qMark."+qtfield, qtfield+"SanityCheck",
+      qtfield+"SanityCheckPts",qtfield+"SanityCheckOOPts",
+      "rbmarkup."+qtfield]);
     ProcessIt = true;
     var f = this.getField("qMark."+qtfield);
     if ( f != null ) f.display = display.hidden;
@@ -976,16 +993,16 @@ function DisplayQuizResults(qtfield,nPointTotal,nQuestions)
     NPointTotal=nPointTotal; NQuestions=nQuestions;
     for (var i=1; i < RightWrong.length; i++)
     {
-        if ( (typeof RightWrong[i] == "object" ) %
-&& ( RightWrong[i][0] == "grp" ) ) {
+        if ( (typeof RightWrong[i] == "object" ) && %
+( RightWrong[i][0] == "grp" ) ) {
             // grouped question
-                Score += GrpRight(RightWrong[i], i, qtfield);
-                var aWeights = ProbValue[i].slice(2);
-                var evalGrpJS = eval(ProbValue[i][1]);
-                var evalGrpJSValue = evalGrpJS(this,qtfield,i,
-                    RightWrong[i],aWeights);
-                ProbDist[i] = evalGrpJSValue;
-                ptScore = ptScore + evalGrpJSValue;
+            Score += GrpRight(RightWrong[i], i, qtfield);
+            var aWeights = ProbValue[i].slice(2);
+            var evalGrpJS = eval(ProbValue[i][1]);
+            var evalGrpJSValue = evalGrpJS(this,qtfield,i,
+                RightWrong[i],aWeights);
+            ProbDist[i] = evalGrpJSValue;
+            ptScore = ptScore + evalGrpJSValue;
         } else {
             if (typeof RightWrong[i] == "object") {
                 if ( RightWrong[i][0] == 1 ) {
@@ -1000,20 +1017,21 @@ function DisplayQuizResults(qtfield,nPointTotal,nQuestions)
                     else {
                         ProbDist[i]=(typeof ProbValue[i] == "object") ?
                             1*ProbValue[i][1] : 0;
-                        if (!negPointsAllowed && !negPointsMarkupAllowed) if (ProbDist[i]<0) ProbDist[i]=0
+                        if (!negPointsAllowed && %
+!negPointsMarkupAllowed && (ProbDist[i]<0) ) ProbDist[i]=0;
                     }
                     ptScore += (1*ProbDist[i]);
                 }
             } else {
                 if (RightWrong[i]==1) {
                     Score++;
-                    ProbDist[i] = ( typeof ProbValue[i] == "object") ?
-                        1*ProbValue[i][1] : 1*ProbValue[i];
+                    ProbDist[i] = ( typeof ProbValue[i] == "object") ? %
+1*ProbValue[i][1] : 1*ProbValue[i];
                     ptScore += (1*ProbDist[i]);
                 }
                 else {
-                    ProbDist[i] = ( typeof ProbValue[i] == "object") ?
-                        1*ProbValue[i][2] : 0;
+                    ProbDist[i] = ( typeof ProbValue[i] == "object") ? %
+1*ProbValue[i][2] : 0;
                     ptScore += (1*ProbDist[i]);
                 }
             }
-- 
cgit v1.2.3

