Mister Ed Mathematics Collaboration Tutorial

Mister Ed Mathematics Collaboration Tutorial

Mister Ed Mathematics Collaboration Tutorial

Onto the previous Mister Ed Mathematics Primer Tutorial, if we are talking collaboration today, you might expect an emoji button or two to send an email or SMS, but we’ve intertwined …

  • ideas of collaboration and sharing … with …
  • window.localStorage (ie. like HTTP Cookie) web browser intersessional and intrasessional approaches to recalling …
  • a user’s own defined YouTube … identifier,duration,start,end … inhouse argument definitions … which can …
  • be slotted (for yourself, as a user, or derivable by an email or SMS recipient) into the mix of (perhaps, now, not) Mister Ed video snippets that get played as a user answers correctly, in the Mister Ed Mathematics quiz

… and we access that just with “behind the scenes” links a savvy user can click to access (but explained in “blurb land”)


function ask() {
var advice='', kpstr='';
var xem=prompt('Enter arguments such as ... ' + String.fromCharCode(10) + String.fromCharCode(10) + "?mr_ed_ideas=REC2gi-Hu2M,REC2gi-Hu2M&mr_ed_ideasdur=299.0,299.0&mr_ed_ideasizero=60,168&mr_ed_ideasjzero=70,237&keep=y" + String.fromCharCode(10) + String.fromCharCode(10) + " ... where your entry must start with ? and the keep=y is there to remember for next session and email= or sms= can be used.", "keep=y&mr_ed_ideas=REC2gi-Hu2M,REC2gi-Hu2M&mr_ed_ideasdur=299.0,299.0&mr_ed_ideasizero=60,168&mr_ed_ideasjzero=70,237");
if (xem == null) { xem=''; } else if (('' + xem + '!').substring(0,1) != '?') { xem=''; }
var wasxem=xem;
if (xem.indexOf('mr_ed_ideas=') != -1 && xem.indexOf('mr_ed_ideasdur=') != -1 && xem.indexOf('mr_ed_ideasizero=') != -1 && xem.indexOf('mr_ed_ideasjzero=') != -1) {
if (xem.indexOf('?') == 0 && xem.indexOf('=') != -1) {
var recip='';
if (xem.indexOf('email=') != -1) {
if (inbideas != '' && inbideasdur != '' && inbideasizero != '' && inbideasjzero != '' && xem.indexOf('mr_ed_ideas') == -1) {
wasxem+='&mr_ed_ideas=' + encodeURIComponent(inbideas);
wasxem+='&mr_ed_ideasdur=' + encodeURIComponent(inbideasdur);
wasxem+='&mr_ed_ideasizero=' + encodeURIComponent(inbideasizero);
wasxem+='&mr_ed_ideasjzero=' + encodeURIComponent(inbideasjzero);
}
if (xem.indexOf('keep=') != -1) {
wasxem=wasxem.replace(/keep\=/g,'keNOep=');
kpstr='?keNOep=y';
advice=encodeURIComponent(' ... if you like Mister Ed (YouTube video) ideas, to remember for the next time, reissue URL below with keNOep changed to keep ...');
}
recip=(xem + '&').split('email=')[1].split('&')[0];
if (recip.trim().indexOf('@') != -1) {
document.getElementById('ems').href='mailto:' + recip + '?subject=Mister%20Ed%20Mathematics' + advice + '&body=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0] + kpstr + '#' + wasxem.replace(/^\?/g,'').replace('email=','emJail=').replace('sms=','sJms='));
setTimeout(function(){ document.getElementById('ems').click(); }, 2000);
}
} else if (xem.indexOf('sms=') != -1) {
if (inbideas != '' && inbideasdur != '' && inbideasizero != '' && inbideasjzero != '' && xem.indexOf('mr_ed_ideas') == -1) {
wasxem+='&mr_ed_ideas=' + encodeURIComponent(inbideas);
wasxem+='&mr_ed_ideasdur=' + encodeURIComponent(inbideasdur);
wasxem+='&mr_ed_ideasizero=' + encodeURIComponent(inbideasizero);
wasxem+='&mr_ed_ideasjzero=' + encodeURIComponent(inbideasjzero);
}
if (xem.indexOf('keep=') != -1) {
wasxem=wasxem.replace(/keep\=/g,'keNOep=');
kpstr='?keNOep=y';
advice=encodeURIComponent(' ... if you like Mister Ed (YouTube video) ideas, to remember for the next time, reissue URL below with keNOep changed to keep ...');
}
recip=(xem + '&').split('sms=')[1].split('&')[0];
if (recip.trim() != '' && recip.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
document.getElementById('ems').href='sms:' + recip + '&body=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0] + kpstr + '#' + wasxem.replace(/^\?/g,'').replace('sms=','sJms=').replace('email=','emJail='));
setTimeout(function(){ document.getElementById('ems').click(); }, 2000);
}
}
location.hash='#' + xem.replace(/^\?/g,'');
var jnbideas=(('' + location.hash + '&' + location.search).split('mr_ed_ideas=')[1] ? ',' + decodeURIComponent(('' + location.hash + '&' + location.search).split('mr_ed_ideas=')[1].split('&')[0]) + ',' : (',' + decodeURIComponent(('' + window.localStorage.getItem('mr_ed_ideas')).replace(/^null/g,'').replace(/^undefined/g,'')).replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",")).replace(/^\,$/g,'') );
var jnbideasdur=(('' + location.hash + '&' + location.search).split('mr_ed_ideasdur=')[1] ? ',' + decodeURIComponent(('' + location.hash + '&' + location.search).split('mr_ed_ideasdur=')[1].split('&')[0]) + ',' : (',' + decodeURIComponent(('' + window.localStorage.getItem('mr_ed_ideasdur')).replace(/^null/g,'').replace(/^undefined/g,'')).replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",")).replace(/^\,$/g,'') );
var jnbideasizero=(('' + location.hash + '&' + location.search).split('mr_ed_ideasizero=')[1] ? ',' + decodeURIComponent(('' + location.hash + '&' + location.search).split('mr_ed_ideasizero=')[1].split('&')[0]) + ',' : (',' + decodeURIComponent(('' + window.localStorage.getItem('mr_ed_ideasizero')).replace(/^null/g,'').replace(/^undefined/g,'')).replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",")).replace(/^\,$/g,'') );
var jnbideasjzero=(('' + location.hash + '&' + location.search).split('mr_ed_ideasjzero=')[1] ? ',' + decodeURIComponent(('' + location.hash + '&' + location.search).split('mr_ed_ideasjzero=')[1].split('&')[0]) + ',' : (',' + decodeURIComponent(('' + window.localStorage.getItem('mr_ed_ideasjzero')).replace(/^null/g,'').replace(/^undefined/g,'')).replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",")).replace(/^\,$/g,'') );
if ((xem + '&').indexOf('mr_ed_ideas=&') != -1 && xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideas');
} catch { }
} else if (jnbideas != '' && jnbideas != inbideas) {
//alert('0:' + jnbideas);
//document.write(String.fromCharCode(10) + '<scr' + "ipt> ideas=['hMPbipfgQ2c'," + jnbideas.replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",") + "'hMPbipfgQ2c','B5eRMaBMOTs','B5eRMaBMOTs','B5eRMaBMOTs','PDJQwyB81vg','PDJQwyB81vg','PDJQwyB81vg','PDJQwyB81vg','-AK1aeKTGDg']; </scr" + "ipt> " + String.fromCharCode(10));
eval(" ideas=['hMPbipfgQ2c'," + jnbideas.replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",") + "'hMPbipfgQ2c','B5eRMaBMOTs','B5eRMaBMOTs','B5eRMaBMOTs','PDJQwyB81vg','PDJQwyB81vg','PDJQwyB81vg','PDJQwyB81vg','-AK1aeKTGDg']");
//alert('1:' + jnbideas);
if (xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideas');
} catch { }
//alert('2:' + jnbideas);
window.localStorage.setItem('mr_ed_ideas', encodeURIComponent(jnbideas));
//alert('3:' + jnbideas);
}
} else if ((xem + '&').indexOf('mr_ed_ideas=&') != -1 && xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideas');
} catch { }
}
if ((xem + '&').indexOf('mr_ed_ideasdur=&') != -1 && xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasdur');
} catch { }
} else if (jnbideasdur != '' && jnbideasdur != inbideasdur) {
//alert(3);
//document.write(String.fromCharCode(10) + '<scr' + "ipt> ideasdur=['41.808'," + jnbideasdur.replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",") + "'41.808','1753.0','1753.0','1753.0','876.0','876.0','876.0','876.0','942.0']; </scr" + "ipt> " + String.fromCharCode(10));
eval(" ideasdur=['41.808'," + jnbideasdur.replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",") + "'41.808','1753.0','1753.0','1753.0','876.0','876.0','876.0','876.0','942.0']");
if (xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasdur');
} catch { }
window.localStorage.setItem('mr_ed_ideasdur', encodeURIComponent(jnbideasdur));
}
} else if ((xem + '&').indexOf('mr_ed_ideasdur=&') != -1 && xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasdur');
} catch { }
}
if ((xem + '&').indexOf('mr_ed_ideasizero=&') != -1 && xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasizero');
} catch { }
} else if (jnbideasizero != '' && jnbideasizero != inbideasizero) {
//alert(4);
//document.write(String.fromCharCode(10) + '<scr' + "ipt> ideasizero=['9'," + jnbideasizero.replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",") + "'23','127','697','742','0','97','175','155','720']; </scr" + "ipt> " + String.fromCharCode(10));
eval(" ideasizero=['9'," + jnbideasizero.replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",") + "'23','127','697','742','0','97','175','155','720']");
if (xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasizero');
} catch { }
window.localStorage.setItem('mr_ed_ideasizero', encodeURIComponent(jnbideasizero));
}
} else if ((xem + '&').indexOf('mr_ed_ideasizero=&') != -1 && xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasizero');
} catch { }
}
if ((xem + '&').indexOf('mr_ed_ideasjzero=&') != -1 && xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasjzero');
} catch { }
} else if (jnbideasjzero != '' && jnbideasjzero != inbideasjzero) {
//alert(5);
//document.write(String.fromCharCode(10) + '<scr' + "ipt> ideasjzero=['11'," + jnbideasjzero.replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",") + "'25','139','742','762','4','150','204','161','785']; </scr" + "ipt> " + String.fromCharCode(10));
eval(" ideasjzero=['11'," + jnbideasjzero.replace(/\'/g,'').replace(/\"/g,'').replace(/^\,/g,"'").replace(/\,/g,"','").replace(/\,\'$/g,",") + "'25','139','742','762','4','150','204','161','785']");
if (xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasjzero');
} catch { }
window.localStorage.setItem('mr_ed_ideasjzero', encodeURIComponent(jnbideasjzero));
}
} else if ((xem + '&').indexOf('mr_ed_ideasjzero=&') != -1 && xem.indexOf('keep=') != -1) {
try {
window.localStorage.removeItem('mr_ed_ideasjzero');
} catch { }
}
//alert(33);
}
}
}

