|
@@ -282,7 +282,7 @@ class iassign {
|
|
|
|
|
|
$action_iassign_limit = array(
|
|
|
'view' => '$this->view_iassign_current();',
|
|
|
- 'newcomment' => '$this->get_answer();',
|
|
|
+ //'newcomment' => '$this->get_answer();',
|
|
|
'viewsubmission' => '$this->view_iassign_current();',
|
|
|
'edit_status' => '$this->edit_status();',
|
|
|
'edit_grade' => '$this->edit_grade();',
|
|
@@ -305,6 +305,7 @@ class iassign {
|
|
|
'duplicate_activity' => '$this->duplicate_activity();',
|
|
|
'move_activity' => '$this->move_activity();',
|
|
|
'auto_evaluate' => '$this->auto_evaluate();',
|
|
|
+ 'all_submissions' => '$this->all_submissions();',
|
|
|
'get_student_submission' => '$this->get_student_submission();',
|
|
|
'get_teacher_exercise' => '$this->get_teacher_exercise();',
|
|
|
'post_auto_eval_result' => '$this->post_auto_eval_result();'
|
|
@@ -392,6 +393,10 @@ class iassign {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /// Manage all submissions in exercises to table iassign_allsubmissions
|
|
|
+ function all_submissions () {
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/// This method runs activities auto evaluation in teacher area
|
|
|
function auto_evaluate () {
|
|
@@ -994,11 +999,24 @@ class iassign {
|
|
|
|
|
|
// / This method gets the content from comment and register it
|
|
|
function add_comment () {
|
|
|
+ global $USER, $DB;
|
|
|
$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);
|
|
|
+ if (!$id_submission) {
|
|
|
+ $iassign_submission =
|
|
|
+ $DB->get_record("iassign_submission",
|
|
|
+ array(
|
|
|
+ "iassign_statementid" => $this->activity->get_activity()->id,
|
|
|
+ "userid" => $USER->id
|
|
|
+ )
|
|
|
+ );
|
|
|
+ if ($iassign_submission) {
|
|
|
+ $id_submission = $iassign_submission->id;
|
|
|
+ }
|
|
|
+ }
|
|
|
echo $this->search_comment_submission($id_submission);
|
|
|
}
|
|
|
|
|
@@ -1927,9 +1945,13 @@ class iassign {
|
|
|
$link_stats = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=stats&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('results') . ' ' . get_string('graphic', 'iassign') . "</a>";
|
|
|
$link_export = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=export_csv&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('export_ilm') . ' ' . get_string('export_csv', 'iassign') . "</a>";
|
|
|
$link_auto_evaluate = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=auto_evaluate&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('correct') . ' ' . get_string('auto_evaluate_reprocess', 'iassign') . "</a>";
|
|
|
+
|
|
|
+ $link_all_submissions_manager = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=all_submissions&iassignid=" . $this->iassign->id . "'><i class='fa fa-files-o' aria-hidden='true' style='color: red'></i> " . get_string('all_submissions_manager', 'iassign') . "</a>";
|
|
|
+
|
|
|
print '<td width=15% align="right">' . $link_stats . '</td>' . "\n";
|
|
|
print '<td width=15% align="right">' . $link_export . '</td>' . "\n";
|
|
|
print '<td width=15% align="right">' . $link_auto_evaluate . '</td>' . "\n";
|
|
|
+ print '<td width=15% align="right">' . $link_all_submissions_manager . '</td>' . "\n";
|
|
|
print '<td width=15% align="right">' . $link_print . '</td>' . "\n";
|
|
|
} // if ($this->action != 'print')
|
|
|
print '</tr></table>' . "\n";
|
|
@@ -4038,6 +4060,11 @@ class iassign {
|
|
|
//MOOC 2016: foi p/ 15 linhas acima:
|
|
|
$iassign_submission = $DB->get_record("iassign_submission", array("id" => $this->iassign_submission_current));
|
|
|
|
|
|
+ // verificar se existe uma submissão para o exercício e aluno informados
|
|
|
+ if (!$iassign_submission) {
|
|
|
+ $iassign_submission = $DB->get_record("iassign_submission", array("iassign_statementid" => $this->activity->get_activity()->id, "userid" => $USER->id));
|
|
|
+ }
|
|
|
+
|
|
|
if (!$iassign_submission) {
|
|
|
$iassign_statement_activity_item = $DB->get_record("iassign_statement", array("id" => $this->activity->get_activity()->id));
|
|
|
|