version 1.35, 2006/02/10 23:45:02
|
version 1.47, 2007/10/17 00:27:19
|
Line 32 Parameter Input Window
|
Line 32 Parameter Input Window
|
<title>LON-CAPA</title> |
<title>LON-CAPA</title> |
</head> |
</head> |
|
|
<script> |
<script type="text/javascript"> |
|
|
var ptype=''; |
var ptype=''; |
var pvalue=''; |
var pvalue=''; |
Line 92 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 500 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 522 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') || (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="'+escapeHTML(svalue)+ |
'" type="text" onChange="parent.stringeval()">'); |
'" type="text" onChange="parent.stringeval()">'); |
} |
} |
if (pscat=='yesno') { |
if (pscat=='yesno') { |
Line 551 function draw() {
|
Line 556 function draw() {
|
if (svalue=='no') { choicewrite(' checked'); } |
if (svalue=='no') { choicewrite(' checked'); } |
choicewrite('> No</label><br />'); |
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="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') { |
if (pscat=='examtype') { |
tablestart('Exam Type'); |
tablestart('Exam Type'); |
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>'); |
Line 570 function draw() {
|
Line 591 function draw() {
|
' type="radio" '+callradiostringeval('problem')); |
' type="radio" '+callradiostringeval('problem')); |
if (svalue=='problem') { choicewrite(' checked'); } |
if (svalue=='problem') { choicewrite(' checked'); } |
choicewrite('> Standard Problem</label><br />'); |
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"'+ |
choicewrite('<label><input name="stringval" value="practice"'+ |
' type="radio" '+callradiostringeval('practice')); |
' type="radio" '+callradiostringeval('practice')); |
if (svalue=='practice') { choicewrite(' checked'); } |
if (svalue=='practice') { choicewrite(' checked'); } |
Line 578 function draw() {
|
Line 603 function draw() {
|
' type="radio" '+callradiostringeval('exam')); |
' type="radio" '+callradiostringeval('exam')); |
if (svalue=='exam') { choicewrite(' checked'); } |
if (svalue=='exam') { choicewrite(' checked'); } |
choicewrite('> Exam</label><br />'); |
choicewrite('> Exam</label><br />'); |
choicewrite('<label><input name="stringval" value="assess"'+ |
// choicewrite('<label><input name="stringval" value="assess"'+ |
' type="radio" '+callradiostringeval('assess')); |
// ' type="radio" '+callradiostringeval('assess')); |
if (svalue=='assess') { choicewrite(' checked'); } |
// if (svalue=='assess') { choicewrite(' checked'); } |
choicewrite('> Assessment</label><br />'); |
// choicewrite('> Assessment</label><br />'); |
choicewrite('<label><input name="stringval" value="survey"'+ |
choicewrite('<label><input name="stringval" value="survey"'+ |
' type="radio" '+callradiostringeval('survey')); |
' type="radio" '+callradiostringeval('survey')); |
if (svalue=='survey') { choicewrite(' checked'); } |
if (svalue=='survey') { choicewrite(' checked'); } |
choicewrite('> Survey</label><br />'); |
choicewrite('> Survey</label><br />'); |
choicewrite('<label><input name="stringval" value="form"'+ |
// choicewrite('<label><input name="stringval" value="form"'+ |
' type="radio" '+callradiostringeval('form')); |
// ' type="radio" '+callradiostringeval('form')); |
if (svalue=='form') { choicewrite(' checked'); } |
// if (svalue=='form') { choicewrite(' checked'); } |
choicewrite('> Input Form</label><br />'); |
// choicewrite('> Input Form</label><br />'); |
choicewrite('<label><input name="stringval" value="library"'+ |
choicewrite('<label><input name="stringval" value="library"'+ |
' type="radio" '+callradiostringeval('library')); |
' type="radio" '+callradiostringeval('library')); |
if (svalue=='library') { choicewrite(' checked'); } |
if (svalue=='library') { choicewrite(' checked'); } |
Line 598 function draw() {
|
Line 623 function draw() {
|
if (pscat=='ip') { |
if (pscat=='ip') { |
tablestart('IP Number/Name'); |
tablestart('IP Number/Name'); |
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="'+escapeHTML(svalue)+ |
'" onChange="parent.stringeval()">'); |
'" onChange="parent.stringeval()">'); |
} |
} |
if (pscat=='fileext') { |
if (pscat=='fileext') { |
Line 616 function draw() {
|
Line 641 function draw() {
|
' type="radio" '+callradiostringeval('doc,xls,ppt')); |
' type="radio" '+callradiostringeval('doc,xls,ppt')); |
if (svalue=='doc,xls,ppt') { choicewrite(' checked'); } |
if (svalue=='doc,xls,ppt') { choicewrite(' checked'); } |
choicewrite('> Office Document</label><br />'); |
choicewrite('> Office Document</label><br />'); |
choicewrite('<input name="stringval" size="20" value="'+svalue+ |
choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+ |
'" onChange="parent.stringeval()">'); |
'" 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 628 function draw() {
|
Line 672 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 642 function draw() {
|
Line 686 function draw() {
|
choicewrite('</table></td></table>'); |
choicewrite('</table></td></table>'); |
} |
} |
|
|
choicewrite('</table></form>'); |
choicewrite('</form>'); |
choiceend(); |
choiceend(); |
} |
} |
|
|
Line 662 function catchange() {
|
Line 706 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 818 function init() {
|
Line 862 function init() {
|
} |
} |
|
|
if (ptype=='string') { |
if (ptype=='string') { |
sopt('default','Default'); |
//sopt('default','Default'); |
|
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'); |
sopt('any','String Value'); |
} |
} |
|
|
Line 843 function init() {
|
Line 895 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( |