Ecrire sous forme de "mixed number" la fraction suivante :
$$\dfrac{14}{3}$$
this.onload = function() {
var ME = this;
var TXT = ME.inside;
var div0 = $.create("div")
.stl("position:relative;display:inline-block;width:120px;height:100px;margin:0px;padding:0px");
var div1 = $.create("div")
.stl("position:relative;display:inline-block;width:120px;height:100px;margin:0px;padding:0px");
var div2 = $.create("div")
.stl("position:absolute;background-color:white;width:120px;height:4px;margin:0px;padding:0px;left:0px;top:48px");
var i0 = $.create("input")
.stl("position:absolute;left:10px;top:0px;outline:none;padding:0px;text-align:center;width:100px;height:100px;font-size:75px")
.cls("w3-input w3-round-large w3-border w3-margin-right")
.att("type:text;pattern:[0-9]*;autocomplete:off;autocorrect:off;autocapitalize:off;spellcheck:false");
var i1 = $.create("input")
.stl("position:absolute;left:10px;top:0px;outline:none;padding:0px;text-align:center;width:100px")
.cls("w3-input w3-xlarge w3-round-large w3-border")
.att("type:text;pattern:[0-9]*;autocomplete:off;autocorrect:off;autocapitalize:off;spellcheck:false");
var i2 = $.create("input")
.stl("position:absolute;left:10px;bottom:0px;outline:none;padding:0px;text-align:center;width:100px")
.cls("w3-input w3-xlarge w3-round-large w3-border")
.att("type:text;pattern:[0-9]*;autocomplete:off;autocorrect:off;autocapitalize:off;spellcheck:false");
var div = $.create("div")
.stl("text-align:center;background-color:#1F96F3;color:white;padding-top:20px;padding-bottom:20px")
.att("id:customized_answer");
div0.add(i0);
div1.add(i1).add(div2).add(i2);
div.add(div0).add(div1);
var old = ME.question.parentNode.find("#customized_answer");
if (old) old.remove();
ME.question.parentNode.add(div);
var N = [i0, i1, i2];
N[0].value = N[1].value = N[2].value = "";
var inp = ME.input.value.split("//");
for (var i = 0; i < inp.length; i++) {
N[i].value = inp[i];
};
var keyup = function(e) {
ME.input.value = N[0].value + "//" + N[1].value + "//" + N[2].value;
ME.input.dispatchEvent(new KeyboardEvent('keyup', {}));
};
var keydown = function(e) {
ME.input.dispatchEvent(new KeyboardEvent('keydown', { 'key': e.key }));
if (["Backspace", "ArrowLeft", "ArrowRight", "Tab"].includes(e.key)) return true;
if (e.key === "Enter") {
return false
};
var old = e.target.value;
var start = e.target.selectionStart;
var end = e.target.selectionEnd;
old = [old.slice(0, start), e.key, old.slice(end)].join('');
return ((/^-$/.test(old)) || (/^-?\d+$/.test(old)));
};
N[0].onkeyup = N[1].onkeyup = N[2].onkeyup = keyup;
N[0].onkeydown = N[1].onkeydown = N[2].onkeydown = keydown;
ME.reponse.hide();
};
