version 1.406, 2022/09/13 12:22:14
|
version 1.409, 2023/09/10 18:12:54
|
Line 1813 clientTime = (new Date()).getTime();
|
Line 1813 clientTime = (new Date()).getTime();
|
END |
END |
} |
} |
|
|
|
## |
|
# Client-side javascript to convert any dashes in text pasted |
|
# into textbox(es) for numericalresponse item(s) to a standard |
|
# minus, i.e., - . Calls to dash_to_minus_js() in end_problem() |
|
# and in loncommon::endbodytag() for a .page (arg: dashjs => 1) |
|
# |
|
# Will apply to any input tag with class: LC_numresponse_text. |
|
# Currently set in start_textline for numericalresponse items. |
|
# |
|
|
|
sub dash_to_minus_js { |
|
return <<'ENDJS'; |
|
|
|
<script type="text/javascript"> |
|
//<![CDATA[ |
|
//<!-- BEGIN LON-CAPA Internal |
|
document.addEventListener("DOMContentLoaded", (event) => { |
|
const numresp = document.querySelectorAll("input.LC_numresponse_text"); |
|
if (numresp.length > 0) { |
|
numresp.forEach((el) => { |
|
el.addEventListener("paste", (e) => { |
|
e.preventDefault(); |
|
e.stopPropagation(); |
|
let p = (e.clipboardData || window.clipboardData).getData("text"); |
|
p.toString(); |
|
p = p.replace(/\p{Dash}/gu, '-'); |
|
putInText(p); |
|
}); |
|
}); |
|
} |
|
const putInText = (newText, el = document.activeElement) => { |
|
const [start, end] = [el.selectionStart, el.selectionEnd]; |
|
el.setRangeText(newText, start, end, 'end'); |
|
} |
|
}); |
|
// END LON-CAPA Internal --> |
|
//]]> |
|
</script> |
|
|
|
ENDJS |
|
} |
|
|
############################################################ |
############################################################ |
############################################################ |
############################################################ |
|
|
Line 2263 sub docs_breadcrumbs {
|
Line 2305 sub docs_breadcrumbs {
|
# each of randompick number, hidden, encrypted, random order, is_page |
# each of randompick number, hidden, encrypted, random order, is_page |
# are appended with ":"s to the foldername |
# are appended with ":"s to the foldername |
$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)\:?(\d*)$//; |
$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)\:?(\d*)$//; |
unless ($supplementalflag) { |
if ($contenteditor) { |
if ($contenteditor) { |
if ($supplementalflag) { |
|
if ($2) { $ishidden=1; } |
|
} else { |
if ($1 ne '') { |
if ($1 ne '') { |
$randompick=$1; |
$randompick=$1; |
} else { |
} else { |