Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Blue Card scripts for assignments on Moodle
<!-- this goes in the additional HTML for the Moodle page-->
<div class="bluecardadded bounce-top" id="tiipopup" style="display: none">
<span style="float: right;" class="dismiss" onclick="dismiss(this);"><i class="fa fa-times"></i></span>
"Blue Card" is now added to the title field of your assignment. Don't delete it!
</div>
<div class="bluecardadded bounce-top" id="mapopup" style="display: none">
<span style="float: right;" class="dismiss" onclick="dismiss(this);"><i class="fa fa-times"></i></span>
"Blue Card" is now added as a comment below.
</div>
<div class="bluecardadded bounce-top" id="tiitutormsg" style="display: none">
<span style="float: right;" class="dismiss" onclick="dismiss(this);"><i class="fa fa-times"></i></span>
<h3>Important message for tutors</h3>
Submissions highlighted in blue are from students with a blue card. <br/>
Please follow the <a href="http://www.brookes.ac.uk/staff/academic/dyslexia-spld-service/marking-work/" target="_blank">Dyslexia/SpLD marking guidelines</a> when marking their work.
</div>
<div class="bluecardadded bounce-top" id="matutormsg" style="display: none">
<span style="float: right;" class="dismiss" onclick="dismiss(this);"><i class="fa fa-times"></i></span>
<h4>Important - markers please check</h4>
<p>A blue box with "Student has added comments, please review" could indicate a blue marking card has been added.</p>
<p>Please check comments and if there is a card, please apply the <a href="http://www.brookes.ac.uk/staff/academic/dyslexia-spld-service/marking-work/" target="_blank">Dyslexia/SpLD marking guidelines</a> accordingly.</p>
</div>
<script type="text/javascript">
function dismiss(el){
el.parentNode.style.display='none';
document.getElementById('overlay').style.display='none';
};
var TurnitinBlueCardButton = '<input type="button" class="bluecard bounce-top" id="tiibluecard" value="Add Blue Card" title="Adds the text \'Blue Card\' at the start of your assignment title" accesskey="b"/> <a href="http://obis-insights.blogspot.co.uk/2017/03/using-blue-card-on-moodle.html" target="_blank" title="What is the Blue Card scheme?" accesskey="?">What\'s this?</a><br/>';
/* TURNITIN BLUE CARD */
if (!document.getElementById('fitem_id_submissiontype')) {
/* do nothing */
} else {
var request = new XMLHttpRequest();
request.open("GET", "/local/obu_indicators/get.php?name=dyslexia_indicator", false);
request.send(null);
if (request.responseText == "Y") {
document.getElementById('fitem_id_submissiontype').insertAdjacentHTML('beforebegin', TurnitinBlueCardButton);
var d = document.getElementsByClassName("dndupload-arrow")[0];
d.className += " accessible";
}
}
/* EVENT LISTENER FOR TURNITIN BLUE CARD BUTTON */
if (!document.getElementById('tiibluecard')) {
/* do nothing */
} else {
document.getElementById("tiibluecard").addEventListener('click', function () {
var title = document.getElementById('id_submissiontitle');
title.removeAttribute('onchange');
if (!title.value) {
title.value = ('Blue Card: ');
} else {
title.value = ('Blue Card: ' + title.value);
}
var x = document.getElementById("tiipopup");
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
});
}
/* highlight blue card in TURNITIN submission inbox table */
if (!document.getElementById('inboxTable')) {
/* do nothing */
} else {
document.getElementById("tiitutormsg").style.display = 'block';
document.getElementById('overlay').style.display='block';
var table = document.getElementById('inboxTable');
var tbody = table.getElementsByTagName('tbody')[0];
var cells = tbody.getElementsByTagName('td');
for (var i=0, len=cells.length; i<len; i++){
if (cells[i].innerText.search('Blue Card') > -1){
var tr = cells[i].parentNode;
tr.style.backgroundColor = '#b7dbff';
cells[i].getElementsByTagName('a')[0].insertAdjacentHTML('afterend', ' &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://its-insights.blogspot.co.uk/2017/03/moodle-blue-card-for-lecturers.html" class="bc-info" target="_blank" title="What is the Blue Card scheme?">Blue Card</a>');
}
}
}
/* MOODLE ASSIGNMENT BLUE CARD */
var checkBlueCard = '<p class="bcsteps"><strong>Assignment submitted</strong><br/>You can check that your blue card has been added by clicking on the comments link below. If you forgot to add it when you submitted, you can <a id="forgotmabluecard" href="#" title="Adds a comment of \'Blue Card\' to request your tutor to use the dyslexia marking scheme" accesskey="b">add it now</a>.</p>';
var MoodleAssignBlueCardButton = '<p class="bcsteps" id="mabcinstructions">Step 1. Add your Blue card. <input type="button" id="mabluecard" value="Add Blue Card" class="bluecard bounce-top" title="Adds a comment of \'Blue Card\' to request your tutor to use the dyslexia marking scheme" accesskey="b"/> <a href="http://its-insights.blogspot.co.uk/2017/03/using-blue-card-on-moodle.html" target="_blank" title="What is the Blue Card scheme?" accesskey="?">What\'s this?</a><br/>&nbsp;<br/>Step 2. Click the add submission button below to submit your assignment</p>';
if (!document.getElementsByClassName('submissionstatustable')[0]) {
/* do nothing */
} else {
var request = new XMLHttpRequest();
request.open("GET", "/local/obu_indicators/get.php?name=dyslexia_indicator", false);
request.send(null);
if (request.responseText == "Y") {
var assignTable = document.getElementsByClassName('submissionstatustable')[0];
assignTable.insertAdjacentHTML('beforebegin', MoodleAssignBlueCardButton);
}
}
/* if it is the tutor's view and there is a blue card comment */
if (!document.getElementsByClassName('submissionstatussubmitted')[0]) {
/* do nothing */
} else {
if (!document.getElementById('mabcinstructions')) {
/* do nothing */
} else {
var bluecardinst = document.getElementById("mabcinstructions");
bluecardinst.style.display = 'none';
bluecardinst.insertAdjacentHTML('beforebegin', checkBlueCard);
}
var commentLink = document.getElementsByClassName("comment-link")[0];
var linkImg = commentLink.getElementsByTagName("img")[0];
if(linkImg.src.search('collapsed') > -1) {
commentLink.click();
}
document.getElementsByClassName('comment-link')[0].insertAdjacentHTML('afterend', '<p class="bluemsg"><strong>Message for tutors</strong>: Student has added comments, please review. If there is a blue card, please apply the <a href="http://www.brookes.ac.uk/staff/academic/dyslexia-spld-service/marking-work/" target="_blank">Dyslexia/SpLD marking guidelines</a> when marking their work.</p>');
}
/* EVENT LISTENER FOR MOODLE ASSIGNMENT BLUE CARD BUTTON */
if (!document.getElementById('mabluecard')) {
/* do nothing */
} else {
document.getElementById("mabluecard").addEventListener('click', function () {
addBlueCard();
});
}
if (!document.getElementById('forgotmabluecard')) {
/* do nothing */
} else {
document.getElementById("forgotmabluecard").addEventListener('click', function () {
addBlueCard();
});
}
if (!document.getElementsByClassName('resettable')[0]) {
/* do nothing */
} else {
var parentdiv = document.getElementsByClassName('resettable')[0];
var resetLink = parentdiv.getElementsByTagName('a')[0];
resetLink.click();
}
/* flag the Blue Card submission in the Grading Table */
if (!document.getElementsByClassName('gradingtable')[0]) {
/* do nothing */
} else {
document.getElementById("block-region-side-post").style.display = 'none';
document.getElementById("region-bs-main-and-pre").style.width = '100%';
document.getElementById("region-main").style.width = '84%';
document.getElementById("block-region-side-pre").style.width = '15%';
document.getElementById("matutormsg").style.display = 'block';
document.getElementById('overlay').style.display='block';
var table = document.getElementsByClassName('gradingtable')[0];
table.insertAdjacentHTML('beforebegin', ' <button id="downloadbluecardcsv" class="bluebutton" onclick="exportTableToCSV(\'submissions.csv\')">Download list of submissions with blue card information</div>');
var tbody = table.getElementsByTagName('tbody')[0];
var comments = tbody.getElementsByClassName('c10');
for (var i=0, len=comments.length; i<len; i++){
if (comments[i].innerText.search('Comments') > -1){
// thisRow = comments[i].closest('tr');
thisRow = comments[i].parentNode;
thisRow.style.backgroundColor = '#ffffcc';
nameLink = thisRow.getElementsByTagName("a")[1];
nameLink.insertAdjacentHTML('afterend', ' <div style="background-color: #99bbff">Student has added comments, please review</div>');
var bluemsg = document.getElementsByClassName('bluemsg')[0];
bluemsg.style.display = 'none';
}
}
}
function addBlueCard() {
var popup = document.getElementById("mapopup");
popup.classList.toggle("show");
var commentbox = document.getElementsByClassName('comment-area')[0];
var textarea = commentbox.getElementsByTagName('textarea')[0];
if (!textarea.value) {
textarea.value = ('<a href="http://its-insights.blogspot.com/2017/03/moodle-blue-card-for-lecturers.html" target="_blank" style="background-color: #99ccff">Blue Card</a>');
} else if (textarea.value == 'Add a comment...') {
textarea.value = ('<a href="http://its-insights.blogspot.com/2017/03/moodle-blue-card-for-lecturers.html" target="_blank" style="background-color: #99ccff">Blue Card</a>');
} else {
textarea.value = ('<a href="http://obis-insights.blogspot.com/2017/03/moodle-blue-card-for-lecturers.html" target="_blank" style="background-color: #99ccff">Blue Card</a>: ' + textarea.value);
}
/* save the comment */
var commentLink = document.getElementsByClassName("comment-link")[0];
var linkImg = commentLink.getElementsByTagName("img")[0];
if(linkImg.src.search('collapsed') > -1) {
commentLink.click();
}
var saveLink = document.getElementsByClassName("fd")[0].getElementsByTagName("a")[0];
saveLink.click();
/* alert the user that something has happened */
var x = document.getElementById("mapopup");
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
}
function downloadCSV(csv, filename) {
var csvFile;
var downloadLink;
// CSV file
csvFile = new Blob([csv], {type: "text/csv"});
// Download link
downloadLink = document.createElement("a");
// File name
downloadLink.download = filename;
// Create a link to the file
downloadLink.href = window.URL.createObjectURL(csvFile);
// Hide download link
downloadLink.style.display = "none";
// Add the link to DOM
document.body.appendChild(downloadLink);
// Click download link
downloadLink.click();
}
function exportTableToCSV(filename) {
var csv = [];
var explanation = 'If the word *Comment* appears in the *Submission comments* or the *Feedback comments* column: the student MAY have added a blue card to their assignment';
csv.push(explanation);
var rows = document.querySelectorAll("table tr");
for (var i = 0; i < rows.length; i++) {
var row = [], cols = rows[i].querySelectorAll("td, th");
for (var j = 0; j < cols.length; j++) {
if (cols[j].innerText.search('Comments') > -1){
row.push('"'+ cols[j].innerText + ' (likely to be a Blue Card, please check)"');
} else {
row.push('"'+ cols[j].innerText + '"');
}
}
csv.push(row.join(","));
}
// Download CSV file
downloadCSV(csv.join("\n"), filename);
}
</script>
/* included as a separate file in case you only want to do Moodle assignements blue card and not Turnitin */
function dismiss(el){
el.parentNode.style.display='none';
};
/* MOODLE ASSIGNMENT BLUE CARD */
var MoodleAssignBlueCardButton = '<p class="bcsteps" id="mabcinstructions">Step 1. Add your Blue card. <input type="button" id="mabluecard" value="Add Blue Card" class="bluecard bounce-top" title="Adds a comment of \'Blue Card\' to request your tutor to use the dyslexia marking scheme" accesskey="b"/> <a href="http://its-insights.blogspot.co.uk/2017/03/using-blue-card-on-moodle.html" target="_blank" title="What is the Blue Card scheme?" accesskey="?">What\'s this?</a><br/>&nbsp;<br/>Step 2. Click the add submission button below to submit your assignment</p>';
if (!document.getElementsByClassName('submissionstatustable')[0]) {
/* do nothing */
} else {
var request = new XMLHttpRequest();
request.open("GET", "/local/obu_indicators/get.php?name=dyslexia_indicator", false);
request.send(null);
if (request.responseText == "Y") {
var assignTable = document.getElementsByClassName('submissionstatustable')[0];
assignTable.insertAdjacentHTML('beforebegin', MoodleAssignBlueCardButton);
}
}
/* if it is the tutor's view and there is a blue card comment */
if (!document.getElementsByClassName('submissionstatussubmitted')[0]) {
/* do nothing */
} else {
if (!document.getElementById('mabcinstructions')) {
/* do nothing */
} else {
var bluecardinst = document.getElementById("mabcinstructions");
bluecardinst.style.display = 'none';
}
var commentLink = document.getElementsByClassName("comment-link")[0];
var linkImg = commentLink.getElementsByTagName("img")[0];
if(linkImg.src.search('collapsed') > -1) {
commentLink.click();
}
document.getElementsByClassName('comment-link')[0].insertAdjacentHTML('afterend', '<p class="bluemsg"><strong>Message for tutors</strong>: Student has added comments, please review. If there is a blue card, please apply the <a href="http://www.brookes.ac.uk/staff/academic/dyslexia-spld-service/marking-work/" target="_blank">Dyslexia/SpLD marking guidelines</a> when marking their work.</p>');
}
/* EVENT LISTENER FOR MOODLE ASSIGNMENT BLUE CARD BUTTON */
if (!document.getElementById('mabluecard')) {
/* do nothing */
} else {
document.getElementById("mabluecard").addEventListener('click', function () {
var popup = document.getElementById("mapopup");
popup.classList.toggle("show");
var commentbox = document.getElementsByClassName('comment-area')[0];
var textarea = commentbox.getElementsByTagName('textarea')[0];
if (!textarea.value) {
textarea.value = ('<a href="http://its-insights.blogspot.com/2017/03/moodle-blue-card-for-lecturers.html" target="_blank" style="background-color: #99ccff">Blue Card</a>');
} else if (textarea.value == 'Add a comment...') {
textarea.value = ('<a href="http://its-insights.blogspot.com/2017/03/moodle-blue-card-for-lecturers.html" target="_blank" style="background-color: #99ccff">Blue Card</a>');
} else {
textarea.value = ('<a href="http://obis-insights.blogspot.com/2017/03/moodle-blue-card-for-lecturers.html" target="_blank" style="background-color: #99ccff">Blue Card</a>: ' + textarea.value);
}
/* save the comment */
var commentLink = document.getElementsByClassName("comment-link")[0];
var linkImg = commentLink.getElementsByTagName("img")[0];
if(linkImg.src.search('collapsed') > -1) {
commentLink.click();
}
var saveLink = document.getElementsByClassName("fd")[0].getElementsByTagName("a")[0];
saveLink.click();
/* alert the user that something has happened */
var x = document.getElementById("mapopup");
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
});
}
if (!document.getElementsByClassName('resettable')[0]) {
/* do nothing */
} else {
var parentdiv = document.getElementsByClassName('resettable')[0];
var resetLink = parentdiv.getElementsByTagName('a')[0];
resetLink.click();
}
/* flag the Blue Card submission in the Grading Table */
if (!document.getElementsByClassName('gradingtable')[0]) {
/* do nothing */
} else {
document.getElementById("block-region-side-post").style.display = 'none';
document.getElementById("region-bs-main-and-pre").style.width = '100%';
document.getElementById("region-main").style.width = '84%';
document.getElementById("block-region-side-pre").style.width = '15%';
document.getElementById("matutormsg").style.display = 'block';
document.getElementById('overlay').style.display='block';
var table = document.getElementsByClassName('gradingtable')[0];
table.insertAdjacentHTML('beforebegin', ' <button id="downloadbluecardcsv" class="bluebutton" onclick="exportTableToCSV(\'submissions.csv\')">Download list of submissions with blue card information</div>');
var tbody = table.getElementsByTagName('tbody')[0];
var comments = tbody.getElementsByClassName('c10');
for (var i=0, len=comments.length; i<len; i++){
if (comments[i].innerText.search('Comments') > -1){
// thisRow = comments[i].closest('tr');
thisRow = comments[i].parentNode;
thisRow.style.backgroundColor = '#ffffcc';
nameLink = thisRow.getElementsByTagName("a")[1];
nameLink.insertAdjacentHTML('afterend', ' <div style="background-color: #99bbff">Student has added comments, please review</div>');
var bluemsg = document.getElementsByClassName('bluemsg')[0];
bluemsg.style.display = 'none';
}
}
}
function downloadCSV(csv, filename) {
var csvFile;
var downloadLink;
// CSV file
csvFile = new Blob([csv], {type: "text/csv"});
// Download link
downloadLink = document.createElement("a");
// File name
downloadLink.download = filename;
// Create a link to the file
downloadLink.href = window.URL.createObjectURL(csvFile);
// Hide download link
downloadLink.style.display = "none";
// Add the link to DOM
document.body.appendChild(downloadLink);
// Click download link
downloadLink.click();
}
function exportTableToCSV(filename) {
var csv = [];
var explanation = 'If the word *Comment* appears in the *Submission comments* or the *Feedback comments* column: the student MAY have added a blue card to their assignment';
csv.push(explanation);
var rows = document.querySelectorAll("table tr");
for (var i = 0; i < rows.length; i++) {
var row = [], cols = rows[i].querySelectorAll("td, th");
for (var j = 0; j < cols.length; j++) {
if (cols[j].innerText.search('Comments') > -1){
row.push('"'+ cols[j].innerText + ' (likely to be a Blue Card, please check)"');
} else {
row.push('"'+ cols[j].innerText + '"');
}
}
csv.push(row.join(","));
}
// Download CSV file
downloadCSV(csv.join("\n"), filename);
}
/* put this in the additonal custom css for your Moodle theme */
/* this was created to work with Aardvark */
/*BLUE CARD*/
.bluecard {
background-color: rgba(0, 0, 255, 1) !important;
color: #fff;
padding: 6px;
border-radius: 6px;
margin: 6px 0 0 33% !important;
}
.bluebutton {
background-color: rgba(0, 0, 255, 1) !important;
color: #fff;
padding: 6px;
border-radius: 6px;
margin: 6px !important;
}
.dndupload-arrow.accessible {
background: #669ed5 !important;
width: 35px;
height: 25px;
margin: 12px 48%;
}
.dndupload-arrow.accessible::after {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(102, 158, 213, 0);
border-top-color: #669ed5;
border-width: 45px;
margin-left: -45px;
}
a[title^="Blue Card:"] {
background-color: #b7dbff;
color: navy !important;
}
.bc-info {
background-color: #0066ff;
color: #fff !important;
padding: 3px;
}
#inboxTable .cell {
background-color: transparent !important;
}
#tiipopup, #tiitutormsg {
left: 35%;
width: 25%;
top: 26%;
z-index: 20;
}
#mapopup {
left: 45%;
width: 25%;
top: 26%;
}
#matutormsg {
top: 40%;
left: 45%;
width: 25%;
}
.bluecardadded {
z-index: 40;
position: absolute;
padding: 1em;
background-color: rgb(153, 204, 255);
color: #000;
border-radius: 6px;
}
.bluemsg {
background-color: rgb(153, 204, 255);
color: #000;
padding: 6px;
}
.bounce-top {
-webkit-animation: bounce-top 0.9s both;
-moz-animation: bounce-top 0.9s both;
animation: bounce-top 0.9s both;
}
.fade-out {
-webkit-animation: fade-out 10s ease-out both;
-moz-animation: fade-out 10s ease-out both;
animation: fade-out 10s ease-out both;
}
div.no-overflow {
clear: left;
}
p.bcsteps {
border: 1px solid #0000FF;
margin: 6px;
padding: 6px;
border-radius: 6px;
width: 50%;
margin: 0 auto;
}
table.flexible th, .generaltable th, table.flexible td, .generaltable td {
max-width: 15em;
word-wrap: break-word;
}
.overlay {
opacity: 0.7;
z-index: 1;
position: absolute;
top: 0;
left: 0;
width: 100%;
background-color: #424a52;
height: 40em;
height: 100vh;
display: none;
}
/* ----------------------------------------------
* Generated by Animista
* http://animista.net
* T: @cssanimista
* ---------------------------------------------- */
@-webkit-keyframes bounce-top{0%{-webkit-transform:translateY(-45px);transform:translateY(-45px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{-webkit-transform:translateY(-24px);transform:translateY(-24px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}65%{-webkit-transform:translateY(-12px);transform:translateY(-12px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}82%{-webkit-transform:translateY(-6px);transform:translateY(-6px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}93%{-webkit-transform:translateY(-4px);transform:translateY(-4px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}25%,55%,75%,87%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;opacity:1}}@keyframes bounce-top{0%{-webkit-transform:translateY(-45px);transform:translateY(-45px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{-webkit-transform:translateY(-24px);transform:translateY(-24px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}65%{-webkit-transform:translateY(-12px);transform:translateY(-12px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}82%{-webkit-transform:translateY(-6px);transform:translateY(-6px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}93%{-webkit-transform:translateY(-4px);transform:translateY(-4px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}25%,55%,75%,87%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;opacity:1}}
@-webkit-keyframes fade-out-left{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform:translateX(-50px);transform:translateX(-50px);opacity:0}}@keyframes fade-out-left{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform:translateX(-50px);transform:translateX(-50px);opacity:0}}@-webkit-keyframes fade-out-bl{0%{-webkit-transform:translateX(0) translateY(0);transform:translateX(0) translateY(0);opacity:1}100%{-webkit-transform:translateX(-50px) translateY(50px);transform:translateX(-50px) translateY(50px);opacity:0}}@keyframes fade-out-bl{0%{-webkit-transform:translateX(0) translateY(0);transform:translateX(0) translateY(0);opacity:1}100%{-webkit-transform:translateX(-50px) translateY(50px);transform:translateX(-50px) translateY(50px);opacity:0}}@-webkit-keyframes fade-out-tl{0%{-webkit-transform:translateX(0) translateY(0);transform:translateX(0) translateY(0);opacity:1}100%{-webkit-transform:translateX(-50px) translateY(-50px);transform:translateX(-50px) translateY(-50px);opacity:0}}@keyframes fade-out-tl{0%{-webkit-transform:translateX(0) translateY(0);transform:translateX(0) translateY(0);opacity:1}100%{-webkit-transform:translateX(-50px) translateY(-50px);transform:translateX(-50px) translateY(-50px);opacity:0}}@-webkit-keyframes fade-out-bottom{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform:translateY(50px);transform:translateY(50px);opacity:0}}@keyframes fade-out-bottom{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform:translateY(50px);transform:translateY(50px);opacity:0}}@-webkit-keyframes fade-out-br{0%{-webkit-transform:translateX(0) translateY(0);transform:translateX(0) translateY(0);opacity:1}100%{-webkit-transform:translateX(50px) translateY(50px);transform:translateX(50px) translateY(50px);opacity:0}}@keyframes fade-out-br{0%{-webkit-transform:translateX(0) translateY(0);transform:translateX(0) translateY(0);opacity:1}100%{-webkit-transform:translateX(50px) translateY(50px);transform:translateX(50px) translateY(50px);opacity:0}}@-webkit-keyframes fade-out-right{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform:translateX(50px);transform:translateX(50px);opacity:0}}@keyframes fade-out-right{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform:translateX(50px);transform:translateX(50px);opacity:0}}@-webkit-keyframes fade-out-tr{0%{-webkit-transform:translateX(0) translateY(0);transform:translateX(0) translateY(0);opacity:1}100%{-webkit-transform:translateX(50px) translateY(-50px);transform:translateX(50px) translateY(-50px);opacity:0}}@keyframes fade-out-tr{0%{-webkit-transform:translateX(0) translateY(0);transform:translateX(0) translateY(0);opacity:1}100%{-webkit-transform:translateX(50px) translateY(-50px);transform:translateX(50px) translateY(-50px);opacity:0}}@-webkit-keyframes fade-out-top{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform:translateY(-50px);transform:translateY(-50px);opacity:0}}@keyframes fade-out-top{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform:translateY(-50px);transform:translateY(-50px);opacity:0}}@-webkit-keyframes fade-out-fwd{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}100%{-webkit-transform:translateZ(80px);transform:translateZ(80px);opacity:0}}@keyframes fade-out-fwd{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}100%{-webkit-transform:translateZ(80px);transform:translateZ(80px);opacity:0}}@-webkit-keyframes fade-out-bck{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}100%{-webkit-transform:translateZ(-80px);transform:translateZ(-80px);opacity:0}}@keyframes fade-out-bck{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}100%{-webkit-transform:translateZ(-80px);transform:translateZ(-80px);opacity:0}}@-webkit-keyframes fade-out{0%{opacity:1}100%{opacity:0}}@keyframes fade-out{0%{opacity:1}100%{opacity:0}}
@-webkit-keyframes bounce-top{0%{-webkit-transform:translateY(-45px);transform:translateY(-45px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{-webkit-transform:translateY(-24px);transform:translateY(-24px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}65%{-webkit-transform:translateY(-12px);transform:translateY(-12px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}82%{-webkit-transform:translateY(-6px);transform:translateY(-6px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}93%{-webkit-transform:translateY(-4px);transform:translateY(-4px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}25%,55%,75%,87%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;opacity:1}}@keyframes bounce-top{0%{-webkit-transform:translateY(-45px);transform:translateY(-45px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{-webkit-transform:translateY(-24px);transform:translateY(-24px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}65%{-webkit-transform:translateY(-12px);transform:translateY(-12px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}82%{-webkit-transform:translateY(-6px);transform:translateY(-6px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}93%{-webkit-transform:translateY(-4px);transform:translateY(-4px);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}25%,55%,75%,87%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateY(0);transform:translateY(0);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;opacity:1}}
/* included as a separate file in case you only want to do Turnitin blue card and not Moodle assignements */
function dismiss(el){
el.parentNode.style.display='none';
document.getElementById('overlay').style.display='none';
};
var TurnitinBlueCardButton = '<input type="button" class="bluecard bounce-top" id="tiibluecard" value="Add Blue Card" title="Adds the text \'Blue Card\' at the start of your assignment title" accesskey="b"/> <a href="http://obis-insights.blogspot.co.uk/2017/03/using-blue-card-on-moodle.html" target="_blank" title="What is the Blue Card scheme?" accesskey="?">What\'s this?</a><br/>';
/* TURNITIN BLUE CARD */
if (!document.getElementById('fitem_id_submissiontype')) {
/* do nothing */
} else {
var request = new XMLHttpRequest();
request.open("GET", "/local/obu_indicators/get.php?name=dyslexia_indicator", false);
request.send(null);
if (request.responseText == "Y") {
document.getElementById('fitem_id_submissiontype').insertAdjacentHTML('beforebegin', TurnitinBlueCardButton);
var d = document.getElementsByClassName("dndupload-arrow")[0];
d.className += " accessible";
}
}
/* EVENT LISTENER FOR TURNITIN BLUE CARD BUTTON */
if (!document.getElementById('tiibluecard')) {
/* do nothing */
} else {
document.getElementById("tiibluecard").addEventListener('click', function () {
var title = document.getElementById('id_submissiontitle');
title.removeAttribute('onchange');
if (!title.value) {
title.value = ('Blue Card: ');
} else {
title.value = ('Blue Card: ' + title.value);
}
var x = document.getElementById("tiipopup");
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
});
}
/* highlight blue card in TURNITIN submission inbox table */
if (!document.getElementById('inboxTable')) {
/* do nothing */
} else {
document.getElementById("tiitutormsg").style.display = 'block';
document.getElementById('overlay').style.display='block';
var table = document.getElementById('inboxTable');
var tbody = table.getElementsByTagName('tbody')[0];
var cells = tbody.getElementsByTagName('td');
for (var i=0, len=cells.length; i<len; i++){
if (cells[i].innerText.search('Blue Card') > -1){
var tr = cells[i].parentNode;
tr.style.backgroundColor = '#b7dbff';
cells[i].getElementsByTagName('a')[0].insertAdjacentHTML('afterend', ' &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://its-insights.blogspot.co.uk/2017/03/moodle-blue-card-for-lecturers.html" class="bc-info" target="_blank" title="What is the Blue Card scheme?">Blue Card</a>');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment