Skip to content

Commit

Permalink
ILMS-99
Browse files Browse the repository at this point in the history
Support advanced gradingin kalvidassign
  • Loading branch information
hilak authored and lucaboesch committed Jun 5, 2023
1 parent 636f5e9 commit dba6d72
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 17 deletions.
61 changes: 61 additions & 0 deletions mod/kalvidassign/classes/grades/gradeitems.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Grade item mappings for the activity.
*
* @package mod_kalvidassign
* @copyright Hila Karimov <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

declare(strict_types = 1);

namespace mod_kalvidassign\grades;

use \core_grades\local\gradeitem\itemnumber_mapping;
use \core_grades\local\gradeitem\advancedgrading_mapping;

/**
* Grade item mappings for the activity.
*
* @package mod_kalvidassign
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class gradeitems implements itemnumber_mapping, advancedgrading_mapping {

/**
* Return the list of grade item mappings for the assign.
*
* @return array
*/
public static function get_itemname_mapping_for_component(): array {
return [
0 => 'submissions',
];
}

/**
* Get the list of advanced grading item names for this component.
*
* @return array
*/
public static function get_advancedgrading_itemnames(): array {
return [
'submissions',
];
}
}
19 changes: 2 additions & 17 deletions mod/kalvidassign/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,33 +245,18 @@ function kalvidassign_scale_used_anywhere($scaleid) {
*/
function kalvidassign_supports($feature) {
switch($feature) {
case FEATURE_GROUPS:
return true;
break;
case FEATURE_GROUPINGS:
return true;
break;
case FEATURE_GROUPS:
case FEATURE_GROUPMEMBERSONLY:
return true;
break;
case FEATURE_MOD_INTRO:
return true;
break;
case FEATURE_COMPLETION_TRACKS_VIEWS:
return true;
break;
case FEATURE_GRADE_HAS_GRADE:
return true;
break;
case FEATURE_GRADE_OUTCOMES:
return true;
break;
case FEATURE_BACKUP_MOODLE2:
CASE FEATURE_ADVANCED_GRADING:
return true;
break;
default:
return null;
break;
}
}

Expand Down

0 comments on commit dba6d72

Please sign in to comment.