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

version 1.64.2.5.4.1, 2022/03/26 00:50:53 version 1.73, 2016/05/21 16:58:07
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 447  function ipstringeval() { Line 447  function ipstringeval() {
     svalue = '';      svalue = '';
     for (var i=0; i<acctypes.length; i++) {      for (var i=0; i<acctypes.length; i++) {
         var items = choices.document.getElementsByName('setip'+acctypes[i]);          var items = choices.document.getElementsByName('setip'+acctypes[i]);
         if (items.length > 0) {          if (items.length) {
             for (var j=0; j<items.length; j++) {              for (var j=0; j<items.length; j++) {
                 if (items[j].type == "text") {                  if (items[j].type == "text") {
                     var possip = items[j].value;                      var possip = items[j].value
                     possip = possip.replace(/^\s+|\s+$/g,'');                      possip = possip.replace(/^\s+|\s+$/g,'');
                     if (patternIp.test(possip)) {                      if (patternIp.test(possip)) {
                         if (acctypes[i] == 'deny') {                          if (acctypes[i] == 'deny') {
Line 466  function ipstringeval() { Line 466  function ipstringeval() {
             }              }
         }          }
     }      }
       draw();
 }  }
   
 function addIpRule(iptype) {  function addIpRule(iptype) {
     var frame = window.frames["choices"];      var frame = window.frames["choices"];
     if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {      if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {
         var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);          var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);
         var count = innerDiv.childNodes.length          var count = innerDiv.childNodes.length 
         var ipDiv = frame.document.createElement('div');          var ipDiv = frame.document.createElement('div');
         ipDiv.innerHTML = '<input type="text" size="10" name="setip'+iptype+'" onblur="parent.ipstringeval();" />'+          ipDiv.innerHTML = '<input type="text" size="10" name="setip'+iptype+'" onblur="parent.ipstringeval();" />'+
                           '<a href="#" onclick="parent.removeIpRule(\''+iptype+'\',\''+count+'\')">Remove</a>';                            '<a href="#" onclick="parent.removeIpRule(\''+iptype+'\',\''+count+'\')">Remove</a>';
Line 504  function callradiostringeval(newval) { Line 505  function callradiostringeval(newval) {
     return 'onclick="parent.radiostringeval(\''+newval+'\')"';      return 'onclick="parent.radiostringeval(\''+newval+'\')"';
 }  }
   
   function lenienteval(newval) {
       if (newval == 'weighted') {
           if (document.getElementById('lenientweighteddiv')) {
               document.getElementById('lenientweighteddiv').style.display='block';
           }
           var patternRelWeight = /^\-?[\d.]+$/;
           var sform=choices.document.forms.sch; 
           if ((sform.lenientrelwt.length != 'undefined')  && (sform.lenientrelwt.length) != 'null') {
               for (var i=0; i<sform.lenientrelwt.length; i++) {
                   var relweight = sform.lenientrelwt[i].value;
                   relweight = relweight.replace(/^\s+|\s+$/g,'');
                   if (!patternRelWeight.test(relweight)) {
                       if (i<2) {
                           relweight = '1.0';
                       } else {
                           relweight = '0.0';
                       }
                   }
                   sform.lenientrelwt[i].value = relweight;
                   if (i==0) {
                       svalue = relweight;
                   } else {
                       svalue += ','+relweight;
                   }
               }
           }
       } else {
           if (document.getElementById('lenientweighteddiv')) {
               document.getElementById('lenientweighteddiv').style.display='none';
           }
           svalue=newval;
       }
       draw();
   }
   
   function calllenientradioeval(newval) {
       return 'onclick="parent.lenienteval(\''+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 636  function draw() { Line 676  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 804  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 873  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 868  function draw() { Line 908  function draw() {
            choicewrite(' /> Library</label><br />');             choicewrite(' /> Library</label><br />');
         }          }
         if (pscat=='lenient') {          if (pscat=='lenient') {
              var patternLenientStd = /^(yes|no|default)$/;
              var patternLenientRel = /^([\-\d\.]+)\,([\-\d\.]+)\,([\-\d\.]+)\,([\-\d\.]+)$/;
              var lenientweighted = 'none';
              var relatives = new Array;
            tablestart('Lenient Grading (Partial Credit)');             tablestart('Lenient Grading (Partial Credit)');
            choicewrite('<tr><td>Value:</td><td colspan="2">');             choicewrite('<tr><td>Value:</td><td colspan="2">');
            choicewrite('<label><input name="stringval" value="yes"'+             choicewrite('<label><input name="stringval" value="yes"'+
                   ' type="radio" '+callradiostringeval('yes'));                    ' type="radio" '+calllenientradioeval('yes'));
            if (svalue=='yes') { choicewrite(' checked="checked"'); }             if (svalue=='yes') { choicewrite(' checked="checked"'); }
            choicewrite(' /> Yes</label><br />');             choicewrite(' /> Yes</label><br />');
            choicewrite('<label><input name="stringval" value="no"'+             choicewrite('<label><input name="stringval" value="no"'+
                   ' type="radio" '+callradiostringeval('no'));                    ' type="radio" '+calllenientradioeval('no'));
            if (svalue=='no') { choicewrite(' checked="checked"'); }             if (svalue=='no') { choicewrite(' checked="checked"'); }
            choicewrite(' /> No</label><br />');             choicewrite(' /> No</label><br />');
            choicewrite('<label><input name="stringval" value="default"'+             choicewrite('<label><input name="stringval" value="default"'+
                ' type="radio" '+callradiostringeval('default'));                 ' type="radio" '+calllenientradioeval('default'));
            if (svalue=='default') { choicewrite(' checked="checked"'); }             if (svalue=='default') { choicewrite(' checked="checked"'); }
            choicewrite(' /> Default (only bubblesheet grading is lenient)</label><br />');             choicewrite(' /> Default (only bubblesheet grading is lenient)</label><br />');
              choicewrite('<label><input name="stringval" value="weighted"'+
                  ' type="radio" '+calllenientradioeval('weighted'));
              if (!patternLenientStd.test(svalue) && svalue != '') {
                 choicewrite(' checked="checked"');
                 lenientweighted='block';
                 var relatives = svalue.match(patternLenientRel);
              }
              choicewrite(' />Yes, weighted (optionresponse in checkbox mode)</label><br /><br />'+
                          '<div id="lenientweighteddiv" style="display:'+lenientweighted+'">'+
                          '<table class="LC_parmsel_table"><tr bgcolor="#C5DB99">'+
                          '<th colspan="2">Foil submission status</th><th>Points</th></tr>');
              var lenienttypes = ['Correct (checked)','Correct (unchecked)','Incorrect (checked)','Incorrect (unchecked)'];
              for (var i=0; i<lenienttypes.length; i++) {
                  var j = i+1;
                  if (relatives[j] == '') {
                      if (i < 2) {
                          relatives[j] = '1.0';
                      } else {
                          relatives[j] = '0.0';
                      }
                  }
                  choicewrite('<tr><td colspan="2">'+lenienttypes[i]+'</td>'+
                              '<td><input type="text" name="lenientrelwt" value="'+relatives[j]+'"'+
                              ' size="3" onblur="parent.lenienteval(\'weighted\')" /></td></tr>');
              }
              choicewrite('</table></div>');
         }          }
         if (pscat=='discussvote') {          if (pscat=='discussvote') {
            tablestart('Discussion Voting');             tablestart('Discussion Voting');
Line 900  function draw() { Line 970  function draw() {
            choicewrite(' /> No</label><br />');             choicewrite(' /> No</label><br />');
         }          }
         if (pscat=='ip') {          if (pscat=='ip') {
             var currallow = new Array;              var currallow = new Array; 
             var currdeny = new Array;              var currdeny = new Array;
             if ((svalue != '') && (svalue != null)) {              if ((svalue != '') && (svalue != null)) {
                 var patternComma = /,/;                  var patternComma = /,/;
                 var patternAllow = /^([\[\]a-zA-Z\.\d\*\-]+)$/;                  var patternAllow = /^([\[\]a-zA-Z\.\d\*\-]+)$/;
                 var patternDeny = /^\!([\[\]a-zA-Z\.\d\*\-]+)$/;                  var patternDeny = /^\!([\[\]a-zA-Z\.\d\*\-]+)$/;
                 var current = new Array;                  var current = new Array;
                 if (patternComma.test(svalue)) {                  if (patternComma.test(svalue)) {  
                     current = svalue.split(',');                      current = svalue.split(',');
                 } else {                  } else {
                     current = [svalue];                      current = (svalue);
                 }                  }
                 for (var i=0; i<current.length; i++) {                  for (var i=0; i<current.length; i++) {
                     if (patternDeny.test(current[i])) {                      if (patternDeny.test(current[i])) {
Line 919  function draw() { Line 989  function draw() {
                     } else {                      } else {
                         if (patternAllow.test(current[i])) {                          if (patternAllow.test(current[i])) {
                             currallow.push(current[i]);                              currallow.push(current[i]);
                         }                          } 
                     }                      }
                 }                  }
             }              }
Line 937  function draw() { Line 1007  function draw() {
                 choicewrite('<td valign="top">'+                  choicewrite('<td valign="top">'+
                             '<div class="LC_string_ipacc_wrap" id="LC_string_ipacc_'+acctypes[i]+'">'+                              '<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]+'">');                              '<div class="LC_string_ipacc_inner" id="LC_string_ipacc_inner_'+acctypes[i]+'">');
                   var num=0;
                 for (var j=0; j<curripaccess[i].length; j++) {                  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('<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>');                      if (num > 0) {
                           choicewrite('<a href="#" onclick="parent.removeIpRule(\''+acctypes[i]+'\',\''+j+'\')">Remove</a>');
                       }
                     choicewrite('</div>');                      choicewrite('</div>');
                       num ++;
                 }                  }
                 choicewrite('</div><button onclick="parent.addIpRule(\''+acctypes[i]+'\');">Add item</button>');                  choicewrite('</div><button onclick="parent.addIpRule(\''+acctypes[i]+'\');">Add more</button>');
             }              }
             choicewrite('</div></td></tr></table>');              choicewrite('</div></td></tr></table>');
         }          }
Line 975  function draw() { Line 1049  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 1207  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 1376  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.73


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