version 1.70, 2016/03/15 14:25:41
|
version 1.71, 2016/05/13 22:48:14
|
Line 41 var ptype='';
|
Line 41 var ptype='';
|
var pvalue=''; |
var pvalue=''; |
var pmodval=''; |
var pmodval=''; |
var pextraval=''; |
var pextraval=''; |
|
var pextravaltwo=''; |
var preturn=''; |
var preturn=''; |
var pcode=''; |
var pcode=''; |
var pscat=''; |
var pscat=''; |
Line 270 function inthour() {
|
Line 271 function inthour() {
|
} |
} |
result += '</select>'; |
result += '</select>'; |
return result; |
return result; |
} |
} |
|
|
function intsecond() { |
function intsecond() { |
var thisseconds=csecs; |
var thisseconds=csecs; |
Line 314 function intcalc() {
|
Line 315 function intcalc() {
|
if ((ptype=='date') && (pscat=='interval')) { |
if ((ptype=='date') && (pscat=='interval')) { |
var newpmodval = ''; |
var newpmodval = ''; |
var newpextraval = ''; |
var newpextraval = ''; |
|
var newpextravaltwo = 'Done'; |
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; |
|
newpextravaltwo = sform.donebutton_text.value; |
} else { |
} else { |
if (sform.donebutton[i].value == '_done_proctor') { |
if (sform.donebutton[i].value == '_done_proctor') { |
newpmodval = sform.donebutton[i].value; |
newpmodval = sform.donebutton[i].value; |
newpextraval = sform.donebutton_proctorkey.value; |
newpextraval = sform.donebutton_proctorkey.value; |
|
newpextravaltwo = sform.donebutton_text.value; |
|
newpextravaltwo = newpextravaltwo.replace(/:/g,''); |
} |
} |
} |
} |
} |
} |
Line 330 function intcalc() {
|
Line 335 function intcalc() {
|
} |
} |
pmodval = newpmodval; |
pmodval = newpmodval; |
pextraval = newpextraval; |
pextraval = newpextraval; |
|
pextravaltwo = newpextravaltwo; |
draw(); |
draw(); |
if (pmodval) { |
if (pmodval) { |
svalue += pmodval; |
var doneRegExp = /^(_done)(|_proctor)$/; |
} |
var donevals = pmodval.match(doneRegExp); |
if (pextraval != '') { |
if (donevals.length == 3) { |
svalue += '_'+pextraval; |
svalue += donevals[1]; |
|
} |
|
if (newpextravaltwo) { |
|
if (newpextravaltwo != 'Done') { |
|
svalue += ':'+newpextravaltwo+':'; |
|
} |
|
} |
|
if (donevals[2] != '') { |
|
svalue += donevals[2]; |
|
if (pextraval != '') { |
|
svalue += '_'+pextraval; |
|
} |
|
} |
} |
} |
} else { |
} else { |
draw(); |
draw(); |
Line 347 function toggleSecret() {
|
Line 365 function toggleSecret() {
|
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 == '') { |
|
if (document.getElementById('donebuttontextdiv')) { |
|
document.getElementById('donebuttontextdiv').style.display='none'; |
|
} |
|
} else { |
|
if (document.getElementById('donebuttontextdiv')) { |
|
document.getElementById('donebuttontextdiv').style.display='block'; |
|
} |
|
} |
if (sform.donebutton[i].value == '_done_proctor') { |
if (sform.donebutton[i].value == '_done_proctor') { |
if (document.getElementById('done_proctorkey')) { |
if (document.getElementById('done_proctorkey')) { |
document.getElementById('done_proctorkey').type='text'; |
document.getElementById('done_proctorkey').type='text'; |
Line 551 function draw() {
|
Line 578 function draw() {
|
} |
} |
if (pscat=='interval') { |
if (pscat=='interval') { |
var proctorkeytype = 'hidden'; |
var proctorkeytype = 'hidden'; |
|
var donebuttontext = 'none'; |
if (pmodval == '_done_proctor') { |
if (pmodval == '_done_proctor') { |
proctorkeytype = 'text'; |
proctorkeytype = 'text'; |
|
donebuttontext = 'block'; |
|
} |
|
if (pmodval == '_done') { |
|
donebuttontext = 'block'; |
} |
} |
tablestart('Time interval'); |
tablestart('Time interval'); |
choicewrite( [ |
choicewrite( [ |
Line 583 function draw() {
|
Line 615 function draw() {
|
choicewrite(' /> Yes, with proctor key</label>'); |
choicewrite(' /> Yes, with proctor key</label>'); |
choicewrite(' <input name="donebutton_proctorkey" value='+ |
choicewrite(' <input name="donebutton_proctorkey" value='+ |
'"'+escapeHTML(pextraval)+'" type="'+proctorkeytype+ |
'"'+escapeHTML(pextraval)+'" type="'+proctorkeytype+ |
'" id="done_proctorkey"'+' size="10"'+ |
'" id="done_proctorkey" size="10"'+ |
' onblur="parent.intcalc();" /></span>'); |
' onblur="parent.intcalc();" /></span><br />'+ |
|
'<div id="donebuttontextdiv" style="display:'+donebuttontext+'">'+ |
|
'<br /><span style="white-space:nowrap">'+ |
|
'Button text:'+ |
|
'<input name="donebutton_text" value='+ |
|
'"'+escapeHTML(pextravaltwo)+'" type="text" '+ |
|
'size="10" onblur="parent.intcalc();" /></span></div>'); |
choicewrite('</td></tr></table>'); |
choicewrite('</td></tr></table>'); |
} else { |
} else { |
choicewrite('<tr><td colspan="3">' |
choicewrite('<tr><td colspan="3">' |
Line 937 function assemble() {
|
Line 975 function assemble() {
|
function init() { |
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 doneproctorRegExp = /_done(|\:[^\:]+\:)_proctor/; |
var proctorkeyRegExp = /^(\d+)_(.+)$/; |
var proctorkeyRegExp = /^(\d+)_(.+)$/; |
|
var donetextRegExp = /\:([^\:]+)\:/; |
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 971 function init() {
|
Line 1010 function init() {
|
|
|
if (ptype=='date' && pscat == 'interval') { |
if (ptype=='date' && pscat == 'interval') { |
if (doneproctorRegExp.test(pvalue)) { |
if (doneproctorRegExp.test(pvalue)) { |
pmodval = pvalue.match(doneproctorRegExp); |
var current = pvalue.match(doneproctorRegExp); |
|
if (current.length == 2) { |
|
var textstr = current[1]; |
|
if (textstr != '') { |
|
var textvals = textstr.match(donetextRegExp); |
|
if (textvals.length == 2) { |
|
pextravaltwo = textvals[1]; |
|
} |
|
} |
|
} |
var intervalwithkey = pvalue.replace(doneproctorRegExp,''); |
var intervalwithkey = pvalue.replace(doneproctorRegExp,''); |
if (proctorkeyRegExp.test(intervalwithkey)) { |
if (proctorkeyRegExp.test(intervalwithkey)) { |
var currvals = intervalwithkey.match(proctorkeyRegExp); |
var currvals = intervalwithkey.match(proctorkeyRegExp); |
if (currvals.length == 3) { |
if (currvals.length == 3) { |
pvalue = currvals[1]; |
pvalue = currvals[1]; |
pextraval = currvals[2]; |
pextraval = currvals[2]; |
|
pmodval = '_done_proctor'; |
} else { |
} else { |
pmodval = ''; |
pmodval = ''; |
} |
} |
} |
} |
} else { |
} else { |
if (doneRegExp.test(pvalue)) { |
if (doneRegExp.test(pvalue)) { |
|
var current = pvalue.match(doneRegExp); |
|
if (current.length == 2) { |
|
var textstr = current[1]; |
|
if (textstr != '') { |
|
var textvals = textstr.match(donetextRegExp); |
|
if (textvals.length == 2) { |
|
pextravaltwo = textvals[1]; |
|
} |
|
} |
|
} |
var pnumval = pvalue.replace(doneRegExp,''); |
var pnumval = pvalue.replace(doneRegExp,''); |
pmodval = pvalue.match(doneRegExp); |
pmodval = '_done'; |
pvalue = pnumval; |
pvalue = pnumval; |
} |
} |
} |
} |