Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 48... Línea 48...
48
     * @var array $required_fields
48
     * @var array $required_fields
49
     */
49
     */
50
    public $required_fields = array('id', 'itemid', 'userid', 'rawgrade', 'rawgrademax', 'rawgrademin',
50
    public $required_fields = array('id', 'itemid', 'userid', 'rawgrade', 'rawgrademax', 'rawgrademin',
51
                                 'rawscaleid', 'usermodified', 'finalgrade', 'hidden', 'locked',
51
                                 'rawscaleid', 'usermodified', 'finalgrade', 'hidden', 'locked',
52
                                 'locktime', 'exported', 'overridden', 'excluded', 'timecreated',
52
                                 'locktime', 'exported', 'overridden', 'excluded', 'timecreated',
53
                                 'timemodified', 'aggregationstatus', 'aggregationweight');
53
                                 'timemodified', 'aggregationstatus', 'aggregationweight', 'deductedmark');
Línea 54... Línea 54...
54
 
54
 
55
    /**
55
    /**
56
     * Array of optional fields with default values (these should match db defaults)
56
     * Array of optional fields with default values (these should match db defaults)
57
     * @var array $optional_fields
57
     * @var array $optional_fields
Línea 216... Línea 216...
216
     * label text.
216
     * label text.
217
     * @var string $label
217
     * @var string $label
218
     */
218
     */
219
    public $label;
219
    public $label;
Línea -... Línea 220...
-
 
220
 
-
 
221
    /** @var float $deductedmark mark deducted from final grade */
-
 
222
    public float $deductedmark = 0;
-
 
223
 
-
 
224
    /**
-
 
225
     * Date when this grade was last graded.
-
 
226
     * @var int $dategraded
-
 
227
     */
-
 
228
    public $dategraded = null;
220
 
229
 
221
    /**
230
    /**
222
     * Returns array of grades for given grade_item+users
231
     * Returns array of grades for given grade_item+users
223
     *
232
     *
224
     * @param grade_item $grade_item
233
     * @param grade_item $grade_item
Línea 1079... Línea 1088...
1079
    /**
1088
    /**
1080
     * Handles adding feedback files in the gradebook.
1089
     * Handles adding feedback files in the gradebook.
1081
     *
1090
     *
1082
     * @param int|null $historyid
1091
     * @param int|null $historyid
1083
     */
1092
     */
1084
    protected function add_feedback_files(int $historyid = null) {
1093
    protected function add_feedback_files(?int $historyid = null) {
1085
        global $CFG;
1094
        global $CFG;
Línea 1086... Línea 1095...
1086
 
1095
 
1087
        // We only support feedback files for modules atm.
1096
        // We only support feedback files for modules atm.
1088
        if ($this->grade_item && $this->grade_item->is_external_item()) {
1097
        if ($this->grade_item && $this->grade_item->is_external_item()) {
Línea 1100... Línea 1109...
1100
    /**
1109
    /**
1101
     * Handles updating feedback files in the gradebook.
1110
     * Handles updating feedback files in the gradebook.
1102
     *
1111
     *
1103
     * @param int|null $historyid
1112
     * @param int|null $historyid
1104
     */
1113
     */
1105
    protected function update_feedback_files(int $historyid = null) {
1114
    protected function update_feedback_files(?int $historyid = null) {
1106
        global $CFG;
1115
        global $CFG;
Línea 1107... Línea 1116...
1107
 
1116
 
1108
        // We only support feedback files for modules atm.
1117
        // We only support feedback files for modules atm.
1109
        if ($this->grade_item && $this->grade_item->is_external_item()) {
1118
        if ($this->grade_item && $this->grade_item->is_external_item()) {
Línea 1282... Línea 1291...
1282
     */
1291
     */
1283
    public function get_context() {
1292
    public function get_context() {
1284
        $this->load_grade_item();
1293
        $this->load_grade_item();
1285
        return $this->grade_item->get_context();
1294
        return $this->grade_item->get_context();
1286
    }
1295
    }
-
 
1296
 
-
 
1297
    /**
-
 
1298
     * Whether the penalty is applied to this final grade.
-
 
1299
     *
-
 
1300
     * @return bool whether penalty is applied
-
 
1301
     */
-
 
1302
    public function is_penalty_applied_to_final_grade(): bool {
-
 
1303
        // Return false if the grade is overridden.
-
 
1304
        if ($this->is_overridden()) {
-
 
1305
            return false;
-
 
1306
        }
-
 
1307
        return $this->deductedmark > 0;
-
 
1308
    }
1287
}
1309
}