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