{"id":4339,"date":"2025-02-23T18:13:02","date_gmt":"2025-02-23T18:13:02","guid":{"rendered":"https:\/\/mbinalpisga.com\/?page_id=4339"},"modified":"2025-02-23T18:27:05","modified_gmt":"2025-02-23T18:27:05","slug":"ai-behavior-intervention-suggestion-tool","status":"publish","type":"page","link":"https:\/\/mbinalpisga.com\/?page_id=4339","title":{"rendered":"AI Behavior Intervention Suggestion Tool"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"4339\" class=\"elementor elementor-4339\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-221b087 e-flex e-con-boxed e-con e-parent\" data-id=\"221b087\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1debc7c elementor-widget elementor-widget-image\" data-id=\"1debc7c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/mbinalpisga.com\/wp-content\/uploads\/elementor\/thumbs\/WhatsApp-Image-2024-06-16-at-08.28.15-qpqb0vouxk63fqfxnuf4yiappllmof3864210xg7k4.jpeg\" title=\"\u05de\u05d1\u05d9\u05e0\u05d4 \u05dc\u05e4\u05e1\u05d2&quot;\u05d4\" alt=\"\u05de\u05d1\u05d9\u05e0\u05d4 \u05dc\u05e4\u05e1\u05d2&quot;\u05d4\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f23660a elementor-widget elementor-widget-button\" data-id=\"f23660a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"#\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t<span class=\"elementor-button-icon\">\n\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-far-arrow-alt-circle-right\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M504 256C504 119 393 8 256 8S8 119 8 256s111 248 248 248 248-111 248-248zm-448 0c0-110.5 89.5-200 200-200s200 89.5 200 200-89.5 200-200 200S56 366.5 56 256zm72 20v-40c0-6.6 5.4-12 12-12h116v-67c0-10.7 12.9-16 20.5-8.5l99 99c4.7 4.7 4.7 12.3 0 17l-99 99c-7.6 7.6-20.5 2.2-20.5-8.5v-67H140c-6.6 0-12-5.4-12-12z\"><\/path><\/svg>\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">\u05d7\u05d6\u05e8\u05d4<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-172f171 e-flex e-con-boxed e-con e-parent\" data-id=\"172f171\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-01c76cc elementor-widget elementor-widget-heading\" data-id=\"01c76cc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">A tool for identifying and designing behavior and building an intervention plan<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-c8f8a29 e-flex e-con-boxed e-con e-parent\" data-id=\"c8f8a29\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-572f923 elementor-widget elementor-widget-heading\" data-id=\"572f923\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Enter the student's behavior data and receive a therapeutic intervention plan<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-af6662c e-flex e-con-boxed e-con e-child\" data-id=\"af6662c\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-2b07a64 e-con-full e-flex e-con e-parent\" data-id=\"2b07a64\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-aa788de elementor-widget elementor-widget-html\" data-id=\"aa788de\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\r\n<script>\r\n\/\/this should be in all tools\r\n\/\/change the chatLang to the language used in the tool\r\nvar promptTemplate = null;\r\nvar chatLang = 'English';\r\n\r\npromptTemplate = 'I am {input1} for a student at the age of  {input2} And recently I saw that there is a change in his behavior, and I know the student already {input3} And the abnormal behavior started appearing before {input4} So far I have operated with the behavior in a manner {input5} The abnormal behaviors that led me to conduct a behavior analysis are {input6} and the frequency that these behaviors occur are {input7} When the other students react to the students behaviors this way {input8} These behaviors occur normally {input9} Me and my assistant respond {input10} And the students background is {input11} And here is the summary of the first observation {input12} And here is the summary of the second observation {input13} And here is the summary of the third observation {input14} Do an analysis of this behavior, and write me an intervention plan and a work plan that I can carry out with the student in order to help him according to the rules of the ABA.';\r\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ed8fee2 elementor-button-align-center elementor-widget__width-initial elementor-widget elementor-widget-form\" data-id=\"ed8fee2\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;button_width&quot;:&quot;100&quot;,&quot;step_type&quot;:&quot;number_text&quot;,&quot;step_icon_shape&quot;:&quot;circle&quot;}\" data-widget_type=\"form.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<form class=\"elementor-form\" method=\"post\" name=\"\u05db\u05dc\u05d9 \u05d1\u05e1\u05d9\u05e1\">\n\t\t\t<input type=\"hidden\" name=\"post_id\" value=\"4339\"\/>\n\t\t\t<input type=\"hidden\" name=\"form_id\" value=\"ed8fee2\"\/>\n\t\t\t<input type=\"hidden\" name=\"referer_title\" value=\"AI Behavior Intervention Suggestion Tool\" \/>\n\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"queried_id\" value=\"4339\"\/>\n\t\t\t\n\t\t\t<div class=\"elementor-form-fields-wrapper elementor-labels-above\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input1 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input1\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tYour Role\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input1]\" id=\"form-field-input1\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"Teacher, Aid, Consultant...\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input2 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input2\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tStudent Age\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input2]\" id=\"form-field-input2\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"How Old Is Your Student\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input3 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input3\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tHow Long Have You Known Him\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input3]\" id=\"form-field-input3\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"write a number with months or years \">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input4 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input4\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tWhen did the abnormal behavior started?\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input4]\" id=\"form-field-input4\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"write a number with months or years\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input5 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input5\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tHow did you react until now ? \t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input5]\" id=\"form-field-input5\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"how did you react to the behavior ? \">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input6 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input6\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\twhat are the behaviors that led you to do an observation ? \t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input6]\" id=\"form-field-input6\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"write the abnormal behavior\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input7 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input7\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tfrequency and prevalence of the behavior\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input7]\" id=\"form-field-input7\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"high, medium , often...\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input8 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input8\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tHow do other students react to the student's behavior?\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input8]\" id=\"form-field-input8\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"runaway, fightback.....\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input9 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input9\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tWhen do the next behaviors usually occur?\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input9]\" id=\"form-field-input9\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"After a fight, when someone plays with his games .......\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input10 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input10\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tHow do you react immediately?\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input10]\" id=\"form-field-input10\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"Write down your immediate behavior in class\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input11 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input11\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tThe student's background\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input11]\" id=\"form-field-input11\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"Write down the student&#039;s background such as: (Normal family, separated parents...)\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input12 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input12\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tSummary of first observation\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input12]\" id=\"form-field-input12\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"write down your summary \">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input13 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input13\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tSummary of second observation\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input13]\" id=\"form-field-input13\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"write downyour summary\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-text elementor-field-group elementor-column elementor-field-group-input14 elementor-col-70\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"form-field-input14\" class=\"elementor-field-label\">\n\t\t\t\t\t\t\t\tSummary of third observation\t\t\t\t\t\t\t<\/label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"text\" name=\"form_fields[input14]\" id=\"form-field-input14\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"write down your summary\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-group elementor-column elementor-field-type-submit elementor-col-100 e-form__buttons\">\n\t\t\t\t\t<button class=\"elementor-button elementor-size-sm\" type=\"submit\" id=\"sendBtn\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-icon\">\n\t\t\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-far-play-circle\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M371.7 238l-176-107c-15.8-8.8-35.7 2.5-35.7 21v208c0 18.4 19.8 29.8 35.7 21l176-101c16.4-9.1 16.4-32.8 0-42zM504 256C504 119 393 8 256 8S8 119 8 256s111 248 248 248 248-111 248-248zm-448 0c0-110.5 89.5-200 200-200s200 89.5 200 200-89.5 200-200 200S56 366.5 56 256z\"><\/path><\/svg>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Analyze and write a plan<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/button>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/form>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-2a40f53 e-flex e-con-boxed e-con e-parent\" data-id=\"2a40f53\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-c5f0193 elementor-widget elementor-widget-html\" data-id=\"c5f0193\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Print Button Example<\/title>\r\n    <link rel=\"stylesheet\" href=\"styles.css\">\r\n<\/head>\r\n<body>\r\n    <button id=\"printButton\">\u05d4\u05d3\u05e4\u05e1<\/button>\r\n\r\n    <script>\r\n    function printTextContent() {\r\n    \/\/ Create a new window\r\n    var printWindow = window.open('', '', 'height=400,width=600');\r\n    \r\n    \/\/ Get the HTML of div\r\n   var divContents = document.getElementById(\"chat-window\").innerHTML;\r\n\r\n   \/\/ Get the HTML of head\r\n   var headContents = document.head.innerHTML;\r\n\r\n    \/\/ Write the text content to the new window\r\n    printWindow.document.write('<html><head>');\r\n    printWindow.document.write(headContents);\r\n    printWindow.document.write('<\/head><body dir=\"rtl\">');\r\n    printWindow.document.write(divContents);\r\n    printWindow.document.write('<\/body><\/html>');\r\n    \/\/ Close the document to ensure all resources are loaded\r\n    printWindow.document.close();\r\n    \r\n    \/\/ Wait for the content to be fully loaded, then print\r\n    printWindow.onload = function() {\r\n        printWindow.print();\r\n    };\r\n}\r\n        document.getElementById('printButton').addEventListener('click', printTextContent);\r\n    <\/script>\r\n<\/body>\r\n<\/html>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-810cfeb e-flex e-con-boxed e-con e-parent\" data-id=\"810cfeb\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-0a35828 elementor-widget elementor-widget-html\" data-id=\"0a35828\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\n<!-- Output Area -->\n<div id=\"output\"><\/div>\n\n<script>\nvar prompt = null;\n  function scanForm(formElement) {\n    const inputs = formElement.elements;\n    const data = {};\n\n    for (let i = 0; i < inputs.length; i++) {\n      const field = inputs[i];\n\n      if ((field.tagName === 'INPUT' || field.tagName === 'TEXTAREA') && field.name) {\n        const nameMatch = field.name.match(\/form_fields\\[(.*?)\\]\/);\n        if (nameMatch) {\n          const inputName = nameMatch[1];\n\n          if (field.type === 'checkbox' || field.type === 'radio') {\n            if (field.checked) {\n              const labelText = getLabelText(field);\n              if (data[inputName]) {\n                if (Array.isArray(data[inputName])) {\n                  data[inputName].push(labelText);\n                } else {\n                  data[inputName] = [data[inputName], labelText];\n                }\n              } else {\n                data[inputName] = labelText;\n              }\n            }\n          } else {\n            const value = field.value;\n            if (data[inputName]) {\n              if (Array.isArray(data[inputName])) {\n                data[inputName].push(value);\n              } else {\n                data[inputName] = [data[inputName], value];\n              }\n            } else {\n              data[inputName] = value;\n            }\n          }\n        }\n      }\n    }\n    return data;\n  }\n\n  function getLabelText(inputElement) {\n    let label = inputElement.closest('label');\n    if (label) {\n      return label.textContent.trim();\n    } else {\n      const id = inputElement.id;\n      if (id) {\n        label = document.querySelector(`label[for='${id}']`);\n        if (label) {\n          return label.textContent.trim();\n        }\n      }\n    }\n    return inputElement.value;\n  }\n\n  function buildPrompt(formData, template) {\n    let tempPrompt = template;\n\n    for (const key in formData) {\n      if (formData.hasOwnProperty(key)) {\n        let value = formData[key];\n\n        if (Array.isArray(value)) {\n          value = value.join(', ');\n        }\n\n        const placeholder = new RegExp(`\\\\{${key}\\\\}`, 'g');\n        \n        tempPrompt = tempPrompt.replace(placeholder, value);\n        console.log(tempPrompt);\n      }\n    }\n\n    \/\/ Remove any unreplaced placeholders\n    tempPrompt = tempPrompt.replace(\/\\{[^}]+\\}\/g, '');\n\n    return tempPrompt.trim();\n  }\n\n  document.getElementById('sendBtn').addEventListener('mouseenter', function(event) {\n    event.preventDefault();\n    const formElement = document.querySelector('.elementor-form');\n    const formData = scanForm(formElement);\n    console.log(formData);\n    prompt = buildPrompt(formData, promptTemplate);\n    console.log(prompt);\n  });\n<\/script>\n\n\n\n<style>\n    .spinner {\n    border: 4px solid rgba(0, 0, 0, 0.1);\n    border-left-color: #ffffff;\n    border-radius: 50%;\n    width: 32px;\n    height: 32px;\n    animation: spin 1s linear infinite;\n    margin: 5px auto;\n}\n\n@keyframes spin {\n    to {\n        transform: rotate(360deg);\n    }\n}\n\n.chat-container {\n  display: none;\n  flex-direction: column;\n  max-width: 600px;\n  height: 90vh;\n  margin: 20px auto;\n  border: 1px solid #ccc;\n  background-color: #fff;\n}\n\n#chat-window {\n  flex: 1;\n  padding: 20px;\n  overflow-y: auto;\n}\n\n.message {\n  margin-bottom: 15px;\n}\n\n.message.user .content {\n  background-color: #dcf8c6;\n  align-self: flex-end;\n}\n\n.message.bot .content {\n  background-color: #ececec;\n  align-self: flex-start;\n}\n\n.message .content {\n  padding: 10px;\n  border-radius: 5px;\n  max-width: 80%;\n}\n\n#chat-form {\n  display: flex;\n  padding: 10px;\n  border-top: 1px solid #ccc;\n}\n\n#message-input {\n  flex: 1;\n  padding: 10px;\n  font-size: 16px;\n}\n\n#chat-form button {\n  padding: 10px 20px;\n  font-size: 16px;\n}\n\n<\/style>\n\n<div class=\"chat-container\" id=\"chat-container\">\n    <div id=\"chat-window\">\n      <!-- Chat messages will be appended here -->\n    <\/div>\n    <form id=\"chat-form\">\n      <input type=\"text\" id=\"message-input\" placeholder=\"\u05d0\u05e0\u05d9 \u05e4\u05d4 \u05dc\u05db\u05dc \u05e9\u05d0\u05dc\u05d4 ...\" autocomplete=\"off\" required \/>\n      <button type=\"submit\" id=\"submitBtn\">\u05e9\u05dc\u05d7<\/button>\n    <\/form>\n<\/div>\n\n<script type=\"module\">\nimport { v4 as uuidv4 } from 'https:\/\/cdn.jsdelivr.net\/npm\/uuid@9.0.0\/dist\/esm-browser\/index.js';\nimport { GoogleGenerativeAI  } from 'https:\/\/esm.run\/@google\/generative-ai';\n\ndocument.addEventListener(\"DOMContentLoaded\",async function () {\n  \/\/don't touch ....\n  const chatContainer = document.getElementById('chat-container');\n  const chatForm = document.getElementById('chat-form');\n  const chatWindow = document.getElementById('chat-window');\n  const messageInput = document.getElementById('message-input');\n  const session = uuidv4();\n  const apiKey = 'AIzaSyAFFG10WMzKhXpVVJ2jp0n8szoLlPk9AW8';\n  const genAI = new GoogleGenerativeAI(apiKey);\n  const model = genAI.getGenerativeModel({ model: \"gemini-1.5-pro\"});\n  const chat = await model.startChat();\n  const spinner = document.createElement('div');\n        spinner.className = 'spinner';\n  if(chatLang === 'Arabic'){\n      messageInput.placeholder = '\u0627\u0646\u0627 \u0647\u0646\u0627 \u0644\u0627\u064a \u0633\u0624\u0627\u0644...';\n      document.getElementById('submitBtn').innerText = '\u0627\u0631\u0633\u0627\u0644';\n  }\n  \/\/...don't touch\n  \n  \n  \/\/change this part only\n  \/\/remove null and add the prompt for example:\n  \/\/`I want you to consider ${input1} and answer the following question ${input2}...`\n  const lang = chatLang;\n  document.getElementById(\"sendBtn\").addEventListener(\"click\", async function(even){\n        event.preventDefault();\n        event.target.parentElement.appendChild(spinner);\n        appendMessage('bot', '...');\n        const botMessageElement = chatWindow.lastElementChild;\n      if(prompt)\n      {\n        try {\n          const text = await getBotResponse(null, prompt);\n          botMessageElement.querySelector('.content').innerHTML = text;\n        \/\/   for await (const chunk of botResponse) {\n        \/\/             const chunkText = await chunk.text();\n        \/\/             console.log(chunkText);\n        \/\/             botMessageElement.querySelector('.content').textContent += chunkText;\n        \/\/         }\n        } catch (error) {\n            console.log('error: '+ error.message);\n          botMessageElement.querySelector('.content').textContent = 'Error: Unable to fetch response.';\n        }\n      }\n      spinner.remove();\n      chatContainer.style.display = 'flex';\n  });\n    \n  await chat.sendMessage(`you will act as an assitant for teachers and will provide all answers in HTML format always, do not change the format even if I ask you to, do not add any wrappers other than pure html content and make sure to attach the prefix \\'chatbox\\' to all css classes, element ids and functions. all answers should be in ${lang}`);\n    \n    \n    \/\/don't touch this is the chat box\n  chatForm.addEventListener('submit', async (e) => {\n    e.preventDefault();\n    const userMessage = messageInput.value.trim();\n    if (!userMessage) return;\n\n    \/\/ Display user's message\n    appendMessage('user', userMessage);\n    messageInput.value = '';\n\n    \/\/ Get bot's response\n    appendMessage('bot', '...'); \/\/ Placeholder while fetching response\n    const botMessageElement = chatWindow.lastElementChild;\n\n    try {\n      const text = await getBotResponse(session, userMessage);\n      botMessageElement.querySelector('.content').innerHTML = text;\n    \/\/   for await (const chunk of botResponse) {\n    \/\/             const chunkText = await chunk.text();\n    \/\/             console.log(chunkText);\n    \/\/             botMessageElement.querySelector('.content').textContent += chunkText;\n    \/\/         }\n    } catch (error) {\n        console.log('error: '+ error.message);\n      botMessageElement.querySelector('.content').textContent = 'Error: Unable to fetch response.';\n    }\n  });\n\n  function appendMessage(sender, message) {\n    const messageElement = document.createElement('div');\n    messageElement.classList.add('message', sender);\n\n    const contentElement = document.createElement('div');\n    contentElement.classList.add('content');\n    contentElement.textContent = message;\n\n    messageElement.appendChild(contentElement);\n    chatWindow.appendChild(messageElement);\n    chatWindow.scrollTop = chatWindow.scrollHeight;\n  }\n\n  async function getBotResponse(session, message) {\n    const result = await chat.sendMessage(message);\n  const response = await result.response;\n    console.log(response);\n    const text = response.text();\n    console.log(text);\n    return text.replace(\/^html```|```$\/g, '');\n    \/\/return formatToRichText(text);\n}\n\nasync function formatToRichText(input) {\n    \/\/ Replace titles surrounded by ** with <h4> tags\n    const formattedText = input.replace(\/\\*\\*(.+?)\\*\\*\/g, '<h4>$1<\/h4>').replace(\/(\\* .+?)(?=\\*|$)\/gs, match => {\n            return '<li>' + match.slice(2) + '<\/li>';\n        });\n\n    \/\/ Wrap bullet points with <ul> tags\n    const wrappedText = formattedText.replace(\/(<li>.*<\\\/li>)\/gs, '<ul>$1<\/ul>');\n\n    return wrappedText;\n}\n\n  });\n\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u05d7\u05d6\u05e8\u05d4 A tool for identifying and designing behavior and building an intervention plan Enter the student's behavior data and receive a therapeutic intervention plan Print Button Example \u05d4\u05d3\u05e4\u05e1 \u05e9\u05dc\u05d7<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4339","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mbinalpisga.com\/index.php?rest_route=\/wp\/v2\/pages\/4339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mbinalpisga.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mbinalpisga.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mbinalpisga.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mbinalpisga.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4339"}],"version-history":[{"count":7,"href":"https:\/\/mbinalpisga.com\/index.php?rest_route=\/wp\/v2\/pages\/4339\/revisions"}],"predecessor-version":[{"id":4347,"href":"https:\/\/mbinalpisga.com\/index.php?rest_route=\/wp\/v2\/pages\/4339\/revisions\/4347"}],"wp:attachment":[{"href":"https:\/\/mbinalpisga.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}