[LON-CAPA-cvs] cvs: rat /client parameter.html
raeburn
raeburn at source.lon-capa.org
Wed Jul 6 18:00:43 EDT 2022
raeburn Wed Jul 6 22:00:43 2022 EDT
Modified files:
/rat/client parameter.html
Log:
- Fix parenthesis. Replace comparison with null with typeof() comparison with
'undefined'.
Index: rat/client/parameter.html
diff -u rat/client/parameter.html:1.87 rat/client/parameter.html:1.88
--- rat/client/parameter.html:1.87 Tue May 24 16:23:04 2022
+++ rat/client/parameter.html Wed Jul 6 22:00:43 2022
@@ -5,7 +5,7 @@
The LearningOnline Network with CAPA
Parameter Input Window
//
-// $Id: parameter.html,v 1.87 2022/05/24 16:23:04 raeburn Exp $
+// $Id: parameter.html,v 1.88 2022/07/06 22:00:43 raeburn Exp $
//
// Copyright Michigan State University Board of Trustees
//
@@ -401,8 +401,8 @@
for (var i=0; i<sform.donebutton.length; i++) {
if (sform.donebutton[i].checked) {
if (sform.donebutton[i].value == '_done_proctor') {
- if ((sform.donebutton_proctorkey.value == '') ||
- (sform.donebutton_proctorkey.value == null)) {
+ var keyval = sform.donebutton_proctorkey.value;
+ if ((keyval == '') || (typeof(keyval) == 'undefined')) {
alert('Please enter a key for a proctor to enter when a student uses the "Done" button.');
return;
}
@@ -636,7 +636,8 @@
}
var patternRelWeight = /^\-?[\d.]+$/;
var sform=choices.document.forms.sch;
- if ((sform.lenientrelwt.length != 'undefined') && (sform.lenientrelwt.length) != 'null') {
+ var relwtlength = sform.lenientrelwt.length;
+ if ((relwtlength != '') && (typeof(relwtlength) != 'undefined')) {
for (var i=0; i<sform.lenientrelwt.length; i++) {
var relweight = sform.lenientrelwt[i].value;
relweight = relweight.replace(/^\s+|\s+$/g,'');
@@ -1095,7 +1096,7 @@
if (pscat=='ip') {
var currallow = new Array;
var currdeny = new Array;
- if ((svalue != '') && (svalue != null)) {
+ if ((svalue != '') && (typeof(svalue) != 'undefined')) {
var patternComma = /,/;
var patternAllow = /^([\[\]a-zA-Z\.\d\*\-]+)$/;
var patternDeny = /^\!([\[\]a-zA-Z\.\d\*\-]+)$/;
@@ -1188,7 +1189,7 @@
var dlinklticdivsty = 'none';
var dlinkltiddivsty = 'none';
var dlinkmenusdivsty = 'none';
- if ((svalue != '') && (svalue != null)) {
+ if ((svalue != '') && (typeof(svalue) != 'undefined')) {
deeplinkvals = svalue.split(',');
if (ltikeyRegExp.test(deeplinkvals[4])) {
linkprotectparts = deeplinkvals[4].split(':');
@@ -1285,7 +1286,7 @@
choicewrite('</span><br />');
var possmenus = new Array();
- if ((pextra != '') && (pextra != null)) {
+ if ((pextra != '') && (typeof(pextra) != 'undefined')) {
var lticRegExp = /^ltic_/;
var ltidRegExp = /^ltid_/;
var menusRegExp = /^menus_/;
More information about the LON-CAPA-cvs
mailing list