--- rat/client/parameter.html 2003/04/18 20:21:38 1.21
+++ rat/client/parameter.html 2007/05/02 01:34:37 1.43
@@ -3,7 +3,7 @@
The LearningOnline Network with CAPA
Parameter Input Window
//
-// $Id: parameter.html,v 1.21 2003/04/18 20:21:38 www Exp $
+// $Id: parameter.html,v 1.43 2007/05/02 01:34:37 albertel Exp $
//
// Copyright Michigan State University Board of Trustees
//
@@ -27,9 +27,6 @@ Parameter Input Window
//
// http://www.lon-capa.org/
//
-06/16/00,06/17,11/17,11/18,11/23,11/27,11/28,12/15,12/16,
-03/21/01,03/24,06/26 Gerd Kortemeyer
-08/08 Gerd Kortemeyer
-->
LON-CAPA
@@ -45,6 +42,10 @@ var pscat='';
var pmarker='';
var pname='';
+var defhour=0;
+var defmin=0;
+var defsec=0;
+
var svalue;
var stype;
var smarker;
@@ -175,6 +176,7 @@ function year() {
var thisyear=cdate.getFullYear();
var nowdate=new Date();
var nowyear=nowdate.getFullYear();
+ if ( !thisyear ) { thisyear=nowyear; }
var loweryear=thisyear-2;
var upperyear=thisyear+5;
if (thisyear>nowyear) { loweryear=nowyear-2; }
@@ -304,6 +306,17 @@ function stringeval() {
draw();
}
+function radiostringeval(newval) {
+ svalue=newval;
+ draw();
+}
+
+function callradiostringeval(newval) {
+ return 'onChange="parent.radiostringeval(\''
+ +newval+'\')" onClick="parent.radiostringeval(\''
+ +newval+'\')"';
+}
+
function intervaldis() {
csecs=svalue;
cdays=Math.floor(csecs/86400);
@@ -323,10 +336,10 @@ function pickcolor(picked) {
function colorfield(ir,ig,ib) {
var col=new Array;
- col=["00","11","22","33","44","55","66","77","88","99","AA","BB","CC","DD","EE","FF"];
+ col=["00","11","22","44","66","88","AA","CC","DD","EE","FF"];
var color='#'+col[ir]+col[ig]+col[ib];
- var selection=" ";
- if (color==svalue) { selection="X"; }
+ var selection="X ";
+ if (color==svalue) { selection="X "; }
choicewrite(''+selection+' ');
@@ -420,10 +433,10 @@ function draw() {
choicewrite('');
} else {
if (pscat=='start') {
- tablestart('Starting or opening date and time');
+ tablestart('Date and time');
}
if (pscat=='end') {
- tablestart('Ending or closing date and time');
+ tablestart('Date and time');
}
if (pscat=='interval') {
tablestart('Time interval');
@@ -516,16 +529,116 @@ function draw() {
}
if (ptype=='string') {
- if (pscat=='default') {
- tablestart('Default value or none');
- choicewrite('');
- } else {
- if (pscat=='any') {
+ if ((pscat=='any') || (pscat=='') || (pscat=='default') ||
+ (typeof(pscat)=='undefined')) {
tablestart('Text');
- }
- choicewrite('Value: ');
- choicewrite(' ');
+ choicewrite(' Value: ');
+ choicewrite(' ');
+ }
+ if (pscat=='yesno') {
+ tablestart('Yes/No');
+ choicewrite(' Value: ');
+ choicewrite(' Yes ');
+ choicewrite(' No ');
+ }
+ if (pscat=='examtype') {
+ tablestart('Exam Type');
+ choicewrite(' Value: ');
+ choicewrite(' Online ');
+ choicewrite(' Check out ');
+ }
+ if (pscat=='questiontype') {
+ tablestart('Question Type');
+ choicewrite(' Value: ');
+ choicewrite(' Standard Problem ');
+// choicewrite(' Quiz ');
+ choicewrite(' Practice ');
+ choicewrite(' Exam ');
+// choicewrite(' Assessment ');
+ choicewrite(' Survey ');
+// choicewrite(' Input Form ');
+ choicewrite(' Library ');
+ }
+ if (pscat=='ip') {
+ tablestart('IP Number/Name');
+ choicewrite(' Value: ');
+ choicewrite(' ');
+ }
+ if (pscat=='fileext') {
+ tablestart('Allowed File Extensions');
+ choicewrite(' Value: ');
+ choicewrite(' Plain Text ');
+ choicewrite(' Picture File ');
+ choicewrite(' Office Document ');
+ choicewrite(' ');
+ }
+ if (pscat=='useslots') {
+ tablestart('Slots control access');
+ choicewrite(' Value: ');
+ choicewrite(' No ');
+ choicewrite(' Yes, and the scope of student selected slot is a single resource. ');
+ choicewrite(' Yes, and the scope of student selected slot is the enclosing map/folder. When checking in, it applies to only one resource. ');
+ 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.. ');
choicewrite(' ');
}
}
@@ -534,13 +647,13 @@ function draw() {
tablestart('Choose a Color');
choicewrite('');
if (svalue) {
- choicewrite('Current choice: ');
+ choicewrite('Current choice: ');
}
- for (var ir=1; ir<=15; ir++) {
- for (var ig=1; ig<=15; ig++) {
+ for (var ir=0; ir<=10; ir++) {
+ for (var ig=0; ig<=10; ig++) {
choicewrite('');
- for (var ib=1; ib<=15; ib++) {
+ for (var ib=0; ib<=10; ib++) {
colorfield(ir,ig,ib);
}
choicewrite(' ');
@@ -549,7 +662,7 @@ function draw() {
choicewrite('
');
}
- choicewrite('');
+ choicewrite('');
choiceend();
}
@@ -569,7 +682,7 @@ function catchange() {
function assemble() {
if ((ptype=='date') && (pscat!='interval')) {
- svalue=Math.round(cdate.getTime()/1000);
+ svalue=Math.floor(cdate.getTime()/1000);
}
if (ptype=='tolerance') {
if (pscat=='relative_sym') {
@@ -638,6 +751,11 @@ function init() {
if (pair[0]=='call') { pcode=pair[1]; }
if (pair[0]=='marker') { pmarker=pair[1]; }
if (pair[0]=='name') { pname=pair[1]; }
+ if (pair[0]=='defhour' && pair[1] >= 0 && pair[1] < 24 ) {
+ defhour=pair[1];
+ }
+ if (pair[0]=='defmin' && pair[1] >= 0 && pair[1] < 60) { defmin=pair[1]; }
+ if (pair[0]=='defsec' && pair[1] >= 0 && pair[1] < 60) { defsec=pair[1]; }
}
svalue=pvalue;
@@ -682,6 +800,10 @@ function init() {
if ((pvalue!='') && (typeof(pvalue)!="undefined")) {
cdate.setTime(pvalue*1000);
+ } else {
+ cdate.setSeconds(defsec);
+ cdate.setMinutes(defmin);
+ cdate.setHours(defhour);
}
months[0]='January';
@@ -717,7 +839,12 @@ function init() {
if (ptype=='string') {
sopt('default','Default');
- sopt('string','String Value');
+ sopt('any','String Value');
+ }
+
+ if (ptype=='color') {
+ sopt('default','Use Default Color');
+ sopt('custom','Use Custom Color');
}
selwrite('');
@@ -736,7 +863,7 @@ function init() {
if (pcode!='') {
selwrite('parent.opener.'+pcode+'();');
}
- selwrite('">Store ');
+ selwrite('">Save ');
selwrite('