From 388397fe6620aef70b7707f38acf5abc5122cf42 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 11:16:41 +0200
Subject: [PATCH 01/32] Clear theme elements for WAI1 - Update
_writing-evaluation-form.scss
---
.../components/_writing-evaluation-form.scss | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/public/assets/scss/components/_writing-evaluation-form.scss b/public/assets/scss/components/_writing-evaluation-form.scss
index 710e7ee..b92c6a7 100644
--- a/public/assets/scss/components/_writing-evaluation-form.scss
+++ b/public/assets/scss/components/_writing-evaluation-form.scss
@@ -119,3 +119,44 @@
background: #f5f4f4;
}
}
+
+/*----------- clear theme elements for Writing AI evaluation -------------*/
+
+.header-mainmenu,
+.edu-breadcrumb-area,
+.nav-tabs,
+.edu-course-widget,
+.edu-footer,
+h3.heading-title{
+
+ display: none;
+}
+
+
+.col-lg-8{
+ width: 100%
+}
+
+.course-details-content{
+ max-width: 900px;
+ margin: 0 auto;
+ border: 1px solid #eaeaea;
+ border-radius: 5px;
+ padding: 0 50px 50px 50px;
+ box-shadow: 0px 10px 50px rgba(0, 0, 0, 0.05);
+}
+
+.waf-textarea textarea{
+ border: 1px solid #eaeaea !important;
+ border-radius: 5px;
+ height: 300px;
+ background-color: #fff ;
+}
+
+button{
+ margin-top: 30px;
+}
+
+label{
+ padding-left: 25px;
+}
From 18d6dcafd0be829402f992f76538397cce9e44ef Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 14:35:01 +0200
Subject: [PATCH 02/32] Disabling jquery.js for further updates
---
src/utils/jquery.js | 41 +++++++++++++++++++++--------------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index cd40398..19f9379 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -1,32 +1,33 @@
-if (typeof window !== 'undefined') {
+// if (typeof window !== 'undefined') {
- window.$ = window.jQuery = require('jquery');
+// window.$ = window.jQuery = require('jquery');
- $(document).ready(function() {
+// $(document).ready(function() {
- setTimeout(function() { // Change the h1 text
+// setTimeout(function() {
+
+ // // Change the h5 text
+ // $('h5').text("TST Prep's Writing Evaluation Demo 1");
- $('h5').text("TST Prep's Writing Evaluation Demo 1");
+ // // Change placeholder text for textarea elements
+ // $('textarea[name="task"]').attr('placeholder', 'Paste your TOEFL integrated writing task here').css('margin-bottom', '30px');
+ // $('textarea[name="essay"]').attr('placeholder', 'Paste or write your essay here');
- // Change placeholder text for textarea elements
- $('textarea[name="task"]').attr('placeholder', 'Paste your TOEFL integrated writing task here').css('margin-bottom', '30px');
- $('textarea[name="essay"]').attr('placeholder', 'Paste or write your essay here');
+ // // Move the task textarea and its label before the essay textarea
+ // var taskTextArea = $('textarea[name="task"]');
+ // var taskLabel = $('label[for="task"]');
+ // var essayTextArea = $('textarea[name="essay"]');
+ // var essayLabel = $('label[for="essay"]');
- // Move the task textarea and its label before the essay textarea
- var taskTextArea = $('textarea[name="task"]');
- var taskLabel = $('label[for="task"]');
- var essayTextArea = $('textarea[name="essay"]');
- var essayLabel = $('label[for="essay"]');
+ // // Reorder the textareas: Move the task textarea and label before the essay label
+ // essayLabel.before(taskTextArea);
+ // taskTextArea.before(taskLabel);
- // Reorder the textareas: Move the task textarea and label before the essay label
- essayLabel.before(taskTextArea);
- taskTextArea.before(taskLabel);
+// }, 700);
+// });
- }, 700);
- });
-
-}
+// }
From 946b8add8430ebf60deef7d756a322db49c90381 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 15:57:23 +0200
Subject: [PATCH 03/32] Adding code for behavior after submission
---
src/utils/jquery.js | 100 ++++++++++++++++++++++++++++++++++----------
1 file changed, 79 insertions(+), 21 deletions(-)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index 19f9379..b1f6f83 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -1,33 +1,91 @@
-// if (typeof window !== 'undefined') {
+if (typeof window !== 'undefined') {
-// window.$ = window.jQuery = require('jquery');
+ window.$ = window.jQuery = require('jquery');
-// $(document).ready(function() {
+ $(document).ready(function() {
-// setTimeout(function() {
-
- // // Change the h5 text
- // $('h5').text("TST Prep's Writing Evaluation Demo 1");
+ setTimeout(function() {
- // // Change placeholder text for textarea elements
- // $('textarea[name="task"]').attr('placeholder', 'Paste your TOEFL integrated writing task here').css('margin-bottom', '30px');
- // $('textarea[name="essay"]').attr('placeholder', 'Paste or write your essay here');
- // // Move the task textarea and its label before the essay textarea
- // var taskTextArea = $('textarea[name="task"]');
- // var taskLabel = $('label[for="task"]');
- // var essayTextArea = $('textarea[name="essay"]');
- // var essayLabel = $('label[for="essay"]');
+ // PART 1 - edits on form content
+
+ // Change the h5 text
+ $('h5').text("TST Prep's Writing Evaluation Demo 1");
- // // Reorder the textareas: Move the task textarea and label before the essay label
- // essayLabel.before(taskTextArea);
- // taskTextArea.before(taskLabel);
+ // Change placeholder text for textarea elements
+ $('textarea[name="task"]').attr('placeholder', 'Paste your TOEFL integrated writing task here').css('margin-bottom', '30px');
+ $('textarea[name="essay"]').attr('placeholder', 'Paste or write your essay here');
-// }, 700);
-// });
+ // Part 2 - Behavior after form submission
-// }
+ var targetNode = document.querySelector('.course-details-content');
+ var config = { childList: true, subtree: true, characterData: true, attributes: true };
+
+ // Timer functionality encapsulated within startTimer function
+ function startTimer() {
+ var seconds = 0; // Initialize seconds to 0
+ // Update the timer every second
+ return setInterval(function() {
+ seconds++;
+ $('#timer').text(seconds + ' seconds'); // Dynamically update the text
+ }, 1000); // Set interval to 1 second
+ }
+
+ var timerInterval = null; // Declare outside to make it accessible
+
+ // Callback function to execute when mutations are observed
+ var callback = function(mutationsList, observer) {
+ mutationsList.forEach(function(mutation) {
+ if (mutation.type === 'childList') {
+ mutation.addedNodes.forEach(function(node) {
+ if (node.nodeType === 1 && $(node).find('#timer').length) {
+ // Timer exists, indicating form submission occurred and timer was set
+ if (timerInterval) clearInterval(timerInterval);
+ timerInterval = startTimer(); // Start or restart the timer
+ }
+ });
+
+ if (!$(mutation.target).closest('.course-details-content').find('.edu-btn').length) {
+ // If the submit button disappears, clear the timer and remove additional content
+ clearInterval(timerInterval);
+ $('#elapsedTime, #waitingTime').remove();
+ }
+ }
+ });
+ };
+
+ var observer = new MutationObserver(callback);
+ observer.observe(targetNode, config);
+
+ // Handle form submission
+ $('.course-details-content form').on('submit', function(event) {
+ event.preventDefault(); // Prevent the actual form submission for demonstration; adjust as needed
+
+ // Initialize or reset UI elements and timer upon form submission
+ $('textarea[name="task"], textarea[name="essay"]').prop('disabled', true).css({
+ 'background-color': '#f0f0f0',
+ 'cursor': 'not-allowed'
+ });
+
+ var submitButton = $(this).find('.edu-btn').prop('disabled', true).text('Loading...')
+ .css({'pointer-events': 'none', 'filter': 'saturate(30%)'});
+
+ if (!$('#elapsedTime').length) {
+ $('
Elapsed time: 0 seconds
').insertBefore(submitButton);
+ $('
Depending on the length of your essay and the amount of mistakes, the waiting time can vary between 15s and 120s
').insertBefore(submitButton);
+ }
+
+ if (timerInterval) clearInterval(timerInterval); // Clear any existing timer
+ timerInterval = startTimer(); // Start the timer
+ });
+
+
+ }, 700);
+ });
+
+
+}
From d2851e46158c025804fba64af661c9d3b0190906 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 16:09:26 +0200
Subject: [PATCH 04/32] Update script with technical comments
---
src/utils/jquery.js | 135 +++++++++++++++++++++-----------------------
1 file changed, 65 insertions(+), 70 deletions(-)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index b1f6f83..d9c8de4 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -1,91 +1,86 @@
if (typeof window !== 'undefined') {
-
+ // Ensure jQuery is available globally in the window object, a necessary step if jQuery is being used in a React project.
window.$ = window.jQuery = require('jquery');
-
$(document).ready(function() {
-
-
setTimeout(function() {
-
-
- // PART 1 - edits on form content
-
- // Change the h5 text
+ // PART 1 - Edits on form content
+ // Feature: Update the heading to provide a clear title for the demo.
+ // For React: This could be done by storing the title in a state variable and using it directly in the render method or JSX return statement.
$('h5').text("TST Prep's Writing Evaluation Demo 1");
- // Change placeholder text for textarea elements
+ // Feature: Update placeholder text in textarea fields to guide the user on what to input.
+ // For React: Control the placeholder text using state or props, allowing dynamic updates based on user interaction or other conditions.
$('textarea[name="task"]').attr('placeholder', 'Paste your TOEFL integrated writing task here').css('margin-bottom', '30px');
$('textarea[name="essay"]').attr('placeholder', 'Paste or write your essay here');
-
-
- // Part 2 - Behavior after form submission
-
+ // PART 2 - Behavior after form submission
+ // Setup to observe changes in the form container, allowing dynamic response to form submission and other events.
var targetNode = document.querySelector('.course-details-content');
- var config = { childList: true, subtree: true, characterData: true, attributes: true };
-
- // Timer functionality encapsulated within startTimer function
- function startTimer() {
- var seconds = 0; // Initialize seconds to 0
- // Update the timer every second
- return setInterval(function() {
- seconds++;
- $('#timer').text(seconds + ' seconds'); // Dynamically update the text
- }, 1000); // Set interval to 1 second
- }
-
- var timerInterval = null; // Declare outside to make it accessible
+ var config = { childList: true, subtree: true, characterData: true, attributes: true };
+
+ // Timer functionality to provide feedback to the user after form submission.
+ // For React: Use the useState hook for the seconds counter and useEffect for starting the interval. Ensure to clear the interval on component unmount.
+ function startTimer() {
+ var seconds = 0; // Initialize seconds to 0
+ return setInterval(function() {
+ seconds++;
+ $('#timer').text(seconds + ' seconds'); // Dynamically update the text
+ }, 1000); // Set interval to 1 second
+ }
- // Callback function to execute when mutations are observed
- var callback = function(mutationsList, observer) {
- mutationsList.forEach(function(mutation) {
- if (mutation.type === 'childList') {
- mutation.addedNodes.forEach(function(node) {
- if (node.nodeType === 1 && $(node).find('#timer').length) {
- // Timer exists, indicating form submission occurred and timer was set
- if (timerInterval) clearInterval(timerInterval);
- timerInterval = startTimer(); // Start or restart the timer
+ var timerInterval = null; // Declare outside to make it accessible
+
+ // Observe DOM mutations to dynamically adjust UI based on form interaction.
+ var callback = function(mutationsList, observer) {
+ mutationsList.forEach(function(mutation) {
+ if (mutation.type === 'childList') {
+ mutation.addedNodes.forEach(function(node) {
+ // Response to form submission: If the timer element is found, clear any existing timer and start a new one.
+ if (node.nodeType === 1 && $(node).find('#timer').length) {
+ if (timerInterval) clearInterval(timerInterval);
+ timerInterval = startTimer(); // Start or restart the timer
+ }
+ });
+
+ // Cleanup upon form or page change: If the submit button is no longer present, stop the timer and remove added content.
+ if (!$(mutation.target).closest('.course-details-content').find('.edu-btn').length) {
+ clearInterval(timerInterval);
+ $('#elapsedTime, #waitingTime').remove();
+ }
}
});
+ };
- if (!$(mutation.target).closest('.course-details-content').find('.edu-btn').length) {
- // If the submit button disappears, clear the timer and remove additional content
- clearInterval(timerInterval);
- $('#elapsedTime, #waitingTime').remove();
- }
- }
- });
- };
-
- var observer = new MutationObserver(callback);
- observer.observe(targetNode, config);
-
- // Handle form submission
- $('.course-details-content form').on('submit', function(event) {
- event.preventDefault(); // Prevent the actual form submission for demonstration; adjust as needed
-
- // Initialize or reset UI elements and timer upon form submission
- $('textarea[name="task"], textarea[name="essay"]').prop('disabled', true).css({
- 'background-color': '#f0f0f0',
- 'cursor': 'not-allowed'
- });
-
- var submitButton = $(this).find('.edu-btn').prop('disabled', true).text('Loading...')
- .css({'pointer-events': 'none', 'filter': 'saturate(30%)'});
+ var observer = new MutationObserver(callback);
+ observer.observe(targetNode, config);
- if (!$('#elapsedTime').length) {
- $('
Elapsed time: 0 seconds
').insertBefore(submitButton);
- $('
Depending on the length of your essay and the amount of mistakes, the waiting time can vary between 15s and 120s
').insertBefore(submitButton);
- }
+ // Handle form submission to disable inputs, show a loading state, and start a timer.
+ // For React: Implement form submission handling using event handlers. Manage form and button states with useState, and show feedback using state-driven UI updates.
+ $('.course-details-content form').on('submit', function(event) {
+ event.preventDefault(); // Prevent the actual form submission for demonstration; adjust as needed
- if (timerInterval) clearInterval(timerInterval); // Clear any existing timer
- timerInterval = startTimer(); // Start the timer
- });
+ // Disable inputs and show a visual cue to the user that the form is processing.
+ $('textarea[name="task"], textarea[name="essay"]').prop('disabled', true).css({
+ 'background-color': '#f0f0f0',
+ 'cursor': 'not-allowed'
+ });
+
+ // Change the button text to "Loading..." to indicate processing state.
+ var submitButton = $(this).find('.edu-btn').prop('disabled', true).text('Loading...')
+ .css({'pointer-events': 'none', 'filter': 'saturate(30%)'});
+
+ // Add visual feedback about the elapsed time since form submission and expected wait time.
+ if (!$('#elapsedTime').length) {
+ $('
Elapsed time: 0 seconds
').insertBefore(submitButton);
+ $('
Depending on the length of your essay and the amount of mistakes, the waiting time can vary between 15s and 120s
').insertBefore(submitButton);
+ }
+ // Start or reset the timer to give live feedback to the user.
+ if (timerInterval) clearInterval(timerInterval); // Clear any existing timer
+ timerInterval = startTimer(); // Start the timer
+ });
- }, 700);
+ }, 700); // Delay to ensure jQuery manipulations occur after React component render.
});
-
-
}
From 1a6827f8e693ac604a5d3feff19e4ed8281b9ae7 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 17:46:56 +0200
Subject: [PATCH 05/32] Added Part 3 - display original essay after submission
---
src/utils/jquery.js | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index d9c8de4..0b80964 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -81,6 +81,37 @@ if (typeof window !== 'undefined') {
timerInterval = startTimer(); // Start the timer
});
+ // PART 3 - display the original content after submission
+ // Attach an event handler to the form submission on Screen 1
+ $('.course-details-content form').submit(function() {
+ var essayContent = $('textarea[name="essay"]').val();
+ localStorage.setItem('essayContent', essayContent);
+ console.log("Step 1: Form submitted on Screen 1");
+ // After form submission, immediately check and display essay content
+ checkAndDisplayEssayContent();
+ });
+
+ // Function to check for Screen 2 and display the essay content
+ function checkAndDisplayEssayContent() {
+ console.log("Step 2: Inside checkAndDisplayEssayContent function");
+ var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
+ if (screen2Detected) {
+ var essayContent = localStorage.getItem('essayContent');
+ if (essayContent) {
+ // Create a paragraph element with the essay content, add class and insert after h5 title
+ var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
+ $essayParagraph.insertAfter('.course-details-content h5');
+
+ // Create a bolded title and insert before the paragraph
+ var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
+ $title.insertBefore($essayParagraph);
+
+ localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
+ console.log("Step 3: Original essay content displayed");
+ }
+ }
+ }
+
}, 700); // Delay to ensure jQuery manipulations occur after React component render.
});
}
From 69effa647c27283fa2448151cb6c21758cc23278 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 18:01:20 +0200
Subject: [PATCH 06/32] Attempt to add a script to check when an element
appears
---
src/utils/jquery.js | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index 0b80964..dba03a8 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -112,6 +112,25 @@ if (typeof window !== 'undefined') {
}
}
+ // Define a function to check for the presence of .content-box.hovertextp
+ function checkForElement() {
+ console.log("Check for element loaded");
+ // Check if the element exists
+ if ($('.content-box.hovertextp').length > 0) {
+ console.log('.content-box.hovertextp element detected!');
+ clearInterval(intervalId); // Stop checking once the element is detected
+
+ // Update CSS for .original-essay and .original-essay-title elements
+ $('.original-essay, .original-essay-title').css('display', 'inline-block');
+ }
+ }
+
+ // Set an interval to periodically check for the presence of .content-box.hovertextp
+ var intervalId = setInterval(checkForElement, 1000); // Check every second (1000 milliseconds)
+
+
+ // THE END
+
}, 700); // Delay to ensure jQuery manipulations occur after React component render.
});
}
From 6fee2e2c2bb9fa9d34f739549bc3a23eeabb0616 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 18:17:52 +0200
Subject: [PATCH 07/32] Add a dropdown for sample task selection
---
src/utils/jquery.js | 54 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index dba03a8..e34e6f3 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -129,6 +129,60 @@ if (typeof window !== 'undefined') {
var intervalId = setInterval(checkForElement, 1000); // Check every second (1000 milliseconds)
+ // PART 4 - add a dropdown with options to select a sample task
+
+ // Execute code when the DOM is fully loaded
+ $(document).ready(function() {
+ // Create a dropdown with options
+ var dropdown = '';
+
+ // Insert the dropdown above the task label
+ $(dropdown).insertBefore('.course-overview form .form-group:nth-child(2)');
+
+ // Event listener for dropdown change
+ $('#task-sample').change(function() {
+ var selectedSample = $(this).val();
+ var taskContent = '';
+
+ // Define task content based on selected sample
+ switch(selectedSample) {
+ case '1':
+ taskContent = "Sample task 1 content";
+ break;
+ case '2':
+ taskContent = "Sample task 2 content";
+ break;
+ case '3':
+ taskContent = "Sample task 3 content";
+ break;
+ case '4':
+ taskContent = "Sample task 4 content";
+ break;
+ case '5':
+ taskContent = "Sample task 5 content";
+ break;
+ case '6':
+ taskContent = "Sample task 6 content";
+ break;
+ case '7':
+ taskContent = "Sample task 7 content";
+ break;
+ case '8':
+ taskContent = "Sample task 8 content";
+ break;
+ default:
+ taskContent = ""; // Default empty content
+ }
+
+ // Autofill the task textarea with the selected task content as HTML
+ $('textarea[name="task"]').html(taskContent);
+ });
+ });
+
// THE END
}, 700); // Delay to ensure jQuery manipulations occur after React component render.
From 9236fcf06b4fa6181de754957eb1cf1805b1680e Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 18:24:06 +0200
Subject: [PATCH 08/32] 1.6 - start using versioning numbers
---
src/utils/jquery.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index e34e6f3..0ffcefc 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -7,7 +7,7 @@ if (typeof window !== 'undefined') {
// PART 1 - Edits on form content
// Feature: Update the heading to provide a clear title for the demo.
// For React: This could be done by storing the title in a state variable and using it directly in the render method or JSX return statement.
- $('h5').text("TST Prep's Writing Evaluation Demo 1");
+ $('h5').text("TST Prep's Writing Evaluation Demo 1.6");
// Feature: Update placeholder text in textarea fields to guide the user on what to input.
// For React: Control the placeholder text using state or props, allowing dynamic updates based on user interaction or other conditions.
From bf30fd5fde3d280dd7e7701c4f75faf3ab618f16 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 19:47:24 +0200
Subject: [PATCH 09/32] v1.0.7 - updated version number scheme + testing an
insertion in screen 2
---
src/utils/jquery.js | 42 +++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index 0ffcefc..5635d2b 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -7,7 +7,7 @@ if (typeof window !== 'undefined') {
// PART 1 - Edits on form content
// Feature: Update the heading to provide a clear title for the demo.
// For React: This could be done by storing the title in a state variable and using it directly in the render method or JSX return statement.
- $('h5').text("TST Prep's Writing Evaluation Demo 1.6");
+ $('h5').text("TST Prep's Writing Evaluation Demo v1.0.7");
// Feature: Update placeholder text in textarea fields to guide the user on what to input.
// For React: Control the placeholder text using state or props, allowing dynamic updates based on user interaction or other conditions.
@@ -93,24 +93,32 @@ if (typeof window !== 'undefined') {
// Function to check for Screen 2 and display the essay content
function checkAndDisplayEssayContent() {
- console.log("Step 2: Inside checkAndDisplayEssayContent function");
- var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
- if (screen2Detected) {
- var essayContent = localStorage.getItem('essayContent');
- if (essayContent) {
- // Create a paragraph element with the essay content, add class and insert after h5 title
- var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
- $essayParagraph.insertAfter('.course-details-content h5');
-
- // Create a bolded title and insert before the paragraph
- var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
- $title.insertBefore($essayParagraph);
-
- localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
- console.log("Step 3: Original essay content displayed");
- }
+ console.log("Step 2: Inside checkAndDisplayEssayContent function");
+ var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
+ if (screen2Detected) {
+ var essayContent = localStorage.getItem('essayContent');
+ if (essayContent) {
+ // Create a paragraph element with the essay content, add class and insert after h5 title
+ var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
+ $essayParagraph.insertAfter('.course-details-content h5');
+
+ // Create a bolded title and insert before the paragraph
+ var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
+ $title.insertBefore($essayParagraph);
+
+ localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
+ console.log("Step 3: Original essay content displayed");
}
}
+ console.log("Ready to insert buttons");
+ insertButtons(); // Call the new function here
+ }
+
+ // Define the new function somewhere else in the file
+ function insertButtons() {
+ console.log("Inserting buttons now...");
+ // Your button insertion logic here
+ }
// Define a function to check for the presence of .content-box.hovertextp
function checkForElement() {
From ac23779989641bcefc843aa5fc06bcacadd67733 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 20:03:49 +0200
Subject: [PATCH 10/32] v1.0.8 - Insert buttons for 3-way view in screen 2
---
src/utils/jquery.js | 73 +++++++++++++++++++++++++++------------------
1 file changed, 44 insertions(+), 29 deletions(-)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index 5635d2b..59a6d90 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -4,17 +4,17 @@ if (typeof window !== 'undefined') {
$(document).ready(function() {
setTimeout(function() {
- // PART 1 - Edits on form content
+ // PART 1 - Edits on form content --------------------------------------------------------------------------------------------------------------------------------------------------------
// Feature: Update the heading to provide a clear title for the demo.
// For React: This could be done by storing the title in a state variable and using it directly in the render method or JSX return statement.
- $('h5').text("TST Prep's Writing Evaluation Demo v1.0.7");
+ $('h5').text("TST Prep's Writing Evaluation Demo v1.0.8");
// Feature: Update placeholder text in textarea fields to guide the user on what to input.
// For React: Control the placeholder text using state or props, allowing dynamic updates based on user interaction or other conditions.
$('textarea[name="task"]').attr('placeholder', 'Paste your TOEFL integrated writing task here').css('margin-bottom', '30px');
$('textarea[name="essay"]').attr('placeholder', 'Paste or write your essay here');
- // PART 2 - Behavior after form submission
+ // PART 2 - Behavior after form submission --------------------------------------------------------------------------------------------------------------------------------------------------------
// Setup to observe changes in the form container, allowing dynamic response to form submission and other events.
var targetNode = document.querySelector('.course-details-content');
var config = { childList: true, subtree: true, characterData: true, attributes: true };
@@ -81,7 +81,7 @@ if (typeof window !== 'undefined') {
timerInterval = startTimer(); // Start the timer
});
- // PART 3 - display the original content after submission
+ // PART 3 - display the original content after submission --------------------------------------------------------------------------------------------------------------------------------------------------------
// Attach an event handler to the form submission on Screen 1
$('.course-details-content form').submit(function() {
var essayContent = $('textarea[name="essay"]').val();
@@ -93,32 +93,26 @@ if (typeof window !== 'undefined') {
// Function to check for Screen 2 and display the essay content
function checkAndDisplayEssayContent() {
- console.log("Step 2: Inside checkAndDisplayEssayContent function");
- var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
- if (screen2Detected) {
- var essayContent = localStorage.getItem('essayContent');
- if (essayContent) {
- // Create a paragraph element with the essay content, add class and insert after h5 title
- var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
- $essayParagraph.insertAfter('.course-details-content h5');
-
- // Create a bolded title and insert before the paragraph
- var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
- $title.insertBefore($essayParagraph);
-
- localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
- console.log("Step 3: Original essay content displayed");
+ console.log("Step 2: Inside checkAndDisplayEssayContent function");
+ var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
+ if (screen2Detected) {
+ var essayContent = localStorage.getItem('essayContent');
+ if (essayContent) {
+ // Create a paragraph element with the essay content, add class and insert after h5 title
+ var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
+ $essayParagraph.insertAfter('.course-details-content h5');
+
+ // Create a bolded title and insert before the paragraph
+ var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
+ $title.insertBefore($essayParagraph);
+
+ localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
+ console.log("Step 3: Original essay content displayed");
+ }
}
+ console.log("Ready to insert buttons");
+ insertButtons(); // Call the new function here
}
- console.log("Ready to insert buttons");
- insertButtons(); // Call the new function here
- }
-
- // Define the new function somewhere else in the file
- function insertButtons() {
- console.log("Inserting buttons now...");
- // Your button insertion logic here
- }
// Define a function to check for the presence of .content-box.hovertextp
function checkForElement() {
@@ -137,7 +131,7 @@ if (typeof window !== 'undefined') {
var intervalId = setInterval(checkForElement, 1000); // Check every second (1000 milliseconds)
- // PART 4 - add a dropdown with options to select a sample task
+ // PART 4 - add a dropdown with options to select a sample task --------------------------------------------------------------------------------------------------------------------------------------------------------
// Execute code when the DOM is fully loaded
$(document).ready(function() {
@@ -190,6 +184,27 @@ if (typeof window !== 'undefined') {
$('textarea[name="task"]').html(taskContent);
});
});
+
+ // PART 5 - 3-way view behavior --------------------------------------------------------------------------------------------------------------------------------------------------------
+
+ function insertButtons() {
+ console.log("Inserting buttons now...");
+ // Create a div element and add the 'buttons-container' class to it
+ var $buttonsContainer = $('').addClass('buttons-container');
+
+ // Create buttons with the specified labels
+ var $buttonOriginalEssay = $('').text('Original Essay').addClass('btn-original-essay');
+ var $buttonInlineCorrections = $('').text('Inline Corrections').addClass('btn-inline-corrections');
+ var $buttonCorrectedEssay = $('').text('Corrected Essay').addClass('btn-corrected-essay');
+
+ // Append the buttons to the buttons-container div
+ $buttonsContainer.append($buttonOriginalEssay, $buttonInlineCorrections, $buttonCorrectedEssay);
+
+ // Find the .content-box.hovertextp element and insert the buttons container above it
+ $buttonsContainer.insertBefore('.content-box.hovertextp');
+
+ console.log("Buttons container and buttons inserted.");
+ }
// THE END
From f7529c7261597720531d86859262cad39b93cf8a Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 20:10:54 +0200
Subject: [PATCH 11/32] v1.0.7b - fall back to v1.0.7 after v1.0.8 failed
Same as v1.0.7
---
src/utils/jquery.js | 73 ++++++++++++++++++---------------------------
1 file changed, 29 insertions(+), 44 deletions(-)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index 59a6d90..f45b917 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -4,17 +4,17 @@ if (typeof window !== 'undefined') {
$(document).ready(function() {
setTimeout(function() {
- // PART 1 - Edits on form content --------------------------------------------------------------------------------------------------------------------------------------------------------
+ // PART 1 - Edits on form content
// Feature: Update the heading to provide a clear title for the demo.
// For React: This could be done by storing the title in a state variable and using it directly in the render method or JSX return statement.
- $('h5').text("TST Prep's Writing Evaluation Demo v1.0.8");
+ $('h5').text("TST Prep's Writing Evaluation Demo v1.0.7b");
// Feature: Update placeholder text in textarea fields to guide the user on what to input.
// For React: Control the placeholder text using state or props, allowing dynamic updates based on user interaction or other conditions.
$('textarea[name="task"]').attr('placeholder', 'Paste your TOEFL integrated writing task here').css('margin-bottom', '30px');
$('textarea[name="essay"]').attr('placeholder', 'Paste or write your essay here');
- // PART 2 - Behavior after form submission --------------------------------------------------------------------------------------------------------------------------------------------------------
+ // PART 2 - Behavior after form submission
// Setup to observe changes in the form container, allowing dynamic response to form submission and other events.
var targetNode = document.querySelector('.course-details-content');
var config = { childList: true, subtree: true, characterData: true, attributes: true };
@@ -81,7 +81,7 @@ if (typeof window !== 'undefined') {
timerInterval = startTimer(); // Start the timer
});
- // PART 3 - display the original content after submission --------------------------------------------------------------------------------------------------------------------------------------------------------
+ // PART 3 - display the original content after submission
// Attach an event handler to the form submission on Screen 1
$('.course-details-content form').submit(function() {
var essayContent = $('textarea[name="essay"]').val();
@@ -93,26 +93,32 @@ if (typeof window !== 'undefined') {
// Function to check for Screen 2 and display the essay content
function checkAndDisplayEssayContent() {
- console.log("Step 2: Inside checkAndDisplayEssayContent function");
- var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
- if (screen2Detected) {
- var essayContent = localStorage.getItem('essayContent');
- if (essayContent) {
- // Create a paragraph element with the essay content, add class and insert after h5 title
- var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
- $essayParagraph.insertAfter('.course-details-content h5');
-
- // Create a bolded title and insert before the paragraph
- var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
- $title.insertBefore($essayParagraph);
-
- localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
- console.log("Step 3: Original essay content displayed");
- }
+ console.log("Step 2: Inside checkAndDisplayEssayContent function");
+ var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
+ if (screen2Detected) {
+ var essayContent = localStorage.getItem('essayContent');
+ if (essayContent) {
+ // Create a paragraph element with the essay content, add class and insert after h5 title
+ var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
+ $essayParagraph.insertAfter('.course-details-content h5');
+
+ // Create a bolded title and insert before the paragraph
+ var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
+ $title.insertBefore($essayParagraph);
+
+ localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
+ console.log("Step 3: Original essay content displayed");
}
- console.log("Ready to insert buttons");
- insertButtons(); // Call the new function here
}
+ console.log("Ready to insert buttons");
+ insertButtons(); // Call the new function here
+ }
+
+ // Define the new function somewhere else in the file
+ function insertButtons() {
+ console.log("Inserting buttons now...");
+ // Your button insertion logic here
+ }
// Define a function to check for the presence of .content-box.hovertextp
function checkForElement() {
@@ -131,7 +137,7 @@ if (typeof window !== 'undefined') {
var intervalId = setInterval(checkForElement, 1000); // Check every second (1000 milliseconds)
- // PART 4 - add a dropdown with options to select a sample task --------------------------------------------------------------------------------------------------------------------------------------------------------
+ // PART 4 - add a dropdown with options to select a sample task
// Execute code when the DOM is fully loaded
$(document).ready(function() {
@@ -184,27 +190,6 @@ if (typeof window !== 'undefined') {
$('textarea[name="task"]').html(taskContent);
});
});
-
- // PART 5 - 3-way view behavior --------------------------------------------------------------------------------------------------------------------------------------------------------
-
- function insertButtons() {
- console.log("Inserting buttons now...");
- // Create a div element and add the 'buttons-container' class to it
- var $buttonsContainer = $('').addClass('buttons-container');
-
- // Create buttons with the specified labels
- var $buttonOriginalEssay = $('').text('Original Essay').addClass('btn-original-essay');
- var $buttonInlineCorrections = $('').text('Inline Corrections').addClass('btn-inline-corrections');
- var $buttonCorrectedEssay = $('').text('Corrected Essay').addClass('btn-corrected-essay');
-
- // Append the buttons to the buttons-container div
- $buttonsContainer.append($buttonOriginalEssay, $buttonInlineCorrections, $buttonCorrectedEssay);
-
- // Find the .content-box.hovertextp element and insert the buttons container above it
- $buttonsContainer.insertBefore('.content-box.hovertextp');
-
- console.log("Buttons container and buttons inserted.");
- }
// THE END
From c69cee434aa3a37089be02f219af81c5c289f2d3 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Thu, 7 Mar 2024 20:15:56 +0200
Subject: [PATCH 12/32] v1.0.6b - fall back to 1.0.6 after 1.0.7 failed
---
src/utils/jquery.js | 42 +++++++++++++++++-------------------------
1 file changed, 17 insertions(+), 25 deletions(-)
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index f45b917..3da5581 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -7,7 +7,7 @@ if (typeof window !== 'undefined') {
// PART 1 - Edits on form content
// Feature: Update the heading to provide a clear title for the demo.
// For React: This could be done by storing the title in a state variable and using it directly in the render method or JSX return statement.
- $('h5').text("TST Prep's Writing Evaluation Demo v1.0.7b");
+ $('h5').text("TST Prep's Writing Evaluation Demo v1.0.6b");
// Feature: Update placeholder text in textarea fields to guide the user on what to input.
// For React: Control the placeholder text using state or props, allowing dynamic updates based on user interaction or other conditions.
@@ -93,32 +93,24 @@ if (typeof window !== 'undefined') {
// Function to check for Screen 2 and display the essay content
function checkAndDisplayEssayContent() {
- console.log("Step 2: Inside checkAndDisplayEssayContent function");
- var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
- if (screen2Detected) {
- var essayContent = localStorage.getItem('essayContent');
- if (essayContent) {
- // Create a paragraph element with the essay content, add class and insert after h5 title
- var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
- $essayParagraph.insertAfter('.course-details-content h5');
-
- // Create a bolded title and insert before the paragraph
- var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
- $title.insertBefore($essayParagraph);
-
- localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
- console.log("Step 3: Original essay content displayed");
+ console.log("Step 2: Inside checkAndDisplayEssayContent function");
+ var screen2Detected = $('.course-details-content h5').text().includes("TST Prep's Writing Evaluation Demo 1");
+ if (screen2Detected) {
+ var essayContent = localStorage.getItem('essayContent');
+ if (essayContent) {
+ // Create a paragraph element with the essay content, add class and insert after h5 title
+ var $essayParagraph = $('').text(essayContent).addClass('original-essay').css('margin-bottom', '0px');
+ $essayParagraph.insertAfter('.course-details-content h5');
+
+ // Create a bolded title and insert before the paragraph
+ var $title = $('').text('Original Essay').addClass('original-essay-title').css('font-size', '16px').css('font-weight', 'bold').css('margin-bottom', '0px');
+ $title.insertBefore($essayParagraph);
+
+ localStorage.removeItem('essayContent'); // Optional: Clear the localStorage
+ console.log("Step 3: Original essay content displayed");
+ }
}
}
- console.log("Ready to insert buttons");
- insertButtons(); // Call the new function here
- }
-
- // Define the new function somewhere else in the file
- function insertButtons() {
- console.log("Inserting buttons now...");
- // Your button insertion logic here
- }
// Define a function to check for the presence of .content-box.hovertextp
function checkForElement() {
From f0ed4a12455515c00ff988ffbf3896ba04bde119 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Tue, 12 Mar 2024 14:00:04 +0200
Subject: [PATCH 13/32] Update _writing-evaluation-form.scss
---
public/assets/scss/components/_writing-evaluation-form.scss | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/public/assets/scss/components/_writing-evaluation-form.scss b/public/assets/scss/components/_writing-evaluation-form.scss
index b92c6a7..e2e6de4 100644
--- a/public/assets/scss/components/_writing-evaluation-form.scss
+++ b/public/assets/scss/components/_writing-evaluation-form.scss
@@ -13,6 +13,12 @@
padding: 0 3px;
}
+.garbled{
+ text-decoration-style: wavy;
+ text-decoration: underline;
+ color: #d5baba;
+}
+
.corrected {
border-bottom: 2px solid #9ec59e;
padding-left: 3px;
From e3d8093c556c1ebfe56c75871c1723fb6159cc1f Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Tue, 12 Mar 2024 17:06:43 +0200
Subject: [PATCH 14/32] Update _writing-evaluation-form.scss
---
public/assets/scss/components/_writing-evaluation-form.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/assets/scss/components/_writing-evaluation-form.scss b/public/assets/scss/components/_writing-evaluation-form.scss
index e2e6de4..419e533 100644
--- a/public/assets/scss/components/_writing-evaluation-form.scss
+++ b/public/assets/scss/components/_writing-evaluation-form.scss
@@ -14,8 +14,8 @@
}
.garbled{
- text-decoration-style: wavy;
text-decoration: underline;
+ text-decoration-style: wavy !important;
color: #d5baba;
}
From d1663dc10ef36144a9a6b2495db08f3566fe8b42 Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Tue, 12 Mar 2024 17:09:36 +0200
Subject: [PATCH 15/32] Update _writing-evaluation-form.scss
---
public/assets/scss/components/_writing-evaluation-form.scss | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/assets/scss/components/_writing-evaluation-form.scss b/public/assets/scss/components/_writing-evaluation-form.scss
index 419e533..7889f9d 100644
--- a/public/assets/scss/components/_writing-evaluation-form.scss
+++ b/public/assets/scss/components/_writing-evaluation-form.scss
@@ -8,7 +8,7 @@
.incorrect, .delete {
text-decoration: line-through;
- border-bottom: 2px solid #c38181;
+ border-bottom: 1px solid #c38181;
color: #d5bbbb !important;
padding: 0 3px;
}
@@ -20,7 +20,7 @@
}
.corrected {
- border-bottom: 2px solid #9ec59e;
+ border-bottom: 1px solid #9ec59e;
padding-left: 3px;
font-weight: 600;
}
From 48915075299b0a452cfc5557842960765d46869c Mon Sep 17 00:00:00 2001
From: AlexStratov2 <109147486+AlexStratov2@users.noreply.github.com>
Date: Tue, 12 Mar 2024 17:27:58 +0200
Subject: [PATCH 16/32] Update _writing-evaluation-form.scss
---
public/assets/scss/components/_writing-evaluation-form.scss | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/public/assets/scss/components/_writing-evaluation-form.scss b/public/assets/scss/components/_writing-evaluation-form.scss
index 7889f9d..bb3ccd9 100644
--- a/public/assets/scss/components/_writing-evaluation-form.scss
+++ b/public/assets/scss/components/_writing-evaluation-form.scss
@@ -14,8 +14,10 @@
}
.garbled{
- text-decoration: underline;
- text-decoration-style: wavy !important;
+ // text-decoration: underline;
+ // text-decoration-style: wavy !important;
+ // text-decoration-thickness: 1px;
+ text-decoration-line: grammar-error;
color: #d5baba;
}
From c5b65dd5e341bf7cbf8044e8157d360ccf29a815 Mon Sep 17 00:00:00 2001
From: Valentin Ceaprazaru
<6508597+valentinceaprazaru@users.noreply.github.com>
Date: Mon, 25 Mar 2024 14:07:24 +0200
Subject: [PATCH 17/32] Own page for WAIs
---
next.config.js | 2 +-
src/pages/dev/wai-1.jsx | 22 +++++
src/utils/jquery.js | 182 ----------------------------------------
3 files changed, 23 insertions(+), 183 deletions(-)
create mode 100644 src/pages/dev/wai-1.jsx
diff --git a/next.config.js b/next.config.js
index 9785e4d..db64dce 100644
--- a/next.config.js
+++ b/next.config.js
@@ -7,7 +7,7 @@ const nextConfig = {
* Added for GitHub Pages deployment.
*/
basePath: "/react-learndash",
- output: "export",
+ ...(!process.env.DEPLOY_TO_GITHUB_PAGES ? {output: 'export'} : {})
}
module.exports = nextConfig
diff --git a/src/pages/dev/wai-1.jsx b/src/pages/dev/wai-1.jsx
new file mode 100644
index 0000000..9d5e568
--- /dev/null
+++ b/src/pages/dev/wai-1.jsx
@@ -0,0 +1,22 @@
+import React from 'react';
+import {Wrapper} from "../../layout";
+import WritingEvaluationForm from "../../components/forms/writing-evaluation-form";
+
+
+const WaiOne = () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default WaiOne;
diff --git a/src/utils/jquery.js b/src/utils/jquery.js
index 3da5581..4f0210a 100644
--- a/src/utils/jquery.js
+++ b/src/utils/jquery.js
@@ -3,188 +3,6 @@ if (typeof window !== 'undefined') {
window.$ = window.jQuery = require('jquery');
$(document).ready(function() {
- setTimeout(function() {
- // PART 1 - Edits on form content
- // Feature: Update the heading to provide a clear title for the demo.
- // For React: This could be done by storing the title in a state variable and using it directly in the render method or JSX return statement.
- $('h5').text("TST Prep's Writing Evaluation Demo v1.0.6b");
- // Feature: Update placeholder text in textarea fields to guide the user on what to input.
- // For React: Control the placeholder text using state or props, allowing dynamic updates based on user interaction or other conditions.
- $('textarea[name="task"]').attr('placeholder', 'Paste your TOEFL integrated writing task here').css('margin-bottom', '30px');
- $('textarea[name="essay"]').attr('placeholder', 'Paste or write your essay here');
-
- // PART 2 - Behavior after form submission
- // Setup to observe changes in the form container, allowing dynamic response to form submission and other events.
- var targetNode = document.querySelector('.course-details-content');
- var config = { childList: true, subtree: true, characterData: true, attributes: true };
-
- // Timer functionality to provide feedback to the user after form submission.
- // For React: Use the useState hook for the seconds counter and useEffect for starting the interval. Ensure to clear the interval on component unmount.
- function startTimer() {
- var seconds = 0; // Initialize seconds to 0
- return setInterval(function() {
- seconds++;
- $('#timer').text(seconds + ' seconds'); // Dynamically update the text
- }, 1000); // Set interval to 1 second
- }
-
- var timerInterval = null; // Declare outside to make it accessible
-
- // Observe DOM mutations to dynamically adjust UI based on form interaction.
- var callback = function(mutationsList, observer) {
- mutationsList.forEach(function(mutation) {
- if (mutation.type === 'childList') {
- mutation.addedNodes.forEach(function(node) {
- // Response to form submission: If the timer element is found, clear any existing timer and start a new one.
- if (node.nodeType === 1 && $(node).find('#timer').length) {
- if (timerInterval) clearInterval(timerInterval);
- timerInterval = startTimer(); // Start or restart the timer
- }
- });
-
- // Cleanup upon form or page change: If the submit button is no longer present, stop the timer and remove added content.
- if (!$(mutation.target).closest('.course-details-content').find('.edu-btn').length) {
- clearInterval(timerInterval);
- $('#elapsedTime, #waitingTime').remove();
- }
- }
- });
- };
-
- var observer = new MutationObserver(callback);
- observer.observe(targetNode, config);
-
- // Handle form submission to disable inputs, show a loading state, and start a timer.
- // For React: Implement form submission handling using event handlers. Manage form and button states with useState, and show feedback using state-driven UI updates.
- $('.course-details-content form').on('submit', function(event) {
- event.preventDefault(); // Prevent the actual form submission for demonstration; adjust as needed
-
- // Disable inputs and show a visual cue to the user that the form is processing.
- $('textarea[name="task"], textarea[name="essay"]').prop('disabled', true).css({
- 'background-color': '#f0f0f0',
- 'cursor': 'not-allowed'
- });
-
- // Change the button text to "Loading..." to indicate processing state.
- var submitButton = $(this).find('.edu-btn').prop('disabled', true).text('Loading...')
- .css({'pointer-events': 'none', 'filter': 'saturate(30%)'});
-
- // Add visual feedback about the elapsed time since form submission and expected wait time.
- if (!$('#elapsedTime').length) {
- $('
Elapsed time: 0 seconds
').insertBefore(submitButton);
- $('
Depending on the length of your essay and the amount of mistakes, the waiting time can vary between 15s and 120s
- )
-}
+ );
+};
-export default TeamArea;
\ No newline at end of file
+export default TeamArea;
diff --git a/src/components/abouts/about-2/why-chose.jsx b/src/components/abouts/about-2/why-chose.jsx
index fb70744..b86756b 100644
--- a/src/components/abouts/about-2/why-chose.jsx
+++ b/src/components/abouts/about-2/why-chose.jsx
@@ -8,51 +8,87 @@ const WhyChose = () => {
const { scrollYProgress } = useScroll();
const y = useTransform(scrollYProgress, [0, 1], [0, 1000]);
return (
-
-
-
-
-
-
We Providing The Best Quality Online Courses
-
+
+
+
+
+
+
+ We Providing The Best{' '}
+ Quality Online {' '}
+ Courses
+
+
+
+
-
-
Lorem ipsum dolor sit amet cons etur adipisicing elit sed do eiusm aut tempor incididunt labore dolore magna aliqua quis nostrud ex ertation lamcolab oris aliquip.
+
+
+ Lorem ipsum dolor sit amet cons etur adipisicing elit sed
+ do eiusm aut tempor incididunt labore dolore magna aliqua
+ quis nostrud ex ertation lamcolab oris aliquip.
+
-
-
+
+
-
+
-
+
-
-
+
-
-
+
-
-
+
+
- )
-}
+ );
+};
-export default WhyChose;
\ No newline at end of file
+export default WhyChose;
diff --git a/src/components/abouts/about-3/about-us-area.jsx b/src/components/abouts/about-3/about-us-area.jsx
index 4b4574c..c339b66 100644
--- a/src/components/abouts/about-3/about-us-area.jsx
+++ b/src/components/abouts/about-3/about-us-area.jsx
@@ -5,88 +5,178 @@ import { useMouseMoveUI } from '../../../contexts/mouse-move-context';
// MissionItem
function MissionItem({ color, icon, title, text }) {
return (
-
Magna aliquaenim ad minim veniam quis nostrud exercitation ullamco laborisLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eius tempor incididunt labore.
+
+
+
+
+
+
+ About Us
+
+ We Provide Best{' '}
+ Education{' '}
+ Services For You.
+
+
+
+
+
+ Magna aliquaenim ad minim veniam quis nostrud
+ exercitation ullamco laborisLorem ipsum dolor sit
+ amet, consectetur adipisicing elit, sed do eius tempor
+ incididunt labore.
+
- )
-}
+ );
+};
-export default WhyChose;
\ No newline at end of file
+export default WhyChose;
diff --git a/src/components/blog-details/blog-details-area.jsx b/src/components/blog-details/blog-details-area.jsx
index 2e59a7d..22b314d 100644
--- a/src/components/blog-details/blog-details-area.jsx
+++ b/src/components/blog-details/blog-details-area.jsx
@@ -3,28 +3,50 @@ import BlogSidebar from '../blog/blog-sidebar';
import BlogCommentForm from '../forms/blog-comment-form';
import CommentArea from './comment-area';
-const BlogDetailsArea = ({blog}) => {
+const BlogDetailsArea = ({ blog }) => {
return (
-
-
-
-
-
-
- Developer
-
{blog?.title}
-
-
{blog?.date}
-
Com {blog?.comment}
+
+
+
+
+
+
+ Developer
+
{blog?.title}
+
+
+
+ {blog?.date}
+
+
+ Com {blog?.comment}
+
-
-
+
+
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor inc idid unt ut labore et dolore magna aliqua enim ad minim veniam, quis nostrud exerec tation ullamco laboris nis aliquip commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit sed quia consequuntur magni dolores.
-
-
Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium totam rem aperiam.
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+ sed do eiusmod tempor inc idid unt ut labore et dolore
+ magna aliqua enim ad minim veniam, quis nostrud exerec
+ tation ullamco laboris nis aliquip commodo consequat. Duis
+ aute irure dolor in reprehenderit in voluptate velit esse
+ cillum dolore eu fugiat nulla pariatur enim ipsam
+ voluptatem quia voluptas sit aspernatur aut odit aut fugit
+ sed quia consequuntur magni dolores.{' '}
+
+
+
+ Excepteur sint occaecat cupidatat non proident sunt in
+ culpa qui officia deserunt mollit anim id est laborum. Sed
+ ut perspiciatis unde omnis iste natus error sit voluptatem
+ accusantium doloremque laudantium totam rem aperiam.
+
Lorem ipsum dolor amet con sectur elitadicing elit sed do usmod tempor uincididunt enim minim veniam nostrud.
-
Simon Baker
+
+ Lorem ipsum dolor amet con sectur elitadicing elit sed
+ do usmod tempor uincididunt enim minim veniam nostrud.
+
+
Simon Baker
-
The Complete Camtasia
-
Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium totam rem aperiam.
-
-
-
-
-
-
+
The Complete Camtasia
+
+ Excepteur sint occaecat cupidatat non proident sunt in
+ culpa qui officia deserunt mollit anim id est laborum. Sed
+ ut perspiciatis unde omnis iste natus error sit voluptatem
+ accusantium doloremque laudantium totam rem aperiam.{' '}
+
+
+
+
+
+
+
-
-
-
+
+
+
-
Consectetur adipisicing elit, sed do eiusmod tempor inc idid unt ut labore et dolore magna aliqua enim ad minim veniam, quis nostrud exerec tation ullamco laboris nis aliquip commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit sed quia consequuntur magni dolores.
-
-
Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium totam rem aperiam.
-
-
Intrinsic Motivation
-
Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium totam rem aperiam.
+
+ Consectetur adipisicing elit, sed do eiusmod tempor inc
+ idid unt ut labore et dolore magna aliqua enim ad minim
+ veniam, quis nostrud exerec tation ullamco laboris nis
+ aliquip commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate velit esse cillum dolore eu
+ fugiat nulla pariatur enim ipsam voluptatem quia voluptas
+ sit aspernatur aut odit aut fugit sed quia consequuntur
+ magni dolores.{' '}
+
+
+
+ Excepteur sint occaecat cupidatat non proident sunt in
+ culpa qui officia deserunt mollit anim id est laborum. Sed
+ ut perspiciatis unde omnis iste natus error sit voluptatem
+ accusantium doloremque laudantium totam rem aperiam.
+
+
+
Intrinsic Motivation
+
+ Excepteur sint occaecat cupidatat non proident sunt in
+ culpa qui officia deserunt mollit anim id est laborum. Sed
+ ut perspiciatis unde omnis iste natus error sit voluptatem
+ accusantium doloremque laudantium totam rem aperiam.{' '}
+