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