<commit_before><?php

$DATABASE_UNINSTALL = array(
"drop table if exists {$CFG->dbprefix}peer_flag",
"drop table if exists {$CFG->dbprefix}peer_grade",
"drop table if exists {$CFG->dbprefix}peer_submit",
"drop table if exists {$CFG->dbprefix}peer_assn"
);

$DATABASE_INSTALL = array(
array( "{$CFG->dbprefix}peer_assn",
"create table {$CFG->dbprefix}peer_assn (
    assn_id    INTEGER NOT NULL KEY AUTO_INCREMENT,
    link_id    INTEGER NOT NULL,
    due_at     DATETIME NOT NULL,

    json         TEXT NULL,

    updated_at  DATETIME NOT NULL,
    created_at  DATETIME NOT NULL,

    CONSTRAINT `{$CFG->dbprefix}peer_assn_ibfk_1`
        FOREIGN KEY (`link_id`)
        REFERENCES `{$CFG->dbprefix}lti_link` (`link_id`)
        ON DELETE CASCADE ON UPDATE CASCADE,

    UNIQUE(link_id)
) ENGINE = InnoDB DEFAULT CHARSET=utf8"),

array( "{$CFG->dbprefix}peer_submit",
"create table {$CFG->dbprefix}peer_submit (
    submit_id  INTEGER NOT NULL KEY AUTO_INCREMENT,
    assn_id    INTEGER NOT NULL,
    user_id    INTEGER NOT NULL,

    json         TEXT NULL,
    note         TEXT NULL,
    reflect      TEXT NULL,

    regrade      TINYINT NULL;

    updated_at  DATETIME NOT NULL,
    created_at  DATETIME NOT NULL,

    CONSTRAINT `{$CFG->dbprefix}peer_submit_ibfk_1`
        FOREIGN KEY (`user_id`)
        REFERENCES `{$CFG->dbprefix}lti_user` (`user_id`)
        ON DELETE CASCADE ON UPDATE CASCADE,

    CONSTRAINT `{$CFG->dbprefix}peer_submit_ibfk_2`
        FOREIGN KEY (`assn_id`)
        REFERENCES `{$CFG->dbprefix}peer_assn` (`assn_id`)
        ON DELETE CASCADE ON UPDATE CASCADE,

    UNIQUE(assn_id, user_id)<commit_msg>Corrected a typo in the peer assessment database script<commit_after><?php

$DATABASE_UNINSTALL = array(
"drop table if exists {$CFG->dbprefix}peer_flag",
"drop table if exists {$CFG->dbprefix}peer_grade",
"drop table if exists {$CFG->dbprefix}peer_submit",
"drop table if exists {$CFG->dbprefix}peer_assn"
);

$DATABASE_INSTALL = array(
array( "{$CFG->dbprefix}peer_assn",
"create table {$CFG->dbprefix}peer_assn (
    assn_id    INTEGER NOT NULL KEY AUTO_INCREMENT,
    link_id    INTEGER NOT NULL,
    due_at     DATETIME NOT NULL,

    json         TEXT NULL,

    updated_at  DATETIME NOT NULL,
    created_at  DATETIME NOT NULL,

    CONSTRAINT `{$CFG->dbprefix}peer_assn_ibfk_1`
        FOREIGN KEY (`link_id`)
        REFERENCES `{$CFG->dbprefix}lti_link` (`link_id`)
        ON DELETE CASCADE ON UPDATE CASCADE,

    UNIQUE(link_id)
) ENGINE = InnoDB DEFAULT CHARSET=utf8"),

array( "{$CFG->dbprefix}peer_submit",
"create table {$CFG->dbprefix}peer_submit (
    submit_id  INTEGER NOT NULL KEY AUTO_INCREMENT,
    assn_id    INTEGER NOT NULL,
    user_id    INTEGER NOT NULL,

    json         TEXT NULL,
    note         TEXT NULL,
    reflect      TEXT NULL,

    regrade      TINYINT NULL,

    updated_at  DATETIME NOT NULL,
    created_at  DATETIME NOT NULL,

    CONSTRAINT `{$CFG->dbprefix}peer_submit_ibfk_1`
        FOREIGN KEY (`user_id`)
        REFERENCES `{$CFG->dbprefix}lti_user` (`user_id`)
        ON DELETE CASCADE ON UPDATE CASCADE,

    CONSTRAINT `{$CFG->dbprefix}peer_submit_ibfk_2`
        FOREIGN KEY (`assn_id`)
        REFERENCES `{$CFG->dbprefix}peer_assn` (`assn_id`)
        ON DELETE CASCADE ON UPDATE CASCADE,

    UNIQUE(assn_id, user_id)
{'fraction_non_alphanumeric': 0.10313630880579011, 'fraction_numerical': 0.0024125452352231603, 'mean_word_length': 3.28, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3072886', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1167, 'n_words': 293}