version 1.69, 2015/11/21 00:16:09
|
version 1.70, 2016/03/15 14:25:41
|
Line 40 Parameter Input Window
|
Line 40 Parameter Input Window
|
var ptype=''; |
var ptype=''; |
var pvalue=''; |
var pvalue=''; |
var pmodval=''; |
var pmodval=''; |
|
var pextraval=''; |
var preturn=''; |
var preturn=''; |
var pcode=''; |
var pcode=''; |
var pscat=''; |
var pscat=''; |
Line 312 function intcalc() {
|
Line 313 function intcalc() {
|
sform.seconds.options[sform.seconds.selectedIndex].value*1; |
sform.seconds.options[sform.seconds.selectedIndex].value*1; |
if ((ptype=='date') && (pscat=='interval')) { |
if ((ptype=='date') && (pscat=='interval')) { |
var newpmodval = ''; |
var newpmodval = ''; |
|
var newpextraval = ''; |
if (sform.donebutton.length) { |
if (sform.donebutton.length) { |
for (var i=0; i<sform.donebutton.length; i++) { |
for (var i=0; i<sform.donebutton.length; i++) { |
if (sform.donebutton[i].checked) { |
if (sform.donebutton[i].checked) { |
if (sform.donebutton[i].value == '_done') { |
if (sform.donebutton[i].value == '_done') { |
newpmodval = sform.donebutton[i].value; |
newpmodval = sform.donebutton[i].value; |
|
} else { |
|
if (sform.donebutton[i].value == '_done_proctor') { |
|
newpmodval = sform.donebutton[i].value; |
|
newpextraval = sform.donebutton_proctorkey.value; |
|
} |
} |
} |
} |
} |
} |
} |
} |
} |
pmodval = newpmodval; |
pmodval = newpmodval; |
|
pextraval = newpextraval; |
draw(); |
draw(); |
if (pmodval) { |
if (pmodval) { |
svalue += pmodval; |
svalue += pmodval; |
} |
} |
|
if (pextraval != '') { |
|
svalue += '_'+pextraval; |
|
} |
} else { |
} else { |
draw(); |
draw(); |
} |
} |
} |
} |
|
|
|
function toggleSecret() { |
|
var sform=choices.document.forms.sch; |
|
if (sform.donebutton.length) { |
|
for (var i=0; i<sform.donebutton.length; i++) { |
|
if (sform.donebutton[i].checked) { |
|
if (sform.donebutton[i].value == '_done_proctor') { |
|
if (document.getElementById('done_proctorkey')) { |
|
document.getElementById('done_proctorkey').type='text'; |
|
} |
|
} else { |
|
if (document.getElementById('done_proctorkey')) { |
|
document.getElementById('done_proctorkey').type='hidden'; |
|
document.getElementById('done_proctorkey').value=''; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
function validateInterval() { |
|
var sform=choices.document.forms.sch; |
|
if (sform.donebutton.length) { |
|
for (var i=0; i<sform.donebutton.length; i++) { |
|
if (sform.donebutton[i].checked) { |
|
if (sform.donebutton[i].value == '_done_proctor') { |
|
if ((sform.donebutton_proctorkey.value == '') || |
|
(sform.donebutton_proctorkey.value == null)) { |
|
alert('Please provide a key for a proctor to enter when a student uses the "Done" button.'); |
|
return; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
intcalc(); |
|
assemble(); |
|
} |
|
|
function integereval() { |
function integereval() { |
svalue=choices.document.forms.sch.intval.value; |
svalue=choices.document.forms.sch.intval.value; |
svalue=Math.round(svalue); |
svalue=Math.round(svalue); |
Line 373 function callradiostringeval(newval) {
|
Line 423 function callradiostringeval(newval) {
|
} |
} |
|
|
function callintervalpmodval() { |
function callintervalpmodval() { |
return 'onclick="parent.intcalc()"'; |
return 'onclick="parent.intcalc();parent.toggleSecret()"'; |
} |
} |
|
|
function intervaldis() { |
function intervaldis() { |
Line 500 function draw() {
|
Line 550 function draw() {
|
tablestart('Date and time'); |
tablestart('Date and time'); |
} |
} |
if (pscat=='interval') { |
if (pscat=='interval') { |
|
var proctorkeytype = 'hidden'; |
|
if (pmodval == '_done_proctor') { |
|
proctorkeytype = 'text'; |
|
} |
tablestart('Time interval'); |
tablestart('Time interval'); |
choicewrite( [ |
choicewrite( [ |
'<tr><td colspan="3">'+intervaldis()+'</td></tr>', |
'<tr><td colspan="3">'+intervaldis()+'</td></tr>', |
Line 514 function draw() {
|
Line 568 function draw() {
|
].join("\n")); |
].join("\n")); |
tablestart('Provide a "Done" button to students?'); |
tablestart('Provide a "Done" button to students?'); |
choicewrite('<tr><td>Value:</td><td colspan="2">'); |
choicewrite('<tr><td>Value:</td><td colspan="2">'); |
|
choicewrite('<label><input name="donebutton" value=""'+ |
|
' type="radio" '+callintervalpmodval()); |
|
if (pmodval == '') { choicewrite(' checked="checked"'); } |
|
choicewrite(' /> No</label><br />'); |
choicewrite('<label><input name="donebutton" value="_done"'+ |
choicewrite('<label><input name="donebutton" value="_done"'+ |
' type="radio" '+callintervalpmodval()); |
' type="radio" '+callintervalpmodval()); |
if (pmodval =='_done') { choicewrite(' checked="checked"'); } |
if (pmodval == '_done') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Yes</label><br />'); |
choicewrite(' /> Yes</label><br />'); |
choicewrite('<label><input name="donebutton" value=""'+ |
choicewrite('<span style="white-space:nowrap">'+ |
|
'<label><input name="donebutton" value="_done_proctor"'+ |
' type="radio" '+callintervalpmodval()); |
' type="radio" '+callintervalpmodval()); |
if (pmodval != '_done') { choicewrite(' checked="checked"'); } |
if (pmodval == '_done_proctor') { choicewrite(' checked="checked"'); } |
choicewrite(' /> No</label><br />'); |
choicewrite(' /> Yes, with proctor key</label>'); |
|
choicewrite(' <input name="donebutton_proctorkey" value='+ |
|
'"'+escapeHTML(pextraval)+'" type="'+proctorkeytype+ |
|
'" id="done_proctorkey"'+' size="10"'+ |
|
' onblur="parent.intcalc();" /></span>'); |
choicewrite('</td></tr></table>'); |
choicewrite('</td></tr></table>'); |
} else { |
} else { |
choicewrite('<tr><td colspan="3">' |
choicewrite('<tr><td colspan="3">' |
Line 875 function init() {
|
Line 938 function init() {
|
var i; |
var i; |
var subs=new Array(); |
var subs=new Array(); |
var doneRegExp = /_done/; |
var doneRegExp = /_done/; |
|
var doneproctorRegExp = /_done_proctor/; |
|
var proctorkeyRegExp = /^(\d+)_(.+)$/; |
var namevalue=this.window.location.search.split('&'); |
var namevalue=this.window.location.search.split('&'); |
namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1); |
namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1); |
|
|
Line 905 function init() {
|
Line 970 function init() {
|
} |
} |
|
|
if (ptype=='date' && pscat == 'interval') { |
if (ptype=='date' && pscat == 'interval') { |
if (doneRegExp.test(pvalue)) { |
if (doneproctorRegExp.test(pvalue)) { |
var pnumval = pvalue.replace(doneRegExp,''); |
pmodval = pvalue.match(doneproctorRegExp); |
pmodval = pvalue.match(doneRegExp); |
var intervalwithkey = pvalue.replace(doneproctorRegExp,''); |
pvalue = pnumval; |
if (proctorkeyRegExp.test(intervalwithkey)) { |
|
var currvals = intervalwithkey.match(proctorkeyRegExp); |
|
if (currvals.length == 3) { |
|
pvalue = currvals[1]; |
|
pextraval = currvals[2]; |
|
} else { |
|
pmodval = ''; |
|
} |
|
} |
|
} else { |
|
if (doneRegExp.test(pvalue)) { |
|
var pnumval = pvalue.replace(doneRegExp,''); |
|
pmodval = pvalue.match(doneRegExp); |
|
pvalue = pnumval; |
|
} |
} |
} |
} |
} |
svalue=pvalue; |
svalue=pvalue; |
Line 1032 function init() {
|
Line 1111 function init() {
|
var targ='parent.opener'; |
var targ='parent.opener'; |
if (pmodal==1) { |
if (pmodal==1) { |
targ='parent.parent'; |
targ='parent.parent'; |
} |
} |
selwrite('<a href="javascript:parent.assemble();'); |
if ((ptype=='date') && (pscat=='interval')) { |
|
selwrite('<a href="javascript:parent.validateInterval();'); |
|
} else { |
|
selwrite('<a href="javascript:parent.assemble();'); |
|
} |
if (preturn!='') { |
if (preturn!='') { |
selwrite(targ+'.document.'+preturn+'_value.value=parent.window.svalue;'); |
selwrite(targ+'.document.'+preturn+'_value.value=parent.window.svalue;'); |
selwrite(targ+'.document.'+preturn+'_type.value=parent.window.stype;'); |
selwrite(targ+'.document.'+preturn+'_type.value=parent.window.stype;'); |