aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Lti/Grade.php
blob: 51970d9e3f946bc81ad1d25d2217f7c7130c0b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace Lti;

use User;
use SimpleORMap;

/**
 * NOTE: LtiGrade is only for the LTI 1.0/1.1 interface.
 * The LTI 1.3A interface uses the grade book tables for storing grades.
 */

class Grade extends SimpleORMap
{
    protected static function configure($config = []): void
    {
        $config['db_table'] = 'lti_grade';

        // TODO:: rename link and link_id to deployment and deployment_id
        $config['belongs_to']['link'] = [
            'class_name' => Deployment::class,
            'foreign_key' => 'link_id'
        ];

        $config['belongs_to']['user'] = [
            'class_name' => User::class,
            'foreign_key' => 'user_id'
        ];

        parent::configure($config);
    }
}