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