ソースを参照

Added the necessary fields for the Assistant

victor_passos 2 年 前
コミット
de8e2acd89
1 ファイル変更23 行追加0 行削除
  1. 23 0
      js/assessment/output_matching/assessment_result.js

+ 23 - 0
js/assessment/output_matching/assessment_result.js

@@ -35,6 +35,19 @@ export class OutputAssessmentResult {
       </div>`;
   }
 
+  static get ASSISTANT_TEMPLATE () {
+    return `<div class='details-body'>
+        <div class='assistant-div-left'>
+          <h1>Desempenho</h1>
+          <p style='padding-left:0.5rem;'>:performance-text:</p>
+        </div>
+        <div class='assistant-div-right'>
+          <h1>Sugestões</h1>
+          <p style='padding-left:0.5rem;'>:suggestion-text:</p>
+        </div>
+      </div>`;
+  }
+
   static get OUPUT_TABLE_TEMPLATE () {
     return `<div class='detaisl-div-table'>
         <table class='assessment-output-table'>
@@ -192,6 +205,16 @@ export class OutputAssessmentResult {
     return page;
   }
 
+  generateAssistantOutput (performanceText,suggestionText) {
+    let template = OutputAssessmentResult.ASSISTANT_TEMPLATE;
+    template = template.replace(":performance-text:",performanceText);
+    template = template.replace(":suggestion-text:",suggestionText);
+    let page = OutputAssessmentResult.PAGE_TEMPLATE;
+    page = page.replace(":assessment-result:", template);
+    page = page.replace(/(\r|\n|\t)/gm, "").replace(/> *</g, "><");
+    return page;
+  }
+
   formatNumber (result) {
     const result_class =
       result.grade == 1