428
428
// Save changes button.
429
429
$action = 'grade';
430
430
if ($this->process_save_grade($mform)) {
431
$message = get_string('gradingchangessaved', 'assign');
432
$action = 'savegradingresult';
431
$action = 'redirect';
432
$nextpageparams['action'] = 'savegradingresult';
435
435
// Cancel button.
465
465
redirect($nextpageurl);
467
467
} else if ($action == 'savegradingresult') {
468
$message = get_string('gradingchangessaved', 'assign');
468
469
$o .= $this->view_savegrading_result($message);
469
470
} else if ($action == 'quickgradingresult') {
785
786
$event = new stdClass();
787
788
$params = array('modulename'=>'assign', 'instance'=>$instance->id);
788
$event->id = $DB->get_field('event',
789
$event->id = $DB->get_field('event', 'id', $params);
790
$event->name = $instance->name;
791
$event->timestart = $instance->duedate;
793
// Convert the links to pluginfile. It is a bit hacky but at this stage the files
794
// might not have been saved in the module area yet.
795
$intro = $instance->intro;
796
if ($draftid = file_get_submitted_draft_itemid('introeditor')) {
797
$intro = file_rewrite_urls_to_pluginfile($intro, $draftid);
800
// We need to remove the links to files as the calendar is not ready
801
// to support module events with file areas.
802
$intro = strip_pluginfile_content($intro);
803
$event->description = array(
805
'format' => $instance->introformat
792
808
if ($event->id) {
793
$event->name = $instance->name;
794
$event->description = format_module_intro('assign', $instance, $coursemoduleid);
795
$event->timestart = $instance->duedate;
797
809
$calendarevent = calendar_event::load($event->id);
798
810
$calendarevent->update($event);
800
$event = new stdClass();
801
$event->name = $instance->name;
802
$event->description = format_module_intro('assign', $instance, $coursemoduleid);
803
813
$event->courseid = $instance->course;
804
814
$event->groupid = 0;
805
815
$event->userid = 0;
806
816
$event->modulename = 'assign';
807
817
$event->instance = $instance->id;
808
818
$event->eventtype = 'due';
809
$event->timestart = $instance->duedate;
810
819
$event->timeduration = 0;
812
820
calendar_event::create($event);
1938
$strsectionname = get_string('sectionname', 'format_'.$course->format);
1946
$strsectionname = '';
1939
1947
$usesections = course_format_uses_sections($course->format);
1940
1948
$modinfo = get_fast_modinfo($course);
1942
1950
if ($usesections) {
1951
$strsectionname = get_string('sectionname', 'format_'.$course->format);
1943
1952
$sections = $modinfo->get_section_info_all();
1945
1954
$courseindexsummary = new assign_course_index_summary($usesections, $strsectionname);
2765
2774
$this->get_course_module()->id,
2766
2775
$this->get_return_action(),
2767
2776
$this->get_return_params(),
2770
2781
$o .= $this->get_renderer()->render($history);
3451
3462
$this->get_course_module()->id,
3452
3463
$this->get_return_action(),
3453
3464
$this->get_return_params(),
3456
3469
$o .= $this->get_renderer()->render($history);
3955
3968
$graders = array();
3956
3969
if (groups_get_activity_groupmode($this->get_course_module()) == SEPARATEGROUPS) {
3957
if ($groups = groups_get_all_groups($this->get_course()->id, $userid)) {
3970
if ($groups = groups_get_all_groups($this->get_course()->id, $userid, $this->get_course_module()->groupingid)) {
3958
3971
foreach ($groups as $group) {
3959
3972
foreach ($potentialgraders as $grader) {
3960
3973
if ($grader->id == $userid) {