|
@@ -395,7 +395,55 @@ class iassign {
|
|
|
|
|
|
/// Manage all submissions in exercises to table iassign_allsubmissions
|
|
|
function all_submissions () {
|
|
|
+ global $COURSE, $CFG, $USER, $DB, $OUTPUT, $PAGE;
|
|
|
+
|
|
|
+ if (!has_capability('mod/iassign:runautoevaluate', $this->context, $USER->id))
|
|
|
+ exit;
|
|
|
+
|
|
|
+ print $OUTPUT->header();
|
|
|
+
|
|
|
+ print '<h2>' . get_string('all_submissions_manager', 'iassign') . '</h2>';
|
|
|
+
|
|
|
+ // Get list of exercises in the instance:
|
|
|
+ $iassignid = optional_param('iassignid', NULL, PARAM_TEXT);
|
|
|
+ $exercises_list = $DB->get_records("iassign_statement", array("iassignid" => $iassignid));
|
|
|
+
|
|
|
+ // Get list of enrolled students:
|
|
|
+ $params = array('shortname' => 'student');
|
|
|
+ $role = $DB->get_record_sql("SELECT s.id, s.shortname FROM {role} s WHERE s.shortname = :shortname", $params);
|
|
|
+ $context = context_course::instance($this->course->id);
|
|
|
+ $params = array('contextid' => $context->id, 'roleid' => $role->id);
|
|
|
+ $students_list = $DB->get_records_sql(
|
|
|
+ "SELECT s.userid, a.firstname, a.lastname FROM {role_assignments} s, {user} a " . " WHERE s.contextid = :contextid AND s.userid = a.id AND s.roleid = :roleid " . " ORDER BY a.firstname ASC,a.lastname ASC", $params);
|
|
|
+
|
|
|
+ print '<div class="list-group list-group-root">';
|
|
|
+ foreach ($exercises_list as $exercise) {
|
|
|
+
|
|
|
+ print '
|
|
|
+ <a href="#item-'.$exercise->id.'" class="list-group-item list-group-item-action" data-toggle="collapse">
|
|
|
+ <i class="fa fa-caret-right"></i> '
|
|
|
+ . $exercise->name . '</a>';
|
|
|
+
|
|
|
+ print '<div class="list-group collapse" id="item-'.$exercise->id.'">';
|
|
|
+
|
|
|
+ foreach ($students_list as $student) {
|
|
|
+
|
|
|
+ print '<a href="#item-'.$exercise->id.'-'.$student->userid.'" class="list-group-item list-group-item-action" data-toggle="collapse">
|
|
|
+ <i class="fa fa-caret-right"></i> ' . $student->firstname . ' ' . $student->lastname . ' </a>';
|
|
|
|
|
|
+ print '<div class="list-group collapse" id="item-'.$exercise->id.'-'.$student->userid.'">';
|
|
|
+
|
|
|
+ print '<a href="#" class="list-group-item list-group-item-action">Item 1.1.1</a>';
|
|
|
+
|
|
|
+ print '</div>';
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ print '</div>';
|
|
|
+ }
|
|
|
+ print '</div>';
|
|
|
+
|
|
|
+ print $OUTPUT->footer();
|
|
|
}
|
|
|
|
|
|
/// This method runs activities auto evaluation in teacher area
|