Yesterday’s Keyboard Typing Practice Tutorial‘s web application gets improved today by adding to the variety of input typing ideas on top of the default …
- quotes (thanks to https://www.goodreads.com/quotes) … with …
- random thoughts (thanks to https://randomthingstodo.com/thoughts) … and …
- news headline (thanks to https://newsapi.org)
… input data choices, that last option’s output being in JSON format, and so asking us to convert JSON to HTML. Luckily for us, we can use a global substitution logic set and succeed because the HTML is not needed for display purposes but just as a data source that holds together in recently changed remote_files.php (usage of PHP fopen URL web application) …
<?php
$isjson=false;
function lastjson($intl) {
global $isjson;
$outtl=$intl;
if ($isjson) {
$huhs=explode(']"', $intl);
if (sizeof($huhs) > 1) {
if (trim($huhs[1]) != "") {
$outtl="";
for ($i=0; $i<sizeof($huhs); $i++) {
$outtl.='"' . str_replace("\\" . 'n', '<br>', str_replace("\\" . 'r' . "\\" . 'n', '<br>', explode('"', explode(']"', $intl)[$i] )[-1 + sizeof(explode('"', explode(']"', $intl)[$i]))] )) . ']"<br>';
}
}
}
}
return $outtl;
}
function fixforjson($iln) {
global $isjson;
if ($isjson) {
$wasiln=$iln;
$iln=str_replace('},{','</td></tr><tr><td>',$iln);
$iln=str_replace('}]}','</td></tr></table>',$iln);
$iln=str_replace('{[{','<table><tr><td>',$iln);
$iln=str_replace(':[{',':</td></tr></thead><tr><td>',$iln);
if (substr($iln,0,1) == '{') { $iln='<table><thead><tr><td>' . substr($iln,1); }
$iln=str_replace('":{','":<span>',$iln);
$iln=str_replace('},','</span>,',$iln);
$iln=str_replace(',"','</td><td>"',$iln);
$iln=str_replace('>"',' class="',$iln);
$iln=str_replace('":','">',$iln);
//if (file_exists('iln.html')) {
//file_put_contents('iln.html', file_get_contents('iln.html') . "\n\n" . $iln . "\n\n" . $wasiln);
//} else {
//file_put_contents('iln.html', $iln . "\n\n" . $wasiln);
//}
}
return $iln;
}
?>
… worked via a new dropdown (select) HTML element in the changed no_copy_paste.htm Keyboard Typing Practising web application you can also try below.
Previous relevant Keyboard Typing Practice Tutorial is shown below.
Yes, as a lot of you will have guessed, from Paste Disabling Primer Tutorial, that today we use it in a new “Keyboard Typing Practice” web application, knowing that we’ll be testing typing rather than “copy/pasting”.
And another recently changed remote_files.php (usage of PHP fopen URL web application) last talked about at PHP Remote Files Refined Containing Attribute Tutorial joins us, helping us randomize a quote that the user is asked to type, and we calculate the user …
- typing words per minute rate
- typing characters per minute rate
- typing accuracy percentage … aim for 100%
- typing retake percentage … aim for 0%
… as guidelines the user can note to monitor for improvement.
So try our “how we got there from proof of concept” no_copy_paste.htm Keyboard Typing Practising web application you can also try below …
Previous relevant Paste Disabling Primer Tutorial is shown below.
We have an unusual request to make to even consider a new project, which we’ll reveal over time, and which we want to take on, today. It’s a requirement to disable any “paste” parts (of the copy/cut/paste paradigm) to the use of any HTML elements the event logic is applied too.
Luckily for us a Google search “set textarea to not allowing copy and paste” got us to javascript – Disable pasting text into HTML form – Stack Overflow webpage, thanks, which helped us out here in compiling our first draft “proof of concept” no_copy_paste.html HTML/Javascript web application you can also try below …
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.