Skip to content

Commit

Permalink
speech added back to the backend and front end
Browse files Browse the repository at this point in the history
Logger writes xml speech synthesis utterances when logger has completed
task in back end and front end
  • Loading branch information
jehovahsays committed Jun 30, 2024
1 parent f73c5a1 commit db9abae
Show file tree
Hide file tree
Showing 57 changed files with 353 additions and 417 deletions.
101 changes: 72 additions & 29 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
header( 'Accept-Language: en-US,en;q=0.5' );
header( 'Connection: Keep-alive' );
$answer1 = $_POST['secure-form-answer'];
$totalCorrect = 1;
$totalCorrect = 1;
$answer2 = $_POST[''];
$totalCorrect = 0;
if ($answer1 == "Human") { $totalCorrect++; }
echo "<div id='results'>$totalCorrect / 1 correct</div>";
if ($answer2 == "") { $totalCorrect++; }


foreach($_POST as $variable => $value)
{
$value = str_replace(' ', '_', $value);
Expand Down Expand Up @@ -51,8 +56,7 @@
."\""
.">\n"
."<style>fieldset{position:absolute;width:100%;height: 100%;}</style>\n<title>$value</title>\n</head>\n<body>"
// ."<script> var msg = new SpeechSynthesisUtterance('$value'); window.speechSynthesis.speak(msg); </script>\n"
."<fieldset>\n<legend>$value</legend>\n</fieldset>\n</body>\n<html>");
."<fieldset>\n<legend>$value</legend><script> var msg = new SpeechSynthesisUtterance('$value'); window.speechSynthesis.speak(msg); </script\n</fieldset>\n</body>\n<html>");
}
foreach($_POST as $variable => $value)
{
Expand All @@ -61,8 +65,9 @@
fwrite($handle,
"<a href="
. "\""
. "../index.html#en/"
. $value
. "./"
. $value
. ".html"
. "\""
. "class="
. "\""
Expand All @@ -76,6 +81,14 @@
. "\r\n");
}

foreach($_POST as $variable => $value)
{
$handle = fopen("./en/$value.txt", "a");
fwrite($handle, "$value"
. "\r\n");
}


foreach($_POST as $variable => $value)
{
$value = str_replace(' ', '_', $value);
Expand All @@ -101,13 +114,13 @@
foreach($_POST as $variable => $value)
{
$value = str_replace(' ', '_', $value);
$handle = fopen("./js/tagcloud.js", "a");
$handle = fopen("./js/tagcloudlog.js", "a");
// load the data and delete the line from the array
$lines = file('./js/tagcloud.js');
$lines = file('./js/tagcloudlog.js');
$last = sizeof($lines) - 1 ;
unset($lines[$last]);
// write the new data to the file
file_put_contents('./js/tagcloud.js', $lines);
file_put_contents('./js/tagcloudlog.js', $lines);
$value = str_replace(' ', '_', $value);
fwrite($handle,
"\""
Expand All @@ -118,26 +131,6 @@
. "];var tc = TagCloud('.content', texts);console.log(tc);");
}

foreach($_POST as $variable => $value)
{
$value = str_replace(' ', '_', $value);
$handle = fopen("./js/chatbot.js", "a");
// load the data and delete the line from the array
$lines = file('./js/chatbot.js');
$last = sizeof($lines) - 1 ;
unset($lines[$last]);
// write the new data to the file
file_put_contents('./js/chatbot.js', $lines);
$value = str_replace(' ', '_', $value);
fwrite($handle,
"\""
. $value
. "\""
. ","
. "\n"
. "];return responses[Math.floor(Math.random() * responses.length)];}window.onblur = function (tabs) {alert('switch tabs alert');};");
}

foreach($_POST as $variable => $value)
{
$value = str_replace(' ', '_', $value);
Expand All @@ -162,7 +155,57 @@
. "\n"
. "}}}");
}


foreach($_POST as $variable => $value)
{
$handle = fopen("./en/index.html", "a");
// load the data and delete the line from the array
$lines = file('./en/index.html');
$last = sizeof($lines) - 1 ;
unset($lines[$last]);
// write the new data to the file
file_put_contents('./en/index.html', $lines);
$value = str_replace(' ', '_', $value);
fwrite($handle,
"<li><a data-page="
. "\""
. $value
. "\""
. "class="
. "\""
. "titleInput"
. "\""
. ">"
. $value
. "</a></li>"
. "\n"
. "</ul><script type="
. "\""
."text/javascript"
. "\""
."src="
. "\""
."../js/edit.js"
. "\""
. ">"
."></script>"
. "\r\n");
}

