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