4,8d3 < 13,15d7 < var sourcenum=location.search.split('sourcenum=')[1] ? eval(location.search.split('sourcenum=')[1].split('&')[0]) : 1; < var sdone=false; < var sourceid='sou' + 'rce'; 95c87 < document.getElementById(sourceid).setAttribute('contenteditable',false); --- > document.getElementById('source').setAttribute('contenteditable',false); 98,99c90,91 < if (clonedata != document.getElementById(sourceid).innerHTML) { < clonedata=document.getElementById(sourceid).outerHTML.replace(' id=', ' data-id='); --- > if (clonedata != document.getElementById('source').innerHTML) { > clonedata=document.getElementById('source').outerHTML.replace(' id=', ' data-id='); 101,144d92 < } < if (sourcenum > 1 && !sdone) { < sdone=true; < var snc=document.getElementById('source').innerText; < var ourone=1, onepos=0; < var spanstuff='', kspan=0; < if (eval('' + snc.length) > eval('' + sourcenum)) { < ourone=Math.floor(eval(eval('' + snc.length) / eval('' + sourcenum))); < } < for (kspan=0; kspan' + snc.substring(onepos).substring(0,ourone) + ''; < } else if (eval('' + onepos) < eval('' + snc.length)) { < //alert(snc.substring(onepos)); < spanstuff+='' + snc.substring(onepos) + ''; < } else { < spanstuff+=' '; < } < onepos+=ourone; < } < document.getElementById('dsource').innerHTML='' + spanstuff.replace(/span/g, 'td') + ''; < setTimeout(aathen, 50); < setTimeout(cloneize, 100); < } < < function aathen() { < for (var kspan=0; kspan { < console.log("dragStart"); < sourceid='' + ev.target.id; < // Change the source element's background color < // to show that drag has started < ev.currentTarget.classList.add("dragging"); < // Clear the drag data cache (for all formats/types) < ev.dataTransfer.clearData(); < // Set the drag's format and data. < // Use the event target's id for the data < ev.dataTransfer.setData("text/plain", ev.target.id); < }); < document.getElementById('td' + kspan).addEventListener("dragend", (ev) => < ev.target.classList.remove("dragging") < ); < } < //alert(spanstuff); 145a94 > setTimeout(cloneize, 100); 296,297c245,246 <
<

--- >

>

317d265 < sourceid='' + ev.target.id; 350c298 < if (('' + ev.target.getAttribute('data-answer')) == ('' + document.getElementById('source').getAttribute('data-answer')) || ('' + ev.target.getAttribute('data-answer')) == ('' + document.getElementById(sourceid).getAttribute('data-answer'))) { --- > if (('' + ev.target.getAttribute('data-answer')) == ('' + document.getElementById('source').getAttribute('data-answer'))) { 355,359c303 < if (document.getElementById('source').outerHTML.indexOf(' alert('Correct answer was ' + document.getElementById('source').getAttribute('data-answer')); 364c308 < clonedatatwo=document.getElementById(sourceid).outerHTML; --- > clonedatatwo=document.getElementById('source').outerHTML; 368c312 < clonedatatwo=document.getElementById(sourceid).outerHTML; --- > clonedatatwo=document.getElementById('source').outerHTML;