diff --git a/application/helpers/expressions/em_core_helper.php b/application/helpers/expressions/em_core_helper.php index fdd1dc6ea4a..c314a53be6c 100644 --- a/application/helpers/expressions/em_core_helper.php +++ b/application/helpers/expressions/em_core_helper.php @@ -1269,7 +1269,7 @@ public function GetJavaScriptEquivalentOfExpression() elseif ($i+1<$numTokens && $tokens[$i+1][2] == 'ASSIGN') { $jsName = $this->GetVarAttribute($token[0],'jsName',''); - $stringParts[] = "$('" . $jsName . "').val()"; + $stringParts[] = "document.getElementById('" . $jsName . "').value"; if ($tokens[$i+1][0] == '+=') { // Javascript does concatenation unless both left and right side are numbers, so refactor the equation @@ -1361,8 +1361,8 @@ public function GetJavascriptTestforExpression($expected,$num) $jsParts = array(); $jsParts[] = "val = " . $jsmultiline_expr . ";\n"; $jsParts[] = "klass = (LEMeq(addslashes(val),'" . $jsmultiline_expected . "')) ? 'ok' : 'error';\n"; - $jsParts[] = "$('test_" . $num . "').html(val);\n"; - $jsParts[] = "$('test_" . $num . "').addClass(klass);\n"; + $jsParts[] = "document.getElementById('test_" . $num . "').innerHTML=(val);\n"; + $jsParts[] = "document.getElementById('test_" . $num . "').className=klass;\n"; return implode('',$jsParts); } @@ -1377,9 +1377,9 @@ public function GetJavaScriptFunctionForReplacement($questionNum, $name,$eqn) $jsParts = array(); // $jsParts[] = "\n // Tailor Question " . $questionNum . " - " . $name . ": { " . $eqn . " }\n"; $jsParts[] = " try{\n"; - $jsParts[] = " $('" . $name . "').html(LEMfixnum(\n "; + $jsParts[] = " document.getElementById('" . $name . "').innerHTML=LEMfixnum(\n "; $jsParts[] = $this->GetJavaScriptEquivalentOfExpression(); - $jsParts[] = "));\n"; + $jsParts[] = ");\n"; $jsParts[] = " } catch (e) { console.log(e); }\n"; return implode('',$jsParts); }