--- rat/client/parameter.html 2005/06/06 16:06:25 1.30
+++ rat/client/parameter.html 2007/06/13 01:01:33 1.45
@@ -3,7 +3,7 @@
The LearningOnline Network with CAPA
Parameter Input Window
//
-// $Id: parameter.html,v 1.30 2005/06/06 16:06:25 www Exp $
+// $Id: parameter.html,v 1.45 2007/06/13 01:01:33 albertel Exp $
//
// Copyright Michigan State University Board of Trustees
//
@@ -42,6 +42,10 @@ var pscat='';
var pmarker='';
var pname='';
+var defhour=0;
+var defmin=0;
+var defsec=0;
+
var svalue;
var stype;
var smarker;
@@ -172,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; }
@@ -524,11 +529,8 @@ function draw() {
}
if (ptype=='string') {
- if (pscat=='default') {
- tablestart('Default value or none');
- choicewrite('');
- } else {
- if ((pscat=='any') || (pscat=='') || (typeof(pscat)=='undefined')) {
+ if ((pscat=='any') || (pscat=='') || (pscat=='default') ||
+ (typeof(pscat)=='undefined')) {
tablestart('Text');
choicewrite('
Value: | ');
choicewrite(' | Value: | ');
- choicewrite(' Yes ');
- choicewrite(' Yes ');
+ choicewrite(' ');
}
if (pscat=='examtype') {
tablestart('Exam Type');
choicewrite(' |
Value: | ');
- choicewrite(' Online ');
- choicewrite(' Online ');
+ choicewrite(' ');
}
if (pscat=='questiontype') {
tablestart('Question Type');
choicewrite(' |
Value: | ');
- choicewrite(' Standard Problem ');
- choicewrite(' Quiz ');
- choicewrite(' Standard Problem ');
+// choicewrite(' ');
+ choicewrite(' ');
+ choicewrite(' ');
+// choicewrite(' ');
+ choicewrite(' ');
+// choicewrite(' ');
+ choicewrite(' ');
}
if (pscat=='ip') {
tablestart('IP Number/Name');
@@ -599,21 +605,40 @@ function draw() {
if (pscat=='fileext') {
tablestart('Allowed File Extensions');
choicewrite(' |
Value: | ');
- choicewrite(' Plain Text ');
- choicewrite(' Plain Text ');
+ choicewrite(' ');
+ choicewrite(' ');
choicewrite('');
}
+ if (pscat=='useslots') {
+ tablestart('Slots control access');
+ choicewrite(' |
Value: | ');
+ choicewrite(' ');
+ choicewrite(' ');
+ choicewrite(' ');
+ choicewrite(' ');
choicewrite(' | ');
}
}
@@ -637,7 +662,7 @@ function draw() {
choicewrite('');
}
- choicewrite('');
+ choicewrite('');
choiceend();
}
@@ -657,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') {
@@ -726,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;
@@ -771,8 +801,9 @@ function init() {
if ((pvalue!='') && (typeof(pvalue)!="undefined")) {
cdate.setTime(pvalue*1000);
} else {
- cdate.setSeconds(0);
- cdate.setMinutes(0);
+ cdate.setSeconds(defsec);
+ cdate.setMinutes(defmin);
+ cdate.setHours(defhour);
}
months[0]='January';
@@ -807,7 +838,14 @@ function init() {
}
if (ptype=='string') {
- sopt('default','Default');
+ //sopt('default','Default');
+ if (pscat == 'yesno') { sopt('yesno','Yes/No'); }
+ else if (pscat == 'examtype') { sopt('examtype','Exam Type'); }
+ else if (pscat == 'questiontype') { sopt('questiontype','Question Type'); }
+ else if (pscat == 'ip') { sopt('ip','IP Number/Name'); }
+ else if (pscat == 'fileext') { sopt('fileext','File Extension'); }
+ else if (pscat == 'useslots') { sopt('useslots','Slots control access'); }
+ else { pscat = 'any'; }
sopt('any','String Value');
}
@@ -832,7 +870,7 @@ function init() {
if (pcode!='') {
selwrite('parent.opener.'+pcode+'();');
}
- selwrite('">Store ');
+ selwrite('">Save ');
selwrite('