Commit cce321cd by Jorem Magcawas

update pause metrics

parent 93dfa4d2
filename,speed,avg_speed
"Felizardo, Brylle Theodure - Application Form.TIFF",2019.4465220643233,2019.4465220643233
"Felizardo, Theodure Brylle - Application Form.TIFF",1667.6961087090797,1843.5713153867014
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Image_Source_Path>./input/Felizardo, Brylle Theodure - Application Form.TIFF</Image_Source_Path>
<No_of_Keystrokes>17</No_of_Keystrokes>
<Processing_Time_Seconds>4.721</Processing_Time_Seconds>
<Surname>asdfasd</Surname>
<Religion>asdfasdf</Religion>
<Birthdate>2022-09-14</Birthdate>
<Age>12</Age>
<No_of_Keystrokes>3</No_of_Keystrokes>
<Processing_Time_Seconds>5.348</Processing_Time_Seconds>
<Surname>MAGALONA</Surname>
<Religion>BIBLE BAPTIST</Religion>
<Birthdate>2022-09-07</Birthdate>
<Age>22</Age>
<Civil_Status>Single</Civil_Status>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Image_Source_Path>./input/Felizardo, Theodure Brylle - Application Form.TIFF</Image_Source_Path>
<No_of_Keystrokes>31</No_of_Keystrokes>
<Processing_Time_Seconds>6.827</Processing_Time_Seconds>
<Surname>asdhfkjahsdkjh</Surname>
<Religion>ksajdhflkjasdf</Religion>
<Birthdate>2022-09-14</Birthdate>
<Age>12</Age>
<No_of_Keystrokes>3</No_of_Keystrokes>
<Processing_Time_Seconds>6.476</Processing_Time_Seconds>
<Surname>ONG</Surname>
<Religion>CHRISTIAN</Religion>
<Birthdate>2022-09-21</Birthdate>
<Age>21</Age>
<Civil_Status>Single</Civil_Status>
\ No newline at end of file
......@@ -13,6 +13,8 @@ let shortcut_flag = false
const csv_header = ['filename', 'speed', 'avg_speed'];
let temp;
const startMetricCapture = () => {
// reset key strokes
key_strokes = 0
......@@ -78,6 +80,8 @@ const stopMetricCapture = () => {
}
}
let interval = null;
const showMetricCapture = () => {
const obj = document.getElementById("counter");
if(key_strokes != 0) {
......@@ -86,9 +90,11 @@ const showMetricCapture = () => {
rate >= 8000 ? obj.className = "green" : obj.className = "red";
obj.innerHTML = rate + " kph"; // immediately apply start value
}
setTimeout(showMetricCapture, 1000);
interval = setTimeout(showMetricCapture, 1000);
}
const saveMetrics = (metrics) => {
try
{
......@@ -135,6 +141,8 @@ const pauseMetricCapture = () => {
hideImage();
disableForm();
promptPaused();
clearTimeout(interval);
temp = key_strokes;
// unpauseMetricCapture();
// alert("PAUSED");
}
......@@ -144,6 +152,8 @@ const unpauseMetricCapture = () => {
time_pause = 0;
unhideImage();
enableForm();
key_strokes = temp;
showMetricCapture();
}
const hideImage = () => {
......@@ -187,6 +197,7 @@ function promptPaused(){
promptMain.appendChild(message);
promptMain.appendChild(okButton);
viewer.appendChild(promptMain);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment