Annotation of rat/client/parameter.html, revision 1.85
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.85 ! raeburn 8: // $Id: parameter.html,v 1.84 2020/10/29 23:24:13 raeburn 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.71 raeburn 44: var pextravaltwo='';
1.1 www 45: var preturn='';
46: var pcode='';
1.2 www 47: var pscat='';
1.85 ! raeburn 48: var psmap='';
1.2 www 49: var pmarker='';
1.63 www 50: var pmodal='';
1.1 www 51: var pname='';
1.76 raeburn 52: var precursive='';
53: var pnonreccol='';
54: var pmarkerst='';
55: var pparm='';
1.80 raeburn 56: var pextra='';
1.1 www 57:
1.31 www 58: var defhour=0;
59: var defmin=0;
60: var defsec=0;
61:
1.1 www 62: var svalue;
1.2 www 63: var stype;
64: var smarker;
1.1 www 65:
66: var vars=new Array();
67:
1.2 www 68: var cdate=new Date();
69:
70: var csec;
71: var cmin;
72: var chour;
73: var cday;
74:
75: var months=new Array();
76:
77:
1.1 www 78: function selwrite(text) {
79: this.window.selector.document.write(text);
80: }
81:
82: function choicestart() {
1.61 raeburn 83: this.window.choices.document.open();
1.62 raeburn 84: choicewrite('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
85: choicewrite('<html xmlns="http://www.w3.org/1999/xhtml">');
1.55 bisitz 86: choicewrite('<head>');
1.62 raeburn 87: choicewrite('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
88: choicewrite('<title>LON-CAPA</title>');
1.55 bisitz 89: choicewrite('<style type="text/css">');
90: choicewrite('<!--');
91: choicewrite('body {');
92: choicewrite('font-family: Verdana,Arial,Helvetica,sans-serif;');
93: choicewrite('line-height:130%;');
94: choicewrite('font-size:0.83em;');
95: choicewrite('background: #FFFFFF;');
96: choicewrite('}');
97: choicewrite('table.LC_parmsel_table {font-size: 90%;}');
98: choicewrite('table.LC_parmsel_table tr td { padding: 5px; border: 1px solid #C8C8C8;}');
99: choicewrite('-->');
100: choicewrite('</style>');
101: choicewrite('</head>');
1.62 raeburn 102: choicewrite('<body>');
1.1 www 103: }
104:
105: function choiceend() {
106: choicewrite('</body></html>');
107: this.window.choices.document.close();
108: }
109:
110: function choicewrite(text) {
111: this.window.choices.document.write(text);
112: }
113:
114: function tablestart(headtext) {
1.55 bisitz 115: choicewrite('<table class="LC_parmsel_table"><tr bgcolor="#C5DB99"><th colspan="3">'+
1.1 www 116: headtext+'</th></tr>');
117: }
118:
119: function valline(text,id1,id2) {
1.52 bisitz 120: choicewrite('<tr><td>'+text+
1.51 bisitz 121: '</td><td><input type="text" size="4" name="val'+
1.53 bisitz 122: id1+'" /></td><td>incl:<input type="checkbox" name="val'+
123: id2+'" /></td></tr>');
1.1 www 124: }
125:
1.46 albertel 126: function escapeHTML(text) {
127: text = text.replace(/&/g, '&');
128: text = text.replace(/"/g, '"');
129: text = text.replace(/</g, '<');
130: text = text.replace(/>/g, '>');
131: return text;
132: }
133:
1.2 www 134: function datecalc() {
135: var sform=choices.document.forms.sch;
136:
137: cdate.setHours(sform.hours.options[sform.hours.selectedIndex].value);
138: cdate.setMinutes(sform.minutes.options[sform.minutes.selectedIndex].value);
139: cdate.setSeconds(sform.minutes.options[sform.seconds.selectedIndex].value);
140: cdate.setDate(sform.date.options[sform.date.selectedIndex].value);
141: cdate.setMonth(sform.month.options[sform.month.selectedIndex].value);
142: cdate.setFullYear(sform.year.options[sform.year.selectedIndex].value);
143:
144: draw();
145: }
146:
147: function hour() {
148: var thishour=cdate.getHours();
149: var i; var j;
1.53 bisitz 150: choicewrite('<select name="hours" onchange="parent.datecalc();">');
1.2 www 151: for (i=0;i<=23;i++) {
1.54 bisitz 152: choicewrite('<option value="'+i+'"');
1.2 www 153: if (i==thishour) {
1.54 bisitz 154: choicewrite(' selected="selected"');
1.2 www 155: }
156: choicewrite('>');
157: if (i==12) { choicewrite('noon'); } else {
158: if (i==0) { choicewrite('midnight') } else {
159:
160: if (i<12) { choicewrite(i+' am'); } else {
161: j=i-12; choicewrite(j+' pm');
162: }
163:
164: }
165: }
166: choicewrite('</option>');
167: }
168: choicewrite('</select>');
169: }
170:
171: function minute() {
172: var thisminutes=cdate.getMinutes();
173: var i;
1.53 bisitz 174: choicewrite('<select name="minutes" onchange="parent.datecalc();">');
1.2 www 175: for (i=0;i<=59;i++) {
1.54 bisitz 176: choicewrite('<option value="'+i+'"');
1.2 www 177: if (i==thisminutes) {
1.54 bisitz 178: choicewrite(' selected="selected"');
1.2 www 179: }
180: choicewrite('>'+i+'</option>');
181: }
182: choicewrite('</select>');
183: }
184:
185: function second() {
186: var thisseconds=cdate.getSeconds();
187: var i;
1.53 bisitz 188: choicewrite('<select name="seconds" onchange="parent.datecalc();">');
1.2 www 189: for (i=0;i<=59;i++) {
1.54 bisitz 190: choicewrite('<option value="'+i+'"');
1.2 www 191: if (i==thisseconds) {
1.54 bisitz 192: choicewrite(' selected="selected"');
1.2 www 193: }
194: choicewrite('>'+i+'</option>');
195: }
196: choicewrite('</select>');
1.79 raeburn 197: }
1.2 www 198:
199:
200: function date() {
201: var thisdate=cdate.getDate();
202: var i;
1.53 bisitz 203: choicewrite('<select name="date" onchange="parent.datecalc();">');
1.2 www 204: for (i=1;i<=31;i++) {
1.54 bisitz 205: choicewrite('<option value="'+i+'"');
1.2 www 206: if (i==thisdate) {
1.54 bisitz 207: choicewrite(' selected="selected"');
1.2 www 208: }
209: choicewrite('>'+i+'</option>');
210: }
211: choicewrite('</select>');
212: }
213:
214: function year() {
215: var thisyear=cdate.getFullYear();
1.19 www 216: var nowdate=new Date();
217: var nowyear=nowdate.getFullYear();
1.33 albertel 218: if ( !thisyear ) { thisyear=nowyear; }
1.19 www 219: var loweryear=thisyear-2;
220: var upperyear=thisyear+5;
221: if (thisyear>nowyear) { loweryear=nowyear-2; }
222: if (thisyear<nowyear) { upperyear=nowyear+5; }
1.2 www 223: var i;
1.53 bisitz 224: choicewrite('<select name="year" onchange="parent.datecalc();">');
1.19 www 225: for (i=loweryear;i<=upperyear;i++) {
1.54 bisitz 226: choicewrite('<option value="'+i+'"');
1.2 www 227: if (i==thisyear) {
1.54 bisitz 228: choicewrite(' selected="selected"');
1.2 www 229: }
230: choicewrite('>'+i+'</option>');
231: }
232: choicewrite('</select>');
233: }
234:
235: function month() {
236: var thismonth=cdate.getMonth();
237: var i;
1.53 bisitz 238: choicewrite('<select name="month" onchange="parent.datecalc();">');
1.2 www 239: for (i=0;i<=11;i++) {
1.54 bisitz 240: choicewrite('<option value="'+i+'"');
1.2 www 241: if (i==thismonth) {
1.54 bisitz 242: choicewrite(' selected="selected"');
1.2 www 243: }
244: choicewrite('>'+months[i]+'</option>');
245: }
246: choicewrite('</select>');
247: }
1.79 raeburn 248:
249:
1.2 www 250: function intminute() {
251: var thisminutes=cmins;
252: var i;
1.69 musolffc 253: var result = '';
254: result += '<select name="minutes" onchange="parent.intcalc();">';
1.2 www 255: for (i=0;i<=59;i++) {
1.69 musolffc 256: result += '<option value="'+i+'"';
1.2 www 257: if (i==thisminutes) {
1.69 musolffc 258: result += ' selected="selected"';
1.2 www 259: }
1.69 musolffc 260: result += '>'+i+'</option>';
1.2 www 261: }
1.69 musolffc 262: result += '</select>';
263: return result;
1.2 www 264: }
265:
266: function inthour() {
267: var thishours=chours;
268: var i;
1.69 musolffc 269: var result = '';
270: result += '<select name="hours" onchange="parent.intcalc();">';
1.2 www 271: for (i=0;i<=23;i++) {
1.69 musolffc 272: result += '<option value="'+i+'"';
1.2 www 273: if (i==thishours) {
1.69 musolffc 274: result += ' selected="selected"';
1.2 www 275: }
1.69 musolffc 276: result += '>'+i+'</option>';
1.2 www 277: }
1.69 musolffc 278: result += '</select>';
279: return result;
1.71 raeburn 280: }
1.2 www 281:
282: function intsecond() {
1.69 musolffc 283: var thisseconds=csecs;
1.2 www 284: var i;
1.69 musolffc 285: var result = '';
286: result += '<select name="seconds" onchange="parent.intcalc();">';
1.2 www 287: for (i=0;i<=59;i++) {
1.69 musolffc 288: result += '<option value="'+i+'"';
1.2 www 289: if (i==thisseconds) {
1.69 musolffc 290: result += ' selected="selected"';
1.2 www 291: }
1.69 musolffc 292: result += '>'+i+'</option>';
1.2 www 293: }
1.69 musolffc 294: result += '</select>';
295: return result;
1.2 www 296: }
297:
298:
299: function intday() {
300: var thisdate=cdays;
301: var i;
1.69 musolffc 302: var result ='';
303: result += '<select name="date" onchange="parent.intcalc();">';
1.2 www 304: for (i=0;i<=31;i++) {
1.69 musolffc 305: result += '<option value="'+i+'"';
1.2 www 306: if (i==thisdate) {
1.69 musolffc 307: result += ' selected="selected"';
1.2 www 308: }
1.69 musolffc 309: result += '>'+i+'</option>';
1.2 www 310: }
1.69 musolffc 311: result += '</select>';
312: return result;
1.2 www 313: }
314:
315: function intcalc() {
316: var sform=choices.document.forms.sch;
317: svalue=((sform.date.options[sform.date.selectedIndex].value*24+
318: sform.hours.options[sform.hours.selectedIndex].value*1)*60+
319: sform.minutes.options[sform.minutes.selectedIndex].value*1)*60+
320: sform.seconds.options[sform.seconds.selectedIndex].value*1;
1.68 raeburn 321: if ((ptype=='date') && (pscat=='interval')) {
322: var newpmodval = '';
1.70 raeburn 323: var newpextraval = '';
1.71 raeburn 324: var newpextravaltwo = 'Done';
1.68 raeburn 325: if (sform.donebutton.length) {
326: for (var i=0; i<sform.donebutton.length; i++) {
327: if (sform.donebutton[i].checked) {
328: if (sform.donebutton[i].value == '_done') {
329: newpmodval = sform.donebutton[i].value;
1.71 raeburn 330: newpextravaltwo = sform.donebutton_text.value;
1.70 raeburn 331: } else {
332: if (sform.donebutton[i].value == '_done_proctor') {
333: newpmodval = sform.donebutton[i].value;
334: newpextraval = sform.donebutton_proctorkey.value;
1.71 raeburn 335: newpextravaltwo = sform.donebutton_text.value;
336: newpextravaltwo = newpextravaltwo.replace(/:/g,'');
1.70 raeburn 337: }
1.68 raeburn 338: }
339: }
340: }
341: }
342: pmodval = newpmodval;
1.70 raeburn 343: pextraval = newpextraval;
1.71 raeburn 344: pextravaltwo = newpextravaltwo;
1.68 raeburn 345: draw();
346: if (pmodval) {
1.71 raeburn 347: var doneRegExp = /^(_done)(|_proctor)$/;
348: var donevals = pmodval.match(doneRegExp);
349: if (donevals.length == 3) {
350: svalue += donevals[1];
351: }
352: if (newpextravaltwo) {
353: if (newpextravaltwo != 'Done') {
354: svalue += ':'+newpextravaltwo+':';
355: }
356: }
357: if (donevals[2] != '') {
358: svalue += donevals[2];
359: if (pextraval != '') {
360: svalue += '_'+pextraval;
361: }
362: }
1.70 raeburn 363: }
1.68 raeburn 364: } else {
365: draw();
366: }
1.2 www 367: }
368:
1.70 raeburn 369: function toggleSecret() {
370: var sform=choices.document.forms.sch;
371: if (sform.donebutton.length) {
372: for (var i=0; i<sform.donebutton.length; i++) {
373: if (sform.donebutton[i].checked) {
1.71 raeburn 374: if (sform.donebutton[i].value == '') {
375: if (document.getElementById('donebuttontextdiv')) {
376: document.getElementById('donebuttontextdiv').style.display='none';
377: }
378: } else {
379: if (document.getElementById('donebuttontextdiv')) {
380: document.getElementById('donebuttontextdiv').style.display='block';
381: }
382: }
1.70 raeburn 383: if (sform.donebutton[i].value == '_done_proctor') {
384: if (document.getElementById('done_proctorkey')) {
385: document.getElementById('done_proctorkey').type='text';
386: }
387: } else {
388: if (document.getElementById('done_proctorkey')) {
389: document.getElementById('done_proctorkey').type='hidden';
390: document.getElementById('done_proctorkey').value='';
391: }
392: }
393: }
394: }
395: }
396: }
397:
398: function validateInterval() {
399: var sform=choices.document.forms.sch;
400: if (sform.donebutton.length) {
401: for (var i=0; i<sform.donebutton.length; i++) {
402: if (sform.donebutton[i].checked) {
403: if (sform.donebutton[i].value == '_done_proctor') {
404: if ((sform.donebutton_proctorkey.value == '') ||
405: (sform.donebutton_proctorkey.value == null)) {
1.84 raeburn 406: alert('Please enter a key for a proctor to enter when a student uses the "Done" button.');
1.70 raeburn 407: return;
408: }
409: }
410: }
411: }
412: }
413: intcalc();
414: assemble();
415: }
416:
1.80 raeburn 417: function validateDeepLink() {
418: var sform=choices.document.forms.sch;
419: svalue = sform.deeplinklisted.options[sform.deeplinklisted.selectedIndex].value+',';
420: svalue += sform.deeplinkacc.options[sform.deeplinkacc.selectedIndex].value+',';
1.84 raeburn 421: var keyRegExp = /^[a-zA-Z\d_.!@#$%^&*()+=-]+$/;
422: var numRegExp = /^\d+$/;
1.80 raeburn 423: if (sform.deeplinktypes.length) {
424: for (var i=0; i<sform.deeplinktypes.length; i++) {
425: if (sform.deeplinktypes[i].checked) {
426: svalue += sform.deeplinktypes[i].value;
427: if (sform.deeplinktypes[i].value == 'key') {
428: var posskey = sform.deeplinkkey.value;
429: posskey = posskey.replace(/^\s+|\s+$/g,'');
430: if (keyRegExp.test(posskey)) {
431: svalue += ':'+posskey;
1.84 raeburn 432: } else {
433: alert('Please enter a value for the key containing one or more of: a-zA-Z0-9_.!@#$%^&*()+=-\n'+
434: 'or choose a different supported link type.');
435: return;
1.80 raeburn 436: }
437: } else if (sform.deeplinktypes[i].value == 'lti') {
438: var posslti = sform.linkposslti.options[sform.linkposslti.selectedIndex].value;
1.84 raeburn 439: if ((numRegExp.test(posslti)) && (posslti > 0)) {
1.80 raeburn 440: svalue += ':'+posslti;
1.84 raeburn 441: } else {
442: alert('Please select an LTI launcher, or choose a different supported link type.');
443: return;
444: }
445: }
446: break;
447: }
448: }
449: }
450: svalue += ',';
451: if (sform.deeplinkmenus.length) {
452: for (var i=0; i<sform.deeplinkmenus.length; i++) {
453: if (sform.deeplinkmenus[i].checked) {
454: if (sform.deeplinkmenus[i].value == 'std') {
455: svalue += '0';
456: } else if (sform.deeplinkmenus[i].value == 'collnum') {
457: var posscoll = sform.linkpossmenu.options[sform.linkpossmenu.selectedIndex].value;
458: if ((numRegExp.test(posscoll)) && (posscoll > 0)) {
459: svalue += posscoll;
460: } else {
461: alert("Please select either a numbered collection or check 'Standard (all menus)'.");
462: return;
1.80 raeburn 463: }
464: }
465: break;
466: }
467: }
468: }
469: assemble();
470: }
471:
1.84 raeburn 472: function toggleDeepLink(caller) {
1.80 raeburn 473: var sform=choices.document.forms.sch;
1.84 raeburn 474: if ((caller == 'types') && (sform.deeplinktypes.length)) {
1.80 raeburn 475: var frame = window.frames["choices"];
476: for (var i=0; i<sform.deeplinktypes.length; i++) {
477: if (sform.deeplinktypes[i].checked) {
478: if (sform.deeplinktypes[i].value == 'key') {
479: if (frame.document.getElementById('deeplinkkey')) {
480: frame.document.getElementById('deeplinkkey').type='text';
481: }
482: if (frame.document.getElementById('deeplinkltidiv')) {
483: frame.document.getElementById('deeplinkltidiv').style.display='none';
484: }
485: } else {
486: if (frame.document.getElementById('deeplinkkey')) {
487: frame.document.getElementById('deeplinkkey').type='hidden';
488: }
489: if (frame.document.getElementById('deeplinkltidiv')) {
490: if (sform.deeplinktypes[i].value == 'lti') {
1.84 raeburn 491: frame.document.getElementById('deeplinkltidiv').style.display='block';
1.80 raeburn 492: } else {
493: frame.document.getElementById('deeplinkltidiv').style.display='none';
494: }
495: }
496: }
497: break;
498: }
499: }
500: }
1.84 raeburn 501: if ((caller == 'menus') && (sform.deeplinkmenus.length)) {
502: var frame = window.frames["choices"];
503: for (var i=0; i<sform.deeplinkmenus.length; i++) {
504: if (sform.deeplinkmenus[i].checked) {
505: if (frame.document.getElementById('deeplinkmenusdiv')) {
506: if (sform.deeplinkmenus[i].value == 'collnum') {
507: frame.document.getElementById('deeplinkmenusdiv').style.display='inline-block';
508: } else {
509: frame.document.getElementById('deeplinkmenusdiv').style.display='none';
510: }
511: }
512: break;
513: }
514: }
515: }
1.80 raeburn 516: }
517:
1.84 raeburn 518: function calldeeplink(caller) {
519: return 'onclick="parent.toggleDeepLink(\''+caller+'\')"';
1.80 raeburn 520: }
521:
1.6 www 522: function integereval() {
523: svalue=choices.document.forms.sch.intval.value;
524: svalue=Math.round(svalue);
525: if (pscat=='zeropos') { svalue=Math.abs(svalue); }
526: if ((pscat=='pos') && (svalue==0)) {
527: svalue='';
528: }
1.12 www 529: if (pscat.indexOf('inrange')!=-1) {
1.10 www 530: var rangeparts=new Array;
531: rangeparts=split('_',pscat);
1.12 www 532: rangeparts=split(',',rangeparts[1]);
1.10 www 533: if (svalue<rangeparts[0]) { svalue=rangeparts[0]; }
534: if (svalue>rangeparts[1]) { svalue=rangeparts[1]; }
535: }
1.6 www 536: draw();
537: }
538:
539: function floateval() {
540: svalue=choices.document.forms.sch.floatval.value;
541: svalue=1.0*svalue;
542: if (pscat=='pos') { svalue=Math.abs(svalue); }
543: if ((pscat=='zeroone') && ((svalue<0) || (svalue>1))) {
544: svalue='';
545: }
546: draw();
547: }
548:
549: function stringeval() {
550: svalue=choices.document.forms.sch.stringval.value;
551: draw();
552: }
553:
1.73 raeburn 554: function ipstringeval() {
555: var patternIp = /^([\[\]a-zA-Z\.\d\*\-]+)$/;
556: var acctypes = new Array;
557: acctypes = ['allow','deny'];
558: svalue = '';
559: for (var i=0; i<acctypes.length; i++) {
560: var items = choices.document.getElementsByName('setip'+acctypes[i]);
1.74 raeburn 561: if (items.length > 0) {
1.73 raeburn 562: for (var j=0; j<items.length; j++) {
563: if (items[j].type == "text") {
1.79 raeburn 564: var possip = items[j].value;
1.73 raeburn 565: possip = possip.replace(/^\s+|\s+$/g,'');
566: if (patternIp.test(possip)) {
567: if (acctypes[i] == 'deny') {
568: possip = '!'+possip;
569: }
570: if (svalue == '') {
571: svalue = possip;
572: } else {
573: svalue += ','+possip;
574: }
575: }
576: }
577: }
578: }
579: }
580: }
581:
582: function addIpRule(iptype) {
583: var frame = window.frames["choices"];
584: if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {
585: var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);
586: var count = innerDiv.childNodes.length
587: var ipDiv = frame.document.createElement('div');
588: ipDiv.innerHTML = '<input type="text" size="10" name="setip'+iptype+'" onblur="parent.ipstringeval();" />'+
589: '<a href="#" onclick="parent.removeIpRule(\''+iptype+'\',\''+count+'\')">Remove</a>';
590: frame.document.getElementById('LC_string_ipacc_inner_'+iptype).appendChild(ipDiv);
591: }
592: return false;
593: }
594:
595: function removeIpRule(iptype,num) {
596: var frame = window.frames["choices"];
597: if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {
598: var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);
599: for (var i=0; i<innerDiv.childNodes.length; i++) {
600: if (i==num) {
601: innerDiv.removeChild(innerDiv.childNodes[i]);
602: ipstringeval();
603: break;
604: }
605: }
606: }
607: }
608:
1.25 www 609: function radiostringeval(newval) {
610: svalue=newval;
611: draw();
612: }
613:
1.29 www 614: function callradiostringeval(newval) {
1.67 raeburn 615: return 'onclick="parent.radiostringeval(\''+newval+'\')"';
1.29 www 616: }
617:
1.72 raeburn 618: function lenienteval(newval) {
619: if (newval == 'weighted') {
620: if (document.getElementById('lenientweighteddiv')) {
621: document.getElementById('lenientweighteddiv').style.display='block';
622: }
623: var patternRelWeight = /^\-?[\d.]+$/;
1.79 raeburn 624: var sform=choices.document.forms.sch;
1.72 raeburn 625: if ((sform.lenientrelwt.length != 'undefined') && (sform.lenientrelwt.length) != 'null') {
626: for (var i=0; i<sform.lenientrelwt.length; i++) {
627: var relweight = sform.lenientrelwt[i].value;
628: relweight = relweight.replace(/^\s+|\s+$/g,'');
629: if (!patternRelWeight.test(relweight)) {
630: if (i<2) {
631: relweight = '1.0';
632: } else {
633: relweight = '0.0';
634: }
635: }
636: sform.lenientrelwt[i].value = relweight;
637: if (i==0) {
638: svalue = relweight;
639: } else {
640: svalue += ','+relweight;
641: }
642: }
643: }
644: } else {
645: if (document.getElementById('lenientweighteddiv')) {
646: document.getElementById('lenientweighteddiv').style.display='none';
647: }
648: svalue=newval;
1.73 raeburn 649: }
1.72 raeburn 650: draw();
651: }
652:
653: function calllenientradioeval(newval) {
654: return 'onclick="parent.lenienteval(\''+newval+'\')"';
655: }
656:
1.68 raeburn 657: function callintervalpmodval() {
1.70 raeburn 658: return 'onclick="parent.intcalc();parent.toggleSecret()"';
1.79 raeburn 659: }
1.68 raeburn 660:
1.2 www 661: function intervaldis() {
662: csecs=svalue;
663: cdays=Math.floor(csecs/86400);
664: csecs-=cdays*86400;
665: chours=Math.floor(csecs/3600);
666: csecs-=chours*3600;
667: cmins=Math.floor(csecs/60);
668: csecs-=cmins*60;
1.69 musolffc 669: return cdays+' days '+chours+' hours '+cmins+' mins '+csecs+' secs';
1.2 www 670: }
1.21 www 671:
672: function pickcolor(picked) {
673: svalue=picked;
674: draw();
675: }
676:
677: function colorfield(ir,ig,ib) {
678: var col=new Array;
1.23 www 679: col=["00","11","22","44","66","88","AA","CC","DD","EE","FF"];
1.21 www 680: var color='#'+col[ir]+col[ig]+col[ib];
1.23 www 681: var selection="<font color='"+color+"'>X</font>";
682: if (color==svalue) { selection="<font color='#"+col[10-ir]+col[10-ig]+col[10-ib]+"'>X</font>"; }
1.21 www 683: choicewrite('<td bgcolor="'+color+'"><a href="javascript:parent.pickcolor('+"'"+
684: color+"'"+')">'+selection+'</a></td>');
1.80 raeburn 685: }
1.21 www 686:
1.1 www 687: function draw() {
688: choicestart();
1.51 bisitz 689: choicewrite('<form name="sch"');
1.6 www 690: if (ptype=='int') {
691: choicewrite(' action="javascript:integereval();"');
692: }
693: if (ptype=='float') {
694: choicewrite(' action="javascript:floateval();"');
695: }
696: if (ptype=='string') {
1.73 raeburn 697: if (pscat == 'ip') {
698: choicewrite(' action="javascript:ipstringeval();"');
699: } else {
700: choicewrite(' action="javascript:stringeval();"');
701: }
1.6 www 702: }
1.62 raeburn 703: if (ptype != 'int' && ptype != 'float' && ptype != 'string') {
704: choicewrite(' action=""');
705: }
1.6 www 706: choicewrite('>');
1.1 www 707: if (ptype=='tolerance') {
1.2 www 708: // 0: pscat
709: if (pscat=='default') {
1.1 www 710: tablestart('Use default value or algorithm of resource');
711: }
1.2 www 712: if (pscat=='relative_sym') {
1.1 www 713: // 2: percentage
714: // 3: open
715: tablestart('Percentage error, symmetric around value');
716: valline('Percentage',2,3);
1.13 www 717: if ((svalue!='') && (typeof(svalue)!="undefined")) {
718: choices.document.forms.sch.val2.value=parseInt(svalue);
719: if (svalue.indexOf('+')!=-1) {
720: choices.document.forms.sch.val3.checked=true;
721: }
722: }
1.1 www 723: }
1.2 www 724: if (pscat=='relative') {
1.1 www 725: // 2: left
726: // 3: open
727: // 4: right
728: // 5: open
729: tablestart('Percentage error, asymmetric around value');
730: valline('Upper percentage',2,3);
731: valline('Lower percentage',4,5);
1.17 matthew 732: var range1=new Array;
1.13 www 733: if ((svalue!='') && (typeof(svalue)!="undefined")) {
1.17 matthew 734: range1=svalue.split(',');
735: if (typeof(range1[1])=='undefined') { range1[1]=range1[0]; }
736: choices.document.forms.sch.val2.value=parseFloat(range1[0]);
737: if (range1[0].indexOf('+')!=-1) {
1.13 www 738: choices.document.forms.sch.val3.checked=true;
739: }
1.17 matthew 740: choices.document.forms.sch.val4.value=parseFloat(range1[1]);
741: if (range1[1].indexOf('+')!=-1) {
1.13 www 742: choices.document.forms.sch.val5.checked=true;
743: }
744: }
1.1 www 745: }
1.2 www 746: if (pscat=='absolute_sym') {
1.1 www 747: tablestart('Absolute error, symmetric around value');
748: valline('Value',2,3);
1.13 www 749: if ((svalue!='') && (typeof(svalue)!="undefined")) {
1.15 www 750: choices.document.forms.sch.val2.value=parseFloat(svalue);
1.13 www 751: if (svalue.indexOf('+')!=-1) {
752: choices.document.forms.sch.val3.checked=true;
753: }
754: }
1.1 www 755: }
1.2 www 756: if (pscat=='absolute') {
1.1 www 757: tablestart('Absolute error, asymmetric around value');
758: valline('Upper value',2,3);
759: valline('Lower value',4,5);
1.17 matthew 760: var range2=new Array;
1.13 www 761: if ((svalue!='') && (typeof(svalue)!="undefined")) {
762: range=svalue.split(',');
1.17 matthew 763: if (typeof(range2[1])=='undefined') { range2[1]=range2[0]; }
764: choices.document.forms.sch.val2.value=parseFloat(range2[0]);
765: if (range2[0].indexOf('+')!=-1) {
1.13 www 766: choices.document.forms.sch.val3.checked=true;
767: }
1.17 matthew 768: choices.document.forms.sch.val4.value=parseFloat(range2[1]);
769: if (range2[1].indexOf('+')!=-1) {
1.13 www 770: choices.document.forms.sch.val5.checked=true;
771: }
772: }
1.1 www 773: }
774: }
775:
776: if (ptype=='date') {
1.2 www 777: if (pscat=='default') {
778: tablestart('Default value or none');
779: choicewrite('</table>');
780: } else {
781: if (pscat=='start') {
1.24 www 782: tablestart('Date and time');
1.2 www 783: }
784: if (pscat=='end') {
1.24 www 785: tablestart('Date and time');
1.2 www 786: }
787: if (pscat=='interval') {
1.70 raeburn 788: var proctorkeytype = 'hidden';
1.71 raeburn 789: var donebuttontext = 'none';
1.70 raeburn 790: if (pmodval == '_done_proctor') {
791: proctorkeytype = 'text';
1.71 raeburn 792: donebuttontext = 'block';
793: }
794: if (pmodval == '_done') {
795: donebuttontext = 'block';
1.70 raeburn 796: }
1.2 www 797: tablestart('Time interval');
1.69 musolffc 798: choicewrite( [
799: '<tr><td colspan="3">'+intervaldis()+'</td></tr>',
800: '<tr><td>Time:</td><td colspan="2">',
801: '<span style="white-space:nowrap">'+intday()+' days </span>',
802: '<span style="white-space:nowrap">'+inthour()+' hours</span>',
803: '<span style="white-space:nowrap">'+intminute()+' mins</span>',
804: '<span style="white-space:nowrap">'+intsecond()+' secs</span>',
805: '</td></tr>',
806: '</table>',
807: '<br />',
808: ].join("\n"));
1.68 raeburn 809: tablestart('Provide a "Done" button to students?');
810: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.70 raeburn 811: choicewrite('<label><input name="donebutton" value=""'+
812: ' type="radio" '+callintervalpmodval());
813: if (pmodval == '') { choicewrite(' checked="checked"'); }
814: choicewrite(' /> No</label><br />');
1.68 raeburn 815: choicewrite('<label><input name="donebutton" value="_done"'+
816: ' type="radio" '+callintervalpmodval());
1.70 raeburn 817: if (pmodval == '_done') { choicewrite(' checked="checked"'); }
1.68 raeburn 818: choicewrite(' /> Yes</label><br />');
1.70 raeburn 819: choicewrite('<span style="white-space:nowrap">'+
820: '<label><input name="donebutton" value="_done_proctor"'+
1.68 raeburn 821: ' type="radio" '+callintervalpmodval());
1.70 raeburn 822: if (pmodval == '_done_proctor') { choicewrite(' checked="checked"'); }
823: choicewrite(' /> Yes, with proctor key</label>');
824: choicewrite(' <input name="donebutton_proctorkey" value='+
825: '"'+escapeHTML(pextraval)+'" type="'+proctorkeytype+
1.71 raeburn 826: '" id="done_proctorkey" size="10"'+
827: ' onblur="parent.intcalc();" /></span><br />'+
828: '<div id="donebuttontextdiv" style="display:'+donebuttontext+'">'+
829: '<br /><span style="white-space:nowrap">'+
830: 'Button text:'+
831: '<input name="donebutton_text" value='+
832: '"'+escapeHTML(pextravaltwo)+'" type="text" '+
833: 'size="10" onblur="parent.intcalc();" /></span></div>');
1.68 raeburn 834: choicewrite('</td></tr></table>');
835: } else {
1.52 bisitz 836: choicewrite('<tr><td colspan="3">'
1.2 www 837: +cdate.toString()+
1.52 bisitz 838: '</td></tr><tr><td>Date:</td><td colspan="2">');
1.2 www 839: month();date();year();
1.52 bisitz 840: choicewrite('</td></tr><tr><td>Time:'
1.51 bisitz 841: +'</td><td colspan="2">');hour();choicewrite('h ');minute();
1.2 www 842: choicewrite('m ');second();
843: choicewrite('s</td></tr></table>');
844: }
845: }
1.1 www 846: }
847:
1.6 www 848: if (ptype=='int') {
1.19 www 849: var pscatparts=new Array;
850: pscatparts=pscat.split(',');
851: pscat=pscatparts[0];
1.6 www 852: if (pscat=='default') {
853: tablestart('Default value or none');
1.14 www 854: choicewrite('</table>');
1.6 www 855: } else {
1.14 www 856: if (pscat=='range') {
857: tablestart('Integer range');
1.52 bisitz 858: choicewrite('<tr><td>Lower Value:'+
1.51 bisitz 859: '</td><td colspan="2"><input type="text" size="4" name="val2'+
1.53 bisitz 860: '" /></td></tr>');
1.52 bisitz 861: choicewrite('<tr><td>Upper Value:'+
1.51 bisitz 862: '</td><td colspan="2"><input type="text" size="4" name="val4'+
1.53 bisitz 863: '" /></td></tr></table>');
1.14 www 864: var range=new Array;
865: if ((svalue!='') && (typeof(svalue)!="undefined")) {
866: range=svalue.split(',');
867: if (typeof(range[1])=='undefined') { range[1]=range[0]; }
868: choices.document.forms.sch.val2.value=parseInt(range[0]);
869: choices.document.forms.sch.val4.value=parseInt(range[1]);
870: }
871: } else {
1.6 www 872: if (pscat=='pos') {
873: tablestart('Positive (non-zero) integer');
874: }
875: if (pscat=='zeropos') {
876: tablestart('Positive integer or zero');
877: }
1.12 www 878: if (pscat.indexOf('inrange')!=-1) {
1.10 www 879: var rangeparts=new Array;
1.12 www 880: rangeparts=split(',',pscat);
1.10 www 881: tablestart('Integer in the range ['+rangeparts[1]+']');
882: }
1.6 www 883: if (pscat=='any') {
884: tablestart('Integer');
885: }
1.52 bisitz 886: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.51 bisitz 887: choicewrite('<input name="intval" size="10" value="'+escapeHTML(svalue)+
1.53 bisitz 888: '" onchange="parent.integereval()" />');
1.54 bisitz 889: choicewrite('</td></tr></table>');
1.6 www 890: }
1.14 www 891: }
1.1 www 892: }
893:
1.6 www 894: if (ptype=='float') {
895: if (pscat=='default') {
896: tablestart('Default value or none');
1.79 raeburn 897: choicewrite('</table>');
1.6 www 898: } else {
899: if (pscat=='pos') {
900: tablestart('Positive floating point number or zero');
901: }
902: if (pscat=='zeroone') {
903: tablestart('Floating point number between zero and one');
904: }
905: if (pscat=='any') {
906: tablestart('Floating point number');
907: }
1.52 bisitz 908: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.51 bisitz 909: choicewrite('<input name="floatval" size="10" value="'+escapeHTML(svalue)+
1.53 bisitz 910: '" onchange="parent.floateval()" />');
1.54 bisitz 911: choicewrite('</td></tr></table>');
1.6 www 912: }
1.1 www 913: }
914:
1.6 www 915: if (ptype=='string') {
1.83 raeburn 916: if ((pscat=='any') || (pscat=='') || (pscat=='default') ||
1.42 albertel 917: (typeof(pscat)=='undefined')) {
1.6 www 918: tablestart('Text');
1.54 bisitz 919: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.46 albertel 920: choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
1.53 bisitz 921: '" type="text" onchange="parent.stringeval()" />');
1.25 www 922: }
923: if (pscat=='yesno') {
924: tablestart('Yes/No');
1.52 bisitz 925: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.32 albertel 926: choicewrite('<label><input name="stringval" value="yes"'+
1.29 www 927: ' type="radio" '+callradiostringeval('yes'));
1.53 bisitz 928: if (svalue=='yes') { choicewrite(' checked="checked"'); }
929: choicewrite(' /> Yes</label><br />');
1.32 albertel 930: choicewrite('<label><input name="stringval" value="no"'+
1.29 www 931: ' type="radio" '+callradiostringeval('no'));
1.53 bisitz 932: if (svalue=='no') { choicewrite(' checked="checked"'); }
933: choicewrite(' /> No</label><br />');
1.25 www 934: }
1.47 albertel 935: if (pscat=='problemstatus') {
936: tablestart('Problem Status');
1.52 bisitz 937: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.47 albertel 938: choicewrite('<label><input name="stringval" value="yes"'+
939: ' type="radio" '+callradiostringeval('yes'));
1.53 bisitz 940: if (svalue=='yes') { choicewrite(' checked="checked"'); }
941: choicewrite(' /> Yes</label><br />');
1.49 albertel 942: choicewrite('<label><input name="stringval" value="answer"'+
943: ' type="radio" '+callradiostringeval('answer'));
1.53 bisitz 944: if (svalue=='answer') { choicewrite(' checked="checked"'); }
945: choicewrite(' /> Yes, and show correct answer if they exceed the maximum number of tries.</label><br />');
1.47 albertel 946: choicewrite('<label><input name="stringval" value="no"'+
947: ' type="radio" '+callradiostringeval('no'));
1.53 bisitz 948: if (svalue=='no') { choicewrite(' checked="checked"'); }
949: choicewrite(' /> No, don\'t show correct/incorrect feedback.</label><br />');
1.47 albertel 950: choicewrite('<label><input name="stringval" value="no_feedback_ever"'+
951: ' type="radio" '+callradiostringeval('no_feedback_ever'));
1.53 bisitz 952: if (svalue=='no_feedback_ever') { choicewrite(' checked="checked"'); }
953: choicewrite(' /> No, show no feedback at all.</label><br />');
1.47 albertel 954: }
1.25 www 955: if (pscat=='examtype') {
956: tablestart('Exam Type');
1.52 bisitz 957: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.32 albertel 958: choicewrite('<label><input name="stringval" value="online"'+
1.29 www 959: ' type="radio" '+callradiostringeval('online'));
1.53 bisitz 960: if (svalue=='online') { choicewrite(' checked="checked"'); }
961: choicewrite(' /> Online</label><br />');
1.32 albertel 962: choicewrite('<label><input name="stringval" value="checkout"'+
1.29 www 963: ' type="radio" '+callradiostringeval('checkout'));
1.53 bisitz 964: if (svalue=='checkout') { choicewrite(' checked="checked"'); }
965: choicewrite(' /> Check out</label><br />');
1.25 www 966: }
967: if (pscat=='questiontype') {
968: tablestart('Question Type');
1.52 bisitz 969: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.32 albertel 970: choicewrite('<label><input name="stringval" value="problem"'+
1.29 www 971: ' type="radio" '+callradiostringeval('problem'));
1.53 bisitz 972: if (svalue=='problem') { choicewrite(' checked="checked"'); }
973: choicewrite(' /> Standard Problem</label><br />');
1.36 albertel 974: // choicewrite('<label><input name="stringval" value="quiz"'+
975: // ' type="radio" '+callradiostringeval('quiz'));
1.53 bisitz 976: // if (svalue=='quiz') { choicewrite(' checked="checked"'); }
977: // choicewrite(' /> Quiz</label><br />');
1.35 albertel 978: choicewrite('<label><input name="stringval" value="practice"'+
979: ' type="radio" '+callradiostringeval('practice'));
1.53 bisitz 980: if (svalue=='practice') { choicewrite(' checked="checked"'); }
981: choicewrite(' /> Practice</label><br />');
1.32 albertel 982: choicewrite('<label><input name="stringval" value="exam"'+
1.29 www 983: ' type="radio" '+callradiostringeval('exam'));
1.53 bisitz 984: if (svalue=='exam') { choicewrite(' checked="checked"'); }
1.65 bisitz 985: choicewrite(' /> Bubblesheet Exam</label><br />');
1.36 albertel 986: // choicewrite('<label><input name="stringval" value="assess"'+
987: // ' type="radio" '+callradiostringeval('assess'));
1.53 bisitz 988: // if (svalue=='assess') { choicewrite(' checked="checked"'); }
989: // choicewrite(' /> Assessment</label><br />');
1.32 albertel 990: choicewrite('<label><input name="stringval" value="survey"'+
1.29 www 991: ' type="radio" '+callradiostringeval('survey'));
1.53 bisitz 992: if (svalue=='survey') { choicewrite(' checked="checked"'); }
993: choicewrite(' /> Survey</label><br />');
1.36 albertel 994: // choicewrite('<label><input name="stringval" value="form"'+
995: // ' type="radio" '+callradiostringeval('form'));
1.53 bisitz 996: // if (svalue=='form') { choicewrite(' checked="checked"'); }
1.36 albertel 997: // choicewrite('> Input Form</label><br />');
1.57 raeburn 998: choicewrite('<label><input name="stringval" value="surveycred"'+
999: ' type="radio" '+callradiostringeval('surveycred'));
1000: if (svalue=='surveycred') { choicewrite(' checked="checked"'); }
1001: choicewrite('> Survey (credit for submission)</label><br />');
1002: choicewrite('<label><input name="stringval" value="anonsurvey"'+
1003: ' type="radio" '+callradiostringeval('anonsurvey'));
1004: if (svalue=='anonsurvey') { choicewrite(' checked="checked"'); }
1005: choicewrite('> Anonymous Survey</label><br />');
1006: choicewrite('<label><input name="stringval" value="anonsurveycred"'+
1007: ' type="radio" '+callradiostringeval('anonsurveycred'));
1008: if (svalue=='anonsurveycred') { choicewrite(' checked="checked"'); }
1009: choicewrite('> Anonymous Survey (credit for submission)</label><br />');
1.59 raeburn 1010: choicewrite('<label><input name="stringval" value="randomizetry"'+
1011: ' type="radio" '+callradiostringeval('randomizetry'));
1012: if (svalue=='randomizetry') { choicewrite(' checked="checked"'); }
1013: choicewrite('> New Randomization Each N Tries (default N=1)</label><br />');
1.32 albertel 1014: choicewrite('<label><input name="stringval" value="library"'+
1.29 www 1015: ' type="radio" '+callradiostringeval('library'));
1.53 bisitz 1016: if (svalue=='library') { choicewrite(' checked="checked"'); }
1017: choicewrite(' /> Library</label><br />');
1.25 www 1018: }
1.60 raeburn 1019: if (pscat=='lenient') {
1.72 raeburn 1020: var patternLenientStd = /^(yes|no|default)$/;
1021: var patternLenientRel = /^([\-\d\.]+)\,([\-\d\.]+)\,([\-\d\.]+)\,([\-\d\.]+)$/;
1022: var lenientweighted = 'none';
1023: var relatives = new Array;
1.60 raeburn 1024: tablestart('Lenient Grading (Partial Credit)');
1025: choicewrite('<tr><td>Value:</td><td colspan="2">');
1026: choicewrite('<label><input name="stringval" value="yes"'+
1.72 raeburn 1027: ' type="radio" '+calllenientradioeval('yes'));
1.60 raeburn 1028: if (svalue=='yes') { choicewrite(' checked="checked"'); }
1029: choicewrite(' /> Yes</label><br />');
1030: choicewrite('<label><input name="stringval" value="no"'+
1.72 raeburn 1031: ' type="radio" '+calllenientradioeval('no'));
1.60 raeburn 1032: if (svalue=='no') { choicewrite(' checked="checked"'); }
1033: choicewrite(' /> No</label><br />');
1034: choicewrite('<label><input name="stringval" value="default"'+
1.72 raeburn 1035: ' type="radio" '+calllenientradioeval('default'));
1.60 raeburn 1036: if (svalue=='default') { choicewrite(' checked="checked"'); }
1037: choicewrite(' /> Default (only bubblesheet grading is lenient)</label><br />');
1.72 raeburn 1038: choicewrite('<label><input name="stringval" value="weighted"'+
1039: ' type="radio" '+calllenientradioeval('weighted'));
1040: if (!patternLenientStd.test(svalue) && svalue != '') {
1041: choicewrite(' checked="checked"');
1042: lenientweighted='block';
1043: var relatives = svalue.match(patternLenientRel);
1044: }
1045: choicewrite(' />Yes, weighted (optionresponse in checkbox mode)</label><br /><br />'+
1046: '<div id="lenientweighteddiv" style="display:'+lenientweighted+'">'+
1047: '<table class="LC_parmsel_table"><tr bgcolor="#C5DB99">'+
1048: '<th colspan="2">Foil submission status</th><th>Points</th></tr>');
1049: var lenienttypes = ['Correct (checked)','Correct (unchecked)','Incorrect (checked)','Incorrect (unchecked)'];
1050: for (var i=0; i<lenienttypes.length; i++) {
1051: var j = i+1;
1052: if (relatives[j] == '') {
1053: if (i < 2) {
1054: relatives[j] = '1.0';
1055: } else {
1056: relatives[j] = '0.0';
1057: }
1058: }
1059: choicewrite('<tr><td colspan="2">'+lenienttypes[i]+'</td>'+
1060: '<td><input type="text" name="lenientrelwt" value="'+relatives[j]+'"'+
1061: ' size="3" onblur="parent.lenienteval(\'weighted\')" /></td></tr>');
1062: }
1063: choicewrite('</table></div>');
1.60 raeburn 1064: }
1.64 raeburn 1065: if (pscat=='discussvote') {
1066: tablestart('Discussion Voting');
1067: choicewrite('<tr><td>Value:</td><td colspan="2">');
1068: choicewrite('<label><input name="stringval" value="yes"'+
1069: ' type="radio" '+callradiostringeval('yes'));
1070: if (svalue=='yes') { choicewrite(' checked="checked"'); }
1071: choicewrite(' /> Yes</label><br />');
1072: choicewrite('<label><input name="stringval" value="notended"'+
1073: ' type="radio" '+callradiostringeval('notended'));
1074: if (svalue=='notended') { choicewrite(' checked="checked"'); }
1075: choicewrite(' /> Yes, unless discussion ended</label><br />');
1076: choicewrite('<label><input name="stringval" value="no"'+
1077: ' type="radio" '+callradiostringeval('no'));
1078: if (svalue=='no') { choicewrite(' checked="checked"'); }
1079: choicewrite(' /> No</label><br />');
1080: }
1.25 www 1081: if (pscat=='ip') {
1.83 raeburn 1082: var currallow = new Array;
1.73 raeburn 1083: var currdeny = new Array;
1084: if ((svalue != '') && (svalue != null)) {
1085: var patternComma = /,/;
1086: var patternAllow = /^([\[\]a-zA-Z\.\d\*\-]+)$/;
1087: var patternDeny = /^\!([\[\]a-zA-Z\.\d\*\-]+)$/;
1088: var current = new Array;
1.83 raeburn 1089: if (patternComma.test(svalue)) {
1.73 raeburn 1090: current = svalue.split(',');
1091: } else {
1.81 raeburn 1092: current = [svalue];
1.73 raeburn 1093: }
1094: for (var i=0; i<current.length; i++) {
1095: if (patternDeny.test(current[i])) {
1096: var denied = current[i].replace(/^!/,'');
1097: currdeny.push(denied);
1098: } else {
1099: if (patternAllow.test(current[i])) {
1100: currallow.push(current[i]);
1.83 raeburn 1101: }
1.73 raeburn 1102: }
1103: }
1104: }
1105: if (currdeny.length == 0) {
1106: currdeny = ('');
1107: }
1108: if (currallow.length == 0) {
1109: currallow = ('');
1110: }
1111: var curripaccess = [currallow,currdeny];
1112: tablestart('IP Number/Name');
1113: choicewrite('<tr><th>Allow from</th><th>Deny from</th></tr><tr>');
1114: var acctypes = ['allow','deny'];
1115: for (var i=0; i<acctypes.length; i++) {
1116: choicewrite('<td valign="top">'+
1117: '<div class="LC_string_ipacc_wrap" id="LC_string_ipacc_'+acctypes[i]+'">'+
1118: '<div class="LC_string_ipacc_inner" id="LC_string_ipacc_inner_'+acctypes[i]+'">');
1119: for (var j=0; j<curripaccess[i].length; j++) {
1120: choicewrite('<div><input type="text" size="10" name="setip'+acctypes[i]+'" value="'+curripaccess[i][j]+'" onblur="parent.ipstringeval();" />');
1.74 raeburn 1121: choicewrite('<a href="#" onclick="parent.removeIpRule(\''+acctypes[i]+'\',\''+j+'\')">Remove</a>');
1.73 raeburn 1122: choicewrite('</div>');
1123: }
1.74 raeburn 1124: choicewrite('</div><button onclick="parent.addIpRule(\''+acctypes[i]+'\');">Add item</button>');
1.73 raeburn 1125: }
1126: choicewrite('</div></td></tr></table>');
1.6 www 1127: }
1.26 www 1128: if (pscat=='fileext') {
1129: tablestart('Allowed File Extensions');
1.52 bisitz 1130: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.32 albertel 1131: choicewrite('<label><input name="radstringval" value="txt"'+
1.29 www 1132: ' type="radio" '+callradiostringeval('txt'));
1.53 bisitz 1133: if (svalue=='txt') { choicewrite(' checked="checked"'); }
1134: choicewrite(' /> Plain Text</label><br />');
1.32 albertel 1135: choicewrite('<label><input name="radstringval" value="png,jpg,jpeg,gif"'+
1.29 www 1136: ' type="radio" '+callradiostringeval('png,jpg,jpeg,gif'));
1.53 bisitz 1137: if (svalue=='png,jpg,jpeg,gif') { choicewrite(' checked="checked"'); }
1138: choicewrite(' /> Picture File</label><br />');
1.58 raeburn 1139: choicewrite('<label><input name="radstringval" value="doc,docx,xls,xlsx,ppt,pptx"'+
1140: ' type="radio" '+callradiostringeval('doc,docx,xls,xlsx,ppt,pptx'));
1141: if (svalue=='doc,docx,xls,xlsx,ppt,pptx') { choicewrite(' checked="checked"'); }
1.53 bisitz 1142: if (svalue=='doc,xls,ppt') { choicewrite(' checked="checked"'); }
1143: choicewrite(' /> Office Document</label><br />');
1.46 albertel 1144: choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
1.53 bisitz 1145: '" onchange="parent.stringeval()" />');
1.26 www 1146: }
1.37 albertel 1147: if (pscat=='useslots') {
1148: tablestart('Slots control access');
1.52 bisitz 1149: choicewrite('<tr><td>Value:</td><td colspan="2">');
1.37 albertel 1150: choicewrite('<label><input name="stringval" value="no"'+
1151: ' type="radio" '+callradiostringeval('no'));
1.53 bisitz 1152: if (svalue=='no') { choicewrite(' checked="checked"'); }
1153: choicewrite(' /> No</label><br />');
1.37 albertel 1154: choicewrite('<label><input name="stringval" value="resource"'+
1155: ' type="radio" '+callradiostringeval('resource'));
1.53 bisitz 1156: if (svalue=='resource') { choicewrite(' checked="checked"'); }
1.82 raeburn 1157: choicewrite(' /> Yes, and the scope of the slot is a single resource.</label><br />');
1.38 albertel 1158: choicewrite('<label><input name="stringval" value="map"'+
1159: ' type="radio" '+callradiostringeval('map'));
1.53 bisitz 1160: if (svalue=='map') { choicewrite(' checked="checked"'); }
1.82 raeburn 1161: choicewrite(' /> Yes, and the scope of the slot is the enclosing map/folder. When checking in, it applies to only one resource.</label><br />');
1.39 albertel 1162: choicewrite('<label><input name="stringval" value="map_map"'+
1.40 albertel 1163: ' type="radio" '+callradiostringeval('map_map'));
1.53 bisitz 1164: if (svalue=='map_map') { choicewrite(' checked="checked"'); }
1.82 raeburn 1165: 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 />');
1.79 raeburn 1166: choicewrite('</td></tr></table>');
1.80 raeburn 1167: }
1168: if (pscat=='deeplink') {
1169: var deeplinkvals = new Array();
1170: var linktypeparts = new Array();
1171: var ltikeyRegExp = /^(lti|key):(\w+)$/;
1172: var dlinkkeysty = 'hidden';
1.84 raeburn 1173: var dlinkkeyval = '';
1.80 raeburn 1174: var dlinkltidivsty = 'none';
1.84 raeburn 1175: var dlinkmenusdivsty = 'none';
1.80 raeburn 1176: if ((svalue != '') && (svalue != null)) {
1177: deeplinkvals = svalue.split(',');
1178: if (ltikeyRegExp.test(deeplinkvals[2])) {
1179: linktypeparts = deeplinkvals[2].split(':');
1180: deeplinkvals[2] = linktypeparts[0];
1181: if (linktypeparts[0] == 'key') {
1182: dlinkkeysty = 'text';
1183: dlinkkeyval = linktypeparts[1];
1184: } else if (linktypeparts[0] == 'lti') {
1.84 raeburn 1185: dlinkltidivsty = 'block';
1.80 raeburn 1186: }
1187: }
1.84 raeburn 1188: if (deeplinkvals[3] >= 1) {
1189: dlinkmenusdivsty = 'inline-block';
1190: }
1.80 raeburn 1191: } else {
1.84 raeburn 1192: deeplinkvals = ['full','res','any','0'];
1.80 raeburn 1193: }
1194: var deeplinklisting = new Array();
1195: deeplinklisting = ['full','absent','grades','details','datestatus'];
1196: var deeplinklisttxt = new Array();
1197: deeplinklisttxt = ['Listed (linked) in both','Not listed','Listed in grades only','Listed (unlinked) in both','Listed (unlinked) inc. status in both'];
1198: var deeplinkscopes = new Array();
1199: deeplinkscopes = ['res','map','rec'];
1200: var deeplinkscopetxt = new Array();
1201: deeplinkscopetxt = ['resource only','enclosing map/folder','recursive map/folder'];
1202: var deeplinkurls = new Array();
1203: deeplinkurls = ['any','only','key','lti'];
1.78 raeburn 1204: tablestart('Deep-linked items');
1.84 raeburn 1205: choicewrite('<tr><td>In Contents + Gradebook?</td><td>');
1.80 raeburn 1206: choicewrite('<select name="deeplinklisted">');
1207: for (var i=0; i<deeplinklisting.length; i++) {
1208: choicewrite('<option value="'+deeplinklisting[i]+'"');
1209: if (deeplinkvals[0] == deeplinklisting[i]) {
1210: choicewrite(' selected="selected"');
1211: }
1212: choicewrite('>'+deeplinklisttxt[i]+'</option>');
1213: }
1214: choicewrite('</select></td></tr>');
1215: choicewrite('<tr><td>Access scope via deep-link</td><td>');
1216: choicewrite('<select name="deeplinkacc">');
1217: for (var i=0; i<deeplinkscopes.length; i++) {
1218: choicewrite('<option value="'+deeplinkscopes[i]+'"');
1219: if (deeplinkvals[1] == deeplinkscopes[i]) {
1220: choicewrite(' selected="selected"');
1221: }
1222: choicewrite('>'+deeplinkscopetxt[i]+'</option>');
1223: }
1224: choicewrite('</select></td></tr>');
1225: choicewrite('<tr><td>Supported Link Types</td><td>');
1226: choicewrite('<span style="white-space: nowrap;"><label>');
1227: choicewrite('<input name="deeplinktypes" value="any"'+
1.84 raeburn 1228: ' type="radio" '+calldeeplink('types'));
1.80 raeburn 1229: if (deeplinkvals[2]=='any') { choicewrite(' checked="checked"'); }
1230: choicewrite(' /> regular + deep</label></span><br />');
1231: choicewrite('<span style="white-space: nowrap;"><label>');
1232: choicewrite('<input name="deeplinktypes" value="only"'+
1.84 raeburn 1233: ' type="radio" '+calldeeplink('types'));
1.80 raeburn 1234: if (deeplinkvals[2]=='only') { choicewrite(' checked="checked"'); }
1235: choicewrite(' /> deep only</label></span><br />');
1236: choicewrite('<span style="white-space: nowrap;"><label>');
1237: choicewrite('<input name="deeplinktypes" value="key"'+
1.84 raeburn 1238: ' type="radio" '+calldeeplink('types'));
1.80 raeburn 1239: if (deeplinkvals[2]=='key') { choicewrite(' checked="checked"'); }
1240: choicewrite(' /> deep with key</label>');
1.84 raeburn 1241: choicewrite('<input type="'+dlinkkeysty+'" name="deeplinkkey" id="deeplinkkey" value="'+dlinkkeyval+'" size="10" />');
1.80 raeburn 1242: choicewrite('</span><br />');
1.84 raeburn 1243:
1244: var possmenus = new Array();
1.80 raeburn 1245: if ((pextra != '') && (pextra != null)) {
1246: var ltiRegExp = /^lti_/;
1.84 raeburn 1247: var menusRegExp = /^menus_/;
1248: var extras = pextra.split('&');
1249: for (var i=0; i<extras.length; i++) {
1250: if (ltiRegExp.test(extras[i])) {
1251: extras[i] = extras[i].replace(ltiRegExp,'');
1252: var posslti = extras[i].split(',');
1253: if (posslti.length >= 1) {
1254: var ltinums = new Array();
1255: var ltititles = new Array();
1256: for (var j=0; j<posslti.length; j++) {
1257: var entries = posslti[j].split(':');
1258: ltinums[j] = entries[0];
1259: ltititles[j] = decodeURIComponent(entries[1]);
1.80 raeburn 1260: }
1.84 raeburn 1261: if (ltinums.length) {
1262: choicewrite('<span style="white-space: nowrap;"><label>');
1263: choicewrite('<input name="deeplinktypes" value="lti"'+
1264: ' type="radio" '+calldeeplink('types'));
1265: if (deeplinkvals[2]=='lti') { choicewrite(' checked="checked"'); }
1266: choicewrite(' /> deep with LTI launch</label>');
1267: choicewrite('<div id="deeplinkltidiv" style="display:'+dlinkltidivsty+'">');
1268: choicewrite('<select name="linkposslti">');
1269: var sel='';
1270: if (deeplinkvals[2]!='lti') {
1271: sel = ' selected="selected"';
1272: }
1273: if (ltinums.length > 1) {
1274: choicewrite('<option value=""'+sel+'>Select</option>');
1275: }
1276: for (var j=0; j<ltinums.length; j++) {
1277: sel = '';
1278: if (deeplinkvals[2]=='lti') {
1279: if (linktypeparts.length) {
1280: if (ltinums[j] == linktypeparts[1]) {
1281: sel = ' selected="selected"';
1282: }
1.80 raeburn 1283: }
1284: }
1.84 raeburn 1285: choicewrite('<option value="'+ltinums[j]+'"'+sel+'>'+ltititles[j]+'</option>');
1.80 raeburn 1286: }
1.84 raeburn 1287: choicewrite('</select></div></span><br />');
1.80 raeburn 1288: }
1289: }
1.84 raeburn 1290: } else if (menusRegExp.test(extras[i])) {
1291: extras[i] = extras[i].replace(menusRegExp,'');
1292: possmenus = extras[i].split(',');
1.80 raeburn 1293: }
1294: }
1295: }
1.84 raeburn 1296: choicewrite('<tr><td>Menu Items Displayed</td><td>');
1297: choicewrite('<span style="white-space: nowrap;"><label>');
1298: choicewrite('<input name="deeplinkmenus" value="std"'+
1299: ' type="radio" '+calldeeplink('menus'));
1300: if (deeplinkvals[3] == 0) {
1301: choicewrite(' checked="checked"');
1302: }
1303: choicewrite(' /> Standard (all menus)</label></span><br />');
1304: if (possmenus.length >= 1) {
1305: choicewrite('<span style="white-space: nowrap;"><label>');
1306: choicewrite('<input name="deeplinkmenus" value="collnum"'+
1307: ' type="radio" '+calldeeplink('menus'));
1308: if (deeplinkvals[3] > 0) { choicewrite(' checked="checked"'); }
1309: choicewrite(' /> Numbered collection</label>');
1310: choicewrite('<div id="deeplinkmenusdiv" style="display:'+dlinkmenusdivsty+'">');
1311: choicewrite('<select name="linkpossmenu">');
1312: var sel='';
1313: if (deeplinkvals[3] == 0) {
1314: sel = ' selected="selected"';
1315: }
1316: if (possmenus.length > 1) {
1317: choicewrite('<option value=""'+sel+'>Select</option>');
1318: }
1319: for (var i=0; i<possmenus.length; i++) {
1320: sel = '';
1321: if (deeplinkvals[3] == possmenus[i]) {
1322: sel = ' selected="selected"';
1323: }
1324: choicewrite('<option value="'+possmenus[i]+'"'+sel+'>'+possmenus[i]+'</option>');
1325: }
1326: choicewrite('</select></div></span><br />');
1327: }
1.78 raeburn 1328: choicewrite('</td></tr></table>');
1.80 raeburn 1329: }
1.21 www 1330: }
1.79 raeburn 1331:
1.21 www 1332: if (ptype=='color') {
1333: tablestart('Choose a Color');
1334: choicewrite('<table>');
1335: if (svalue) {
1.23 www 1336: choicewrite('<tr><td colspan="9">Current choice:</td><td bgcolor="'+
1.46 albertel 1337: escapeHTML(svalue)+'" colspan="2"> </td></tr>');
1.21 www 1338: }
1.23 www 1339: for (var ir=0; ir<=10; ir++) {
1340: for (var ig=0; ig<=10; ig++) {
1.21 www 1341: choicewrite('<tr>');
1.23 www 1342: for (var ib=0; ib<=10; ib++) {
1.21 www 1343: colorfield(ir,ig,ib);
1344: }
1345: choicewrite('</tr>');
1.79 raeburn 1346: }
1.21 www 1347: }
1348: choicewrite('</table></td></table>');
1.1 www 1349: }
1350:
1.40 albertel 1351: choicewrite('</form>');
1.1 www 1352: choiceend();
1353: }
1354:
1355: function sopt(va,text) {
1356: selwrite('<option value="'+va+'"');
1.2 www 1357: if (va==pscat) {
1.54 bisitz 1358: selwrite(' selected="selected"');
1.1 www 1359: }
1360: selwrite('>'+text+'</option>');
1361: }
1362:
1363: function catchange() {
1364: var sform=selector.document.forms.fsel.fcat;
1.2 www 1365: pscat=sform.options[sform.selectedIndex].value;
1.1 www 1366: draw();
1367: }
1368:
1.76 raeburn 1369: function recursechange() {
1370: var rform=selector.document.forms.frec;
1371: var count = rform.recurse.length;
1372: if (count > 0) {
1373: for (var i=0; i<count; i++) {
1374: if (rform.recurse[i].checked) {
1375: var colnum = pnonreccol;
1376: if (rform.recurse[i].value == 1) {
1377: colnum++;
1378: }
1.79 raeburn 1379: pmarker = pmarkerst+'_'+pparm+'&'+colnum;
1.76 raeburn 1380: }
1381: }
1382: }
1383: }
1384:
1.1 www 1385: function assemble() {
1.2 www 1386: if ((ptype=='date') && (pscat!='interval')) {
1.41 www 1387: svalue=Math.floor(cdate.getTime()/1000);
1.2 www 1388: }
1.12 www 1389: if (ptype=='tolerance') {
1390: if (pscat=='relative_sym') {
1391: svalue=choices.document.forms.sch.val2.value+'%';
1392: if (choices.document.forms.sch.val3.checked) {
1393: svalue+='+';
1394: }
1395: }
1396: if (pscat=='absolute_sym') {
1397: svalue=choices.document.forms.sch.val2.value;
1398: if (choices.document.forms.sch.val3.checked) {
1399: svalue+='+';
1400: }
1401: }
1402: if (pscat=='absolute') {
1403: svalue=choices.document.forms.sch.val2.value;
1404: if (choices.document.forms.sch.val3.checked) {
1405: svalue+='+';
1406: }
1407: svalue+=','+choices.document.forms.sch.val4.value;
1408: if (choices.document.forms.sch.val5.checked) {
1409: svalue+='+';
1410: }
1411: }
1412: if (pscat=='relative') {
1413: svalue=choices.document.forms.sch.val2.value+'%';
1414: if (choices.document.forms.sch.val3.checked) {
1415: svalue+='+';
1416: }
1417: svalue+=','+choices.document.forms.sch.val4.value+'%';
1418: if (choices.document.forms.sch.val5.checked) {
1419: svalue+='+';
1420: }
1421: }
1.14 www 1422: }
1423: if ((ptype=='int') && (pscat=='range')) {
1424: svalue=choices.document.forms.sch.val2.value+','+
1425: choices.document.forms.sch.val4.value;
1.12 www 1426: }
1.6 www 1427: if (pscat=='default') { svalue=''; }
1.2 www 1428: stype=ptype+'_'+pscat;
1.1 www 1429: }
1430:
1431:
1432: function init() {
1433: var i;
1.2 www 1434: var subs=new Array();
1.71 raeburn 1435: var doneRegExp = /_done(|\:[^\:]+\:)/;
1436: var doneproctorRegExp = /_done(|\:[^\:]+\:)_proctor/;
1.70 raeburn 1437: var proctorkeyRegExp = /^(\d+)_(.+)$/;
1.71 raeburn 1438: var donetextRegExp = /\:([^\:]+)\:/;
1.79 raeburn 1439: var markerRegExp = /^(.+)_([A-Za-z0-9]+)\&(\d+)$/;
1.1 www 1440: var namevalue=this.window.location.search.split('&');
1441: namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1);
1442:
1443: for (i=0;i<namevalue.length;i++) {
1444: var pair=namevalue[i].split('=');
1.3 www 1445: pair[1]=unescape(pair[1]);
1.1 www 1446: if (pair[0]=='value') { pvalue=pair[1]; }
1.2 www 1447: if (pair[0]=='type') { subs=pair[1].split('_');
1448: ptype=subs[0];
1449: pscat=subs[1];
1.79 raeburn 1450: if (typeof(subs[2])!="undefined") {
1451: pscat+='_'+subs[2];
1.11 www 1452: }
1.79 raeburn 1453: if ((pscat=='') || (typeof(pscat)=="undefined")) {
1.6 www 1454: pscat='default';
1455: }
1.2 www 1456: }
1.1 www 1457: if (pair[0]=='return') { preturn=pair[1]; }
1458: if (pair[0]=='call') { pcode=pair[1]; }
1.2 www 1459: if (pair[0]=='marker') { pmarker=pair[1]; }
1.1 www 1460: if (pair[0]=='name') { pname=pair[1]; }
1.63 www 1461: if (pair[0]=='modal') { pmodal=pair[1]; }
1.34 albertel 1462: if (pair[0]=='defhour' && pair[1] >= 0 && pair[1] < 24 ) {
1463: defhour=pair[1];
1464: }
1465: if (pair[0]=='defmin' && pair[1] >= 0 && pair[1] < 60) { defmin=pair[1]; }
1466: if (pair[0]=='defsec' && pair[1] >= 0 && pair[1] < 60) { defsec=pair[1]; }
1.80 raeburn 1467: if (pair[0]=='extra') { pextra=pair[1]; }
1.1 www 1468: }
1469:
1.79 raeburn 1470: var tablecol = '';
1.76 raeburn 1471: var ismap = '';
1472: if (markerRegExp.test(pmarker)) {
1473: var markerinfo = pmarker.match(markerRegExp);
1474: if (markerinfo.length == 4) {
1475: pmarkerst = markerinfo[1];
1476: pparm = markerinfo[2];
1.79 raeburn 1477: tablecol = markerinfo[3];
1.76 raeburn 1478: if (tablecol == 17 || tablecol == 16) {
1479: ismap = 1;
1480: if (tablecol == 17) {
1481: precursive = 1;
1482: }
1483: pnonreccol = 16;
1.79 raeburn 1484: } else if (tablecol == 11 || tablecol == 10) {
1.76 raeburn 1485: ismap = 1;
1486: if (tablecol == 11) {
1487: precursive = 1;
1488: }
1489: pnonreccol = 10;
1490: } else if (tablecol == 7 || tablecol == 6) {
1491: ismap = 1;
1492: if (tablecol == 7) {
1493: precursive = 1;
1494: }
1495: pnonreccol = 6;
1496: } else if (tablecol == 3 || tablecol == 2) {
1497: ismap = 1;
1498: if (tablecol == 3) {
1499: precursive = 1;
1500: }
1501: pnonreccol = 2;
1502: }
1503: }
1504: }
1.85 ! raeburn 1505: psmap = ismap;
1.76 raeburn 1506:
1507:
1.68 raeburn 1508: if (ptype=='date' && pscat == 'interval') {
1.70 raeburn 1509: if (doneproctorRegExp.test(pvalue)) {
1.71 raeburn 1510: var current = pvalue.match(doneproctorRegExp);
1511: if (current.length == 2) {
1512: var textstr = current[1];
1513: if (textstr != '') {
1514: var textvals = textstr.match(donetextRegExp);
1515: if (textvals.length == 2) {
1516: pextravaltwo = textvals[1];
1517: }
1518: }
1519: }
1.70 raeburn 1520: var intervalwithkey = pvalue.replace(doneproctorRegExp,'');
1521: if (proctorkeyRegExp.test(intervalwithkey)) {
1522: var currvals = intervalwithkey.match(proctorkeyRegExp);
1523: if (currvals.length == 3) {
1524: pvalue = currvals[1];
1525: pextraval = currvals[2];
1.71 raeburn 1526: pmodval = '_done_proctor';
1.70 raeburn 1527: } else {
1528: pmodval = '';
1529: }
1530: }
1531: } else {
1532: if (doneRegExp.test(pvalue)) {
1.79 raeburn 1533: var current = pvalue.match(doneRegExp);
1.71 raeburn 1534: if (current.length == 2) {
1535: var textstr = current[1];
1536: if (textstr != '') {
1537: var textvals = textstr.match(donetextRegExp);
1538: if (textvals.length == 2) {
1539: pextravaltwo = textvals[1];
1540: }
1541: }
1542: }
1.70 raeburn 1543: var pnumval = pvalue.replace(doneRegExp,'');
1.71 raeburn 1544: pmodval = '_done';
1.70 raeburn 1545: pvalue = pnumval;
1546: }
1.68 raeburn 1547: }
1548: }
1.1 www 1549: svalue=pvalue;
1.6 www 1550: if (((ptype=='float') || (ptype=='string') || (ptype=='int')) &&
1.79 raeburn 1551: (pscat=='default') &&
1552: (typeof(svalue)!="undefined") &&
1.11 www 1553: (svalue!=0) && (svalue!='')) { pscat='any'; }
1.1 www 1554:
1.13 www 1555: if (ptype=='tolerance') {
1556: var tperc=0;
1557: var trange=0;
1558: if (typeof(svalue)!='undefined') {
1559: if (svalue.indexOf('%')!=-1) { tperc=1; }
1560: if (svalue.indexOf(',')!=-1) { trange=1; }
1561: if (trange) {
1562: if (tperc) { pscat='relative'; } else { pscat='absolute'; }
1563: } else {
1564: if (tperc) { pscat='relative_sym'; } else { pscat='absolute_sym'; }
1565: }
1566: }
1567: }
1568:
1.61 raeburn 1569: this.window.selector.document.open();
1.62 raeburn 1570: selwrite('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
1571: selwrite('<html xmlns="http://www.w3.org/1999/xhtml">');
1.55 bisitz 1572: selwrite('<head>');
1.62 raeburn 1573: selwrite('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
1574: selwrite('<title>LON-CAPA</title>');
1.55 bisitz 1575: selwrite('<style type="text/css">');
1576: selwrite('<!--');
1577: selwrite('body {');
1578: selwrite('font-family: Verdana,Arial,Helvetica,sans-serif;');
1579: selwrite('line-height:130%;');
1580: selwrite('font-size:0.83em;');
1581: selwrite('background: #FFFFFF;');
1582: selwrite('}');
1583: selwrite('-->');
1584: selwrite('</style>');
1585: selwrite('</head>');
1.62 raeburn 1586: selwrite('<body>');
1587: selwrite('<form name="fsel" action=""><b>'+pname+'</b><br />');
1.66 bisitz 1588: selwrite('Format of Value(s): <select name="fcat" onchange="parent.catchange();">');
1.12 www 1589:
1.1 www 1590: if (ptype=='tolerance') {
1591: sopt('default','Default');
1592: sopt('relative_sym','Relative Tolerance, Symmetric (percent)');
1593: sopt('relative','Relative Tolerance (percentages)');
1594: sopt('absolute_sym','Absolute Tolerance, Symmetric (value)');
1595: sopt('absolute','Absolute Tolerance (values)');
1596: }
1597:
1598: if (ptype=='date') {
1.48 albertel 1599: if (pscat != 'interval') {
1600: sopt('default','Default');
1601: sopt('start','Starting Date');
1602: sopt('end','Ending Date');
1603: } else {
1604: sopt('interval','Time Interval');
1605: }
1606:
1.11 www 1607: if ((pvalue!='') && (typeof(pvalue)!="undefined")) {
1.2 www 1608: cdate.setTime(pvalue*1000);
1.30 www 1609: } else {
1.31 www 1610: cdate.setSeconds(defsec);
1611: cdate.setMinutes(defmin);
1612: cdate.setHours(defhour);
1.2 www 1613: }
1614:
1615: months[0]='January';
1616: months[1]='February';
1617: months[2]='March';
1618: months[3]='April';
1619: months[4]='May';
1620: months[5]='June';
1621: months[6]='July';
1622: months[7]='August';
1623: months[8]='September';
1624: months[9]='October';
1625: months[10]='November';
1626: months[11]='December';
1.1 www 1627: }
1.79 raeburn 1628:
1.6 www 1629: if (ptype=='int') {
1630: sopt('default','Default');
1631: sopt('pos','Positive Integer, Not Zero');
1632: sopt('zeropos','Positive Integer or Zero');
1.13 www 1633: sopt('inrange','Integer in Range');
1634: sopt('range','Range of Integers');
1.6 www 1635: sopt('any','Integer');
1.1 www 1636: }
1637:
1.6 www 1638: if (ptype=='float') {
1639: sopt('default','Default');
1640: sopt('zeroone','Floating Point between 0 and 1');
1641: sopt('pos','Positive Floating Point');
1642: sopt('any','Floating Point');
1.1 www 1643:
1644: }
1645:
1.6 www 1646: if (ptype=='string') {
1.44 albertel 1647: //sopt('default','Default');
1648: if (pscat == 'yesno') { sopt('yesno','Yes/No'); }
1.47 albertel 1649: else if (pscat == 'problemstatus'){ sopt('problemstatus','Problem Status'); }
1.45 albertel 1650: else if (pscat == 'examtype') { sopt('examtype','Exam Type'); }
1651: else if (pscat == 'questiontype') { sopt('questiontype','Question Type'); }
1.60 raeburn 1652: else if (pscat == 'lenient') { sopt('lenient','Lenient Grading (Partial Credit)'); }
1.64 raeburn 1653: else if (pscat == 'discussvote') { sopt('discussvote','Discussion Voting'); }
1.45 albertel 1654: else if (pscat == 'ip') { sopt('ip','IP Number/Name'); }
1655: else if (pscat == 'fileext') { sopt('fileext','File Extension'); }
1656: else if (pscat == 'useslots') { sopt('useslots','Slots control access'); }
1.78 raeburn 1657: else if (pscat == 'deeplink') { sopt('deeplink','Deep-linked items'); }
1.45 albertel 1658: else { pscat = 'any'; }
1.80 raeburn 1659: if (pscat != 'deeplink') { sopt('any','String Value'); }
1.22 www 1660: }
1661:
1662: if (ptype=='color') {
1663: sopt('default','Use Default Color');
1664: sopt('custom','Use Custom Color');
1.1 www 1665: }
1666:
1667: selwrite('</select></form>');
1.77 raeburn 1668: if (ismap == 1) {
1.76 raeburn 1669: if ((pparm != 'hiddenresource') && (pparm != 'encrypturl')) {
1670: selwrite('<form name="frec" action="">');
1671: selwrite('Recursive: <label><input type="radio" name="recurse" value="1" ');
1672: if (precursive == 1) {
1673: selwrite('checked="checked" ');
1674: }
1675: selwrite('onclick="parent.recursechange();" />Yes</label> ');
1676: selwrite('<label><input type="radio" name="recurse" value="0" ');
1677: if (precursive != 1) {
1678: selwrite('checked="checked" ');
1679: }
1.83 raeburn 1680: selwrite('onclick="parent.recursechange();" />No</label>');
1.76 raeburn 1681: selwrite('</form><br />');
1682: }
1683: }
1.63 www 1684: var targ='parent.opener';
1685: if (pmodal==1) {
1686: targ='parent.parent';
1.70 raeburn 1687: }
1688: if ((ptype=='date') && (pscat=='interval')) {
1689: selwrite('<a href="javascript:parent.validateInterval();');
1.80 raeburn 1690: } else if ((ptype=='string') && (pscat=='deeplink')) {
1691: selwrite('<a href="javascript:parent.validateDeepLink();');
1.70 raeburn 1692: } else {
1693: selwrite('<a href="javascript:parent.assemble();');
1694: }
1.1 www 1695: if (preturn!='') {
1.63 www 1696: selwrite(targ+'.document.'+preturn+'_value.value=parent.window.svalue;');
1697: selwrite(targ+'.document.'+preturn+'_type.value=parent.window.stype;');
1.2 www 1698: }
1699: if (pmarker!='') {
1.63 www 1700: selwrite(targ+'.document.'+preturn+'_marker.value=parent.window.pmarker;');
1.1 www 1701: }
1702: if (pcode!='') {
1.63 www 1703: selwrite(targ+'.'+pcode+'();');
1.1 www 1704: }
1.43 albertel 1705: selwrite('">Save</a> ');
1.5 www 1706:
1707: selwrite('<a href="javascript:');
1.63 www 1708: selwrite(targ+'.document.'+preturn+'_value.value='+"'';");
1.5 www 1709: if (pmarker!='') {
1710: selwrite(
1.63 www 1711: targ+'.document.'+preturn+'_marker.value=parent.window.pmarker;');
1.5 www 1712: }
1713: if (pcode!='') {
1.63 www 1714: selwrite(targ+'.'+pcode+'();');
1.5 www 1715: }
1716: selwrite('">Delete</a> ');
1.4 www 1717:
1.1 www 1718: selwrite('</body></html>');
1719: this.window.selector.document.close();
1.84 raeburn 1720: if (pscat == 'deeplink') {
1.85 ! raeburn 1721: if (psmap==1) {
! 1722: document.getElementById("LCparampopup").rows="100,*";
! 1723: } else {
! 1724: document.getElementById("LCparampopup").rows="60,*";
! 1725: }
1.84 raeburn 1726: }
1.2 www 1727: draw();
1.83 raeburn 1728:
1.1 www 1729: }
1730:
1.56 raeburn 1731: // ]]>
1.1 www 1732: </script>
1.56 raeburn 1733: </head>
1.1 www 1734:
1.84 raeburn 1735: <frameset id="LCparampopup" rows="125,*" onload="init();">
1.56 raeburn 1736: <frame name="selector" src="empty.html" />
1737: <frame name="choices" src="empty.html" />
1.1 www 1738: </frameset>
1739:
1740:
1741:
1.16 albertel 1742: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>