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