version 1.20, 2003/02/03 18:03:54
|
version 1.38, 2006/05/12 01:20:18
|
Line 27 Parameter Input Window
|
Line 27 Parameter Input Window
|
// |
// |
// http://www.lon-capa.org/ |
// 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 |
|
--> |
--> |
<head> |
<head> |
<title>LON-CAPA</title> |
<title>LON-CAPA</title> |
Line 45 var pscat='';
|
Line 42 var pscat='';
|
var pmarker=''; |
var pmarker=''; |
var pname=''; |
var pname=''; |
|
|
|
var defhour=0; |
|
var defmin=0; |
|
var defsec=0; |
|
|
var svalue; |
var svalue; |
var stype; |
var stype; |
var smarker; |
var smarker; |
Line 175 function year() {
|
Line 176 function year() {
|
var thisyear=cdate.getFullYear(); |
var thisyear=cdate.getFullYear(); |
var nowdate=new Date(); |
var nowdate=new Date(); |
var nowyear=nowdate.getFullYear(); |
var nowyear=nowdate.getFullYear(); |
|
if ( !thisyear ) { thisyear=nowyear; } |
var loweryear=thisyear-2; |
var loweryear=thisyear-2; |
var upperyear=thisyear+5; |
var upperyear=thisyear+5; |
if (thisyear>nowyear) { loweryear=nowyear-2; } |
if (thisyear>nowyear) { loweryear=nowyear-2; } |
Line 304 function stringeval() {
|
Line 306 function stringeval() {
|
draw(); |
draw(); |
} |
} |
|
|
|
function radiostringeval(newval) { |
|
svalue=newval; |
|
draw(); |
|
} |
|
|
|
function callradiostringeval(newval) { |
|
return 'onChange="parent.radiostringeval(\'' |
|
+newval+'\')" onClick="parent.radiostringeval(\'' |
|
+newval+'\')"'; |
|
} |
|
|
function intervaldis() { |
function intervaldis() { |
csecs=svalue; |
csecs=svalue; |
cdays=Math.floor(csecs/86400); |
cdays=Math.floor(csecs/86400); |
Line 315 function intervaldis() {
|
Line 328 function intervaldis() {
|
choicewrite(cdays+' days '+chours+' hours ' |
choicewrite(cdays+' days '+chours+' hours ' |
+cmins+' mins '+csecs+' secs'); |
+cmins+' mins '+csecs+' secs'); |
} |
} |
|
|
|
function pickcolor(picked) { |
|
svalue=picked; |
|
draw(); |
|
} |
|
|
|
function colorfield(ir,ig,ib) { |
|
var col=new Array; |
|
col=["00","11","22","44","66","88","AA","CC","DD","EE","FF"]; |
|
var color='#'+col[ir]+col[ig]+col[ib]; |
|
var selection="<font color='"+color+"'>X</font>"; |
|
if (color==svalue) { selection="<font color='#"+col[10-ir]+col[10-ig]+col[10-ib]+"'>X</font>"; } |
|
choicewrite('<td bgcolor="'+color+'"><a href="javascript:parent.pickcolor('+"'"+ |
|
color+"'"+')">'+selection+'</a></td>'); |
|
|
|
} |
|
|
function draw() { |
function draw() { |
choicestart(); |
choicestart(); |
choicewrite('<form name=sch'); |
choicewrite('<form name=sch'); |
Line 404 function draw() {
|
Line 433 function draw() {
|
choicewrite('</table>'); |
choicewrite('</table>'); |
} else { |
} else { |
if (pscat=='start') { |
if (pscat=='start') { |
tablestart('Starting or opening date and time'); |
tablestart('Date and time'); |
} |
} |
if (pscat=='end') { |
if (pscat=='end') { |
tablestart('Ending or closing date and time'); |
tablestart('Date and time'); |
} |
} |
if (pscat=='interval') { |
if (pscat=='interval') { |
tablestart('Time interval'); |
tablestart('Time interval'); |
Line 504 function draw() {
|
Line 533 function draw() {
|
tablestart('Default value or none'); |
tablestart('Default value or none'); |
choicewrite('</table>'); |
choicewrite('</table>'); |
} else { |
} else { |
if (pscat=='any') { |
if ((pscat=='any') || (pscat=='') || (typeof(pscat)=='undefined')) { |
tablestart('Text'); |
tablestart('Text'); |
} |
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
choicewrite('<input name="stringval" size="20" value="'+svalue+ |
choicewrite('<input name=stringval size=20 value="'+svalue+ |
'" type="text" onChange="parent.stringeval()">'); |
'" name=stringval onChange="parent.stringeval()">'); |
} |
|
if (pscat=='yesno') { |
|
tablestart('Yes/No'); |
|
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
|
choicewrite('<label><input name="stringval" value="yes"'+ |
|
' type="radio" '+callradiostringeval('yes')); |
|
if (svalue=='yes') { choicewrite(' checked'); } |
|
choicewrite('> Yes</label><br />'); |
|
choicewrite('<label><input name="stringval" value="no"'+ |
|
' type="radio" '+callradiostringeval('no')); |
|
if (svalue=='no') { choicewrite(' checked'); } |
|
choicewrite('> No</label><br />'); |
|
} |
|
if (pscat=='examtype') { |
|
tablestart('Exam Type'); |
|
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
|
choicewrite('<label><input name="stringval" value="online"'+ |
|
' type="radio" '+callradiostringeval('online')); |
|
if (svalue=='online') { choicewrite(' checked'); } |
|
choicewrite('> Online</label><br />'); |
|
choicewrite('<label><input name="stringval" value="checkout"'+ |
|
' type="radio" '+callradiostringeval('checkout')); |
|
if (svalue=='checkout') { choicewrite(' checked'); } |
|
choicewrite('> Check out</label><br />'); |
|
} |
|
if (pscat=='questiontype') { |
|
tablestart('Question Type'); |
|
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
|
choicewrite('<label><input name="stringval" value="problem"'+ |
|
' type="radio" '+callradiostringeval('problem')); |
|
if (svalue=='problem') { choicewrite(' checked'); } |
|
choicewrite('> Standard Problem</label><br />'); |
|
// choicewrite('<label><input name="stringval" value="quiz"'+ |
|
// ' type="radio" '+callradiostringeval('quiz')); |
|
// if (svalue=='quiz') { choicewrite(' checked'); } |
|
// choicewrite('> Quiz</label><br />'); |
|
choicewrite('<label><input name="stringval" value="practice"'+ |
|
' type="radio" '+callradiostringeval('practice')); |
|
if (svalue=='practice') { choicewrite(' checked'); } |
|
choicewrite('> Practice</label><br />'); |
|
choicewrite('<label><input name="stringval" value="exam"'+ |
|
' type="radio" '+callradiostringeval('exam')); |
|
if (svalue=='exam') { choicewrite(' checked'); } |
|
choicewrite('> Exam</label><br />'); |
|
// choicewrite('<label><input name="stringval" value="assess"'+ |
|
// ' type="radio" '+callradiostringeval('assess')); |
|
// if (svalue=='assess') { choicewrite(' checked'); } |
|
// choicewrite('> Assessment</label><br />'); |
|
choicewrite('<label><input name="stringval" value="survey"'+ |
|
' type="radio" '+callradiostringeval('survey')); |
|
if (svalue=='survey') { choicewrite(' checked'); } |
|
choicewrite('> Survey</label><br />'); |
|
// choicewrite('<label><input name="stringval" value="form"'+ |
|
// ' type="radio" '+callradiostringeval('form')); |
|
// if (svalue=='form') { choicewrite(' checked'); } |
|
// choicewrite('> Input Form</label><br />'); |
|
choicewrite('<label><input name="stringval" value="library"'+ |
|
' type="radio" '+callradiostringeval('library')); |
|
if (svalue=='library') { choicewrite(' checked'); } |
|
choicewrite('> Library</label><br />'); |
|
} |
|
if (pscat=='ip') { |
|
tablestart('IP Number/Name'); |
|
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
|
choicewrite('<input name="stringval" size="20" value="'+svalue+ |
|
'" onChange="parent.stringeval()">'); |
|
} |
|
if (pscat=='fileext') { |
|
tablestart('Allowed File Extensions'); |
|
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
|
choicewrite('<label><input name="radstringval" value="txt"'+ |
|
' type="radio" '+callradiostringeval('txt')); |
|
if (svalue=='txt') { choicewrite(' checked'); } |
|
choicewrite('> Plain Text</label><br />'); |
|
choicewrite('<label><input name="radstringval" value="png,jpg,jpeg,gif"'+ |
|
' type="radio" '+callradiostringeval('png,jpg,jpeg,gif')); |
|
if (svalue=='png,jpg,jpeg,gif') { choicewrite(' checked'); } |
|
choicewrite('> Picture File</label><br />'); |
|
choicewrite('<label><input name="radstringval" value="doc,xls,ppt"'+ |
|
' type="radio" '+callradiostringeval('doc,xls,ppt')); |
|
if (svalue=='doc,xls,ppt') { choicewrite(' checked'); } |
|
choicewrite('> Office Document</label><br />'); |
|
choicewrite('<input name="stringval" size="20" value="'+svalue+ |
|
'" onChange="parent.stringeval()">'); |
|
} |
|
if (pscat=='useslots') { |
|
tablestart('Slots control access'); |
|
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
|
choicewrite('<label><input name="stringval" value="no"'+ |
|
' type="radio" '+callradiostringeval('no')); |
|
if (svalue=='no') { choicewrite(' checked'); } |
|
choicewrite('> No</label><br />'); |
|
choicewrite('<label><input name="stringval" value="resource"'+ |
|
' type="radio" '+callradiostringeval('resource')); |
|
if (svalue=='resource') { choicewrite(' checked'); } |
|
choicewrite('> Yes, and the scope of student selected slot is a single resource.</label><br />'); |
|
choicewrite('<label><input name="stringval" value="map"'+ |
|
' type="radio" '+callradiostringeval('map')); |
|
if (svalue=='map') { choicewrite(' checked'); } |
|
choicewrite('> Yes, and the scope of student selected slot is the enclosing map/folder.</label><br />'); |
|
} |
choicewrite('</td></table>'); |
choicewrite('</td></table>'); |
} |
} |
} |
} |
|
|
|
if (ptype=='color') { |
|
tablestart('Choose a Color'); |
|
choicewrite('<table>'); |
|
if (svalue) { |
|
choicewrite('<tr><td colspan="9">Current choice:</td><td bgcolor="'+ |
|
svalue+'" colspan="2"> </td></tr>'); |
|
} |
|
for (var ir=0; ir<=10; ir++) { |
|
for (var ig=0; ig<=10; ig++) { |
|
choicewrite('<tr>'); |
|
for (var ib=0; ib<=10; ib++) { |
|
colorfield(ir,ig,ib); |
|
} |
|
choicewrite('</tr>'); |
|
} |
|
} |
|
choicewrite('</table></td></table>'); |
|
} |
|
|
choicewrite('</table></form>'); |
choicewrite('</table></form>'); |
choiceend(); |
choiceend(); |
Line 603 function init() {
|
Line 751 function init() {
|
if (pair[0]=='call') { pcode=pair[1]; } |
if (pair[0]=='call') { pcode=pair[1]; } |
if (pair[0]=='marker') { pmarker=pair[1]; } |
if (pair[0]=='marker') { pmarker=pair[1]; } |
if (pair[0]=='name') { pname=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; |
svalue=pvalue; |
Line 647 function init() {
|
Line 800 function init() {
|
|
|
if ((pvalue!='') && (typeof(pvalue)!="undefined")) { |
if ((pvalue!='') && (typeof(pvalue)!="undefined")) { |
cdate.setTime(pvalue*1000); |
cdate.setTime(pvalue*1000); |
|
} else { |
|
cdate.setSeconds(defsec); |
|
cdate.setMinutes(defmin); |
|
cdate.setHours(defhour); |
} |
} |
|
|
months[0]='January'; |
months[0]='January'; |
Line 682 function init() {
|
Line 839 function init() {
|
|
|
if (ptype=='string') { |
if (ptype=='string') { |
sopt('default','Default'); |
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('</select></form>'); |
selwrite('</select></form>'); |