File:
[LON-CAPA] /
rat /
client /
parameter.html
Revision
1.71.2.2:
download - view:
text,
annotated -
select for diffs
Sat Mar 2 16:25:56 2019 UTC (5 years, 5 months ago) by
raeburn
Branches:
version_2_11_2_uiuc
Diff to branchpoint 1.71:
preferred,
unified
- For 2.11.2 (modified)
Use 2.12 feature: deny from specified IPs/Hosts as well as existing allow
from for (a) slots with IP access control, (b) Client IP/Name (acc) param.
Domain's configuration must be set to prohibit hosting of sessions for
for user's domains outside own domain, and modification must be in place
on all nodes in domain.
lonparmset.pm: 1.548 (part), 1.549 (part), 1.551, 1.589, 1.590, 1.591
loncommon.pm: 1.1219 (part)
parameter.html: 1.73, 1.74, 1.75
newslot.helper 1.34
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.71.2.2 2019/03/02 16:25:56 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 pmarker='';
49: var pmodal='';
50: var pname='';
51:
52: var defhour=0;
53: var defmin=0;
54: var defsec=0;
55:
56: var svalue;
57: var stype;
58: var smarker;
59:
60: var vars=new Array();
61:
62: var cdate=new Date();
63:
64: var csec;
65: var cmin;
66: var chour;
67: var cday;
68:
69: var months=new Array();
70:
71:
72: function selwrite(text) {
73: this.window.selector.document.write(text);
74: }
75:
76: function choicestart() {
77: this.window.choices.document.open();
78: choicewrite('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
79: choicewrite('<html xmlns="http://www.w3.org/1999/xhtml">');
80: choicewrite('<head>');
81: choicewrite('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
82: choicewrite('<title>LON-CAPA</title>');
83: choicewrite('<style type="text/css">');
84: choicewrite('<!--');
85: choicewrite('body {');
86: choicewrite('font-family: Verdana,Arial,Helvetica,sans-serif;');
87: choicewrite('line-height:130%;');
88: choicewrite('font-size:0.83em;');
89: choicewrite('background: #FFFFFF;');
90: choicewrite('}');
91: choicewrite('table.LC_parmsel_table {font-size: 90%;}');
92: choicewrite('table.LC_parmsel_table tr td { padding: 5px; border: 1px solid #C8C8C8;}');
93: choicewrite('-->');
94: choicewrite('</style>');
95: choicewrite('</head>');
96: choicewrite('<body>');
97: }
98:
99: function choiceend() {
100: choicewrite('</body></html>');
101: this.window.choices.document.close();
102: }
103:
104: function choicewrite(text) {
105: this.window.choices.document.write(text);
106: }
107:
108: function tablestart(headtext) {
109: choicewrite('<table class="LC_parmsel_table"><tr bgcolor="#C5DB99"><th colspan="3">'+
110: headtext+'</th></tr>');
111: }
112:
113: function valline(text,id1,id2) {
114: choicewrite('<tr><td>'+text+
115: '</td><td><input type="text" size="4" name="val'+
116: id1+'" /></td><td>incl:<input type="checkbox" name="val'+
117: id2+'" /></td></tr>');
118: }
119:
120: function escapeHTML(text) {
121: text = text.replace(/&/g, '&');
122: text = text.replace(/"/g, '"');
123: text = text.replace(/</g, '<');
124: text = text.replace(/>/g, '>');
125: return text;
126: }
127:
128: function datecalc() {
129: var sform=choices.document.forms.sch;
130:
131: cdate.setHours(sform.hours.options[sform.hours.selectedIndex].value);
132: cdate.setMinutes(sform.minutes.options[sform.minutes.selectedIndex].value);
133: cdate.setSeconds(sform.minutes.options[sform.seconds.selectedIndex].value);
134: cdate.setDate(sform.date.options[sform.date.selectedIndex].value);
135: cdate.setMonth(sform.month.options[sform.month.selectedIndex].value);
136: cdate.setFullYear(sform.year.options[sform.year.selectedIndex].value);
137:
138: draw();
139: }
140:
141: function hour() {
142: var thishour=cdate.getHours();
143: var i; var j;
144: choicewrite('<select name="hours" onchange="parent.datecalc();">');
145: for (i=0;i<=23;i++) {
146: choicewrite('<option value="'+i+'"');
147: if (i==thishour) {
148: choicewrite(' selected="selected"');
149: }
150: choicewrite('>');
151: if (i==12) { choicewrite('noon'); } else {
152: if (i==0) { choicewrite('midnight') } else {
153:
154: if (i<12) { choicewrite(i+' am'); } else {
155: j=i-12; choicewrite(j+' pm');
156: }
157:
158: }
159: }
160: choicewrite('</option>');
161: }
162: choicewrite('</select>');
163: }
164:
165: function minute() {
166: var thisminutes=cdate.getMinutes();
167: var i;
168: choicewrite('<select name="minutes" onchange="parent.datecalc();">');
169: for (i=0;i<=59;i++) {
170: choicewrite('<option value="'+i+'"');
171: if (i==thisminutes) {
172: choicewrite(' selected="selected"');
173: }
174: choicewrite('>'+i+'</option>');
175: }
176: choicewrite('</select>');
177: }
178:
179: function second() {
180: var thisseconds=cdate.getSeconds();
181: var i;
182: choicewrite('<select name="seconds" onchange="parent.datecalc();">');
183: for (i=0;i<=59;i++) {
184: choicewrite('<option value="'+i+'"');
185: if (i==thisseconds) {
186: choicewrite(' selected="selected"');
187: }
188: choicewrite('>'+i+'</option>');
189: }
190: choicewrite('</select>');
191: }
192:
193:
194: function date() {
195: var thisdate=cdate.getDate();
196: var i;
197: choicewrite('<select name="date" onchange="parent.datecalc();">');
198: for (i=1;i<=31;i++) {
199: choicewrite('<option value="'+i+'"');
200: if (i==thisdate) {
201: choicewrite(' selected="selected"');
202: }
203: choicewrite('>'+i+'</option>');
204: }
205: choicewrite('</select>');
206: }
207:
208: function year() {
209: var thisyear=cdate.getFullYear();
210: var nowdate=new Date();
211: var nowyear=nowdate.getFullYear();
212: if ( !thisyear ) { thisyear=nowyear; }
213: var loweryear=thisyear-2;
214: var upperyear=thisyear+5;
215: if (thisyear>nowyear) { loweryear=nowyear-2; }
216: if (thisyear<nowyear) { upperyear=nowyear+5; }
217: var i;
218: choicewrite('<select name="year" onchange="parent.datecalc();">');
219: for (i=loweryear;i<=upperyear;i++) {
220: choicewrite('<option value="'+i+'"');
221: if (i==thisyear) {
222: choicewrite(' selected="selected"');
223: }
224: choicewrite('>'+i+'</option>');
225: }
226: choicewrite('</select>');
227: }
228:
229: function month() {
230: var thismonth=cdate.getMonth();
231: var i;
232: choicewrite('<select name="month" onchange="parent.datecalc();">');
233: for (i=0;i<=11;i++) {
234: choicewrite('<option value="'+i+'"');
235: if (i==thismonth) {
236: choicewrite(' selected="selected"');
237: }
238: choicewrite('>'+months[i]+'</option>');
239: }
240: choicewrite('</select>');
241: }
242:
243:
244: function intminute() {
245: var thisminutes=cmins;
246: var i;
247: var result = '';
248: result += '<select name="minutes" onchange="parent.intcalc();">';
249: for (i=0;i<=59;i++) {
250: result += '<option value="'+i+'"';
251: if (i==thisminutes) {
252: result += ' selected="selected"';
253: }
254: result += '>'+i+'</option>';
255: }
256: result += '</select>';
257: return result;
258: }
259:
260: function inthour() {
261: var thishours=chours;
262: var i;
263: var result = '';
264: result += '<select name="hours" onchange="parent.intcalc();">';
265: for (i=0;i<=23;i++) {
266: result += '<option value="'+i+'"';
267: if (i==thishours) {
268: result += ' selected="selected"';
269: }
270: result += '>'+i+'</option>';
271: }
272: result += '</select>';
273: return result;
274: }
275:
276: function intsecond() {
277: var thisseconds=csecs;
278: var i;
279: var result = '';
280: result += '<select name="seconds" onchange="parent.intcalc();">';
281: for (i=0;i<=59;i++) {
282: result += '<option value="'+i+'"';
283: if (i==thisseconds) {
284: result += ' selected="selected"';
285: }
286: result += '>'+i+'</option>';
287: }
288: result += '</select>';
289: return result;
290: }
291:
292:
293: function intday() {
294: var thisdate=cdays;
295: var i;
296: var result ='';
297: result += '<select name="date" onchange="parent.intcalc();">';
298: for (i=0;i<=31;i++) {
299: result += '<option value="'+i+'"';
300: if (i==thisdate) {
301: result += ' selected="selected"';
302: }
303: result += '>'+i+'</option>';
304: }
305: result += '</select>';
306: return result;
307: }
308:
309: function intcalc() {
310: var sform=choices.document.forms.sch;
311: svalue=((sform.date.options[sform.date.selectedIndex].value*24+
312: sform.hours.options[sform.hours.selectedIndex].value*1)*60+
313: sform.minutes.options[sform.minutes.selectedIndex].value*1)*60+
314: sform.seconds.options[sform.seconds.selectedIndex].value*1;
315: if ((ptype=='date') && (pscat=='interval')) {
316: var newpmodval = '';
317: var newpextraval = '';
318: var newpextravaltwo = 'Done';
319: if (sform.donebutton.length) {
320: for (var i=0; i<sform.donebutton.length; i++) {
321: if (sform.donebutton[i].checked) {
322: if (sform.donebutton[i].value == '_done') {
323: newpmodval = sform.donebutton[i].value;
324: newpextravaltwo = sform.donebutton_text.value;
325: } else {
326: if (sform.donebutton[i].value == '_done_proctor') {
327: newpmodval = sform.donebutton[i].value;
328: newpextraval = sform.donebutton_proctorkey.value;
329: newpextravaltwo = sform.donebutton_text.value;
330: newpextravaltwo = newpextravaltwo.replace(/:/g,'');
331: }
332: }
333: }
334: }
335: }
336: pmodval = newpmodval;
337: pextraval = newpextraval;
338: pextravaltwo = newpextravaltwo;
339: draw();
340: if (pmodval) {
341: var doneRegExp = /^(_done)(|_proctor)$/;
342: var donevals = pmodval.match(doneRegExp);
343: if (donevals.length == 3) {
344: svalue += donevals[1];
345: }
346: if (newpextravaltwo) {
347: if (newpextravaltwo != 'Done') {
348: svalue += ':'+newpextravaltwo+':';
349: }
350: }
351: if (donevals[2] != '') {
352: svalue += donevals[2];
353: if (pextraval != '') {
354: svalue += '_'+pextraval;
355: }
356: }
357: }
358: } else {
359: draw();
360: }
361: }
362:
363: function toggleSecret() {
364: var sform=choices.document.forms.sch;
365: if (sform.donebutton.length) {
366: for (var i=0; i<sform.donebutton.length; i++) {
367: if (sform.donebutton[i].checked) {
368: if (sform.donebutton[i].value == '') {
369: if (document.getElementById('donebuttontextdiv')) {
370: document.getElementById('donebuttontextdiv').style.display='none';
371: }
372: } else {
373: if (document.getElementById('donebuttontextdiv')) {
374: document.getElementById('donebuttontextdiv').style.display='block';
375: }
376: }
377: if (sform.donebutton[i].value == '_done_proctor') {
378: if (document.getElementById('done_proctorkey')) {
379: document.getElementById('done_proctorkey').type='text';
380: }
381: } else {
382: if (document.getElementById('done_proctorkey')) {
383: document.getElementById('done_proctorkey').type='hidden';
384: document.getElementById('done_proctorkey').value='';
385: }
386: }
387: }
388: }
389: }
390: }
391:
392: function validateInterval() {
393: var sform=choices.document.forms.sch;
394: if (sform.donebutton.length) {
395: for (var i=0; i<sform.donebutton.length; i++) {
396: if (sform.donebutton[i].checked) {
397: if (sform.donebutton[i].value == '_done_proctor') {
398: if ((sform.donebutton_proctorkey.value == '') ||
399: (sform.donebutton_proctorkey.value == null)) {
400: alert('Please provide a key for a proctor to enter when a student uses the "Done" button.');
401: return;
402: }
403: }
404: }
405: }
406: }
407: intcalc();
408: assemble();
409: }
410:
411: function integereval() {
412: svalue=choices.document.forms.sch.intval.value;
413: svalue=Math.round(svalue);
414: if (pscat=='zeropos') { svalue=Math.abs(svalue); }
415: if ((pscat=='pos') && (svalue==0)) {
416: svalue='';
417: }
418: if (pscat.indexOf('inrange')!=-1) {
419: var rangeparts=new Array;
420: rangeparts=split('_',pscat);
421: rangeparts=split(',',rangeparts[1]);
422: if (svalue<rangeparts[0]) { svalue=rangeparts[0]; }
423: if (svalue>rangeparts[1]) { svalue=rangeparts[1]; }
424: }
425: draw();
426: }
427:
428: function floateval() {
429: svalue=choices.document.forms.sch.floatval.value;
430: svalue=1.0*svalue;
431: if (pscat=='pos') { svalue=Math.abs(svalue); }
432: if ((pscat=='zeroone') && ((svalue<0) || (svalue>1))) {
433: svalue='';
434: }
435: draw();
436: }
437:
438: function stringeval() {
439: svalue=choices.document.forms.sch.stringval.value;
440: draw();
441: }
442:
443: function ipstringeval() {
444: var patternIp = /^([\[\]a-zA-Z\.\d\*\-]+)$/;
445: var acctypes = new Array;
446: acctypes = ['allow','deny'];
447: svalue = '';
448: for (var i=0; i<acctypes.length; i++) {
449: var items = choices.document.getElementsByName('setip'+acctypes[i]);
450: if (items.length > 0) {
451: for (var j=0; j<items.length; j++) {
452: if (items[j].type == "text") {
453: var possip = items[j].value;
454: possip = possip.replace(/^\s+|\s+$/g,'');
455: if (patternIp.test(possip)) {
456: if (acctypes[i] == 'deny') {
457: possip = '!'+possip;
458: }
459: if (svalue == '') {
460: svalue = possip;
461: } else {
462: svalue += ','+possip;
463: }
464: }
465: }
466: }
467: }
468: }
469: }
470:
471: function addIpRule(iptype) {
472: var frame = window.frames["choices"];
473: if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {
474: var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);
475: var count = innerDiv.childNodes.length
476: var ipDiv = frame.document.createElement('div');
477: ipDiv.innerHTML = '<input type="text" size="10" name="setip'+iptype+'" onblur="parent.ipstringeval();" />'+
478: '<a href="#" onclick="parent.removeIpRule(\''+iptype+'\',\''+count+'\')">Remove</a>';
479: frame.document.getElementById('LC_string_ipacc_inner_'+iptype).appendChild(ipDiv);
480: }
481: return false;
482: }
483:
484: function removeIpRule(iptype,num) {
485: var frame = window.frames["choices"];
486: if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {
487: var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);
488: for (var i=0; i<innerDiv.childNodes.length; i++) {
489: if (i==num) {
490: innerDiv.removeChild(innerDiv.childNodes[i]);
491: ipstringeval();
492: break;
493: }
494: }
495: }
496: }
497:
498: function radiostringeval(newval) {
499: svalue=newval;
500: draw();
501: }
502:
503: function callradiostringeval(newval) {
504: return 'onclick="parent.radiostringeval(\''+newval+'\')"';
505: }
506:
507: function callintervalpmodval() {
508: return 'onclick="parent.intcalc();parent.toggleSecret()"';
509: }
510:
511: function intervaldis() {
512: csecs=svalue;
513: cdays=Math.floor(csecs/86400);
514: csecs-=cdays*86400;
515: chours=Math.floor(csecs/3600);
516: csecs-=chours*3600;
517: cmins=Math.floor(csecs/60);
518: csecs-=cmins*60;
519: return cdays+' days '+chours+' hours '+cmins+' mins '+csecs+' secs';
520: }
521:
522: function pickcolor(picked) {
523: svalue=picked;
524: draw();
525: }
526:
527: function colorfield(ir,ig,ib) {
528: var col=new Array;
529: col=["00","11","22","44","66","88","AA","CC","DD","EE","FF"];
530: var color='#'+col[ir]+col[ig]+col[ib];
531: var selection="<font color='"+color+"'>X</font>";
532: if (color==svalue) { selection="<font color='#"+col[10-ir]+col[10-ig]+col[10-ib]+"'>X</font>"; }
533: choicewrite('<td bgcolor="'+color+'"><a href="javascript:parent.pickcolor('+"'"+
534: color+"'"+')">'+selection+'</a></td>');
535:
536: }
537:
538: function draw() {
539: choicestart();
540: choicewrite('<form name="sch"');
541: if (ptype=='int') {
542: choicewrite(' action="javascript:integereval();"');
543: }
544: if (ptype=='float') {
545: choicewrite(' action="javascript:floateval();"');
546: }
547: if (ptype=='string') {
548: if (pscat == 'ip') {
549: choicewrite(' action="javascript:ipstringeval();"');
550: } else {
551: choicewrite(' action="javascript:stringeval();"');
552: }
553: }
554: if (ptype != 'int' && ptype != 'float' && ptype != 'string') {
555: choicewrite(' action=""');
556: }
557: choicewrite('>');
558: if (ptype=='tolerance') {
559: // 0: pscat
560: if (pscat=='default') {
561: tablestart('Use default value or algorithm of resource');
562: }
563: if (pscat=='relative_sym') {
564: // 2: percentage
565: // 3: open
566: tablestart('Percentage error, symmetric around value');
567: valline('Percentage',2,3);
568: if ((svalue!='') && (typeof(svalue)!="undefined")) {
569: choices.document.forms.sch.val2.value=parseInt(svalue);
570: if (svalue.indexOf('+')!=-1) {
571: choices.document.forms.sch.val3.checked=true;
572: }
573: }
574: }
575: if (pscat=='relative') {
576: // 2: left
577: // 3: open
578: // 4: right
579: // 5: open
580: tablestart('Percentage error, asymmetric around value');
581: valline('Upper percentage',2,3);
582: valline('Lower percentage',4,5);
583: var range1=new Array;
584: if ((svalue!='') && (typeof(svalue)!="undefined")) {
585: range1=svalue.split(',');
586: if (typeof(range1[1])=='undefined') { range1[1]=range1[0]; }
587: choices.document.forms.sch.val2.value=parseFloat(range1[0]);
588: if (range1[0].indexOf('+')!=-1) {
589: choices.document.forms.sch.val3.checked=true;
590: }
591: choices.document.forms.sch.val4.value=parseFloat(range1[1]);
592: if (range1[1].indexOf('+')!=-1) {
593: choices.document.forms.sch.val5.checked=true;
594: }
595: }
596: }
597: if (pscat=='absolute_sym') {
598: tablestart('Absolute error, symmetric around value');
599: valline('Value',2,3);
600: if ((svalue!='') && (typeof(svalue)!="undefined")) {
601: choices.document.forms.sch.val2.value=parseFloat(svalue);
602: if (svalue.indexOf('+')!=-1) {
603: choices.document.forms.sch.val3.checked=true;
604: }
605: }
606: }
607: if (pscat=='absolute') {
608: tablestart('Absolute error, asymmetric around value');
609: valline('Upper value',2,3);
610: valline('Lower value',4,5);
611: var range2=new Array;
612: if ((svalue!='') && (typeof(svalue)!="undefined")) {
613: range=svalue.split(',');
614: if (typeof(range2[1])=='undefined') { range2[1]=range2[0]; }
615: choices.document.forms.sch.val2.value=parseFloat(range2[0]);
616: if (range2[0].indexOf('+')!=-1) {
617: choices.document.forms.sch.val3.checked=true;
618: }
619: choices.document.forms.sch.val4.value=parseFloat(range2[1]);
620: if (range2[1].indexOf('+')!=-1) {
621: choices.document.forms.sch.val5.checked=true;
622: }
623: }
624: }
625: }
626:
627: if (ptype=='date') {
628: if (pscat=='default') {
629: tablestart('Default value or none');
630: choicewrite('</table>');
631: } else {
632: if (pscat=='start') {
633: tablestart('Date and time');
634: }
635: if (pscat=='end') {
636: tablestart('Date and time');
637: }
638: if (pscat=='interval') {
639: var proctorkeytype = 'hidden';
640: var donebuttontext = 'none';
641: if (pmodval == '_done_proctor') {
642: proctorkeytype = 'text';
643: donebuttontext = 'block';
644: }
645: if (pmodval == '_done') {
646: donebuttontext = 'block';
647: }
648: tablestart('Time interval');
649: choicewrite( [
650: '<tr><td colspan="3">'+intervaldis()+'</td></tr>',
651: '<tr><td>Time:</td><td colspan="2">',
652: '<span style="white-space:nowrap">'+intday()+' days </span>',
653: '<span style="white-space:nowrap">'+inthour()+' hours</span>',
654: '<span style="white-space:nowrap">'+intminute()+' mins</span>',
655: '<span style="white-space:nowrap">'+intsecond()+' secs</span>',
656: '</td></tr>',
657: '</table>',
658: '<br />',
659: ].join("\n"));
660: tablestart('Provide a "Done" button to students?');
661: choicewrite('<tr><td>Value:</td><td colspan="2">');
662: choicewrite('<label><input name="donebutton" value=""'+
663: ' type="radio" '+callintervalpmodval());
664: if (pmodval == '') { choicewrite(' checked="checked"'); }
665: choicewrite(' /> No</label><br />');
666: choicewrite('<label><input name="donebutton" value="_done"'+
667: ' type="radio" '+callintervalpmodval());
668: if (pmodval == '_done') { choicewrite(' checked="checked"'); }
669: choicewrite(' /> Yes</label><br />');
670: choicewrite('<span style="white-space:nowrap">'+
671: '<label><input name="donebutton" value="_done_proctor"'+
672: ' type="radio" '+callintervalpmodval());
673: if (pmodval == '_done_proctor') { choicewrite(' checked="checked"'); }
674: choicewrite(' /> Yes, with proctor key</label>');
675: choicewrite(' <input name="donebutton_proctorkey" value='+
676: '"'+escapeHTML(pextraval)+'" type="'+proctorkeytype+
677: '" id="done_proctorkey" size="10"'+
678: ' onblur="parent.intcalc();" /></span><br />'+
679: '<div id="donebuttontextdiv" style="display:'+donebuttontext+'">'+
680: '<br /><span style="white-space:nowrap">'+
681: 'Button text:'+
682: '<input name="donebutton_text" value='+
683: '"'+escapeHTML(pextravaltwo)+'" type="text" '+
684: 'size="10" onblur="parent.intcalc();" /></span></div>');
685: choicewrite('</td></tr></table>');
686: } else {
687: choicewrite('<tr><td colspan="3">'
688: +cdate.toString()+
689: '</td></tr><tr><td>Date:</td><td colspan="2">');
690: month();date();year();
691: choicewrite('</td></tr><tr><td>Time:'
692: +'</td><td colspan="2">');hour();choicewrite('h ');minute();
693: choicewrite('m ');second();
694: choicewrite('s</td></tr></table>');
695: }
696: }
697: }
698:
699: if (ptype=='int') {
700: var pscatparts=new Array;
701: pscatparts=pscat.split(',');
702: pscat=pscatparts[0];
703: if (pscat=='default') {
704: tablestart('Default value or none');
705: choicewrite('</table>');
706: } else {
707: if (pscat=='range') {
708: tablestart('Integer range');
709: choicewrite('<tr><td>Lower Value:'+
710: '</td><td colspan="2"><input type="text" size="4" name="val2'+
711: '" /></td></tr>');
712: choicewrite('<tr><td>Upper Value:'+
713: '</td><td colspan="2"><input type="text" size="4" name="val4'+
714: '" /></td></tr></table>');
715: var range=new Array;
716: if ((svalue!='') && (typeof(svalue)!="undefined")) {
717: range=svalue.split(',');
718: if (typeof(range[1])=='undefined') { range[1]=range[0]; }
719: choices.document.forms.sch.val2.value=parseInt(range[0]);
720: choices.document.forms.sch.val4.value=parseInt(range[1]);
721: }
722: } else {
723: if (pscat=='pos') {
724: tablestart('Positive (non-zero) integer');
725: }
726: if (pscat=='zeropos') {
727: tablestart('Positive integer or zero');
728: }
729: if (pscat.indexOf('inrange')!=-1) {
730: var rangeparts=new Array;
731: rangeparts=split(',',pscat);
732: tablestart('Integer in the range ['+rangeparts[1]+']');
733: }
734: if (pscat=='any') {
735: tablestart('Integer');
736: }
737: choicewrite('<tr><td>Value:</td><td colspan="2">');
738: choicewrite('<input name="intval" size="10" value="'+escapeHTML(svalue)+
739: '" onchange="parent.integereval()" />');
740: choicewrite('</td></tr></table>');
741: }
742: }
743: }
744:
745: if (ptype=='float') {
746: if (pscat=='default') {
747: tablestart('Default value or none');
748: choicewrite('</table>');
749: } else {
750: if (pscat=='pos') {
751: tablestart('Positive floating point number or zero');
752: }
753: if (pscat=='zeroone') {
754: tablestart('Floating point number between zero and one');
755: }
756: if (pscat=='any') {
757: tablestart('Floating point number');
758: }
759: choicewrite('<tr><td>Value:</td><td colspan="2">');
760: choicewrite('<input name="floatval" size="10" value="'+escapeHTML(svalue)+
761: '" onchange="parent.floateval()" />');
762: choicewrite('</td></tr></table>');
763: }
764: }
765:
766: if (ptype=='string') {
767: if ((pscat=='any') || (pscat=='') || (pscat=='default') ||
768: (typeof(pscat)=='undefined')) {
769: tablestart('Text');
770: choicewrite('<tr><td>Value:</td><td colspan="2">');
771: choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
772: '" type="text" onchange="parent.stringeval()" />');
773: }
774: if (pscat=='yesno') {
775: tablestart('Yes/No');
776: choicewrite('<tr><td>Value:</td><td colspan="2">');
777: choicewrite('<label><input name="stringval" value="yes"'+
778: ' type="radio" '+callradiostringeval('yes'));
779: if (svalue=='yes') { choicewrite(' checked="checked"'); }
780: choicewrite(' /> Yes</label><br />');
781: choicewrite('<label><input name="stringval" value="no"'+
782: ' type="radio" '+callradiostringeval('no'));
783: if (svalue=='no') { choicewrite(' checked="checked"'); }
784: choicewrite(' /> No</label><br />');
785: }
786: if (pscat=='problemstatus') {
787: tablestart('Problem Status');
788: choicewrite('<tr><td>Value:</td><td colspan="2">');
789: choicewrite('<label><input name="stringval" value="yes"'+
790: ' type="radio" '+callradiostringeval('yes'));
791: if (svalue=='yes') { choicewrite(' checked="checked"'); }
792: choicewrite(' /> Yes</label><br />');
793: choicewrite('<label><input name="stringval" value="answer"'+
794: ' type="radio" '+callradiostringeval('answer'));
795: if (svalue=='answer') { choicewrite(' checked="checked"'); }
796: choicewrite(' /> Yes, and show correct answer if they exceed the maximum number of tries.</label><br />');
797: choicewrite('<label><input name="stringval" value="no"'+
798: ' type="radio" '+callradiostringeval('no'));
799: if (svalue=='no') { choicewrite(' checked="checked"'); }
800: choicewrite(' /> No, don\'t show correct/incorrect feedback.</label><br />');
801: choicewrite('<label><input name="stringval" value="no_feedback_ever"'+
802: ' type="radio" '+callradiostringeval('no_feedback_ever'));
803: if (svalue=='no_feedback_ever') { choicewrite(' checked="checked"'); }
804: choicewrite(' /> No, show no feedback at all.</label><br />');
805: }
806: if (pscat=='examtype') {
807: tablestart('Exam Type');
808: choicewrite('<tr><td>Value:</td><td colspan="2">');
809: choicewrite('<label><input name="stringval" value="online"'+
810: ' type="radio" '+callradiostringeval('online'));
811: if (svalue=='online') { choicewrite(' checked="checked"'); }
812: choicewrite(' /> Online</label><br />');
813: choicewrite('<label><input name="stringval" value="checkout"'+
814: ' type="radio" '+callradiostringeval('checkout'));
815: if (svalue=='checkout') { choicewrite(' checked="checked"'); }
816: choicewrite(' /> Check out</label><br />');
817: }
818: if (pscat=='questiontype') {
819: tablestart('Question Type');
820: choicewrite('<tr><td>Value:</td><td colspan="2">');
821: choicewrite('<label><input name="stringval" value="problem"'+
822: ' type="radio" '+callradiostringeval('problem'));
823: if (svalue=='problem') { choicewrite(' checked="checked"'); }
824: choicewrite(' /> Standard Problem</label><br />');
825: // choicewrite('<label><input name="stringval" value="quiz"'+
826: // ' type="radio" '+callradiostringeval('quiz'));
827: // if (svalue=='quiz') { choicewrite(' checked="checked"'); }
828: // choicewrite(' /> Quiz</label><br />');
829: choicewrite('<label><input name="stringval" value="practice"'+
830: ' type="radio" '+callradiostringeval('practice'));
831: if (svalue=='practice') { choicewrite(' checked="checked"'); }
832: choicewrite(' /> Practice</label><br />');
833: choicewrite('<label><input name="stringval" value="exam"'+
834: ' type="radio" '+callradiostringeval('exam'));
835: if (svalue=='exam') { choicewrite(' checked="checked"'); }
836: choicewrite(' /> Exam</label><br />');
837: // choicewrite('<label><input name="stringval" value="assess"'+
838: // ' type="radio" '+callradiostringeval('assess'));
839: // if (svalue=='assess') { choicewrite(' checked="checked"'); }
840: // choicewrite(' /> Assessment</label><br />');
841: choicewrite('<label><input name="stringval" value="survey"'+
842: ' type="radio" '+callradiostringeval('survey'));
843: if (svalue=='survey') { choicewrite(' checked="checked"'); }
844: choicewrite(' /> Survey</label><br />');
845: // choicewrite('<label><input name="stringval" value="form"'+
846: // ' type="radio" '+callradiostringeval('form'));
847: // if (svalue=='form') { choicewrite(' checked="checked"'); }
848: // choicewrite('> Input Form</label><br />');
849: choicewrite('<label><input name="stringval" value="surveycred"'+
850: ' type="radio" '+callradiostringeval('surveycred'));
851: if (svalue=='surveycred') { choicewrite(' checked="checked"'); }
852: choicewrite('> Survey (credit for submission)</label><br />');
853: choicewrite('<label><input name="stringval" value="anonsurvey"'+
854: ' type="radio" '+callradiostringeval('anonsurvey'));
855: if (svalue=='anonsurvey') { choicewrite(' checked="checked"'); }
856: choicewrite('> Anonymous Survey</label><br />');
857: choicewrite('<label><input name="stringval" value="anonsurveycred"'+
858: ' type="radio" '+callradiostringeval('anonsurveycred'));
859: if (svalue=='anonsurveycred') { choicewrite(' checked="checked"'); }
860: choicewrite('> Anonymous Survey (credit for submission)</label><br />');
861: choicewrite('<label><input name="stringval" value="randomizetry"'+
862: ' type="radio" '+callradiostringeval('randomizetry'));
863: if (svalue=='randomizetry') { choicewrite(' checked="checked"'); }
864: choicewrite('> New Randomization Each N Tries (default N=1)</label><br />');
865: choicewrite('<label><input name="stringval" value="library"'+
866: ' type="radio" '+callradiostringeval('library'));
867: if (svalue=='library') { choicewrite(' checked="checked"'); }
868: choicewrite(' /> Library</label><br />');
869: }
870: if (pscat=='lenient') {
871: tablestart('Lenient Grading (Partial Credit)');
872: choicewrite('<tr><td>Value:</td><td colspan="2">');
873: choicewrite('<label><input name="stringval" value="yes"'+
874: ' type="radio" '+callradiostringeval('yes'));
875: if (svalue=='yes') { choicewrite(' checked="checked"'); }
876: choicewrite(' /> Yes</label><br />');
877: choicewrite('<label><input name="stringval" value="no"'+
878: ' type="radio" '+callradiostringeval('no'));
879: if (svalue=='no') { choicewrite(' checked="checked"'); }
880: choicewrite(' /> No</label><br />');
881: choicewrite('<label><input name="stringval" value="default"'+
882: ' type="radio" '+callradiostringeval('default'));
883: if (svalue=='default') { choicewrite(' checked="checked"'); }
884: choicewrite(' /> Default (only bubblesheet grading is lenient)</label><br />');
885: }
886: if (pscat=='discussvote') {
887: tablestart('Discussion Voting');
888: choicewrite('<tr><td>Value:</td><td colspan="2">');
889: choicewrite('<label><input name="stringval" value="yes"'+
890: ' type="radio" '+callradiostringeval('yes'));
891: if (svalue=='yes') { choicewrite(' checked="checked"'); }
892: choicewrite(' /> Yes</label><br />');
893: choicewrite('<label><input name="stringval" value="notended"'+
894: ' type="radio" '+callradiostringeval('notended'));
895: if (svalue=='notended') { choicewrite(' checked="checked"'); }
896: choicewrite(' /> Yes, unless discussion ended</label><br />');
897: choicewrite('<label><input name="stringval" value="no"'+
898: ' type="radio" '+callradiostringeval('no'));
899: if (svalue=='no') { choicewrite(' checked="checked"'); }
900: choicewrite(' /> No</label><br />');
901: }
902: if (pscat=='ip') {
903: var currallow = new Array;
904: var currdeny = new Array;
905: if ((svalue != '') && (svalue != null)) {
906: var patternComma = /,/;
907: var patternAllow = /^([\[\]a-zA-Z\.\d\*\-]+)$/;
908: var patternDeny = /^\!([\[\]a-zA-Z\.\d\*\-]+)$/;
909: var current = new Array;
910: if (patternComma.test(svalue)) {
911: current = svalue.split(',');
912: } else {
913: current = [svalue];
914: }
915: for (var i=0; i<current.length; i++) {
916: if (patternDeny.test(current[i])) {
917: var denied = current[i].replace(/^!/,'');
918: currdeny.push(denied);
919: } else {
920: if (patternAllow.test(current[i])) {
921: currallow.push(current[i]);
922: }
923: }
924: }
925: }
926: if (currdeny.length == 0) {
927: currdeny = ('');
928: }
929: if (currallow.length == 0) {
930: currallow = ('');
931: }
932: var curripaccess = [currallow,currdeny];
933: tablestart('IP Number/Name');
934: choicewrite('<tr><th>Allow from</th><th>Deny from</th></tr><tr>');
935: var acctypes = ['allow','deny'];
936: for (var i=0; i<acctypes.length; i++) {
937: choicewrite('<td valign="top">'+
938: '<div class="LC_string_ipacc_wrap" id="LC_string_ipacc_'+acctypes[i]+'">'+
939: '<div class="LC_string_ipacc_inner" id="LC_string_ipacc_inner_'+acctypes[i]+'">');
940: for (var j=0; j<curripaccess[i].length; j++) {
941: choicewrite('<div><input type="text" size="10" name="setip'+acctypes[i]+'" value="'+curripaccess[i][j]+'" onblur="parent.ipstringeval();" />');
942: choicewrite('<a href="#" onclick="parent.removeIpRule(\''+acctypes[i]+'\',\''+j+'\')">Remove</a>');
943: choicewrite('</div>');
944: }
945: choicewrite('</div><button onclick="parent.addIpRule(\''+acctypes[i]+'\');">Add item</button>');
946: }
947: choicewrite('</div></td></tr></table>');
948: }
949: if (pscat=='fileext') {
950: tablestart('Allowed File Extensions');
951: choicewrite('<tr><td>Value:</td><td colspan="2">');
952: choicewrite('<label><input name="radstringval" value="txt"'+
953: ' type="radio" '+callradiostringeval('txt'));
954: if (svalue=='txt') { choicewrite(' checked="checked"'); }
955: choicewrite(' /> Plain Text</label><br />');
956: choicewrite('<label><input name="radstringval" value="png,jpg,jpeg,gif"'+
957: ' type="radio" '+callradiostringeval('png,jpg,jpeg,gif'));
958: if (svalue=='png,jpg,jpeg,gif') { choicewrite(' checked="checked"'); }
959: choicewrite(' /> Picture File</label><br />');
960: choicewrite('<label><input name="radstringval" value="doc,docx,xls,xlsx,ppt,pptx"'+
961: ' type="radio" '+callradiostringeval('doc,docx,xls,xlsx,ppt,pptx'));
962: if (svalue=='doc,docx,xls,xlsx,ppt,pptx') { choicewrite(' checked="checked"'); }
963: if (svalue=='doc,xls,ppt') { choicewrite(' checked="checked"'); }
964: choicewrite(' /> Office Document</label><br />');
965: choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
966: '" onchange="parent.stringeval()" />');
967: }
968: if (pscat=='useslots') {
969: tablestart('Slots control access');
970: choicewrite('<tr><td>Value:</td><td colspan="2">');
971: choicewrite('<label><input name="stringval" value="no"'+
972: ' type="radio" '+callradiostringeval('no'));
973: if (svalue=='no') { choicewrite(' checked="checked"'); }
974: choicewrite(' /> No</label><br />');
975: choicewrite('<label><input name="stringval" value="resource"'+
976: ' type="radio" '+callradiostringeval('resource'));
977: if (svalue=='resource') { choicewrite(' checked="checked"'); }
978: choicewrite(' /> Yes, and the scope of student selected slot is a single resource.</label><br />');
979: choicewrite('<label><input name="stringval" value="map"'+
980: ' type="radio" '+callradiostringeval('map'));
981: if (svalue=='map') { choicewrite(' checked="checked"'); }
982: choicewrite(' /> Yes, and the scope of student selected slot is the enclosing map/folder. When checking in, it applies to only one resource.</label><br />');
983: choicewrite('<label><input name="stringval" value="map_map"'+
984: ' type="radio" '+callradiostringeval('map_map'));
985: if (svalue=='map_map') { choicewrite(' checked="checked"'); }
986: choicewrite(' /> Yes, and the scope of student selected slot is the enclosing map/folder. When checking in, all resources in the map/folder are checked in.</label><br />');
987: choicewrite('</td></tr></table>');
988: }
989: }
990:
991: if (ptype=='color') {
992: tablestart('Choose a Color');
993: choicewrite('<table>');
994: if (svalue) {
995: choicewrite('<tr><td colspan="9">Current choice:</td><td bgcolor="'+
996: escapeHTML(svalue)+'" colspan="2"> </td></tr>');
997: }
998: for (var ir=0; ir<=10; ir++) {
999: for (var ig=0; ig<=10; ig++) {
1000: choicewrite('<tr>');
1001: for (var ib=0; ib<=10; ib++) {
1002: colorfield(ir,ig,ib);
1003: }
1004: choicewrite('</tr>');
1005: }
1006: }
1007: choicewrite('</table></td></table>');
1008: }
1009:
1010: choicewrite('</form>');
1011: choiceend();
1012: }
1013:
1014: function sopt(va,text) {
1015: selwrite('<option value="'+va+'"');
1016: if (va==pscat) {
1017: selwrite(' selected="selected"');
1018: }
1019: selwrite('>'+text+'</option>');
1020: }
1021:
1022: function catchange() {
1023: var sform=selector.document.forms.fsel.fcat;
1024: pscat=sform.options[sform.selectedIndex].value;
1025: draw();
1026: }
1027:
1028: function assemble() {
1029: if ((ptype=='date') && (pscat!='interval')) {
1030: svalue=Math.floor(cdate.getTime()/1000);
1031: }
1032: if (ptype=='tolerance') {
1033: if (pscat=='relative_sym') {
1034: svalue=choices.document.forms.sch.val2.value+'%';
1035: if (choices.document.forms.sch.val3.checked) {
1036: svalue+='+';
1037: }
1038: }
1039: if (pscat=='absolute_sym') {
1040: svalue=choices.document.forms.sch.val2.value;
1041: if (choices.document.forms.sch.val3.checked) {
1042: svalue+='+';
1043: }
1044: }
1045: if (pscat=='absolute') {
1046: svalue=choices.document.forms.sch.val2.value;
1047: if (choices.document.forms.sch.val3.checked) {
1048: svalue+='+';
1049: }
1050: svalue+=','+choices.document.forms.sch.val4.value;
1051: if (choices.document.forms.sch.val5.checked) {
1052: svalue+='+';
1053: }
1054: }
1055: if (pscat=='relative') {
1056: svalue=choices.document.forms.sch.val2.value+'%';
1057: if (choices.document.forms.sch.val3.checked) {
1058: svalue+='+';
1059: }
1060: svalue+=','+choices.document.forms.sch.val4.value+'%';
1061: if (choices.document.forms.sch.val5.checked) {
1062: svalue+='+';
1063: }
1064: }
1065: }
1066: if ((ptype=='int') && (pscat=='range')) {
1067: svalue=choices.document.forms.sch.val2.value+','+
1068: choices.document.forms.sch.val4.value;
1069: }
1070: if (pscat=='default') { svalue=''; }
1071: stype=ptype+'_'+pscat;
1072: }
1073:
1074:
1075: function init() {
1076: var i;
1077: var subs=new Array();
1078: var doneRegExp = /_done(|\:[^\:]+\:)/;
1079: var doneproctorRegExp = /_done(|\:[^\:]+\:)_proctor/;
1080: var proctorkeyRegExp = /^(\d+)_(.+)$/;
1081: var donetextRegExp = /\:([^\:]+)\:/;
1082: var namevalue=this.window.location.search.split('&');
1083: namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1);
1084:
1085: for (i=0;i<namevalue.length;i++) {
1086: var pair=namevalue[i].split('=');
1087: pair[1]=unescape(pair[1]);
1088: if (pair[0]=='value') { pvalue=pair[1]; }
1089: if (pair[0]=='type') { subs=pair[1].split('_');
1090: ptype=subs[0];
1091: pscat=subs[1];
1092: if (typeof(subs[2])!="undefined") {
1093: pscat+='_'+subs[2];
1094: }
1095: if ((pscat=='') || (typeof(pscat)=="undefined")) {
1096: pscat='default';
1097: }
1098: }
1099: if (pair[0]=='return') { preturn=pair[1]; }
1100: if (pair[0]=='call') { pcode=pair[1]; }
1101: if (pair[0]=='marker') { pmarker=pair[1]; }
1102: if (pair[0]=='name') { pname=pair[1]; }
1103: if (pair[0]=='modal') { pmodal=pair[1]; }
1104: if (pair[0]=='defhour' && pair[1] >= 0 && pair[1] < 24 ) {
1105: defhour=pair[1];
1106: }
1107: if (pair[0]=='defmin' && pair[1] >= 0 && pair[1] < 60) { defmin=pair[1]; }
1108: if (pair[0]=='defsec' && pair[1] >= 0 && pair[1] < 60) { defsec=pair[1]; }
1109: }
1110:
1111: if (ptype=='date' && pscat == 'interval') {
1112: if (doneproctorRegExp.test(pvalue)) {
1113: var current = pvalue.match(doneproctorRegExp);
1114: if (current.length == 2) {
1115: var textstr = current[1];
1116: if (textstr != '') {
1117: var textvals = textstr.match(donetextRegExp);
1118: if (textvals.length == 2) {
1119: pextravaltwo = textvals[1];
1120: }
1121: }
1122: }
1123: var intervalwithkey = pvalue.replace(doneproctorRegExp,'');
1124: if (proctorkeyRegExp.test(intervalwithkey)) {
1125: var currvals = intervalwithkey.match(proctorkeyRegExp);
1126: if (currvals.length == 3) {
1127: pvalue = currvals[1];
1128: pextraval = currvals[2];
1129: pmodval = '_done_proctor';
1130: } else {
1131: pmodval = '';
1132: }
1133: }
1134: } else {
1135: if (doneRegExp.test(pvalue)) {
1136: var current = pvalue.match(doneRegExp);
1137: if (current.length == 2) {
1138: var textstr = current[1];
1139: if (textstr != '') {
1140: var textvals = textstr.match(donetextRegExp);
1141: if (textvals.length == 2) {
1142: pextravaltwo = textvals[1];
1143: }
1144: }
1145: }
1146: var pnumval = pvalue.replace(doneRegExp,'');
1147: pmodval = '_done';
1148: pvalue = pnumval;
1149: }
1150: }
1151: }
1152: svalue=pvalue;
1153: if (((ptype=='float') || (ptype=='string') || (ptype=='int')) &&
1154: (pscat=='default') &&
1155: (typeof(svalue)!="undefined") &&
1156: (svalue!=0) && (svalue!='')) { pscat='any'; }
1157:
1158: if (ptype=='tolerance') {
1159: var tperc=0;
1160: var trange=0;
1161: if (typeof(svalue)!='undefined') {
1162: if (svalue.indexOf('%')!=-1) { tperc=1; }
1163: if (svalue.indexOf(',')!=-1) { trange=1; }
1164: if (trange) {
1165: if (tperc) { pscat='relative'; } else { pscat='absolute'; }
1166: } else {
1167: if (tperc) { pscat='relative_sym'; } else { pscat='absolute_sym'; }
1168: }
1169: }
1170: }
1171:
1172: this.window.selector.document.open();
1173: selwrite('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
1174: selwrite('<html xmlns="http://www.w3.org/1999/xhtml">');
1175: selwrite('<head>');
1176: selwrite('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
1177: selwrite('<title>LON-CAPA</title>');
1178: selwrite('<style type="text/css">');
1179: selwrite('<!--');
1180: selwrite('body {');
1181: selwrite('font-family: Verdana,Arial,Helvetica,sans-serif;');
1182: selwrite('line-height:130%;');
1183: selwrite('font-size:0.83em;');
1184: selwrite('background: #FFFFFF;');
1185: selwrite('}');
1186: selwrite('-->');
1187: selwrite('</style>');
1188: selwrite('</head>');
1189: selwrite('<body>');
1190: selwrite('<form name="fsel" action=""><b>'+pname+'</b><br />');
1191: selwrite('Format of Value(s): <select name="fcat" onchange="parent.catchange();">');
1192:
1193: if (ptype=='tolerance') {
1194: sopt('default','Default');
1195: sopt('relative_sym','Relative Tolerance, Symmetric (percent)');
1196: sopt('relative','Relative Tolerance (percentages)');
1197: sopt('absolute_sym','Absolute Tolerance, Symmetric (value)');
1198: sopt('absolute','Absolute Tolerance (values)');
1199: }
1200:
1201: if (ptype=='date') {
1202: if (pscat != 'interval') {
1203: sopt('default','Default');
1204: sopt('start','Starting Date');
1205: sopt('end','Ending Date');
1206: } else {
1207: sopt('interval','Time Interval');
1208: }
1209:
1210: if ((pvalue!='') && (typeof(pvalue)!="undefined")) {
1211: cdate.setTime(pvalue*1000);
1212: } else {
1213: cdate.setSeconds(defsec);
1214: cdate.setMinutes(defmin);
1215: cdate.setHours(defhour);
1216: }
1217:
1218: months[0]='January';
1219: months[1]='February';
1220: months[2]='March';
1221: months[3]='April';
1222: months[4]='May';
1223: months[5]='June';
1224: months[6]='July';
1225: months[7]='August';
1226: months[8]='September';
1227: months[9]='October';
1228: months[10]='November';
1229: months[11]='December';
1230: }
1231:
1232: if (ptype=='int') {
1233: sopt('default','Default');
1234: sopt('pos','Positive Integer, Not Zero');
1235: sopt('zeropos','Positive Integer or Zero');
1236: sopt('inrange','Integer in Range');
1237: sopt('range','Range of Integers');
1238: sopt('any','Integer');
1239: }
1240:
1241: if (ptype=='float') {
1242: sopt('default','Default');
1243: sopt('zeroone','Floating Point between 0 and 1');
1244: sopt('pos','Positive Floating Point');
1245: sopt('any','Floating Point');
1246:
1247: }
1248:
1249: if (ptype=='string') {
1250: //sopt('default','Default');
1251: if (pscat == 'yesno') { sopt('yesno','Yes/No'); }
1252: else if (pscat == 'problemstatus'){ sopt('problemstatus','Problem Status'); }
1253: else if (pscat == 'examtype') { sopt('examtype','Exam Type'); }
1254: else if (pscat == 'questiontype') { sopt('questiontype','Question Type'); }
1255: else if (pscat == 'lenient') { sopt('lenient','Lenient Grading (Partial Credit)'); }
1256: else if (pscat == 'discussvote') { sopt('discussvote','Discussion Voting'); }
1257: else if (pscat == 'ip') { sopt('ip','IP Number/Name'); }
1258: else if (pscat == 'fileext') { sopt('fileext','File Extension'); }
1259: else if (pscat == 'useslots') { sopt('useslots','Slots control access'); }
1260: else { pscat = 'any'; }
1261: sopt('any','String Value');
1262: }
1263:
1264: if (ptype=='color') {
1265: sopt('default','Use Default Color');
1266: sopt('custom','Use Custom Color');
1267: }
1268:
1269: selwrite('</select></form>');
1270: var targ='parent.opener';
1271: if (pmodal==1) {
1272: targ='parent.parent';
1273: }
1274: if ((ptype=='date') && (pscat=='interval')) {
1275: selwrite('<a href="javascript:parent.validateInterval();');
1276: } else {
1277: selwrite('<a href="javascript:parent.assemble();');
1278: }
1279: if (preturn!='') {
1280: selwrite(targ+'.document.'+preturn+'_value.value=parent.window.svalue;');
1281: selwrite(targ+'.document.'+preturn+'_type.value=parent.window.stype;');
1282: }
1283: if (pmarker!='') {
1284: selwrite(targ+'.document.'+preturn+'_marker.value=parent.window.pmarker;');
1285: }
1286: if (pcode!='') {
1287: selwrite(targ+'.'+pcode+'();');
1288: }
1289: selwrite('">Save</a> ');
1290:
1291: selwrite('<a href="javascript:');
1292: selwrite(targ+'.document.'+preturn+'_value.value='+"'';");
1293: if (pmarker!='') {
1294: selwrite(
1295: targ+'.document.'+preturn+'_marker.value=parent.window.pmarker;');
1296: }
1297: if (pcode!='') {
1298: selwrite(targ+'.'+pcode+'();');
1299: }
1300: selwrite('">Delete</a> ');
1301:
1302: selwrite('</body></html>');
1303: this.window.selector.document.close();
1304: draw();
1305:
1306: }
1307:
1308: // ]]>
1309: </script>
1310: </head>
1311:
1312: <frameset rows="120,*" onload="init();">
1313: <frame name="selector" src="empty.html" />
1314: <frame name="choices" src="empty.html" />
1315: </frameset>
1316:
1317:
1318:
1319: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>