Diff for /rat/client/parameter.html between versions 1.64.2.5.4.1 and 1.71

version 1.64.2.5.4.1, 2022/03/26 00:50:53 version 1.71, 2016/05/13 22:48:14
Line 287  function intsecond() { Line 287  function intsecond() {
     }      }
     result += '</select>';      result += '</select>';
     return result;      return result;
 }  } 
   
   
 function intday() {  function intday() {
Line 323  function intcalc() { Line 323  function intcalc() {
                         newpmodval = sform.donebutton[i].value;                          newpmodval = sform.donebutton[i].value;
                         newpextravaltwo = sform.donebutton_text.value;                          newpextravaltwo = sform.donebutton_text.value;
                     } else {                      } else {
                         if (sform.donebutton[i].value == '_done_proctor') {                          if (sform.donebutton[i].value == '_done_proctor') { 
                             newpmodval = sform.donebutton[i].value;                              newpmodval = sform.donebutton[i].value;
                             newpextraval = sform.donebutton_proctorkey.value;                              newpextraval = sform.donebutton_proctorkey.value;
                             newpextravaltwo = sform.donebutton_text.value;                              newpextravaltwo = sform.donebutton_text.value;
Line 344  function intcalc() { Line 344  function intcalc() {
                 svalue += donevals[1];                  svalue += donevals[1];
             }              }
             if (newpextravaltwo) {              if (newpextravaltwo) {
                 if (newpextravaltwo != 'Done') {                  if (newpextravaltwo != 'Done') { 
                     svalue += ':'+newpextravaltwo+':';                      svalue += ':'+newpextravaltwo+':';
                 }                  }
             }              }
Line 395  function validateInterval() { Line 395  function validateInterval() {
         for (var i=0; i<sform.donebutton.length; i++) {          for (var i=0; i<sform.donebutton.length; i++) {
             if (sform.donebutton[i].checked) {              if (sform.donebutton[i].checked) {
                 if (sform.donebutton[i].value == '_done_proctor') {                  if (sform.donebutton[i].value == '_done_proctor') {
                     if ((sform.donebutton_proctorkey.value == '') ||                      if ((sform.donebutton_proctorkey.value == '') || 
                         (sform.donebutton_proctorkey.value == null)) {                          (sform.donebutton_proctorkey.value == null)) {
                         alert('Please provide a key for a proctor to enter when a student uses the "Done" button.');                          alert('Please provide a key for a proctor to enter when a student uses the "Done" button.');
                         return;                          return;
Line 440  function stringeval() { Line 440  function stringeval() {
    draw();     draw();
 }  }
   
 function ipstringeval() {  
     var patternIp = /^([\[\]a-zA-Z\.\d\*\-]+)$/;  
     var acctypes = new Array;  
     acctypes = ['allow','deny'];  
     svalue = '';  
     for (var i=0; i<acctypes.length; i++) {  
         var items = choices.document.getElementsByName('setip'+acctypes[i]);  
         if (items.length > 0) {  
             for (var j=0; j<items.length; j++) {  
                 if (items[j].type == "text") {  
                     var possip = items[j].value;  
                     possip = possip.replace(/^\s+|\s+$/g,'');  
                     if (patternIp.test(possip)) {  
                         if (acctypes[i] == 'deny') {  
                             possip = '!'+possip;  
                         }  
                         if (svalue == '') {  
                             svalue = possip;  
                         } else {  
                             svalue += ','+possip;  
                         }  
                     }  
                 }  
             }  
         }  
     }  
 }  
   
 function addIpRule(iptype) {  
     var frame = window.frames["choices"];  
     if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {  
         var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);  
         var count = innerDiv.childNodes.length  
         var ipDiv = frame.document.createElement('div');  
         ipDiv.innerHTML = '<input type="text" size="10" name="setip'+iptype+'" onblur="parent.ipstringeval();" />'+  
                           '<a href="#" onclick="parent.removeIpRule(\''+iptype+'\',\''+count+'\')">Remove</a>';  
         frame.document.getElementById('LC_string_ipacc_inner_'+iptype).appendChild(ipDiv);  
     }  
     return false;  
 }  
   
 function removeIpRule(iptype,num) {  
     var frame = window.frames["choices"];  
     if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {  
         var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);  
         for (var i=0; i<innerDiv.childNodes.length; i++) {  
             if (i==num) {  
                 innerDiv.removeChild(innerDiv.childNodes[i]);  
                 ipstringeval();  
                 break;  
             }  
         }  
     }  
 }  
   
 function radiostringeval(newval) {  function radiostringeval(newval) {
    svalue=newval;     svalue=newval;
    draw();     draw();
Line 506  function callradiostringeval(newval) { Line 451  function callradiostringeval(newval) {
   
 function callintervalpmodval() {  function callintervalpmodval() {
     return 'onclick="parent.intcalc();parent.toggleSecret()"';      return 'onclick="parent.intcalc();parent.toggleSecret()"';
 }  } 
   
 function intervaldis() {  function intervaldis() {
     csecs=svalue;      csecs=svalue;
Line 545  function draw() { Line 490  function draw() {
       choicewrite(' action="javascript:floateval();"');        choicewrite(' action="javascript:floateval();"');
    }     }
    if (ptype=='string') {     if (ptype=='string') {
       if (pscat == 'ip') {        choicewrite(' action="javascript:stringeval();"');
           choicewrite(' action="javascript:ipstringeval();"');  
       } else {  
           choicewrite(' action="javascript:stringeval();"');  
       }  
    }     }
    if (ptype != 'int' && ptype != 'float' && ptype != 'string') {     if (ptype != 'int' && ptype != 'float' && ptype != 'string') {
        choicewrite(' action=""');         choicewrite(' action=""');
Line 636  function draw() { Line 577  function draw() {
          tablestart('Date and time');           tablestart('Date and time');
       }        }
       if (pscat=='interval') {        if (pscat=='interval') {
          var proctorkeytype = 'hidden';           var proctorkeytype = 'hidden'; 
          var donebuttontext = 'none';           var donebuttontext = 'none';
          if (pmodval == '_done_proctor') {           if (pmodval == '_done_proctor') {
              proctorkeytype = 'text';               proctorkeytype = 'text';
Line 764  function draw() { Line 705  function draw() {
    }     }
   
    if (ptype=='string') {     if (ptype=='string') {
         if ((pscat=='any') || (pscat=='') || (pscat=='default') ||          if ((pscat=='any') || (pscat=='') || (pscat=='default') ||  
             (typeof(pscat)=='undefined')) {              (typeof(pscat)=='undefined')) {
            tablestart('Text');             tablestart('Text');
            choicewrite('<tr><td>Value:</td><td colspan="2">');             choicewrite('<tr><td>Value:</td><td colspan="2">');
Line 833  function draw() { Line 774  function draw() {
            choicewrite('<label><input name="stringval" value="exam"'+             choicewrite('<label><input name="stringval" value="exam"'+
                   ' type="radio" '+callradiostringeval('exam'));                    ' type="radio" '+callradiostringeval('exam'));
            if (svalue=='exam') { choicewrite(' checked="checked"'); }             if (svalue=='exam') { choicewrite(' checked="checked"'); }
            choicewrite(' /> Exam</label><br />');             choicewrite(' /> Bubblesheet Exam</label><br />');
 //         choicewrite('<label><input name="stringval" value="assess"'+  //         choicewrite('<label><input name="stringval" value="assess"'+
 //              ' type="radio" '+callradiostringeval('assess'));  //              ' type="radio" '+callradiostringeval('assess'));
 //         if (svalue=='assess') { choicewrite(' checked="checked"'); }  //         if (svalue=='assess') { choicewrite(' checked="checked"'); }
Line 900  function draw() { Line 841  function draw() {
            choicewrite(' /> No</label><br />');             choicewrite(' /> No</label><br />');
         }          }
         if (pscat=='ip') {          if (pscat=='ip') {
             var currallow = new Array;             tablestart('IP Number/Name');
             var currdeny = new Array;     choicewrite('<tr><td>Value:</td><td colspan="2">');
             if ((svalue != '') && (svalue != null)) {             choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
                 var patternComma = /,/;                      '" onchange="parent.stringeval()" />');
                 var patternAllow = /^([\[\]a-zA-Z\.\d\*\-]+)$/;  
                 var patternDeny = /^\!([\[\]a-zA-Z\.\d\*\-]+)$/;  
                 var current = new Array;  
                 if (patternComma.test(svalue)) {  
                     current = svalue.split(',');  
                 } else {  
                     current = [svalue];  
                 }  
                 for (var i=0; i<current.length; i++) {  
                     if (patternDeny.test(current[i])) {  
                         var denied = current[i].replace(/^!/,'');  
                         currdeny.push(denied);  
                     } else {  
                         if (patternAllow.test(current[i])) {  
                             currallow.push(current[i]);  
                         }  
                     }  
                 }  
             }  
             if (currdeny.length == 0) {  
                 currdeny = ('');  
             }  
             if (currallow.length == 0) {  
                 currallow = ('');  
             }  
             var curripaccess = [currallow,currdeny];  
             tablestart('IP Number/Name');  
             choicewrite('<tr><th>Allow from</th><th>Deny from</th></tr><tr>');  
             var acctypes = ['allow','deny'];  
             for (var i=0; i<acctypes.length; i++) {  
                 choicewrite('<td valign="top">'+  
                             '<div class="LC_string_ipacc_wrap" id="LC_string_ipacc_'+acctypes[i]+'">'+  
                             '<div class="LC_string_ipacc_inner" id="LC_string_ipacc_inner_'+acctypes[i]+'">');  
                 for (var j=0; j<curripaccess[i].length; j++) {  
                     choicewrite('<div><input type="text" size="10" name="setip'+acctypes[i]+'" value="'+curripaccess[i][j]+'" onblur="parent.ipstringeval();" />');  
                     choicewrite('<a href="#" onclick="parent.removeIpRule(\''+acctypes[i]+'\',\''+j+'\')">Remove</a>');  
                     choicewrite('</div>');  
                 }  
                 choicewrite('</div><button onclick="parent.addIpRule(\''+acctypes[i]+'\');">Add item</button>');  
             }  
             choicewrite('</div></td></tr></table>');  
         }          }
         if (pscat=='fileext') {          if (pscat=='fileext') {
             tablestart('Allowed File Extensions');              tablestart('Allowed File Extensions');
Line 975  function draw() { Line 875  function draw() {
            choicewrite('<label><input name="stringval" value="resource"'+             choicewrite('<label><input name="stringval" value="resource"'+
                   ' type="radio" '+callradiostringeval('resource'));                    ' type="radio" '+callradiostringeval('resource'));
            if (svalue=='resource') { choicewrite(' checked="checked"'); }             if (svalue=='resource') { choicewrite(' checked="checked"'); }
            choicewrite(' /> Yes, and the scope of the slot is a single resource.</label><br />');             choicewrite(' /> Yes, and the scope of student selected slot is a single resource.</label><br />');
            choicewrite('<label><input name="stringval" value="map"'+             choicewrite('<label><input name="stringval" value="map"'+
                   ' type="radio" '+callradiostringeval('map'));                    ' type="radio" '+callradiostringeval('map'));
            if (svalue=='map') { choicewrite(' checked="checked"'); }             if (svalue=='map') { choicewrite(' checked="checked"'); }
            choicewrite(' /> Yes, and the scope of the slot is the enclosing map/folder. When checking in, it applies to only one resource.</label><br />');             choicewrite(' /> Yes, and the scope of student selected slot is the enclosing map/folder. When checking in, it applies to only one resource.</label><br />');
            choicewrite('<label><input name="stringval" value="map_map"'+             choicewrite('<label><input name="stringval" value="map_map"'+
                   ' type="radio" '+callradiostringeval('map_map'));                    ' type="radio" '+callradiostringeval('map_map'));
            if (svalue=='map_map') { choicewrite(' checked="checked"'); }             if (svalue=='map_map') { choicewrite(' checked="checked"'); }
            choicewrite(' /> Yes, and the scope of the slot is the enclosing map/folder. When checking in, all resources in the map/folder are checked in.</label><br />');             choicewrite(' /> Yes, and the scope of student selected slot is the enclosing map/folder. When checking in, all resources in the map/folder are checked in.</label><br />');
         choicewrite('</td></tr></table>');          choicewrite('</td></tr></table>');
       }        }
    }     }
Line 1133  function init() { Line 1033  function init() {
           }            }
       } else {        } else {
           if (doneRegExp.test(pvalue)) {            if (doneRegExp.test(pvalue)) {
               var current = pvalue.match(doneRegExp);                var current = pvalue.match(doneRegExp); 
               if (current.length == 2) {                if (current.length == 2) {
                   var textstr = current[1];                    var textstr = current[1];
                   if (textstr != '') {                    if (textstr != '') {
Line 1302  function init() { Line 1202  function init() {
   selwrite('</body></html>');    selwrite('</body></html>');
   this.window.selector.document.close();    this.window.selector.document.close();
   draw();    draw();
     
 }  }
   
 // ]]>  // ]]>

Removed from v.1.64.2.5.4.1  
changed lines
  Added in v.1.71


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>