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