} $o .= html_writer::end_tag('div'); } } $cell2 = new html_table_cell($o); $catdata = $DB->get_record("grade_items", array("courseid" => $cm->course, "iteminstance" => $cm->instance, "itemmodule" => 'sassessment')); $o = ""; if ($grid = $DB->get_record("grade_grades", array("itemid" => $catdata->id, "userid" => $list->uid))) { $rateteacher = round($grid->finalgrade, 1); $o .= html_writer::tag('small', $rateteacher) . " "; } $o .= html_writer::select($levelst, 'rating', '', true, array("class" => "sassessment_rate_box", "data-url" => $id . ":" . $list->id)); $cell5 = new html_table_cell($o); $cells = array($cell1, $cell2); if ($sassessment->textcomparison == 1) { $percent = sassessment_similar_text($comparetext_orig, $comparetext_current); //similar_text($comparetext_orig, $comparetext_current, $percent); $cell3 = new html_table_cell("<div>Total: <b>" . round($percent) . "%</b></div>" . $comparecurrent); $cells[] = $cell3; } if ($sassessment->textanalysis == 1) { $cell4 = new html_table_cell("<small>" . sassessment_analizereport(json_decode($list->analize, true)) . "</small>"); $cells[] = $cell4; } if ($sassessment->grademethod == "default" && $sassessment->humanevaluation == 1) { $cells[] = $cell5; } $row = new html_table_row($cells); $table->data[] = $row; } }
<?php require_once '../../config.php'; require_once 'lib.php'; $text1 = optional_param('text1', 0, PARAM_TEXT); $text2 = optional_param('text2', 0, PARAM_TEXT); echo sassessment_similar_text($text1, $text2);