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