|
@@ -313,7 +313,8 @@ class iassign {
|
|
'get_individual_submission' => '$this->get_individual_submission();',
|
|
'get_individual_submission' => '$this->get_individual_submission();',
|
|
'get_student_submission' => '$this->get_student_submission();',
|
|
'get_student_submission' => '$this->get_student_submission();',
|
|
'get_teacher_exercise' => '$this->get_teacher_exercise();',
|
|
'get_teacher_exercise' => '$this->get_teacher_exercise();',
|
|
- 'post_auto_eval_result' => '$this->post_auto_eval_result();'
|
|
|
|
|
|
+ 'post_auto_eval_result' => '$this->post_auto_eval_result();',
|
|
|
|
+ 'import_activity' => '$this->import_activity();'
|
|
);
|
|
);
|
|
|
|
|
|
$action_iassign_restricted = array_merge($restricted, $action_iassign_limit, $action_iassign);
|
|
$action_iassign_restricted = array_merge($restricted, $action_iassign_limit, $action_iassign);
|
|
@@ -682,6 +683,24 @@ class iassign {
|
|
print '</center>';
|
|
print '</center>';
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function import_activity () {
|
|
|
|
+ global $COURSE, $CFG, $USER, $DB, $OUTPUT, $PAGE;
|
|
|
|
+
|
|
|
|
+ if (!has_capability('mod/iassign:runautoevaluate', $this->context, $USER->id))
|
|
|
|
+ exit;
|
|
|
|
+
|
|
|
|
+ print $OUTPUT->header();
|
|
|
|
+
|
|
|
|
+ $this->print_main_menu();
|
|
|
|
+
|
|
|
|
+ print '<br>';
|
|
|
|
+
|
|
|
|
+ $return = enrol_get_users_courses(2);
|
|
|
|
+
|
|
|
|
+ print_r($return);
|
|
|
|
+
|
|
|
|
+ print $OUTPUT->footer();
|
|
|
|
+ }
|
|
|
|
|
|
/// Manage all submissions in exercises to table iassign_allsubmissions
|
|
/// Manage all submissions in exercises to table iassign_allsubmissions
|
|
function all_submissions () {
|
|
function all_submissions () {
|
|
@@ -4497,6 +4516,7 @@ var exercises = [ '; // '
|
|
$url_auto_evaluate = new moodle_url('/mod/iassign/view.php', array('id' => $id, 'action' => 'auto_evaluate', 'iassignid' => $this->iassign->id));
|
|
$url_auto_evaluate = new moodle_url('/mod/iassign/view.php', array('id' => $id, 'action' => 'auto_evaluate', 'iassignid' => $this->iassign->id));
|
|
$url_sub_stats = new moodle_url('/mod/iassign/view.php', array('id' => $id, 'action' => 'stats', 'iassignid' => $this->iassign->id));
|
|
$url_sub_stats = new moodle_url('/mod/iassign/view.php', array('id' => $id, 'action' => 'stats', 'iassignid' => $this->iassign->id));
|
|
$url_all_submissions = new moodle_url('/mod/iassign/view.php', array('id' => $id, 'action' => 'all_submissions', 'iassignid' => $this->iassign->id));
|
|
$url_all_submissions = new moodle_url('/mod/iassign/view.php', array('id' => $id, 'action' => 'all_submissions', 'iassignid' => $this->iassign->id));
|
|
|
|
+ $url_import_activity = new moodle_url('/mod/iassign/view.php', array('id' => $id, 'action' => 'import_activity', 'iassignid' => $this->iassign->id));
|
|
|
|
|
|
print '<div class="btn-group" role="group" aria-label="">';
|
|
print '<div class="btn-group" role="group" aria-label="">';
|
|
|
|
|
|
@@ -4504,13 +4524,12 @@ var exercises = [ '; // '
|
|
<i class="fa fa-home" aria-hidden="true"></i> '.get_string('activities_page', 'iassign').'
|
|
<i class="fa fa-home" aria-hidden="true"></i> '.get_string('activities_page', 'iassign').'
|
|
</a>';
|
|
</a>';
|
|
|
|
|
|
- // TODO: esta consulta esta sendo feita novamente na linha +/- 2258
|
|
|
|
if (has_capability('mod/iassign:viewiassignall', $this->context, $USER->id)) {
|
|
if (has_capability('mod/iassign:viewiassignall', $this->context, $USER->id)) {
|
|
// could be "has_capability('mod/iassign:viewiassignall', $this->context, $USER->id)"
|
|
// could be "has_capability('mod/iassign:viewiassignall', $this->context, $USER->id)"
|
|
// Has capability to see "report": teacher or up
|
|
// Has capability to see "report": teacher or up
|
|
print '<a href="'.$url_help.'" class="btn btn-outline-primary"><i class="fa fa-question-circle" aria-hidden="true"></i> '.get_string('help_ilm', 'iassign').'</a>';
|
|
print '<a href="'.$url_help.'" class="btn btn-outline-primary"><i class="fa fa-question-circle" aria-hidden="true"></i> '.get_string('help_ilm', 'iassign').'</a>';
|
|
|
|
|
|
- print '<div class="btn-group">
|
|
|
|
|
|
+ print '<div class="btn-group"><div class="btn-group">
|
|
<a href="'.$url_report.'" class="btn btn-outline-primary '.($actual_action == 'report' || $actual_action == 'stats' || $actual_action == 'all_submissions' ? 'active' : '').' dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
<a href="'.$url_report.'" class="btn btn-outline-primary '.($actual_action == 'report' || $actual_action == 'stats' || $actual_action == 'all_submissions' ? 'active' : '').' dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
<i class="fa fa-bar-chart" aria-hidden="true"></i> '.get_string('report', 'iassign').'</a>
|
|
<i class="fa fa-bar-chart" aria-hidden="true"></i> '.get_string('report', 'iassign').'</a>
|
|
<div class="dropdown-menu">
|
|
<div class="dropdown-menu">
|
|
@@ -4537,13 +4556,20 @@ var exercises = [ '; // '
|
|
if ($notifications > 0)
|
|
if ($notifications > 0)
|
|
print ' <span class="badge bg-danger rounded-pill" style="color: white; font-size: .9rem;">'.$notifications.'</span>';
|
|
print ' <span class="badge bg-danger rounded-pill" style="color: white; font-size: .9rem;">'.$notifications.'</span>';
|
|
|
|
|
|
- print '</a>';
|
|
|
|
|
|
+ print '</a></div><div class="btn-group">';
|
|
|
|
|
|
if (has_capability('mod/iassign:editiassign', $this->context, $USER->id)) {
|
|
if (has_capability('mod/iassign:editiassign', $this->context, $USER->id)) {
|
|
print '<a href="'.$url_add.'" class="btn btn-success"><i class="fa fa-plus" aria-hidden="true"></i> '.get_string('add_iassign', 'iassign').'</a>';
|
|
print '<a href="'.$url_add.'" class="btn btn-success"><i class="fa fa-plus" aria-hidden="true"></i> '.get_string('add_iassign', 'iassign').'</a>';
|
|
|
|
+
|
|
|
|
+ print '
|
|
|
|
+ <button type="button" class="btn btn-success dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
+ </button>
|
|
|
|
+ <div class="dropdown-menu">
|
|
|
|
+ <a class="dropdown-item" href="'.$url_import_activity.'">'.get_string('import_activity', 'iassign').'</a>
|
|
|
|
+ </div>';
|
|
} // if (has_capability('mod/iassign:editiassign', $this->context, $USER->id))
|
|
} // if (has_capability('mod/iassign:editiassign', $this->context, $USER->id))
|
|
|
|
|
|
- print '</div>' . "\n";
|
|
|
|
|
|
+ print '</div></div>' . "\n";
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|