foreach($_POST as $variable => $value)
{
$value = str_replace(' ', '_', $value);
$handle = fopen("./rss.xml", "a");
// load the data and delete the line from the array
$lines = file('./rss.xml');
$last = sizeof($lines) - 1 ;
unset($lines[$last]);
// write the new data to the file
file_put_contents('./rss.xml', $lines);
fwrite($handle,
"<$value>en/$value</$value>\n"
."</$value></en></root>");
}
//echo "<meta name='viewport' content='width=device-width'>successfully created <a href='./#en/$value.html'>$value</a>";
echo "<body onload='loadout()'><script>function loadout(){window.location.href = './en/database.html'}</script>";
echo "<script> var msg = new SpeechSynthesisUtterance('i will remember the word $value'); window.speechSynthesis.speak(msg); </script>";
Expand Down
2 changes: 1 addition & 1 deletion css/edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ul {
}

li {
float: right;
float: left;
width: 50%;
height: 50px;
}
Expand Down
12 changes: 12 additions & 0 deletions edit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
foreach($_POST as $variable => $value)
{
$handle = fopen("./en/index.txt", "a");
fwrite($handle, "$value"
. "\r\n");
}
echo "<body onload='loadout()'><script>function loadout(){window.location.href = './en/index.txt'}</script>";
echo "<script> var msg = new SpeechSynthesisUtterance('page edited'); window.speechSynthesis.speak(msg); </script>";
fclose($handle);
exit();
?>
23 changes: 5 additions & 18 deletions en/about.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta
name="viewport"
content="width=device-width">
<style>
fieldset
{
position:absolute;
width: 100%;
height: 100%;
}
</style>
<title>
about
</title>
<head><meta name="viewport"content="width=device-width">
<style>fieldset{position:absolute;width:100%;height: 100%;}</style>
<title>about</title>
</head>
<body>
<body><script> var msg = new SpeechSynthesisUtterance('about'); window.speechSynthesis.speak(msg); </script>
<fieldset>
<legend>about</legend>
<!-- <script> var msg = new SpeechSynthesisUtterance('precipitation'); window.speechSynthesis.speak(msg); </script>
--></fieldset>
</fieldset>
</body>
<html>
1 change: 1 addition & 0 deletions en/about.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
about
12 changes: 0 additions & 12 deletions en/air-pocket.html

This file was deleted.

7 changes: 3 additions & 4 deletions en/light.html → en/balance.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<html>
<head><meta name="viewport"content="width=device-width">
<style>fieldset{position:absolute;width:100%;height: 100%;}</style>
<title>light</title>
<title>balance</title>
</head>
<body><!-- <script> var msg = new SpeechSynthesisUtterance('precipitation'); window.speechSynthesis.speak(msg); </script>
--><fieldset>
<legend>light</legend>
<body><fieldset>
<legend>balance</legend><script> var msg = new SpeechSynthesisUtterance('balance'); window.speechSynthesis.speak(msg); </script
</fieldset>
</body>
<html>
1 change: 1 addition & 0 deletions en/balance.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
balance
13 changes: 0 additions & 13 deletions en/books.html

This file was deleted.

11 changes: 11 additions & 0 deletions en/calculation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head><meta name="viewport"content="width=device-width">
<style>fieldset{position:absolute;width:100%;height: 100%;}</style>
<title>calculation</title>
</head>
<body><fieldset>
<legend>calculation</legend><script> var msg = new SpeechSynthesisUtterance('calculation'); window.speechSynthesis.speak(msg); </script
</fieldset>
</body>
<html>
1 change: 1 addition & 0 deletions en/calculation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
calculation
4 changes: 2 additions & 2 deletions en/condensation.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<style>fieldset{position:absolute;width:100%;height: 100%;}</style>
<title>condensation</title>
</head>
<body><!-- <script> var msg = new SpeechSynthesisUtterance('precipitation'); window.speechSynthesis.speak(msg); </script>
--><fieldset>
<body><fieldset>
<legend>condensation</legend>
<script> var msg = new SpeechSynthesisUtterance('condensation'); window.speechSynthesis.speak(msg); </script>
</fieldset>
</body>
<html>
1 change: 1 addition & 0 deletions en/condensation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
condensation
11 changes: 11 additions & 0 deletions en/creativity.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head><meta name="viewport"content="width=device-width">
<style>fieldset{position:absolute;width:100%;height: 100%;}</style>
<title>creativity</title>
</head>
<body><fieldset>
<legend>creativity</legend><script> var msg = new SpeechSynthesisUtterance('creativity'); window.speechSynthesis.speak(msg); </script
</fieldset>
</body>
<html>
1 change: 1 addition & 0 deletions en/creativity.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
creativity
Loading

0 comments on commit db9abae

Please sign in to comment.