You may have noticed another feature of this changed mr_ed_maths.html Mister Ed Maths web application (you can also try below) continuing on into “day two”. The mathematics test answers, at least ours inspired by Mister Ed, are all one character (albeit numerical) long. And, what does that mean? Anyone? Anyone? Yes, Larry you think it’s …

Hot in Largo

… is that code for “It’s Slowly Getting Hot” … or … yes, Douglas

Flor-ID-a … ErGO?

Yes, well, okay then. Ummm. Think you’re both onto something there. We were thinking, ourselves, like, just in the realms of the everyday, like, that, being as we live in a free society, like, it could be that, given things being the way they were, we could accept user input as if … yes … Amy

As if?!

… it is a Hotkey … phew!!!! Yes, because one key is needed to answer we can introduce a new textbox …


<input onkeydown="return okd(event);" id=ians onblur=checkans(this); style=display:inline-block;width:500px; type=text placeholder='Mobile users can gesture with correct number of fingers involved, for extra score.' value=''></input>

… directed “onkeydown” keyboard event calling …


function okd(evt) {
if (evt.altKey) {
return false;
} else if (evt.ctrlKey) {
return false;
} else if (evt.shiftKey) {
return false;
}
var ichar = evt.which || evt.keyCode;
if (ichar > 48 && ichar <= 57) { setTimeout(function(){ checkans(document.getElementById('ians')); }, 10); } else { evt.target.value=''; return false; }
return true;
}

… Javascript event function, streamlining matters considerably.

And regarding “above the fold” meets “focus” meets “scrolling position” matters, we make more use of that textbox’s placeholder attribute, after it’s initial guise, filling it out with …

  • current score
  • wrong answer explanations … counterintuitively then being able to …
  • shorten it’s width

… for some more improvement, we think, because parts above become “just for show” should they be up the top out of view.


Previous relevant Mister Ed Mathematics Primer Tutorial is shown below.

Mister Ed Mathematics Primer Tutorial

Mister Ed Mathematics Primer Tutorial

Well, we all know …

A horse is a horse, of course, of course …

… and it’s become apparent to Nala that …

No one can talk to a horse, of course …

… but as Luna would tell you …

That is, of course, unless the horse is the famous Mister Ed!

And we wanted to harness these mathematical skills to write a new web application rewarding those eager beaver budding mathematicians (and, presumably, giving short shrift to people) with … well, see for yourself with the “how we got there” mr_ed_maths.html Mister Ed Maths web application …

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Games, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *