Annotation of rat/parameter.html, revision 1.1
1.1 ! www 1: <html>
! 2: <!--
! 3: The LearningOnline Network with CAPA
! 4: Parameter Input Window
! 5: 06/16/00,06/17 Gerd Kortemeyer
! 6: -->
! 7: <head>
! 8: <title>LON-CAPA</title>
! 9: </head>
! 10:
! 11: <script>
! 12:
! 13: var ptype='';
! 14: var pvalue='';
! 15: var preturn='';
! 16: var pcode='';
! 17: var poptions='';
! 18: var pname='';
! 19:
! 20: var svalue;
! 21:
! 22: var scat;
! 23: var vars=new Array();
! 24:
! 25: function selwrite(text) {
! 26: this.window.selector.document.write(text);
! 27: }
! 28:
! 29: function choicestart() {
! 30: this.window.choices.document.clear();
! 31: choicewrite('<html><body bgcolor="#FFFFFF">');
! 32: }
! 33:
! 34: function choiceend() {
! 35: choicewrite('</body></html>');
! 36: this.window.choices.document.close();
! 37: }
! 38:
! 39: function choicewrite(text) {
! 40: this.window.choices.document.write(text);
! 41: }
! 42:
! 43: function tablestart(headtext) {
! 44: choicewrite('<table><tr bgcolor="#AAFFAA"><th colspan=3>'+
! 45: headtext+'</th></tr>');
! 46: }
! 47:
! 48: function valline(text,id1,id2) {
! 49: choicewrite('<tr bgcolor="#AAFFAA"><td>'+text+
! 50: '</td><td><input type=text size=4 name=val'+
! 51: id1+'></td><td>incl:<input type=checkbox name=val'+
! 52: id2+'></td></tr>');
! 53: }
! 54:
! 55: function afterproc() {
! 56: choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>Error after rounding: '
! 57: +'<input type=checkbox name=val1></td></tr>');
! 58: }
! 59:
! 60: function draw() {
! 61: choicestart();
! 62: choicewrite('<form name=sch>');
! 63: if (ptype=='tolerance') {
! 64: // 0: scat
! 65: // 1: after processing
! 66: if (scat=='default') {
! 67: tablestart('Use default value or algorithm of resource');
! 68: }
! 69: if (scat=='exact') {
! 70: tablestart('Accept only exact value, zero tolerance');
! 71: afterproc();
! 72: }
! 73: if (scat=='relative_sym') {
! 74: // 2: percentage
! 75: // 3: open
! 76: tablestart('Percentage error, symmetric around value');
! 77: valline('Percentage',2,3);
! 78: afterproc();
! 79: }
! 80: if (scat=='relative') {
! 81: // 2: left
! 82: // 3: open
! 83: // 4: right
! 84: // 5: open
! 85: tablestart('Percentage error, asymmetric around value');
! 86: valline('Upper percentage',2,3);
! 87: valline('Lower percentage',4,5);
! 88: afterproc();
! 89: }
! 90: if (scat=='absolute_sym') {
! 91: tablestart('Absolute error, symmetric around value');
! 92: valline('Value',2,3);
! 93: afterproc();
! 94: }
! 95: if (scat=='absolute') {
! 96: tablestart('Absolute error, asymmetric around value');
! 97: valline('Upper value',2,3);
! 98: valline('Lower value',4,5);
! 99: afterproc();
! 100: }
! 101: if (scat=='sigdigits') {
! 102: tablestart('Agreement on significant digits');
! 103: choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>Number of digits: '
! 104: +'<input type=text size=4 name=val2></td></tr>');
! 105:
! 106: choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>Accept if more digits given: '
! 107: +'<input type=checkbox name=val3></td></tr>');
! 108:
! 109: }
! 110: }
! 111:
! 112: if (ptype=='date') {
! 113: choicewrite('');
! 114: }
! 115:
! 116: if (ptype=='value') {
! 117: }
! 118:
! 119: if (ptype=='truefalse') {
! 120: }
! 121:
! 122: if (ptype=='check') {
! 123: }
! 124:
! 125: if (ptype=='radio') {
! 126: }
! 127: choicewrite('</table></form>');
! 128: choiceend();
! 129: }
! 130:
! 131: function sopt(va,text) {
! 132: selwrite('<option value="'+va+'"');
! 133: if (va==scat) {
! 134: selwrite(' selected');
! 135: }
! 136: selwrite('>'+text+'</option>');
! 137: }
! 138:
! 139: function catchange() {
! 140: var sform=selector.document.forms.fsel.fcat;
! 141: scat=sform.options[sform.selectedIndex].value;
! 142: draw();
! 143: }
! 144:
! 145: function assemble() {
! 146: }
! 147:
! 148: function disassemble() {
! 149: }
! 150:
! 151: function init() {
! 152: var i;
! 153:
! 154: var namevalue=this.window.location.search.split('&');
! 155: namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1);
! 156:
! 157: for (i=0;i<namevalue.length;i++) {
! 158: var pair=namevalue[i].split('=');
! 159: if (pair[0]=='type') { ptype=pair[1]; }
! 160: if (pair[0]=='value') { pvalue=pair[1]; }
! 161: if (pair[0]=='return') { preturn=pair[1]; }
! 162: if (pair[0]=='call') { pcode=pair[1]; }
! 163: if (pair[0]=='options') { poptions=pair[1]; }
! 164: if (pair[0]=='name') { pname=pair[1]; }
! 165: }
! 166:
! 167: svalue=pvalue;
! 168:
! 169: this.window.selector.document.clear();
! 170: selwrite('<html><body bgcolor="#FFFFFF">');
! 171:
! 172: selwrite('<form name="fsel"><h2>'+pname+'</h2>');
! 173: selwrite('<select name="fcat" onChange="parent.catchange();">');
! 174: if (ptype=='tolerance') {
! 175: sopt('default','Default');
! 176: sopt('exact','Exact Value (no tolerance)');
! 177: sopt('relative_sym','Relative Tolerance, Symmetric (percent)');
! 178: sopt('relative','Relative Tolerance (percentages)');
! 179: sopt('absolute_sym','Absolute Tolerance, Symmetric (value)');
! 180: sopt('absolute','Absolute Tolerance (values)');
! 181: sopt('sigdigits','Significant Digits (number)');
! 182: }
! 183:
! 184: if (ptype=='date') {
! 185: sopt('default','Default');
! 186: sopt('start','Starting Date');
! 187: sopt('end','Ending Date');
! 188: sopt('interval','Starting and Ending Date');
! 189: }
! 190:
! 191: if (ptype=='value') {
! 192: }
! 193:
! 194: if (ptype=='truefalse') {
! 195: }
! 196:
! 197: if (ptype=='check') {
! 198: }
! 199:
! 200: if (ptype=='radio') {
! 201: }
! 202:
! 203: selwrite('</select></form>');
! 204:
! 205: selwrite('<a href="javascript:assemble();');
! 206: if (preturn!='') {
! 207: selwrite('opener.'+preturn+'=this.window.svalue;');
! 208: }
! 209: if (pcode!='') {
! 210: selwrite('opener.'+pcode+';');
! 211: }
! 212: selwrite('">Store</a>');
! 213:
! 214: selwrite('</body></html>');
! 215: this.window.selector.document.close();
! 216:
! 217: }
! 218:
! 219: </script>
! 220:
! 221: <frameset rows="50,*" onLoad="init();">
! 222: <frame name=selector src="empty.html">
! 223: <frame name=choices src="empty.html">
! 224: </frameset>
! 225:
! 226:
! 227:
! 228: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>