Annotation of rat/client/parameter.html, revision 1.70
1.56 raeburn 1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
2: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
3: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1.1 www 4: <!--
5: The LearningOnline Network with CAPA
6: Parameter Input Window
1.16 albertel 7: //
1.70 ! raeburn 8: // $Id: parameter.html,v 1.69 2015/11/21 00:16:09 musolffc Exp $
1.16 albertel 9: //
10: // Copyright Michigan State University Board of Trustees
11: //
12: // This file is part of the LearningOnline Network with CAPA (LON-CAPA).
13: //
14: // LON-CAPA is free software; you can redistribute it and/or modify
15: // it under the terms of the GNU General Public License as published by
16: // the Free Software Foundation; either version 2 of the License, or
17: // (at your option) any later version.
18: //
19: // LON-CAPA is distributed in the hope that it will be useful,
20: // but WITHOUT ANY WARRANTY; without even the implied warranty of
21: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22: // GNU General Public License for more details.
23: //
24: // You should have received a copy of the GNU General Public License
25: // along with LON-CAPA; if not, write to the Free Software
26: // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27: //
28: // /home/httpd/html/adm/gpl.txt
29: //
30: // http://www.lon-capa.org/
31: //
1.1 www 32: -->
33: <head>
1.56 raeburn 34: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1.1 www 35: <title>LON-CAPA</title>
36:
1.46 albertel 37: <script type="text/javascript">
1.56 raeburn 38: // <![CDATA[
1.1 www 39:
40: var ptype='';
41: var pvalue='';
1.68 raeburn 42: var pmodval='';
1.70 ! raeburn 43: var pextraval='';
1.1 www 44: var preturn='';
45: var pcode='';
1.2 www 46: var pscat='';
47: var pmarker='';
1.63 www 48: var pmodal='';
1.1 www 49: var pname='';
50:
1.31 www 51: var defhour=0;
52: var defmin=0;
53: var defsec=0;
54:
1.1 www 55: var svalue;
1.2 www 56: var stype;
57: var smarker;
1.1 www 58:
59: var vars=new Array();
60:
1.2 www 61: var cdate=new Date();
62:
63: var csec;
64: var cmin;
65: var chour;
66: var cday;
67:
68: var months=new Array();
69:
70:
1.1 www 71: function selwrite(text) {
72: this.window.selector.document.write(text);
73: }
74:
75: function choicestart() {
1.61 raeburn 76: this.window.choices.document.open();
1.62 raeburn 77: choicewrite('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
78: choicewrite('<html xmlns="http://www.w3.org/1999/xhtml">');
1.55 bisitz 79: choicewrite('<head>');
1.62 raeburn 80: choicewrite('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
81: choicewrite('<title>LON-CAPA</title>');
1.55 bisitz 82: choicewrite('<style type="text/css">');
83: choicewrite('<!--');
84: choicewrite('body {');
85: choicewrite('font-family: Verdana,Arial,Helvetica,sans-serif;');
86: choicewrite('line-height:130%;');
87: choicewrite('font-size:0.83em;');
88: choicewrite('background: #FFFFFF;');
89: choicewrite('}');
90: choicewrite('table.LC_parmsel_table {font-size: 90%;}');
91: choicewrite('table.LC_parmsel_table tr td { padding: 5px; border: 1px solid #C8C8C8;}');
92: choicewrite('-->');
93: choicewrite('</style>');
94: choicewrite('</head>');
1.62 raeburn 95: choicewrite('<body>');
1.1 www 96: }
97:
98: function choiceend() {
99: choicewrite('</body></html>');
100: this.window.choices.document.close();
101: }
102:
103: function choicewrite(text) {
104: this.window.choices.document.write(text);
105: }
106:
107: function tablestart(headtext) {
1.55 bisitz 108: choicewrite('<table class="LC_parmsel_table"><tr bgcolor="#C5DB99"><th colspan="3">'+
1.1 www 109: headtext+'</th></tr>');
110: }
111:
112: function valline(text,id1,id2) {
1.52 bisitz 113: choicewrite('<tr><td>'+text+
1.51 bisitz 114: '</td><td><input type="text" size="4" name="val'+
1.53 bisitz 115: id1+'" /></td><td>incl:<input type="checkbox" name="val'+
116: id2+'" /></td></tr>');
1.1 www 117: }
118:
1.46 albertel 119: function escapeHTML(text) {
120: text = text.replace(/&/g, '&');
121: text = text.replace(/"/g, '"');
122: text = text.replace(/</g, '<');
123: text = text.replace(/>/g, '>');
124: return text;
125: }
126:
1.2 www 127: function datecalc() {
128: var sform=choices.document.forms.sch;
129:
130: cdate.setHours(sform.hours.options[sform.hours.selectedIndex].value);
131: cdate.setMinutes(sform.minutes.options[sform.minutes.selectedIndex].value);
132: cdate.setSeconds(sform.minutes.options[sform.seconds.selectedIndex].value);
133: cdate.setDate(sform.date.options[sform.date.selectedIndex].value);
134: cdate.setMonth(sform.month.options[sform.month.selectedIndex].value);
135: cdate.setFullYear(sform.year.options[sform.year.selectedIndex].value);
136:
137: draw();
138: }
139:
140: function hour() {
141: var thishour=cdate.getHours();
142: var i; var j;
1.53 bisitz 143: choicewrite('<select name="hours" onchange="parent.datecalc();">');
1.2 www 144: for (i=0;i<=23;i++) {
1.54 bisitz 145: choicewrite('<option value="'+i+'"');
1.2 www 146: if (i==thishour) {
1.54 bisitz 147: choicewrite(' selected="selected"');
1.2 www 148: }
149: choicewrite('>');
150: if (i==12) { choicewrite('noon'); } else {
151: if (i==0) { choicewrite('midnight') } else {
152:
153: if (i<12) { choicewrite(i+' am'); } else {
154: j=i-12; choicewrite(j+' pm');
155: }
156:
157: }
158: }
159: choicewrite('</option>');
160: }
161: choicewrite('</select>');
162: }
163:
164: function minute() {
165: var thisminutes=cdate.getMinutes();
166: var i;
1.53 bisitz 167: choicewrite('<select name="minutes" onchange="parent.datecalc();">');
1.2 www 168: for (i=0;i<=59;i++) {
1.54 bisitz 169: choicewrite('<option value="'+i+'"');
1.2 www 170: if (i==thisminutes) {
1.54 bisitz 171: choicewrite(' selected="selected"');
1.2 www 172: }
173: choicewrite('>'+i+'</option>');
174: }
175: choicewrite('</select>');
176: }
177:
178: function second() {
179: var thisseconds=cdate.getSeconds();
180: var i;
1.53 bisitz 181: choicewrite('<select name="seconds" onchange="parent.datecalc();">');
1.2 www 182: for (i=0;i<=59;i++) {
1.54 bisitz 183: choicewrite('<option value="'+i+'"');
1.2 www 184: if (i==thisseconds) {
1.54 bisitz 185: choicewrite(' selected="selected"');
1.2 www 186: }
187: choicewrite('>'+i+'</option>');
188: }
189: choicewrite('</select>');
190: }
191:
192:
193: function date() {
194: var thisdate=cdate.getDate();
195: var i;
1.53 bisitz 196: choicewrite('<select name="date" onchange="parent.datecalc();">');
1.2 www 197: for (i=1;i<=31;i++) {
1.54 bisitz 198: choicewrite('<option value="'+i+'"');
1.2 www 199: if (i==thisdate) {
1.54 bisitz 200: choicewrite(' selected="selected"');
1.2 www 201: }
202: choicewrite('>'+i+'</option>');
203: }
204: choicewrite('</select>');
205: }
206:
207: function year() {
208: var thisyear=cdate.getFullYear();
1.19 www 209: var nowdate=new Date();
210: var nowyear=nowdate.getFullYear();
1.33 albertel 211: if ( !thisyear ) { thisyear=nowyear; }
1.19 www 212: var loweryear=thisyear-2;
213: var upperyear=thisyear+5;
214: if (thisyear>nowyear) { loweryear=nowyear-2; }
215: if (thisyear<nowyear) { upperyear=nowyear+5; }
1.2 www 216: var i;
1.53 bisitz 217: choicewrite('<select name="year" onchange="parent.datecalc();">');
1.19 www 218: for (i=loweryear;i<=upperyear;i++) {
1.54 bisitz 219: choicewrite('<option value="'+i+'"');
1.2 www 220: if (i==thisyear) {
1.54 bisitz 221: choicewrite(' selected="selected"');
1.2 www 222: }
223: choicewrite('>'+i+'</option>');
224: }
225: choicewrite('</select>');
226: }
227:
228: function month() {
229: var thismonth=cdate.getMonth();
230: var i;
1.53 bisitz 231: choicewrite('<select name="month" onchange="parent.datecalc();">');
1.2 www 232: for (i=0;i<=11;i++) {
1.54 bisitz 233: choicewrite('<option value="'+i+'"');
1.2 www 234: if (i==thismonth) {
1.54 bisitz 235: choicewrite(' selected="selected"');
1.2 www 236: }
237: choicewrite('>'+months[i]+'</option>');
238: }
239: choicewrite('</select>');
240: }
241:
242:
243: function intminute() {
244: var thisminutes=cmins;
245: var i;
1.69 musolffc 246: var result = '';
247: result += '<select name="minutes" onchange="parent.intcalc();">';
1.2 www 248: for (i=0;i<=59;i++) {
1.69 musolffc 249: result += '<option value="'+i+'"';
1.2 www 250: if (i==thisminutes) {
1.69 musolffc 251: result += ' selected="selected"';
1.2 www 252: }
1.69 musolffc 253: result += '>'+i+'</option>';
1.2 www 254: }
1.69 musolffc 255: result += '</select>';
256: return result;
1.2 www 257: }
258:
259: function inthour() {
260: var thishours=chours;
261: var i;
1.69 musolffc 262: var result = '';
263: result += '<select name="hours" onchange="parent.intcalc();">';
1.2 www 264: for (i=0;i<=23;i++) {
1.69 musolffc 265: result += '<option value="'+i+'"';
1.2 www 266: if (i==thishours) {
1.69 musolffc 267: result += ' selected="selected"';
1.2 www 268: }
1.69 musolffc 269: result += '>'+i+'</option>';
1.2 www 270: }
1.69 musolffc 271: result += '</select>';
272: return result;
1.2 www 273: }
274:
275: function intsecond() {
1.69 musolffc 276: var thisseconds=csecs;
1.2 www 277: var i;
1.69 musolffc 278: var result = '';
279: result += '<select name="seconds" onchange="parent.intcalc();">';
1.2 www 280: for (i=0;i<=59;i++) {
1.69 musolffc 281: result += '<option value="'+i+'"';
1.2 www 282: if (i==thisseconds) {
1.69 musolffc 283: result += ' selected="selected"';
1.2 www 284: }
1.69 musolffc 285: result += '>'+i+'</option>';
1.2 www 286: }
1.69 musolffc 287: result += '</select>';
288: return result;
1.2 www 289: }
290:
291:
292: function intday() {
293: var thisdate=cdays;
294: var i;
1.69 musolffc 295: var result ='';
296: result += '<select name="date" onchange="parent.intcalc();">';
1.2 www 297: for (i=0;i<=31;i++) {
1.69 musolffc 298: result += '<option value="'+i+'"';
1.2 www 299: if (i==thisdate) {
1.69 musolffc 300: result += ' selected="selected"';
1.2 www 301: }
1.69 musolffc 302: result += '>'+i+'</option>';
1.2 www 303: }
1.69 musolffc 304: result += '</select>';
305: return result;
1.2 www 306: }
307:
308: function intcalc() {
309: var sform=choices.document.forms.sch;
310: svalue=((sform.date.options[sform.date.selectedIndex].value*24+
311: sform.hours.options[sform.hours.selectedIndex].value*1)*60+
312: sform.minutes.options[sform.minutes.selectedIndex].value*1)*60+
313: sform.seconds.options[sform.seconds.selectedIndex].value*1;
1.68 raeburn 314: if ((ptype=='date') && (pscat=='interval')) {
315: var newpmodval = '';
1.70 ! raeburn 316: var newpextraval = '';
1.68 raeburn 317: if (sform.donebutton.length) {
318: for (var i=0; i<sform.donebutton.length; i++) {
319: if (sform.donebutton[i].checked) {
320: if (sform.donebutton[i].value == '_done') {
321: newpmodval = sform.donebutton[i].value;
1.70 ! raeburn 322: } else {
! 323: if (sform.donebutton[i].value == '_done_proctor') {
! 324: newpmodval = sform.donebutton[i].value;
! 325: newpextraval = sform.donebutton_proctorkey.value;
! 326: }
1.68 raeburn 327: }
328: }
329: }
330: }
331: pmodval = newpmodval;
1.70 ! raeburn 332: pextraval = newpextraval;
1.68 raeburn 333: draw();
334: if (pmodval) {
335: svalue += pmodval;
336: }
1.70 ! raeburn 337: if (pextraval != '') {
! 338: svalue += '_'+pextraval;
! 339: }
1.68 raeburn 340: } else {
341: draw();
342: }
1.2 www 343: }
344:
1.70 ! raeburn 345: function toggleSecret() {
! 346: var sform=choices.document.forms.sch;
! 347: if (sform.donebutton.length) {
! 348: for (var i=0; i<sform.donebutton.length; i++) {
! 349: if (sform.donebutton[i].checked) {
! 350: if (sform.donebutton[i].value == '_done_proctor') {
! 351: if (document.getElementById('done_proctorkey')) {
! 352: document.getElementById('done_proctorkey').type='text';
! 353: }
! 354: } else {
! 355: if (document.getElementById('done_proctorkey')) {
! 356: document.getElementById('done_proctorkey').type='hidden';
! 357: document.getElementById('done_proctorkey').value='';
! 358: }
! 359: }
! 360: }
! 361: }
! 362: }
! 363: }
! 364:
! 365: function validateInterval() {
! 366: var sform=choices.document.forms.sch;
! 367: if (sform.donebutton.length) {
! 368: for (var i=0; i<sform.donebutton.length; i++) {
! 369: if (sform.donebutton[i].checked) {
! 370: if (sform.donebutton[i].value == '_done_proctor') {
! 371: if ((sform.donebutton_proctorkey.value == '') ||
! 372: (sform.donebutton_proctorkey.value == null)) {
! 373: alert('Please provide a key for a proctor to enter when a student uses the "Done" button.');
! 374: return;
! 375: }
! 376: }
! 377: }
! 378: }
! 379: }
! 380: intcalc();
! 381: assemble();
! 382: }
! 383:
1.6 www 384: function integereval() {
385: svalue=choices.document.forms.sch.intval.value;
386: svalue=Math.round(svalue);
387: if (pscat=='zeropos') { svalue=Math.abs(svalue); }
388: if ((pscat=='pos') && (svalue==0)) {
389: svalue='';
390: }
1.12 www 391: if (pscat.indexOf('inrange')!=-1) {
1.10 www 392: var rangeparts=new Array;
393: rangeparts=split('_',pscat);
1.12 www 394: rangeparts=split(',',rangeparts[1]);
1.10 www 395: if (svalue<rangeparts[0]) { svalue=rangeparts[0]; }
396: if (svalue>rangeparts[1]) { svalue=rangeparts[1]; }
397: }
1.6 www 398: draw();
399: }
400:
401: function floateval() {
402: svalue=choices.document.forms.sch.floatval.value;
403: svalue=1.0*svalue;
404: if (pscat=='pos') { svalue=Math.abs(svalue); }
405: if ((pscat=='zeroone') && ((svalue<0) || (svalue>1))) {
406: svalue='';
407: }
408: draw();
409: }
410:
411: function stringeval() {
412: svalue=choices.document.forms.sch.stringval.value;
413: draw();
414: }
415:
1.25 www 416: function radiostringeval(newval) {
417: svalue=newval;
418: draw();
419: }
420:
1.29 www 421: function callradiostringeval(newval) {
1.67 raeburn 422: return 'onclick="parent.radiostringeval(\''+newval+'\')"';
1.29 www 423: }
424:
1.68 raeburn 425: function callintervalpmodval() {
1.70 ! raeburn 426: return 'onclick="parent.intcalc();parent.toggleSecret()"';
1.68 raeburn 427: }
428:
1.2 www 429: function intervaldis() {
430: csecs=svalue;
431: cdays=Math.floor(csecs/86400);
432: csecs-=cdays*86400;
433: chours=Math.floor(csecs/3600);
434: csecs-=chours*3600;
435: cmins=Math.floor(csecs/60);
436: csecs-=cmins*60;
1.69 musolffc 437: return cdays+' days '+chours+' hours '+cmins+' mins '+csecs+' secs';
1.2 www 438: }
1.21 www 439:
440: function pickcolor(picked) {
441: svalue=picked;
442: draw();
443: }
444:
445: function colorfield(ir,ig,ib) {
446: var col=new Array;
1.23 www 447: col=["00","11","22","44","66","88","AA","CC","DD","EE","FF"];
1.21 www 448: var color='#'+col[ir]+col[ig]+col[ib];
1.23 www 449: var selection="<font color='"+color+"'>X</font>";
450: if (color==svalue) { selection="<font color='#"+col[10-ir]+col[10-ig]+col[10-ib]+"'>X</font>"; }
1.21 www 451: choicewrite('<td bgcolor="'+color+'"><a href="javascript:parent.pickcolor('+"'"+
452: color+"'"+')">'+selection+'</a></td>');
453:
454: }
455:
1.1 www 456: function draw() {
457: choicestart();
1.51 bisitz 458: choicewrite('<form name="sch"');
1.6 www 459: if (ptype=='int') {
460: choicewrite(' action="javascript:integereval();"');
461: }
462: if (ptype=='float') {
463: choicewrite(' action="javascript:floateval();"');
464: }
465: if (ptype=='string') {
466: choicewrite(' action="javascript:stringeval();"');
467: }
1.62 raeburn 468: if (ptype != 'int' && ptype != 'float' && ptype != 'string') {
469: choicewrite(' action=""');
470: }
1.6 www 471: choicewrite('>');
1.1 www 472: if (ptype=='tolerance') {
1.2 www 473: // 0: pscat
474: if (pscat=='default') {
1.1 www 475: tablestart('Use default value or algorithm of resource');
476: }
1.2 www 477: if (pscat=='relative_sym') {
1.1 www 478: // 2: percentage
479: // 3: open
480: tablestart('Percentage error, symmetric around value');
481: valline('Percentage',2,3);
1.13 www 482: if ((svalue!='') && (typeof(svalue)!="undefined")) {
483: choices.document.forms.sch.val2.value=parseInt(svalue);
484: if (svalue.indexOf('+')!=-1) {
485: choices.document.forms.sch.val3.checked=true;
486: }
487: }
1.1 www 488: }
1.2 www 489: if (pscat=='relative') {
1.1 www 490: // 2: left
491: // 3: open
492: // 4: right
493: // 5: open
494: tablestart('Percentage error, asymmetric around value');
495: valline('Upper percentage',2,3);
496: valline('Lower percentage',4,5);
1.17 matthew 497: var range1=new Array;
1.13 www 498: if ((svalue!='') && (typeof(svalue)!="undefined")) {
1.17 matthew 499: range1=svalue.split(',');
500: if (typeof(range1[1])=='undefined') { range1[1]=range1[0]; }
501: choices.document.forms.sch.val2.value=parseFloat(range1[0]);
502: if (range1[0].indexOf('+')!=-1) {
1.13 www 503: choices.document.forms.sch.val3.checked=true;
504: }
1.17 matthew 505: choices.document.forms.sch.val4.value=parseFloat(range1[1]);
506: if (range1[1].indexOf('+')!=-1) {
1.13 www 507: choices.document.forms.sch.val5.checked=true;
508: }
509: }
1.1 www 510: }
1.2 www 511: if (pscat=='absolute_sym') {
1.1 www 512: tablestart('Absolute error, symmetric around value');
513: valline('Value',2,3);
1.13 www 514: if ((svalue!='') && (typeof(svalue)!="undefined")) {
1.15 www 515: choices.document.forms.sch.val2.value=parseFloat(svalue);
1.13 www 516: if (svalue.indexOf('+')!=-1) {
517: choices.document.forms.sch.val3.checked=true;
518: }
519: }
1.1 www 520: }
1.2 www 521: if (pscat=='absolute') {
1.1 www 522: tablestart('Absolute error, asymmetric around value');
523: valline('Upper value',2,3);
524: valline('Lower value',4,5);
1.17 matthew 525: var range2=new Array;
1.13 www 526: if ((svalue!='') && (typeof(svalue)!="undefined")) {
527: range=svalue.split(',');
1.17 matthew 528: if (typeof(range2[1])=='undefined') { range2[1]=range2[0]; }
529: choices.document.forms.sch.val2.value=parseFloat(range2[0]);
530: if (range2[0].indexOf('+')!=-1) {
1.13 www 531: choices.document.forms.sch.val3.checked=true;
532: }
1.17 matthew 533: choices.document.forms.sch.val4.value=parseFloat(range2[1]);
534: if (range2[1].indexOf('+')!=-1) {
1.13 www 535: choices.document.forms.sch.val5.checked=true;
536: }
537: }
1.1 www 538: }
539: }
540:
541: if (ptype=='date') {
1.2 www 542: if (pscat=='default') {
543: tablestart('Default value or none');
544: choicewrite('</table>');
545: } else {
546: if (pscat=='start') {
1.24 www 547: tablestart('Date and time');
1.2 www 548: }
549: if (pscat=='end') {
1.24 www 550: tablestart('Date and time');
1.2 www 551: }
552: if (pscat=='interval') {
1.70 ! raeburn 553: var proctorkeytype = 'hidden';
! 554: if (pmodval == '_done_proctor') {
! 555: proctorkeytype = 'text';
! 556: }
1.2 www 557: tablestart('Time interval');
1.69 musolffc 558: choicewrite( [
559: '<tr><td colspan="3">'+intervaldis()+'</td></tr>',
560: '<tr><td>Time:</td><td colspan="2">',
561: '<span style="white-space:nowrap">'+intday()+' days </span>',
562: '<span style="white-space:nowrap">'+inthour()+' hours</span>',
563: '<span style="white-space:nowrap">'+intminute()+' mins</span>',
564: '<span style="white-space:nowrap">'+intsecond()+' secs</span>',
565: '</td></tr>',
566: '</table>',
567: '<br />',
568: ].join("\n"));
1.68 raeburn 569: tablestart('Provide a "Done" button to students?');
570: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.70 ! raeburn 571: choicewrite('<label><input name="donebutton" value=""'+
! 572: ' type="radio" '+callintervalpmodval());
! 573: if (pmodval == '') { choicewrite(' checked="checked"'); }
! 574: choicewrite(' /> No</label><br />');
1.68 raeburn 575: choicewrite('<label><input name="donebutton" value="_done"'+
576: ' type="radio" '+callintervalpmodval());
1.70 ! raeburn 577: if (pmodval == '_done') { choicewrite(' checked="checked"'); }
1.68 raeburn 578: choicewrite(' /> Yes</label><br />');
1.70 ! raeburn 579: choicewrite('<span style="white-space:nowrap">'+
! 580: '<label><input name="donebutton" value="_done_proctor"'+
1.68 raeburn 581: ' type="radio" '+callintervalpmodval());
1.70 ! raeburn 582: if (pmodval == '_done_proctor') { choicewrite(' checked="checked"'); }
! 583: choicewrite(' /> Yes, with proctor key</label>');
! 584: choicewrite(' <input name="donebutton_proctorkey" value='+
! 585: '"'+escapeHTML(pextraval)+'" type="'+proctorkeytype+
! 586: '" id="done_proctorkey"'+' size="10"'+
! 587: ' onblur="parent.intcalc();" /></span>');
1.68 raeburn 588: choicewrite('</td></tr></table>');
589: } else {
1.52 bisitz 590: choicewrite('<tr><td colspan="3">'
1.2 www 591: +cdate.toString()+
1.52 bisitz 592: '</td></tr><tr><td>Date:</td><td colspan="2">');
1.2 www 593: month();date();year();
1.52 bisitz 594: choicewrite('</td></tr><tr><td>Time:'
1.51 bisitz 595: +'</td><td colspan="2">');hour();choicewrite('h ');minute();
1.2 www 596: choicewrite('m ');second();
597: choicewrite('s</td></tr></table>');
598: }
599: }
1.1 www 600: }
601:
1.6 www 602: if (ptype=='int') {
1.19 www 603: var pscatparts=new Array;
604: pscatparts=pscat.split(',');
605: pscat=pscatparts[0];
1.6 www 606: if (pscat=='default') {
607: tablestart('Default value or none');
1.14 www 608: choicewrite('</table>');
1.6 www 609: } else {
1.14 www 610: if (pscat=='range') {
611: tablestart('Integer range');
1.52 bisitz 612: choicewrite('<tr><td>Lower Value:'+
1.51 bisitz 613: '</td><td colspan="2"><input type="text" size="4" name="val2'+
1.53 bisitz 614: '" /></td></tr>');
1.52 bisitz 615: choicewrite('<tr><td>Upper Value:'+
1.51 bisitz 616: '</td><td colspan="2"><input type="text" size="4" name="val4'+
1.53 bisitz 617: '" /></td></tr></table>');
1.14 www 618: var range=new Array;
619: if ((svalue!='') && (typeof(svalue)!="undefined")) {
620: range=svalue.split(',');
621: if (typeof(range[1])=='undefined') { range[1]=range[0]; }
622: choices.document.forms.sch.val2.value=parseInt(range[0]);
623: choices.document.forms.sch.val4.value=parseInt(range[1]);
624: }
625: } else {
1.6 www 626: if (pscat=='pos') {
627: tablestart('Positive (non-zero) integer');
628: }
629: if (pscat=='zeropos') {
630: tablestart('Positive integer or zero');
631: }
1.12 www 632: if (pscat.indexOf('inrange')!=-1) {
1.10 www 633: var rangeparts=new Array;
1.12 www 634: rangeparts=split(',',pscat);
1.10 www 635: tablestart('Integer in the range ['+rangeparts[1]+']');
636: }
1.6 www 637: if (pscat=='any') {
638: tablestart('Integer');
639: }
1.52 bisitz 640: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.51 bisitz 641: choicewrite('<input name="intval" size="10" value="'+escapeHTML(svalue)+
1.53 bisitz 642: '" onchange="parent.integereval()" />');
1.54 bisitz 643: choicewrite('</td></tr></table>');
1.6 www 644: }
1.14 www 645: }
1.1 www 646: }
647:
1.6 www 648: if (ptype=='float') {
649: if (pscat=='default') {
650: tablestart('Default value or none');
651: choicewrite('</table>');
652: } else {
653: if (pscat=='pos') {
654: tablestart('Positive floating point number or zero');
655: }
656: if (pscat=='zeroone') {
657: tablestart('Floating point number between zero and one');
658: }
659: if (pscat=='any') {
660: tablestart('Floating point number');
661: }
1.52 bisitz 662: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.51 bisitz 663: choicewrite('<input name="floatval" size="10" value="'+escapeHTML(svalue)+
1.53 bisitz 664: '" onchange="parent.floateval()" />');
1.54 bisitz 665: choicewrite('</td></tr></table>');
1.6 www 666: }
1.1 www 667: }
668:
1.6 www 669: if (ptype=='string') {
1.42 albertel 670: if ((pscat=='any') || (pscat=='') || (pscat=='default') ||
671: (typeof(pscat)=='undefined')) {
1.6 www 672: tablestart('Text');
1.54 bisitz 673: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.46 albertel 674: choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
1.53 bisitz 675: '" type="text" onchange="parent.stringeval()" />');
1.25 www 676: }
677: if (pscat=='yesno') {
678: tablestart('Yes/No');
1.52 bisitz 679: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.32 albertel 680: choicewrite('<label><input name="stringval" value="yes"'+
1.29 www 681: ' type="radio" '+callradiostringeval('yes'));
1.53 bisitz 682: if (svalue=='yes') { choicewrite(' checked="checked"'); }
683: choicewrite(' /> Yes</label><br />');
1.32 albertel 684: choicewrite('<label><input name="stringval" value="no"'+
1.29 www 685: ' type="radio" '+callradiostringeval('no'));
1.53 bisitz 686: if (svalue=='no') { choicewrite(' checked="checked"'); }
687: choicewrite(' /> No</label><br />');
1.25 www 688: }
1.47 albertel 689: if (pscat=='problemstatus') {
690: tablestart('Problem Status');
1.52 bisitz 691: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.47 albertel 692: choicewrite('<label><input name="stringval" value="yes"'+
693: ' type="radio" '+callradiostringeval('yes'));
1.53 bisitz 694: if (svalue=='yes') { choicewrite(' checked="checked"'); }
695: choicewrite(' /> Yes</label><br />');
1.49 albertel 696: choicewrite('<label><input name="stringval" value="answer"'+
697: ' type="radio" '+callradiostringeval('answer'));
1.53 bisitz 698: if (svalue=='answer') { choicewrite(' checked="checked"'); }
699: choicewrite(' /> Yes, and show correct answer if they exceed the maximum number of tries.</label><br />');
1.47 albertel 700: choicewrite('<label><input name="stringval" value="no"'+
701: ' type="radio" '+callradiostringeval('no'));
1.53 bisitz 702: if (svalue=='no') { choicewrite(' checked="checked"'); }
703: choicewrite(' /> No, don\'t show correct/incorrect feedback.</label><br />');
1.47 albertel 704: choicewrite('<label><input name="stringval" value="no_feedback_ever"'+
705: ' type="radio" '+callradiostringeval('no_feedback_ever'));
1.53 bisitz 706: if (svalue=='no_feedback_ever') { choicewrite(' checked="checked"'); }
707: choicewrite(' /> No, show no feedback at all.</label><br />');
1.47 albertel 708: }
1.25 www 709: if (pscat=='examtype') {
710: tablestart('Exam Type');
1.52 bisitz 711: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.32 albertel 712: choicewrite('<label><input name="stringval" value="online"'+
1.29 www 713: ' type="radio" '+callradiostringeval('online'));
1.53 bisitz 714: if (svalue=='online') { choicewrite(' checked="checked"'); }
715: choicewrite(' /> Online</label><br />');
1.32 albertel 716: choicewrite('<label><input name="stringval" value="checkout"'+
1.29 www 717: ' type="radio" '+callradiostringeval('checkout'));
1.53 bisitz 718: if (svalue=='checkout') { choicewrite(' checked="checked"'); }
719: choicewrite(' /> Check out</label><br />');
1.25 www 720: }
721: if (pscat=='questiontype') {
722: tablestart('Question Type');
1.52 bisitz 723: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.32 albertel 724: choicewrite('<label><input name="stringval" value="problem"'+
1.29 www 725: ' type="radio" '+callradiostringeval('problem'));
1.53 bisitz 726: if (svalue=='problem') { choicewrite(' checked="checked"'); }
727: choicewrite(' /> Standard Problem</label><br />');
1.36 albertel 728: // choicewrite('<label><input name="stringval" value="quiz"'+
729: // ' type="radio" '+callradiostringeval('quiz'));
1.53 bisitz 730: // if (svalue=='quiz') { choicewrite(' checked="checked"'); }
731: // choicewrite(' /> Quiz</label><br />');
1.35 albertel 732: choicewrite('<label><input name="stringval" value="practice"'+
733: ' type="radio" '+callradiostringeval('practice'));
1.53 bisitz 734: if (svalue=='practice') { choicewrite(' checked="checked"'); }
735: choicewrite(' /> Practice</label><br />');
1.32 albertel 736: choicewrite('<label><input name="stringval" value="exam"'+
1.29 www 737: ' type="radio" '+callradiostringeval('exam'));
1.53 bisitz 738: if (svalue=='exam') { choicewrite(' checked="checked"'); }
1.65 bisitz 739: choicewrite(' /> Bubblesheet Exam</label><br />');
1.36 albertel 740: // choicewrite('<label><input name="stringval" value="assess"'+
741: // ' type="radio" '+callradiostringeval('assess'));
1.53 bisitz 742: // if (svalue=='assess') { choicewrite(' checked="checked"'); }
743: // choicewrite(' /> Assessment</label><br />');
1.32 albertel 744: choicewrite('<label><input name="stringval" value="survey"'+
1.29 www 745: ' type="radio" '+callradiostringeval('survey'));
1.53 bisitz 746: if (svalue=='survey') { choicewrite(' checked="checked"'); }
747: choicewrite(' /> Survey</label><br />');
1.36 albertel 748: // choicewrite('<label><input name="stringval" value="form"'+
749: // ' type="radio" '+callradiostringeval('form'));
1.53 bisitz 750: // if (svalue=='form') { choicewrite(' checked="checked"'); }
1.36 albertel 751: // choicewrite('> Input Form</label><br />');
1.57 raeburn 752: choicewrite('<label><input name="stringval" value="surveycred"'+
753: ' type="radio" '+callradiostringeval('surveycred'));
754: if (svalue=='surveycred') { choicewrite(' checked="checked"'); }
755: choicewrite('> Survey (credit for submission)</label><br />');
756: choicewrite('<label><input name="stringval" value="anonsurvey"'+
757: ' type="radio" '+callradiostringeval('anonsurvey'));
758: if (svalue=='anonsurvey') { choicewrite(' checked="checked"'); }
759: choicewrite('> Anonymous Survey</label><br />');
760: choicewrite('<label><input name="stringval" value="anonsurveycred"'+
761: ' type="radio" '+callradiostringeval('anonsurveycred'));
762: if (svalue=='anonsurveycred') { choicewrite(' checked="checked"'); }
763: choicewrite('> Anonymous Survey (credit for submission)</label><br />');
1.59 raeburn 764: choicewrite('<label><input name="stringval" value="randomizetry"'+
765: ' type="radio" '+callradiostringeval('randomizetry'));
766: if (svalue=='randomizetry') { choicewrite(' checked="checked"'); }
767: choicewrite('> New Randomization Each N Tries (default N=1)</label><br />');
1.32 albertel 768: choicewrite('<label><input name="stringval" value="library"'+
1.29 www 769: ' type="radio" '+callradiostringeval('library'));
1.53 bisitz 770: if (svalue=='library') { choicewrite(' checked="checked"'); }
771: choicewrite(' /> Library</label><br />');
1.25 www 772: }
1.60 raeburn 773: if (pscat=='lenient') {
774: tablestart('Lenient Grading (Partial Credit)');
775: choicewrite('<tr><td>Value:</td><td colspan="2">');
776: choicewrite('<label><input name="stringval" value="yes"'+
777: ' type="radio" '+callradiostringeval('yes'));
778: if (svalue=='yes') { choicewrite(' checked="checked"'); }
779: choicewrite(' /> Yes</label><br />');
780: choicewrite('<label><input name="stringval" value="no"'+
781: ' type="radio" '+callradiostringeval('no'));
782: if (svalue=='no') { choicewrite(' checked="checked"'); }
783: choicewrite(' /> No</label><br />');
784: choicewrite('<label><input name="stringval" value="default"'+
785: ' type="radio" '+callradiostringeval('default'));
786: if (svalue=='default') { choicewrite(' checked="checked"'); }
787: choicewrite(' /> Default (only bubblesheet grading is lenient)</label><br />');
788: }
1.64 raeburn 789: if (pscat=='discussvote') {
790: tablestart('Discussion Voting');
791: choicewrite('<tr><td>Value:</td><td colspan="2">');
792: choicewrite('<label><input name="stringval" value="yes"'+
793: ' type="radio" '+callradiostringeval('yes'));
794: if (svalue=='yes') { choicewrite(' checked="checked"'); }
795: choicewrite(' /> Yes</label><br />');
796: choicewrite('<label><input name="stringval" value="notended"'+
797: ' type="radio" '+callradiostringeval('notended'));
798: if (svalue=='notended') { choicewrite(' checked="checked"'); }
799: choicewrite(' /> Yes, unless discussion ended</label><br />');
800: choicewrite('<label><input name="stringval" value="no"'+
801: ' type="radio" '+callradiostringeval('no'));
802: if (svalue=='no') { choicewrite(' checked="checked"'); }
803: choicewrite(' /> No</label><br />');
804: }
1.25 www 805: if (pscat=='ip') {
806: tablestart('IP Number/Name');
1.52 bisitz 807: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.46 albertel 808: choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
1.53 bisitz 809: '" onchange="parent.stringeval()" />');
1.6 www 810: }
1.26 www 811: if (pscat=='fileext') {
812: tablestart('Allowed File Extensions');
1.52 bisitz 813: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.32 albertel 814: choicewrite('<label><input name="radstringval" value="txt"'+
1.29 www 815: ' type="radio" '+callradiostringeval('txt'));
1.53 bisitz 816: if (svalue=='txt') { choicewrite(' checked="checked"'); }
817: choicewrite(' /> Plain Text</label><br />');
1.32 albertel 818: choicewrite('<label><input name="radstringval" value="png,jpg,jpeg,gif"'+
1.29 www 819: ' type="radio" '+callradiostringeval('png,jpg,jpeg,gif'));
1.53 bisitz 820: if (svalue=='png,jpg,jpeg,gif') { choicewrite(' checked="checked"'); }
821: choicewrite(' /> Picture File</label><br />');
1.58 raeburn 822: choicewrite('<label><input name="radstringval" value="doc,docx,xls,xlsx,ppt,pptx"'+
823: ' type="radio" '+callradiostringeval('doc,docx,xls,xlsx,ppt,pptx'));
824: if (svalue=='doc,docx,xls,xlsx,ppt,pptx') { choicewrite(' checked="checked"'); }
1.53 bisitz 825: if (svalue=='doc,xls,ppt') { choicewrite(' checked="checked"'); }
826: choicewrite(' /> Office Document</label><br />');
1.46 albertel 827: choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
1.53 bisitz 828: '" onchange="parent.stringeval()" />');
1.26 www 829: }
1.37 albertel 830: if (pscat=='useslots') {
831: tablestart('Slots control access');
1.52 bisitz 832: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.37 albertel 833: choicewrite('<label><input name="stringval" value="no"'+
834: ' type="radio" '+callradiostringeval('no'));
1.53 bisitz 835: if (svalue=='no') { choicewrite(' checked="checked"'); }
836: choicewrite(' /> No</label><br />');
1.37 albertel 837: choicewrite('<label><input name="stringval" value="resource"'+
838: ' type="radio" '+callradiostringeval('resource'));
1.53 bisitz 839: if (svalue=='resource') { choicewrite(' checked="checked"'); }
840: choicewrite(' /> Yes, and the scope of student selected slot is a single resource.</label><br />');
1.38 albertel 841: choicewrite('<label><input name="stringval" value="map"'+
842: ' type="radio" '+callradiostringeval('map'));
1.53 bisitz 843: if (svalue=='map') { choicewrite(' checked="checked"'); }
844: 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 />');
1.39 albertel 845: choicewrite('<label><input name="stringval" value="map_map"'+
1.40 albertel 846: ' type="radio" '+callradiostringeval('map_map'));
1.53 bisitz 847: if (svalue=='map_map') { choicewrite(' checked="checked"'); }
1.55 bisitz 848: 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 />');
1.54 bisitz 849: choicewrite('</td></tr></table>');
1.6 www 850: }
1.21 www 851: }
852:
853: if (ptype=='color') {
854: tablestart('Choose a Color');
855: choicewrite('<table>');
856: if (svalue) {
1.23 www 857: choicewrite('<tr><td colspan="9">Current choice:</td><td bgcolor="'+
1.46 albertel 858: escapeHTML(svalue)+'" colspan="2"> </td></tr>');
1.21 www 859: }
1.23 www 860: for (var ir=0; ir<=10; ir++) {
861: for (var ig=0; ig<=10; ig++) {
1.21 www 862: choicewrite('<tr>');
1.23 www 863: for (var ib=0; ib<=10; ib++) {
1.21 www 864: colorfield(ir,ig,ib);
865: }
866: choicewrite('</tr>');
867: }
868: }
869: choicewrite('</table></td></table>');
1.1 www 870: }
871:
1.40 albertel 872: choicewrite('</form>');
1.1 www 873: choiceend();
874: }
875:
876: function sopt(va,text) {
877: selwrite('<option value="'+va+'"');
1.2 www 878: if (va==pscat) {
1.54 bisitz 879: selwrite(' selected="selected"');
1.1 www 880: }
881: selwrite('>'+text+'</option>');
882: }
883:
884: function catchange() {
885: var sform=selector.document.forms.fsel.fcat;
1.2 www 886: pscat=sform.options[sform.selectedIndex].value;
1.1 www 887: draw();
888: }
889:
890: function assemble() {
1.2 www 891: if ((ptype=='date') && (pscat!='interval')) {
1.41 www 892: svalue=Math.floor(cdate.getTime()/1000);
1.2 www 893: }
1.12 www 894: if (ptype=='tolerance') {
895: if (pscat=='relative_sym') {
896: svalue=choices.document.forms.sch.val2.value+'%';
897: if (choices.document.forms.sch.val3.checked) {
898: svalue+='+';
899: }
900: }
901: if (pscat=='absolute_sym') {
902: svalue=choices.document.forms.sch.val2.value;
903: if (choices.document.forms.sch.val3.checked) {
904: svalue+='+';
905: }
906: }
907: if (pscat=='absolute') {
908: svalue=choices.document.forms.sch.val2.value;
909: if (choices.document.forms.sch.val3.checked) {
910: svalue+='+';
911: }
912: svalue+=','+choices.document.forms.sch.val4.value;
913: if (choices.document.forms.sch.val5.checked) {
914: svalue+='+';
915: }
916: }
917: if (pscat=='relative') {
918: svalue=choices.document.forms.sch.val2.value+'%';
919: if (choices.document.forms.sch.val3.checked) {
920: svalue+='+';
921: }
922: svalue+=','+choices.document.forms.sch.val4.value+'%';
923: if (choices.document.forms.sch.val5.checked) {
924: svalue+='+';
925: }
926: }
1.14 www 927: }
928: if ((ptype=='int') && (pscat=='range')) {
929: svalue=choices.document.forms.sch.val2.value+','+
930: choices.document.forms.sch.val4.value;
1.12 www 931: }
1.6 www 932: if (pscat=='default') { svalue=''; }
1.2 www 933: stype=ptype+'_'+pscat;
1.1 www 934: }
935:
936:
937: function init() {
938: var i;
1.2 www 939: var subs=new Array();
1.68 raeburn 940: var doneRegExp = /_done/;
1.70 ! raeburn 941: var doneproctorRegExp = /_done_proctor/;
! 942: var proctorkeyRegExp = /^(\d+)_(.+)$/;
1.1 www 943: var namevalue=this.window.location.search.split('&');
944: namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1);
945:
946: for (i=0;i<namevalue.length;i++) {
947: var pair=namevalue[i].split('=');
1.3 www 948: pair[1]=unescape(pair[1]);
1.1 www 949: if (pair[0]=='value') { pvalue=pair[1]; }
1.2 www 950: if (pair[0]=='type') { subs=pair[1].split('_');
951: ptype=subs[0];
952: pscat=subs[1];
1.11 www 953: if (typeof(subs[2])!="undefined") {
954: pscat+='_'+subs[2];
955: }
956: if ((pscat=='') || (typeof(pscat)=="undefined")) {
1.6 www 957: pscat='default';
958: }
1.2 www 959: }
1.1 www 960: if (pair[0]=='return') { preturn=pair[1]; }
961: if (pair[0]=='call') { pcode=pair[1]; }
1.2 www 962: if (pair[0]=='marker') { pmarker=pair[1]; }
1.1 www 963: if (pair[0]=='name') { pname=pair[1]; }
1.63 www 964: if (pair[0]=='modal') { pmodal=pair[1]; }
1.34 albertel 965: if (pair[0]=='defhour' && pair[1] >= 0 && pair[1] < 24 ) {
966: defhour=pair[1];
967: }
968: if (pair[0]=='defmin' && pair[1] >= 0 && pair[1] < 60) { defmin=pair[1]; }
969: if (pair[0]=='defsec' && pair[1] >= 0 && pair[1] < 60) { defsec=pair[1]; }
1.1 www 970: }
971:
1.68 raeburn 972: if (ptype=='date' && pscat == 'interval') {
1.70 ! raeburn 973: if (doneproctorRegExp.test(pvalue)) {
! 974: pmodval = pvalue.match(doneproctorRegExp);
! 975: var intervalwithkey = pvalue.replace(doneproctorRegExp,'');
! 976: if (proctorkeyRegExp.test(intervalwithkey)) {
! 977: var currvals = intervalwithkey.match(proctorkeyRegExp);
! 978: if (currvals.length == 3) {
! 979: pvalue = currvals[1];
! 980: pextraval = currvals[2];
! 981: } else {
! 982: pmodval = '';
! 983: }
! 984: }
! 985: } else {
! 986: if (doneRegExp.test(pvalue)) {
! 987: var pnumval = pvalue.replace(doneRegExp,'');
! 988: pmodval = pvalue.match(doneRegExp);
! 989: pvalue = pnumval;
! 990: }
1.68 raeburn 991: }
992: }
1.1 www 993: svalue=pvalue;
1.6 www 994: if (((ptype=='float') || (ptype=='string') || (ptype=='int')) &&
995: (pscat=='default') &&
1.11 www 996: (typeof(svalue)!="undefined") &&
997: (svalue!=0) && (svalue!='')) { pscat='any'; }
1.1 www 998:
1.13 www 999: if (ptype=='tolerance') {
1000: var tperc=0;
1001: var trange=0;
1002: if (typeof(svalue)!='undefined') {
1003: if (svalue.indexOf('%')!=-1) { tperc=1; }
1004: if (svalue.indexOf(',')!=-1) { trange=1; }
1005: if (trange) {
1006: if (tperc) { pscat='relative'; } else { pscat='absolute'; }
1007: } else {
1008: if (tperc) { pscat='relative_sym'; } else { pscat='absolute_sym'; }
1009: }
1010: }
1011: }
1012:
1.61 raeburn 1013: this.window.selector.document.open();
1.62 raeburn 1014: selwrite('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
1015: selwrite('<html xmlns="http://www.w3.org/1999/xhtml">');
1.55 bisitz 1016: selwrite('<head>');
1.62 raeburn 1017: selwrite('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
1018: selwrite('<title>LON-CAPA</title>');
1.55 bisitz 1019: selwrite('<style type="text/css">');
1020: selwrite('<!--');
1021: selwrite('body {');
1022: selwrite('font-family: Verdana,Arial,Helvetica,sans-serif;');
1023: selwrite('line-height:130%;');
1024: selwrite('font-size:0.83em;');
1025: selwrite('background: #FFFFFF;');
1026: selwrite('}');
1027: selwrite('-->');
1028: selwrite('</style>');
1029: selwrite('</head>');
1.62 raeburn 1030: selwrite('<body>');
1031: selwrite('<form name="fsel" action=""><b>'+pname+'</b><br />');
1.66 bisitz 1032: selwrite('Format of Value(s): <select name="fcat" onchange="parent.catchange();">');
1.12 www 1033:
1.1 www 1034: if (ptype=='tolerance') {
1035: sopt('default','Default');
1036: sopt('relative_sym','Relative Tolerance, Symmetric (percent)');
1037: sopt('relative','Relative Tolerance (percentages)');
1038: sopt('absolute_sym','Absolute Tolerance, Symmetric (value)');
1039: sopt('absolute','Absolute Tolerance (values)');
1040: }
1041:
1042: if (ptype=='date') {
1.48 albertel 1043: if (pscat != 'interval') {
1044: sopt('default','Default');
1045: sopt('start','Starting Date');
1046: sopt('end','Ending Date');
1047: } else {
1048: sopt('interval','Time Interval');
1049: }
1050:
1.11 www 1051: if ((pvalue!='') && (typeof(pvalue)!="undefined")) {
1.2 www 1052: cdate.setTime(pvalue*1000);
1.30 www 1053: } else {
1.31 www 1054: cdate.setSeconds(defsec);
1055: cdate.setMinutes(defmin);
1056: cdate.setHours(defhour);
1.2 www 1057: }
1058:
1059: months[0]='January';
1060: months[1]='February';
1061: months[2]='March';
1062: months[3]='April';
1063: months[4]='May';
1064: months[5]='June';
1065: months[6]='July';
1066: months[7]='August';
1067: months[8]='September';
1068: months[9]='October';
1069: months[10]='November';
1070: months[11]='December';
1.1 www 1071: }
1.2 www 1072:
1.6 www 1073: if (ptype=='int') {
1074: sopt('default','Default');
1075: sopt('pos','Positive Integer, Not Zero');
1076: sopt('zeropos','Positive Integer or Zero');
1.13 www 1077: sopt('inrange','Integer in Range');
1078: sopt('range','Range of Integers');
1.6 www 1079: sopt('any','Integer');
1.1 www 1080: }
1081:
1.6 www 1082: if (ptype=='float') {
1083: sopt('default','Default');
1084: sopt('zeroone','Floating Point between 0 and 1');
1085: sopt('pos','Positive Floating Point');
1086: sopt('any','Floating Point');
1.1 www 1087:
1088: }
1089:
1.6 www 1090: if (ptype=='string') {
1.44 albertel 1091: //sopt('default','Default');
1092: if (pscat == 'yesno') { sopt('yesno','Yes/No'); }
1.47 albertel 1093: else if (pscat == 'problemstatus'){ sopt('problemstatus','Problem Status'); }
1.45 albertel 1094: else if (pscat == 'examtype') { sopt('examtype','Exam Type'); }
1095: else if (pscat == 'questiontype') { sopt('questiontype','Question Type'); }
1.60 raeburn 1096: else if (pscat == 'lenient') { sopt('lenient','Lenient Grading (Partial Credit)'); }
1.64 raeburn 1097: else if (pscat == 'discussvote') { sopt('discussvote','Discussion Voting'); }
1.45 albertel 1098: else if (pscat == 'ip') { sopt('ip','IP Number/Name'); }
1099: else if (pscat == 'fileext') { sopt('fileext','File Extension'); }
1100: else if (pscat == 'useslots') { sopt('useslots','Slots control access'); }
1101: else { pscat = 'any'; }
1.28 albertel 1102: sopt('any','String Value');
1.22 www 1103: }
1104:
1105: if (ptype=='color') {
1106: sopt('default','Use Default Color');
1107: sopt('custom','Use Custom Color');
1.1 www 1108: }
1109:
1110: selwrite('</select></form>');
1.63 www 1111: var targ='parent.opener';
1112: if (pmodal==1) {
1113: targ='parent.parent';
1.70 ! raeburn 1114: }
! 1115: if ((ptype=='date') && (pscat=='interval')) {
! 1116: selwrite('<a href="javascript:parent.validateInterval();');
! 1117: } else {
! 1118: selwrite('<a href="javascript:parent.assemble();');
! 1119: }
1.1 www 1120: if (preturn!='') {
1.63 www 1121: selwrite(targ+'.document.'+preturn+'_value.value=parent.window.svalue;');
1122: selwrite(targ+'.document.'+preturn+'_type.value=parent.window.stype;');
1.2 www 1123: }
1124: if (pmarker!='') {
1.63 www 1125: selwrite(targ+'.document.'+preturn+'_marker.value=parent.window.pmarker;');
1.1 www 1126: }
1127: if (pcode!='') {
1.63 www 1128: selwrite(targ+'.'+pcode+'();');
1.1 www 1129: }
1.43 albertel 1130: selwrite('">Save</a> ');
1.5 www 1131:
1132: selwrite('<a href="javascript:');
1.63 www 1133: selwrite(targ+'.document.'+preturn+'_value.value='+"'';");
1.5 www 1134: if (pmarker!='') {
1135: selwrite(
1.63 www 1136: targ+'.document.'+preturn+'_marker.value=parent.window.pmarker;');
1.5 www 1137: }
1138: if (pcode!='') {
1.63 www 1139: selwrite(targ+'.'+pcode+'();');
1.5 www 1140: }
1141: selwrite('">Delete</a> ');
1.4 www 1142:
1.1 www 1143: selwrite('</body></html>');
1144: this.window.selector.document.close();
1.2 www 1145: draw();
1.1 www 1146:
1147: }
1148:
1.56 raeburn 1149: // ]]>
1.1 www 1150: </script>
1.56 raeburn 1151: </head>
1.1 www 1152:
1.56 raeburn 1153: <frameset rows="120,*" onload="init();">
1154: <frame name="selector" src="empty.html" />
1155: <frame name="choices" src="empty.html" />
1.1 www 1156: </frameset>
1157:
1158:
1159:
1.16 albertel 1160: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>