機械翻訳について

Oracle Intelligent Advisorインタビューのロード中にGrammarly拡張機能をオフにするにはどうすればよいですか。

Oracle Intelligent Advisorインタビューのロード中に、次の2つのアプローチのいずれかを使用して文法拡張機能をオフにできます:

  • 特定のサイトのGrammarlyをオフにする:

    文法設定でOracle Intelligent Advisorインタビューを直接ホストしているwebサイトで、コードなしでGrammarlyをオフにできます。 特定のサイトの文法を無効にするステップについては、この「文法サポート記事」を参照してください。

  • HTMLでデータ・タグを使用して文法を無効にする:

    開発者の場合は、HTML要素にデータ属性を追加することで、特定のインタビュー入力の文法をオフにできます。 Oracle Intelligent Advisorを使用する場合、これは通常、JavaScript拡張を介して行われます。 関連する入力フィールドに属性data-enable-grammarly="false"を追加すると、Grammarlyがそのインタフェースを表示しないようにできます(たとえば、緑色の文法ボタン)。

Oracle Intelligent Advisor JS拡張を使用してこの属性を追加する方法を示すJavaScriptコードの例を次に示します:
OraclePolicyAutomation.AddExtension({
   customInput: function (control, interview) {
       if (control.getProperty("name") == "xMyExtension") {
           return {
               mount: function (el) {
                   var myinput = document.createElement("textarea");
                   myinput.cols = "80";
                   myinput.rows = "10";
                   myinput.maxLength = "5000";
                   myinput.id = "customInput";
                   myinput.value = control.getValue();
                   myinput.setAttribute("data-enable-grammarly", false); // Disable Grammarly
                   el.appendChild(myinput);
               },
               update: function (el) {
                   var myinput = document.getElementById("customInput");
                   
                   // Check if the control is read-only to disable the text area
                   if (control.isReadOnly()) {
                       myinput.disabled = true; // Disable the text area if read-only
                   } else {
                       myinput.disabled = false; // Enable the text area if not read-only
                   }
               },
               validate: function (el) {
                   control.setValue(document.getElementById("customInput").value);
                   return true;
               },
               unmount: function (el) {
                   var customInput = document.getElementById("customInput");
                   customInput.parentNode.removeChild(customInput);
               }
           };
       }
   }
});