version 1.79, 2019/01/06 04:02:19
|
version 1.82, 2020/06/03 12:38:01
|
Line 52 var precursive='';
|
Line 52 var precursive='';
|
var pnonreccol=''; |
var pnonreccol=''; |
var pmarkerst=''; |
var pmarkerst=''; |
var pparm=''; |
var pparm=''; |
|
var pextra=''; |
|
|
var defhour=0; |
var defhour=0; |
var defmin=0; |
var defmin=0; |
Line 412 function validateInterval() {
|
Line 413 function validateInterval() {
|
assemble(); |
assemble(); |
} |
} |
|
|
|
function validateDeepLink() { |
|
var sform=choices.document.forms.sch; |
|
svalue = sform.deeplinklisted.options[sform.deeplinklisted.selectedIndex].value+','; |
|
svalue += sform.deeplinkacc.options[sform.deeplinkacc.selectedIndex].value+','; |
|
if (sform.deeplinktypes.length) { |
|
for (var i=0; i<sform.deeplinktypes.length; i++) { |
|
if (sform.deeplinktypes[i].checked) { |
|
svalue += sform.deeplinktypes[i].value; |
|
if (sform.deeplinktypes[i].value == 'key') { |
|
var posskey = sform.deeplinkkey.value; |
|
posskey = posskey.replace(/^\s+|\s+$/g,''); |
|
var keyRegExp = /^\w+$/; |
|
if (keyRegExp.test(posskey)) { |
|
svalue += ':'+posskey; |
|
} |
|
} else if (sform.deeplinktypes[i].value == 'lti') { |
|
var posslti = sform.linkposslti.options[sform.linkposslti.selectedIndex].value; |
|
if (posslti != '' && posslti != null) { |
|
svalue += ':'+posslti; |
|
} |
|
} |
|
break; |
|
} |
|
} |
|
} |
|
assemble(); |
|
} |
|
|
|
function toggleDeepLink() { |
|
var sform=choices.document.forms.sch; |
|
if (sform.deeplinktypes.length) { |
|
var frame = window.frames["choices"]; |
|
for (var i=0; i<sform.deeplinktypes.length; i++) { |
|
if (sform.deeplinktypes[i].checked) { |
|
if (sform.deeplinktypes[i].value == 'key') { |
|
if (frame.document.getElementById('deeplinkkey')) { |
|
frame.document.getElementById('deeplinkkey').type='text'; |
|
} |
|
if (frame.document.getElementById('deeplinkltidiv')) { |
|
frame.document.getElementById('deeplinkltidiv').style.display='none'; |
|
} |
|
} else { |
|
if (frame.document.getElementById('deeplinkkey')) { |
|
frame.document.getElementById('deeplinkkey').type='hidden'; |
|
} |
|
if (frame.document.getElementById('deeplinkltidiv')) { |
|
if (sform.deeplinktypes[i].value == 'lti') { |
|
frame.document.getElementById('deeplinkltidiv').style.display='inline-block'; |
|
} else { |
|
frame.document.getElementById('deeplinkltidiv').style.display='none'; |
|
} |
|
} |
|
} |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
|
|
function calldeeplink() { |
|
return 'onclick="parent.toggleDeepLink()"'; |
|
} |
|
|
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 575 function colorfield(ir,ig,ib) {
|
Line 639 function colorfield(ir,ig,ib) {
|
if (color==svalue) { selection="<font color='#"+col[10-ir]+col[10-ig]+col[10-ib]+"'>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('+"'"+ |
choicewrite('<td bgcolor="'+color+'"><a href="javascript:parent.pickcolor('+"'"+ |
color+"'"+')">'+selection+'</a></td>'); |
color+"'"+')">'+selection+'</a></td>'); |
|
} |
} |
|
|
|
function draw() { |
function draw() { |
choicestart(); |
choicestart(); |
Line 983 function draw() {
|
Line 1046 function draw() {
|
if (patternComma.test(svalue)) { |
if (patternComma.test(svalue)) { |
current = svalue.split(','); |
current = svalue.split(','); |
} else { |
} else { |
current = (svalue); |
current = [svalue]; |
} |
} |
for (var i=0; i<current.length; i++) { |
for (var i=0; i<current.length; i++) { |
if (patternDeny.test(current[i])) { |
if (patternDeny.test(current[i])) { |
Line 1048 function draw() {
|
Line 1111 function draw() {
|
choicewrite('<label><input name="stringval" value="resource"'+ |
choicewrite('<label><input name="stringval" value="resource"'+ |
' type="radio" '+callradiostringeval('resource')); |
' type="radio" '+callradiostringeval('resource')); |
if (svalue=='resource') { choicewrite(' checked="checked"'); } |
if (svalue=='resource') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Yes, and the scope of student selected slot is a single resource.</label><br />'); |
choicewrite(' /> Yes, and the scope of the slot is a single resource.</label><br />'); |
choicewrite('<label><input name="stringval" value="map"'+ |
choicewrite('<label><input name="stringval" value="map"'+ |
' type="radio" '+callradiostringeval('map')); |
' type="radio" '+callradiostringeval('map')); |
if (svalue=='map') { choicewrite(' checked="checked"'); } |
if (svalue=='map') { choicewrite(' checked="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(' /> Yes, and the scope of the 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"'+ |
choicewrite('<label><input name="stringval" value="map_map"'+ |
' type="radio" '+callradiostringeval('map_map')); |
' type="radio" '+callradiostringeval('map_map')); |
if (svalue=='map_map') { choicewrite(' checked="checked"'); } |
if (svalue=='map_map') { choicewrite(' checked="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(' /> Yes, and the scope of the slot is the enclosing map/folder. When checking in, all resources in the map/folder are checked in.</label><br />'); |
choicewrite('</td></tr></table>'); |
choicewrite('</td></tr></table>'); |
} |
} |
if (pscat=='deeplink') { |
if (pscat=='deeplink') { |
|
var deeplinkvals = new Array(); |
|
var linktypeparts = new Array(); |
|
var ltikeyRegExp = /^(lti|key):(\w+)$/; |
|
var dlinkkeysty = 'hidden'; |
|
var dlinkltidivsty = 'none'; |
|
var dlinkkeyval = ''; |
|
if ((svalue != '') && (svalue != null)) { |
|
deeplinkvals = svalue.split(','); |
|
if (ltikeyRegExp.test(deeplinkvals[2])) { |
|
linktypeparts = deeplinkvals[2].split(':'); |
|
deeplinkvals[2] = linktypeparts[0]; |
|
if (linktypeparts[0] == 'key') { |
|
dlinkkeysty = 'text'; |
|
dlinkkeyval = linktypeparts[1]; |
|
} else if (linktypeparts[0] == 'lti') { |
|
dlinkltidivsty = 'inline-block'; |
|
} |
|
} |
|
} else { |
|
deeplinkvals = ['full','res','any']; |
|
} |
|
var deeplinklisting = new Array(); |
|
deeplinklisting = ['full','absent','grades','details','datestatus']; |
|
var deeplinklisttxt = new Array(); |
|
deeplinklisttxt = ['Listed (linked) in both','Not listed','Listed in grades only','Listed (unlinked) in both','Listed (unlinked) inc. status in both']; |
|
var deeplinkscopes = new Array(); |
|
deeplinkscopes = ['res','map','rec']; |
|
var deeplinkscopetxt = new Array(); |
|
deeplinkscopetxt = ['resource only','enclosing map/folder','recursive map/folder']; |
|
var deeplinkurls = new Array(); |
|
deeplinkurls = ['any','only','key','lti']; |
tablestart('Deep-linked items'); |
tablestart('Deep-linked items'); |
choicewrite('<tr><td>Value:</td><td colspan="2">'); |
choicewrite('<tr><td>In Contents or Gradebook?</td><td>'); |
choicewrite('<label><input name="stringval" value="full"'+ |
choicewrite('<select name="deeplinklisted">'); |
' type="radio" '+callradiostringeval('full')); |
for (var i=0; i<deeplinklisting.length; i++) { |
if (svalue=='full') { choicewrite(' checked="checked"'); } |
choicewrite('<option value="'+deeplinklisting[i]+'"'); |
choicewrite(' /> Displayed (linked) in Contents and Grades.</label><br />'); |
if (deeplinkvals[0] == deeplinklisting[i]) { |
choicewrite('<label><input name="stringval" value="absent"'+ |
choicewrite(' selected="selected"'); |
' type="radio" '+callradiostringeval('absent')); |
} |
if (svalue=='absent') { choicewrite(' checked="checked"'); } |
choicewrite('>'+deeplinklisttxt[i]+'</option>'); |
choicewrite(' /> Not displayed in Contents or Grades.</label><br />'); |
} |
choicewrite('<label><input name="stringval" value="grades"'+ |
choicewrite('</select></td></tr>'); |
' type="radio" '+callradiostringeval('grades')); |
choicewrite('<tr><td>Access scope via deep-link</td><td>'); |
if (svalue=='grades') { choicewrite(' checked="checked"'); } |
choicewrite('<select name="deeplinkacc">'); |
choicewrite(' /> Displayed in Grades only.</label><br />'); |
for (var i=0; i<deeplinkscopes.length; i++) { |
choicewrite('<label><input name="stringval" value="details"'+ |
choicewrite('<option value="'+deeplinkscopes[i]+'"'); |
' type="radio" '+callradiostringeval('details')); |
if (deeplinkvals[1] == deeplinkscopes[i]) { |
if (svalue=='details') { choicewrite(' checked="checked"'); } |
choicewrite(' selected="selected"'); |
choicewrite(' /> Displayed (unlinked) in Contents and Grades.</label><br />'); |
} |
choicewrite('<label><input name="stringval" value="datestatus"'+ |
choicewrite('>'+deeplinkscopetxt[i]+'</option>'); |
' type="radio" '+callradiostringeval('datestatus')); |
} |
if (svalue=='datestatus') { choicewrite(' checked="checked"'); } |
choicewrite('</select></td></tr>'); |
choicewrite(' /> Displayed (with date status) but unlinked in Contents and Grades.</label><br />'); |
choicewrite('<tr><td>Supported Link Types</td><td>'); |
|
choicewrite('<span style="white-space: nowrap;"><label>'); |
|
choicewrite('<input name="deeplinktypes" value="any"'+ |
|
' type="radio" '+calldeeplink()); |
|
if (deeplinkvals[2]=='any') { choicewrite(' checked="checked"'); } |
|
choicewrite(' /> regular + deep</label></span><br />'); |
|
choicewrite('<span style="white-space: nowrap;"><label>'); |
|
choicewrite('<input name="deeplinktypes" value="only"'+ |
|
' type="radio" '+calldeeplink()); |
|
if (deeplinkvals[2]=='only') { choicewrite(' checked="checked"'); } |
|
choicewrite(' /> deep only</label></span><br />'); |
|
choicewrite('<span style="white-space: nowrap;"><label>'); |
|
choicewrite('<input name="deeplinktypes" value="key"'+ |
|
' type="radio" '+calldeeplink()); |
|
if (deeplinkvals[2]=='key') { choicewrite(' checked="checked"'); } |
|
choicewrite(' /> deep with key</label>'); |
|
choicewrite('<input type="'+dlinkkeysty+'" name="deeplinkkey" id="deeplinkkey" value="'+dlinkkeyval+'" size="6" />'); |
|
choicewrite('</span><br />'); |
|
if ((pextra != '') && (pextra != null)) { |
|
var ltiRegExp = /^lti_/; |
|
if (ltiRegExp.test(pextra)) { |
|
pextra = pextra.replace(ltiRegExp,''); |
|
var posslti = pextra.split(','); |
|
if (posslti.length >= 1) { |
|
var ltinums = new Array(); |
|
var ltititles = new Array(); |
|
for (var i=0; i<posslti.length; i++) { |
|
var entries = posslti[i].split(':'); |
|
ltinums[i] = entries[0]; |
|
ltititles[i] = decodeURI(entries[1]); |
|
} |
|
if (ltinums.length) { |
|
choicewrite('<span style="white-space: nowrap;"><label>'); |
|
choicewrite('<input name="deeplinktypes" value="lti"'+ |
|
' type="radio" '+calldeeplink()); |
|
if (deeplinkvals[2]=='lti') { choicewrite(' checked="checked"'); } |
|
choicewrite(' /> deep with LTI launch</label>'); |
|
choicewrite('<div id="deeplinkltidiv" style="display:'+dlinkltidivsty+'">'); |
|
choicewrite('<select name="linkposslti">'); |
|
var sel=''; |
|
if (deeplinkvals[2]!='lti') { |
|
sel = ' selected="selected"'; |
|
} |
|
if (ltinums.length > 1) { |
|
choicewrite('<option value=""'+sel+'>Please select</option>'); |
|
} |
|
for (var i=0; i<ltinums.length; i++) { |
|
sel = ''; |
|
if (deeplinkvals[2]=='lti') { |
|
if (linktypeparts.length) { |
|
if (ltinums[i] == linktypeparts[1]) { |
|
sel = ' selected="selected"'; |
|
} |
|
} |
|
} |
|
choicewrite('<option value="'+ltinums[i]+'"'+sel+'>'+ltititles[i]+'</option>'); |
|
} |
|
choicewrite('</select></div></span><br />'); |
|
} |
|
} |
|
} |
|
} |
choicewrite('</td></tr></table>'); |
choicewrite('</td></tr></table>'); |
} |
} |
} |
} |
|
|
if (ptype=='color') { |
if (ptype=='color') { |
Line 1221 function init() {
|
Line 1376 function init() {
|
} |
} |
if (pair[0]=='defmin' && pair[1] >= 0 && pair[1] < 60) { defmin=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]; } |
if (pair[0]=='defsec' && pair[1] >= 0 && pair[1] < 60) { defsec=pair[1]; } |
|
if (pair[0]=='extra') { pextra=pair[1]; } |
} |
} |
|
|
var tablecol = ''; |
var tablecol = ''; |
Line 1411 function init() {
|
Line 1567 function init() {
|
else if (pscat == 'useslots') { sopt('useslots','Slots control access'); } |
else if (pscat == 'useslots') { sopt('useslots','Slots control access'); } |
else if (pscat == 'deeplink') { sopt('deeplink','Deep-linked items'); } |
else if (pscat == 'deeplink') { sopt('deeplink','Deep-linked items'); } |
else { pscat = 'any'; } |
else { pscat = 'any'; } |
sopt('any','String Value'); |
if (pscat != 'deeplink') { sopt('any','String Value'); } |
} |
} |
|
|
if (ptype=='color') { |
if (ptype=='color') { |
Line 1442 function init() {
|
Line 1598 function init() {
|
} |
} |
if ((ptype=='date') && (pscat=='interval')) { |
if ((ptype=='date') && (pscat=='interval')) { |
selwrite('<a href="javascript:parent.validateInterval();'); |
selwrite('<a href="javascript:parent.validateInterval();'); |
|
} else if ((ptype=='string') && (pscat=='deeplink')) { |
|
selwrite('<a href="javascript:parent.validateDeepLink();'); |
} else { |
} else { |
selwrite('<a href="javascript:parent.assemble();'); |
selwrite('<a href="javascript:parent.assemble();'); |
} |
} |