|
@@ -271,7 +271,7 @@ class iassign {
|
|
// edit - edit activity (modificar atividade)
|
|
// edit - edit activity (modificar atividade)
|
|
|
|
|
|
$action_iassign = array(
|
|
$action_iassign = array(
|
|
- 'newcomment' => '$this->get_answer();',
|
|
|
|
|
|
+ 'newcomment' => '$this->add_comment();',
|
|
'view' => '$this->view_iassign_current();',
|
|
'view' => '$this->view_iassign_current();',
|
|
'get_answer' => '$this->get_answer();',
|
|
'get_answer' => '$this->get_answer();',
|
|
'repeat' => '$this->view_iassign_current();',
|
|
'repeat' => '$this->view_iassign_current();',
|
|
@@ -991,7 +991,16 @@ class iassign {
|
|
$this->return_home_course('duplicated_activity');
|
|
$this->return_home_course('duplicated_activity');
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ // / This method gets the content from comment and register it
|
|
|
|
+ function add_comment () {
|
|
|
|
+ $submission_comment = optional_param('submission_comment', NULL, PARAM_TEXT);
|
|
|
|
+ $comment = false;
|
|
|
|
+ if ($submission_comment)
|
|
|
|
+ $comment = $this->write_comment_submission();
|
|
|
|
+ $id_submission = optional_param('iassign_submission_current', NULL, PARAM_TEXT);
|
|
|
|
+ echo $this->search_comment_submission($id_submission);
|
|
|
|
+ }
|
|
|
|
|
|
/// This method gets the content from the iLM and register it
|
|
/// This method gets the content from the iLM and register it
|
|
// It could be the "exercise template" (teacher) or an answer (student)
|
|
// It could be the "exercise template" (teacher) or an answer (student)
|
|
@@ -1023,6 +1032,17 @@ class iassign {
|
|
$return_get_answer = optional_param('return_get_answer', 0, PARAM_INT);
|
|
$return_get_answer = optional_param('return_get_answer', 0, PARAM_INT);
|
|
$msg = '';
|
|
$msg = '';
|
|
|
|
|
|
|
|
+ if ($this->activity->get_activity()->store_all_submissions == 1) {
|
|
|
|
+ $newentry = new stdClass();
|
|
|
|
+ $newentry->iassign_statementid = $this->activity->get_activity()->id;
|
|
|
|
+ $newentry->userid = $this->userid_iassign;
|
|
|
|
+ $newentry->timecreated = time();
|
|
|
|
+ $newentry->grade = round($iLM_PARAM_RealGrade, 2);
|
|
|
|
+ $newentry->answer = $iLM_PARAM_ArchiveContent;
|
|
|
|
+
|
|
|
|
+ $DB->insert_record("iassign_allsubmissions", $newentry);
|
|
|
|
+ }
|
|
|
|
+
|
|
// Feedback
|
|
// Feedback
|
|
// Activity status: 0 => not post 1; => post; 2 => evaluated as incorrect; 3 => evaluated as correct
|
|
// Activity status: 0 => not post 1; => post; 2 => evaluated as incorrect; 3 => evaluated as correct
|
|
$str_action = "view"; // repeat
|
|
$str_action = "view"; // repeat
|
|
@@ -2574,16 +2594,39 @@ class iassign {
|
|
}
|
|
}
|
|
|
|
|
|
$output .= $OUTPUT->box_start();
|
|
$output .= $OUTPUT->box_start();
|
|
- $output .= "<center><form name='formEnvioComment' id='formEnvioComment1' method='post' action='$enderecoPOSTcomment' enctype='multipart/form-data'>\n";
|
|
|
|
- $output .= "<p><textarea rows='2' cols='60' name='submission_comment'></textarea></p>\n";
|
|
|
|
- $output .= "<p><input type=submit value='" . get_string('submit_comment', 'iassign') . "'\></p>\n";
|
|
|
|
- $output .= "</form></center>\n";
|
|
|
|
- if (!empty($history_comment)) {
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //if (!empty($history_comment)) {
|
|
$output .= " <table id='outlinetable' class='generaltable boxaligncenter' cellpadding='5' width='100%'> \n";
|
|
$output .= " <table id='outlinetable' class='generaltable boxaligncenter' cellpadding='5' width='100%'> \n";
|
|
$output .= " <tr><th>" . get_string('history_comments', 'iassign') . "</th></tr>";
|
|
$output .= " <tr><th>" . get_string('history_comments', 'iassign') . "</th></tr>";
|
|
$output .= $history_comment;
|
|
$output .= $history_comment;
|
|
$output .= "</table>";
|
|
$output .= "</table>";
|
|
|
|
+
|
|
|
|
+ print " <script type='text/javascript'>
|
|
|
|
+ //<![CDATA[
|
|
|
|
+ function submit_comment(url) {
|
|
|
|
+ var formData = new FormData();
|
|
|
|
+ formData.append('submission_comment', document.formEnvioComment.submission_comment.value);
|
|
|
|
+ var request = new XMLHttpRequest();
|
|
|
|
+ request.open('POST', url);
|
|
|
|
+ request.onload = function (e) {
|
|
|
|
+ if (request.readyState === 4) {
|
|
|
|
+ if (request.status === 200) {
|
|
|
|
+ alert(request.responseText);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ request.send(formData);
|
|
}
|
|
}
|
|
|
|
+ //]]>
|
|
|
|
+ </script>";
|
|
|
|
+
|
|
|
|
+ $output .= "<center><form name='formEnvioComment' id='formEnvioComment1' enctype='multipart/form-data'>\n";
|
|
|
|
+ $output .= "<br><p><textarea rows='2' cols='60' name='submission_comment'></textarea></p>\n";
|
|
|
|
+ $output .= "<p><input onclick=\"submit_comment('$enderecoPOSTcomment')\" type=button value='" . get_string('submit_comment', 'iassign') . "'\></p>\n";
|
|
|
|
+ $output .= "</form></center>\n";
|
|
|
|
+
|
|
|
|
+ // }
|
|
$output .= $OUTPUT->box_end();
|
|
$output .= $OUTPUT->box_end();
|
|
print $output;
|
|
print $output;
|
|
} // if ($iassign_statement_activity_item->type_iassign == 3)
|
|
} // if ($iassign_statement_activity_item->type_iassign == 3)
|