File:  [LON-CAPA] / rat / Attic / parameter.html
Revision 1.1: download - view: text, annotated - select for diffs
Wed Jun 28 03:31:38 2000 UTC (22 years, 1 month ago) by www
Branches: MAIN
CVS tags: HEAD
RAT as of 06/27 and parameter entry screen

<html>
<!--
The LearningOnline Network with CAPA
Parameter Input Window
06/16/00,06/17 Gerd Kortemeyer
-->
<head>
<title>LON-CAPA</title>
</head>

<script>

var ptype='';
var pvalue='';
var preturn='';
var pcode='';
var poptions='';
var pname='';

var svalue;

var scat;
var vars=new Array();

function selwrite(text) {
  this.window.selector.document.write(text);
}

function choicestart() {
  this.window.choices.document.clear();
  choicewrite('<html><body bgcolor="#FFFFFF">');
}

function choiceend() {
  choicewrite('</body></html>');
  this.window.choices.document.close();
}

function choicewrite(text) {
  this.window.choices.document.write(text);
}

function tablestart(headtext) {
  choicewrite('<table><tr bgcolor="#AAFFAA"><th colspan=3>'+
              headtext+'</th></tr>');
}

function valline(text,id1,id2) {
  choicewrite('<tr bgcolor="#AAFFAA"><td>'+text+
              '</td><td><input type=text size=4 name=val'+
              id1+'></td><td>incl:<input type=checkbox name=val'+
              id2+'></td></tr>');
}

function afterproc() {
  choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>Error after rounding: '
             +'<input type=checkbox name=val1></td></tr>');
}

function draw() {
   choicestart();
   choicewrite('<form name=sch>');
   if (ptype=='tolerance') {
// 0: scat
// 1: after processing
      if (scat=='default') {
         tablestart('Use default value or algorithm of resource');
      }
      if (scat=='exact') {
         tablestart('Accept only exact value, zero tolerance');
         afterproc();
      }
      if (scat=='relative_sym') {
// 2: percentage
// 3: open
         tablestart('Percentage error, symmetric around value');
         valline('Percentage',2,3);
         afterproc();
      }
      if (scat=='relative') {
// 2: left
// 3: open
// 4: right
// 5: open
         tablestart('Percentage error, asymmetric around value');
         valline('Upper percentage',2,3);
         valline('Lower percentage',4,5);
         afterproc();
      }
      if (scat=='absolute_sym') {
         tablestart('Absolute error, symmetric around value');
         valline('Value',2,3);
         afterproc();
      }
      if (scat=='absolute') {
         tablestart('Absolute error, asymmetric around value');
         valline('Upper value',2,3);
         valline('Lower value',4,5);
         afterproc();
      }
      if (scat=='sigdigits') {
         tablestart('Agreement on significant digits');
  choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>Number of digits: '
             +'<input type=text size=4 name=val2></td></tr>');

  choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>Accept if more digits given: '
             +'<input type=checkbox name=val3></td></tr>');
         
      }
   }

   if (ptype=='date') {
      choicewrite('');
   }

   if (ptype=='value') {
   }

   if (ptype=='truefalse') {
   }

   if (ptype=='check') {
   }

   if (ptype=='radio') {
   }
   choicewrite('</table></form>');
   choiceend();
}

function sopt(va,text) {
   selwrite('<option value="'+va+'"');
   if (va==scat) {
     selwrite(' selected');
   }
   selwrite('>'+text+'</option>');
}

function catchange() {
   var sform=selector.document.forms.fsel.fcat;
   scat=sform.options[sform.selectedIndex].value;
   draw();
}

function assemble() {
}

function disassemble() {
}

function init() {
  var i;

  var namevalue=this.window.location.search.split('&');
  namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1);

  for (i=0;i<namevalue.length;i++) {
     var pair=namevalue[i].split('=');
     if (pair[0]=='type') { ptype=pair[1]; }
     if (pair[0]=='value') { pvalue=pair[1]; }
     if (pair[0]=='return') { preturn=pair[1]; }
     if (pair[0]=='call') { pcode=pair[1]; }
     if (pair[0]=='options') { poptions=pair[1]; }
     if (pair[0]=='name') { pname=pair[1]; }
  }

  svalue=pvalue;

  this.window.selector.document.clear();
  selwrite('<html><body bgcolor="#FFFFFF">');

  selwrite('<form name="fsel"><h2>'+pname+'</h2>');
  selwrite('<select name="fcat" onChange="parent.catchange();">');
  if (ptype=='tolerance') {
     sopt('default','Default');
     sopt('exact','Exact Value (no tolerance)');
     sopt('relative_sym','Relative Tolerance, Symmetric (percent)');
     sopt('relative','Relative Tolerance (percentages)');
     sopt('absolute_sym','Absolute Tolerance, Symmetric (value)');
     sopt('absolute','Absolute Tolerance (values)');
     sopt('sigdigits','Significant Digits (number)');
  }

  if (ptype=='date') {
     sopt('default','Default');
     sopt('start','Starting Date');
     sopt('end','Ending Date');
     sopt('interval','Starting and Ending Date');
  }

  if (ptype=='value') {
  }

  if (ptype=='truefalse') {
  }

  if (ptype=='check') {
  }

  if (ptype=='radio') {
  }

  selwrite('</select></form>');

  selwrite('<a href="javascript:assemble();');
  if (preturn!='') {
     selwrite('opener.'+preturn+'=this.window.svalue;');
  }
  if (pcode!='') {
     selwrite('opener.'+pcode+';');
  }
  selwrite('">Store</a>'); 
 
  selwrite('</body></html>');
  this.window.selector.document.close();
  
}

</script>

<frameset rows="50,*" onLoad="init();">
<frame name=selector src="empty.html">
<frame name=choices src="empty.html">
</frameset>



</html>

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