1144
1144
if ($grade < 0) {
1145
1145
$displaygrade = '';
1147
$displaygrade = format_float($grade);
1147
$displaygrade = format_float($grade, 2);
1149
1149
$o .= '<label class="accesshide" for="quickgrade_' . $userid . '">' .
1150
1150
get_string('usergrade', 'assign') .
3394
3394
// Only show the grade if it is not hidden in gradebook.
3395
3395
if (!empty($gradebookgrade->grade) && ($cangrade || !$gradebookgrade->hidden)) {
3396
3396
if ($controller = $gradingmanager->get_active_controller()) {
3397
$controller->set_grade_range(make_grades_menu($this->get_instance()->grade));
3397
$controller->set_grade_range(make_grades_menu($this->get_instance()->grade), $this->get_instance()->grade > 0);
3398
3398
$gradefordisplay = $controller->render_grade($PAGE,
3492
3492
// Now get the gradefordisplay.
3493
3493
if ($controller) {
3494
$controller->set_grade_range(make_grades_menu($this->get_instance()->grade));
3494
$controller->set_grade_range(make_grades_menu($this->get_instance()->grade), $this->get_instance()->grade > 0);
3495
3495
$grade->gradefordisplay = $controller->render_grade($PAGE,
3660
3660
$team = groups_get_members($submission->groupid, 'u.id');
3662
3662
foreach ($team as $member) {
3663
$submission->groupid = 0;
3664
$submission->userid = $member->id;
3665
$this->gradebook_item_update($submission, null);
3663
$membersubmission = clone $submission;
3664
$membersubmission->groupid = 0;
3665
$membersubmission->userid = $member->id;
3666
$this->gradebook_item_update($membersubmission, null);
3849
if ($this->grading_disabled($userid)) {
3850
// See if this user grade is locked in the gradebook.
3851
$gradinginfo = grade_get_grades($this->get_course()->id,
3854
$this->get_instance()->id,
3857
isset($gradinginfo->items[0]->grades[$userid]) &&
3858
$gradinginfo->items[0]->grades[$userid]->locked) {
4880
4889
global $CFG, $USER;
4882
4891
$grademenu = make_grades_menu($this->get_instance()->grade);
4892
$allowgradedecimals = $this->get_instance()->grade > 0;
4884
4894
$advancedgradingwarning = false;
4885
4895
$gradingmanager = get_grading_manager($this->context, 'mod_assign', 'submissions');
4968
4978
// Use simple direct grading.
4969
4979
if ($this->get_instance()->grade > 0) {
4970
4980
$name = get_string('gradeoutof', 'assign', $this->get_instance()->grade);
4971
$gradingelement = $mform->addElement('text', 'grade', $name);
4972
$mform->addHelpButton('grade', 'gradeoutofhelp', 'assign');
4973
$mform->setType('grade', PARAM_TEXT);
4974
if ($gradingdisabled) {
4975
$gradingelement->freeze();
4981
if (!$gradingdisabled) {
4982
$gradingelement = $mform->addElement('text', 'grade', $name);
4983
$mform->addHelpButton('grade', 'gradeoutofhelp', 'assign');
4984
$mform->setType('grade', PARAM_RAW);
4986
$mform->addElement('hidden', 'grade', $name);
4987
$mform->hardFreeze('grade');
4988
$mform->setType('grade', PARAM_RAW);
4989
$strgradelocked = get_string('gradelocked', 'assign');
4990
$mform->addElement('static', 'gradedisabled', $name, $strgradelocked);
4991
$mform->addHelpButton('gradedisabled', 'gradeoutofhelp', 'assign');
4978
4994
$grademenu = make_grades_menu($this->get_instance()->grade);
5310
5326
// Give each submission plugin a chance to process the locking.
5311
5327
$plugins = $this->get_submission_plugins();
5312
$submission = $this->get_user_submission($userid, false);
5328
$submission = $this->get_user_submission($userid, true);
5313
5329
foreach ($plugins as $plugin) {
5314
5330
if ($plugin->is_enabled() && $plugin->is_visible()) {
5315
5331
$plugin->lock($submission);
5347
5363
// Give each submission plugin a chance to process the unlocking.
5348
5364
$plugins = $this->get_submission_plugins();
5349
$submission = $this->get_user_submission($userid, false);
5365
$submission = $this->get_user_submission($userid, true);
5350
5366
foreach ($plugins as $plugin) {
5351
5367
if ($plugin->is_enabled() && $plugin->is_visible()) {
5352
5368
$plugin->unlock($submission);