Diff for /rat/client/parameter.html between versions 1.17 and 1.46

version 1.17, 2002/03/25 21:01:12 version 1.46, 2007/08/30 00:02:20
Line 27  Parameter Input Window Line 27  Parameter Input Window
 //  //
 // http://www.lon-capa.org/  // http://www.lon-capa.org/
 //  //
 06/16/00,06/17,11/17,11/18,11/23,11/27,11/28,12/15,12/16,  
 03/21/01,03/24,06/26 Gerd Kortemeyer  
 07/24/01 Scott Harrison  
 08/08 Gerd Kortemeyer  
 -->  -->
 <head>  <head>
 <title>LON-CAPA</title>  <title>LON-CAPA</title>
 </head>  </head>
   
 <script>  <script type="text/javascript">
   
 var ptype='';  var ptype='';
 var pvalue='';  var pvalue='';
Line 46  var pscat=''; Line 42  var pscat='';
 var pmarker='';  var pmarker='';
 var pname='';  var pname='';
   
   var defhour=0;
   var defmin=0;
   var defsec=0;
   
 var svalue;  var svalue;
 var stype;  var stype;
 var smarker;  var smarker;
Line 92  function valline(text,id1,id2) { Line 92  function valline(text,id1,id2) {
               id2+'></td></tr>');                id2+'></td></tr>');
 }  }
   
   function escapeHTML(text) {
     text = text.replace(/&/g, '&amp;');
     text = text.replace(/"/g, '&quot;');
     text = text.replace(/</g, '&lt;');
     text = text.replace(/>/g, '&gt;');
     return text;
   }
   
 function datecalc() {  function datecalc() {
     var sform=choices.document.forms.sch;      var sform=choices.document.forms.sch;
   
Line 174  function date() { Line 182  function date() {
   
 function year() {  function year() {
    var thisyear=cdate.getFullYear();     var thisyear=cdate.getFullYear();
      var nowdate=new Date();
      var nowyear=nowdate.getFullYear();
      if ( !thisyear ) { thisyear=nowyear; }
      var loweryear=thisyear-2;
      var upperyear=thisyear+5;
      if (thisyear>nowyear) { loweryear=nowyear-2; }
      if (thisyear<nowyear) { upperyear=nowyear+5; } 
     var i;      var i;
     choicewrite('<select name=year onChange="parent.datecalc();">');      choicewrite('<select name=year onChange="parent.datecalc();">');
     for (i=thisyear-25;i<=thisyear+50;i++) {      for (i=loweryear;i<=upperyear;i++) {
         choicewrite('<option value='+i);          choicewrite('<option value='+i);
         if (i==thisyear) {          if (i==thisyear) {
             choicewrite(' selected');              choicewrite(' selected');
Line 299  function stringeval() { Line 314  function stringeval() {
    draw();     draw();
 }  }
   
   function radiostringeval(newval) {
      svalue=newval;
      draw();
   }
   
   function callradiostringeval(newval) {
      return 'onChange="parent.radiostringeval(\''
             +newval+'\')" onClick="parent.radiostringeval(\''
             +newval+'\')"';
   }
   
 function intervaldis() {  function intervaldis() {
     csecs=svalue;      csecs=svalue;
     cdays=Math.floor(csecs/86400);      cdays=Math.floor(csecs/86400);
Line 310  function intervaldis() { Line 336  function intervaldis() {
     choicewrite(cdays+' days '+chours+' hours '      choicewrite(cdays+' days '+chours+' hours '
                +cmins+' mins '+csecs+' secs');                 +cmins+' mins '+csecs+' secs');
 }  }
       
   function pickcolor(picked) {
     svalue=picked;
     draw();
   }
   
   function colorfield(ir,ig,ib) {
      var col=new Array;
      col=["00","11","22","44","66","88","AA","CC","DD","EE","FF"];
      var color='#'+col[ir]+col[ig]+col[ib];
      var selection="<font color='"+color+"'>X</font>";
      if (color==svalue) { selection="<font color='#"+col[10-ir]+col[10-ig]+col[10-ib]+"'>X</font>"; }
      choicewrite('<td bgcolor="'+color+'"><a href="javascript:parent.pickcolor('+"'"+
                  color+"'"+')">'+selection+'</a></td>');
                  
   }    
   
 function draw() {  function draw() {
    choicestart();     choicestart();
    choicewrite('<form name=sch');     choicewrite('<form name=sch');
Line 399  function draw() { Line 441  function draw() {
          choicewrite('</table>');           choicewrite('</table>');
      } else {       } else {
       if (pscat=='start') {        if (pscat=='start') {
          tablestart('Starting or opening date and time');           tablestart('Date and time');
       }        }
       if (pscat=='end') {        if (pscat=='end') {
          tablestart('Ending or closing date and time');           tablestart('Date and time');
       }        }
       if (pscat=='interval') {        if (pscat=='interval') {
          tablestart('Time interval');           tablestart('Time interval');
Line 428  function draw() { Line 470  function draw() {
    }     }
   
    if (ptype=='int') {     if (ptype=='int') {
         var pscatparts=new Array;
         pscatparts=pscat.split(',');
         pscat=pscatparts[0];
       if (pscat=='default') {        if (pscat=='default') {
          tablestart('Default value or none');           tablestart('Default value or none');
          choicewrite('</table>');           choicewrite('</table>');
Line 463  function draw() { Line 508  function draw() {
            tablestart('Integer');             tablestart('Integer');
         }          }
         choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');          choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
         choicewrite('<input name=intval size=10 value="'+svalue+          choicewrite('<input name=intval size=10 value="'+escapeHTML(svalue)+
                     '" name=intval onChange="parent.integereval()">');                      '" name=intval onChange="parent.integereval()">');
         choicewrite('</td></table>');          choicewrite('</td></table>');
       }        }
Line 485  function draw() { Line 530  function draw() {
            tablestart('Floating point number');             tablestart('Floating point number');
         }          }
         choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');          choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
         choicewrite('<input name=floatval size=10 value="'+svalue+          choicewrite('<input name=floatval size=10 value="'+escapeHTML(svalue)+
                     '" name=floatval onChange="parent.floateval()">');                      '" name=floatval onChange="parent.floateval()">');
         choicewrite('</td></table>');          choicewrite('</td></table>');
       }        }
    }     }
   
    if (ptype=='string') {     if (ptype=='string') {
       if (pscat=='default') {          if ((pscat=='any') || (pscat=='') || (pscat=='default') ||  
          tablestart('Default value or none');              (typeof(pscat)=='undefined')) {
          choicewrite('</table>');           
       } else {  
         if (pscat=='any') {  
            tablestart('Text');             tablestart('Text');
         }     choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
         choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');             choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
         choicewrite('<input name=intval size=20 value="'+svalue+                      '" type="text" onChange="parent.stringeval()">');
                     '" name=stringval onChange="parent.stringeval()">');          }
           if (pscat=='yesno') {
              tablestart('Yes/No');
      choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
              choicewrite('<label><input name="stringval" value="yes"'+
                     ' type="radio" '+callradiostringeval('yes'));
              if (svalue=='yes') { choicewrite(' checked'); }
              choicewrite('> Yes</label><br />');
              choicewrite('<label><input name="stringval" value="no"'+
                     ' type="radio" '+callradiostringeval('no'));
              if (svalue=='no') { choicewrite(' checked'); }
              choicewrite('> No</label><br />');
           }
           if (pscat=='examtype') {
              tablestart('Exam Type');
      choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
              choicewrite('<label><input name="stringval" value="online"'+
                   ' type="radio" '+callradiostringeval('online'));
              if (svalue=='online') { choicewrite(' checked'); }
              choicewrite('> Online</label><br />');
              choicewrite('<label><input name="stringval" value="checkout"'+
                 ' type="radio" '+callradiostringeval('checkout'));
              if (svalue=='checkout') { choicewrite(' checked'); }
              choicewrite('> Check out</label><br />');
          }
           if (pscat=='questiontype') {
              tablestart('Question Type');
      choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
              choicewrite('<label><input name="stringval" value="problem"'+
                  ' type="radio" '+callradiostringeval('problem'));
              if (svalue=='problem') { choicewrite(' checked'); }
              choicewrite('> Standard Problem</label><br />');
   //   choicewrite('<label><input name="stringval" value="quiz"'+
   //                ' type="radio" '+callradiostringeval('quiz'));
   //         if (svalue=='quiz') { choicewrite(' checked'); }
   //         choicewrite('> Quiz</label><br />');
              choicewrite('<label><input name="stringval" value="practice"'+
                     ' type="radio" '+callradiostringeval('practice'));
              if (svalue=='practice') { choicewrite(' checked'); }
              choicewrite('> Practice</label><br />');
              choicewrite('<label><input name="stringval" value="exam"'+
                     ' type="radio" '+callradiostringeval('exam'));
              if (svalue=='exam') { choicewrite(' checked'); }
              choicewrite('> Exam</label><br />');
   //         choicewrite('<label><input name="stringval" value="assess"'+
   //              ' type="radio" '+callradiostringeval('assess'));
   //         if (svalue=='assess') { choicewrite(' checked'); }
   //         choicewrite('> Assessment</label><br />');
              choicewrite('<label><input name="stringval" value="survey"'+
                   ' type="radio" '+callradiostringeval('survey'));
              if (svalue=='survey') { choicewrite(' checked'); }
              choicewrite('> Survey</label><br />');
   //         choicewrite('<label><input name="stringval" value="form"'+
   //                ' type="radio" '+callradiostringeval('form'));
   //         if (svalue=='form') { choicewrite(' checked'); }
   //         choicewrite('> Input Form</label><br />');
              choicewrite('<label><input name="stringval" value="library"'+
                  ' type="radio" '+callradiostringeval('library'));
              if (svalue=='library') { choicewrite(' checked'); }
              choicewrite('> Library</label><br />');
           }
           if (pscat=='ip') {
              tablestart('IP Number/Name');
      choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
              choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
                       '" onChange="parent.stringeval()">');
           }
           if (pscat=='fileext') {
               tablestart('Allowed File Extensions');
      choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
              choicewrite('<label><input name="radstringval" value="txt"'+
                  ' type="radio" '+callradiostringeval('txt'));
              if (svalue=='txt') { choicewrite(' checked'); }
              choicewrite('> Plain Text</label><br />');
              choicewrite('<label><input name="radstringval" value="png,jpg,jpeg,gif"'+
                  ' type="radio" '+callradiostringeval('png,jpg,jpeg,gif'));
              if (svalue=='png,jpg,jpeg,gif') { choicewrite(' checked'); }
              choicewrite('> Picture File</label><br />');
              choicewrite('<label><input name="radstringval" value="doc,xls,ppt"'+
                  ' type="radio" '+callradiostringeval('doc,xls,ppt'));
              if (svalue=='doc,xls,ppt') { choicewrite(' checked'); }
              choicewrite('> Office Document</label><br />');
              choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
                       '" onChange="parent.stringeval()">');
          }
          if (pscat=='useslots') {
              tablestart('Slots control access');
      choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
              choicewrite('<label><input name="stringval" value="no"'+
                     ' type="radio" '+callradiostringeval('no'));
              if (svalue=='no') { choicewrite(' checked'); }
              choicewrite('> No</label><br />');
              choicewrite('<label><input name="stringval" value="resource"'+
                     ' type="radio" '+callradiostringeval('resource'));
              if (svalue=='resource') { choicewrite(' checked'); }
              choicewrite('> Yes, and the scope of student selected slot is a single resource.</label><br />');
              choicewrite('<label><input name="stringval" value="map"'+
                     ' type="radio" '+callradiostringeval('map'));
              if (svalue=='map') { choicewrite(' checked'); }
              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"'+
                     ' type="radio" '+callradiostringeval('map_map'));
              if (svalue=='map_map') { choicewrite(' checked'); }
              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></table>');          choicewrite('</td></table>');
       }        }
    }     }
      
      if (ptype=='color') {
         tablestart('Choose a Color');
         choicewrite('<table>');
         if (svalue) {
            choicewrite('<tr><td colspan="9">Current choice:</td><td bgcolor="'+
                        escapeHTML(svalue)+'" colspan="2">&nbsp;</td></tr>');
         }
         for (var ir=0; ir<=10; ir++) {
             for (var ig=0; ig<=10; ig++) {
                 choicewrite('<tr>');
                 for (var ib=0; ib<=10; ib++) {
                     colorfield(ir,ig,ib);
         }
                 choicewrite('</tr>');
     }      
         }
         choicewrite('</table></td></table>');
      }
   
    choicewrite('</table></form>');     choicewrite('</form>');
    choiceend();     choiceend();
 }  }
   
Line 526  function catchange() { Line 690  function catchange() {
   
 function assemble() {  function assemble() {
     if ((ptype=='date') && (pscat!='interval')) {      if ((ptype=='date') && (pscat!='interval')) {
         svalue=Math.round(cdate.getTime()/1000);          svalue=Math.floor(cdate.getTime()/1000);
     }      }
     if (ptype=='tolerance') {      if (ptype=='tolerance') {
        if (pscat=='relative_sym') {         if (pscat=='relative_sym') {
Line 595  function init() { Line 759  function init() {
      if (pair[0]=='call') { pcode=pair[1]; }       if (pair[0]=='call') { pcode=pair[1]; }
      if (pair[0]=='marker') { pmarker=pair[1]; }       if (pair[0]=='marker') { pmarker=pair[1]; }
      if (pair[0]=='name') { pname=pair[1]; }       if (pair[0]=='name') { pname=pair[1]; }
        if (pair[0]=='defhour' && pair[1] >= 0 && pair[1] < 24 ) {
            defhour=pair[1];
        }
        if (pair[0]=='defmin' && pair[1] >= 0 && pair[1] < 60) { defmin=pair[1]; }
        if (pair[0]=='defsec' && pair[1] >= 0 && pair[1] < 60) { defsec=pair[1]; }
   }    }
   
   svalue=pvalue;    svalue=pvalue;
Line 639  function init() { Line 808  function init() {
             
      if ((pvalue!='') && (typeof(pvalue)!="undefined")) {       if ((pvalue!='') && (typeof(pvalue)!="undefined")) {
         cdate.setTime(pvalue*1000);          cdate.setTime(pvalue*1000);
        } else {        
           cdate.setSeconds(defsec);
           cdate.setMinutes(defmin);
           cdate.setHours(defhour);
      }       }
     
      months[0]='January';       months[0]='January';
Line 673  function init() { Line 846  function init() {
   }    }
   
   if (ptype=='string') {    if (ptype=='string') {
      sopt('default','Default');       //sopt('default','Default');
      sopt('string','String Value');       if (pscat == 'yesno')        { sopt('yesno','Yes/No'); }
        else if (pscat == 'examtype')     { sopt('examtype','Exam Type'); }
        else if (pscat == 'questiontype') { sopt('questiontype','Question Type'); }
        else if (pscat == 'ip')           { sopt('ip','IP Number/Name'); }
        else if (pscat == 'fileext')      { sopt('fileext','File Extension'); }
        else if (pscat == 'useslots')     { sopt('useslots','Slots control access'); }
        else { pscat = 'any'; }
        sopt('any','String Value');
     }
   
     if (ptype=='color') {
        sopt('default','Use Default Color');
        sopt('custom','Use Custom Color');
   }    }
   
   selwrite('</select></form>');    selwrite('</select></form>');
Line 693  function init() { Line 878  function init() {
   if (pcode!='') {    if (pcode!='') {
      selwrite('parent.opener.'+pcode+'();');       selwrite('parent.opener.'+pcode+'();');
   }    }
   selwrite('">Store</a>&nbsp;&nbsp;');    selwrite('">Save</a>&nbsp;&nbsp;');
   
   selwrite('<a href="javascript:');    selwrite('<a href="javascript:');
      selwrite(       selwrite(

Removed from v.1.17  
changed lines
  Added in v.1.46


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