version 1.24, 2003/05/22 23:13:58
|
version 1.49, 2007/11/17 02:50:32
|
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> |
</head> |
</head> |
|
|
<script> |
<script type="text/javascript"> |
|
|
var ptype=''; |
var ptype=''; |
var pvalue=''; |
var pvalue=''; |
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 91 function valline(text,id1,id2) {
|
Line 92 function valline(text,id1,id2) {
|
id2+'></td></tr>'); |
id2+'></td></tr>'); |
} |
} |
|
|
|
function escapeHTML(text) { |
|
text = text.replace(/&/g, '&'); |
|
text = text.replace(/"/g, '"'); |
|
text = text.replace(/</g, '<'); |
|
text = text.replace(/>/g, '>'); |
|
return text; |
|
} |
|
|
function datecalc() { |
function datecalc() { |
var sform=choices.document.forms.sch; |
var sform=choices.document.forms.sch; |
|
|
Line 175 function year() {
|
Line 184 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 314 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 487 function draw() {
|
Line 508 function draw() {
|
tablestart('Integer'); |
tablestart('Integer'); |
} |
} |
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
choicewrite('<input name=intval size=10 value="'+svalue+ |
choicewrite('<input name=intval size=10 value="'+escapeHTML(svalue)+ |
'" name=intval onChange="parent.integereval()">'); |
'" name=intval onChange="parent.integereval()">'); |
choicewrite('</td></table>'); |
choicewrite('</td></table>'); |
} |
} |
Line 509 function draw() {
|
Line 530 function draw() {
|
tablestart('Floating point number'); |
tablestart('Floating point number'); |
} |
} |
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
choicewrite('<input name=floatval size=10 value="'+svalue+ |
choicewrite('<input name=floatval size=10 value="'+escapeHTML(svalue)+ |
'" name=floatval onChange="parent.floateval()">'); |
'" name=floatval onChange="parent.floateval()">'); |
choicewrite('</td></table>'); |
choicewrite('</td></table>'); |
} |
} |
} |
} |
|
|
if (ptype=='string') { |
if (ptype=='string') { |
if (pscat=='default') { |
if ((pscat=='any') || (pscat=='') || (pscat=='default') || |
tablestart('Default value or none'); |
(typeof(pscat)=='undefined')) { |
choicewrite('</table>'); |
|
} else { |
|
if (pscat=='any') { |
|
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="'+escapeHTML(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=='problemstatus') { |
|
tablestart('Problem Status'); |
|
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="answer"'+ |
|
' type="radio" '+callradiostringeval('answer')); |
|
if (svalue=='answer') { choicewrite(' checked'); } |
|
choicewrite('> Yes, and show correct answer if they exceed the maxium number of tries.</label><br />'); |
|
choicewrite('<label><input name="stringval" value="no"'+ |
|
' type="radio" '+callradiostringeval('no')); |
|
if (svalue=='no') { choicewrite(' checked'); } |
|
choicewrite('> No, don\'t show correct/incorrect feedback.</label><br />'); |
|
choicewrite('<label><input name="stringval" value="no_feedback_ever"'+ |
|
' type="radio" '+callradiostringeval('no_feedback_ever')); |
|
if (svalue=='no_feedback_ever') { choicewrite(' checked'); } |
|
choicewrite('> No, show no feedback at all.</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="'+escapeHTML(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="'+escapeHTML(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. When checking in, it applies to only one resource.</label><br />'); |
|
choicewrite('<label><input name="stringval" value="map_map"'+ |
|
' type="radio" '+callradiostringeval('map_map')); |
|
if (svalue=='map_map') { choicewrite(' checked'); } |
|
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 />'); |
choicewrite('</td></table>'); |
choicewrite('</td></table>'); |
} |
} |
} |
} |
Line 535 function draw() {
|
Line 676 function draw() {
|
choicewrite('<table>'); |
choicewrite('<table>'); |
if (svalue) { |
if (svalue) { |
choicewrite('<tr><td colspan="9">Current choice:</td><td bgcolor="'+ |
choicewrite('<tr><td colspan="9">Current choice:</td><td bgcolor="'+ |
svalue+'" colspan="2"> </td></tr>'); |
escapeHTML(svalue)+'" colspan="2"> </td></tr>'); |
} |
} |
for (var ir=0; ir<=10; ir++) { |
for (var ir=0; ir<=10; ir++) { |
for (var ig=0; ig<=10; ig++) { |
for (var ig=0; ig<=10; ig++) { |
Line 549 function draw() {
|
Line 690 function draw() {
|
choicewrite('</table></td></table>'); |
choicewrite('</table></td></table>'); |
} |
} |
|
|
choicewrite('</table></form>'); |
choicewrite('</form>'); |
choiceend(); |
choiceend(); |
} |
} |
|
|
Line 569 function catchange() {
|
Line 710 function catchange() {
|
|
|
function assemble() { |
function assemble() { |
if ((ptype=='date') && (pscat!='interval')) { |
if ((ptype=='date') && (pscat!='interval')) { |
svalue=Math.round(cdate.getTime()/1000); |
svalue=Math.floor(cdate.getTime()/1000); |
} |
} |
if (ptype=='tolerance') { |
if (ptype=='tolerance') { |
if (pscat=='relative_sym') { |
if (pscat=='relative_sym') { |
Line 638 function init() {
|
Line 779 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 675 function init() {
|
Line 821 function init() {
|
} |
} |
|
|
if (ptype=='date') { |
if (ptype=='date') { |
sopt('default','Default'); |
if (pscat != 'interval') { |
sopt('start','Starting Date'); |
sopt('default','Default'); |
sopt('end','Ending Date'); |
sopt('start','Starting Date'); |
sopt('interval','Time Interval'); |
sopt('end','Ending Date'); |
|
} else { |
|
sopt('interval','Time Interval'); |
|
} |
|
|
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 716 function init() {
|
Line 869 function init() {
|
} |
} |
|
|
if (ptype=='string') { |
if (ptype=='string') { |
sopt('default','Default'); |
//sopt('default','Default'); |
sopt('string','String Value'); |
if (pscat == 'yesno') { sopt('yesno','Yes/No'); } |
|
else if (pscat == 'problemstatus'){ sopt('problemstatus','Problem Status'); } |
|
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'); |
} |
} |
|
|
if (ptype=='color') { |
if (ptype=='color') { |
Line 741 function init() {
|
Line 902 function init() {
|
if (pcode!='') { |
if (pcode!='') { |
selwrite('parent.opener.'+pcode+'();'); |
selwrite('parent.opener.'+pcode+'();'); |
} |
} |
selwrite('">Store</a> '); |
selwrite('">Save</a> '); |
|
|
selwrite('<a href="javascript:'); |
selwrite('<a href="javascript:'); |
selwrite( |
selwrite( |