Skip to content
Snippets Groups Projects
initDatabase.sql 6.29 KiB
Newer Older
  • Learn to ignore specific revisions
  • Lukas Köhler's avatar
    Lukas Köhler committed
    INSERT INTO public.opensubmit_grading (id, title, means_passed)
    VALUES (1, 'Correct', true);
    INSERT INTO public.opensubmit_grading (id, title, means_passed)
    VALUES (2, 'Incorrect', false);
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    INSERT INTO public.opensubmit_gradingscheme (id, title)
    VALUES (1, 'Correct/Incorrect');
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    INSERT INTO public.opensubmit_gradingscheme_gradings (id, gradingscheme_id, grading_id)
    VALUES (1, 1, 1);
    INSERT INTO public.opensubmit_gradingscheme_gradings (id, gradingscheme_id, grading_id)
    VALUES (2, 1, 2);
    
    
    INSERT INTO public.opensubmit_course (title, created, homepage, active, owner_id, lti_key, lti_secret)
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    VALUES ('Mo12x', now(), 'https://lernen.h-da.de/course/view.php?id=8845', true,
            (select id from auth_user where username = 'm.roth'), null, null);
    
    
    INSERT INTO public.opensubmit_course (title, created, homepage, active, owner_id, lti_key, lti_secret)
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    VALUES ('Mo12y', now(), 'https://lernen.h-da.de/course/view.php?id=8845', true,
            (select id from auth_user where username = 'm.roth'), null, null);
    
    
    INSERT INTO public.opensubmit_course (title, created, homepage, active, owner_id, lti_key, lti_secret)
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    VALUES ('Do12x', now(), 'https://lernen.h-da.de/course/view.php?id=8845', true,
            (select id from auth_user where username = 'm.roth'), null, null);
    
    
    INSERT INTO public.opensubmit_course (title, created, homepage, active, owner_id, lti_key, lti_secret)
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    VALUES ('Do12y', now(), 'https://lernen.h-da.de/course/view.php?id=8845', true,
            (select id from auth_user where username = 'm.roth'), null, null);
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    INSERT INTO public.opensubmit_course (title, created, homepage, active, owner_id, lti_key, lti_secret)
    VALUES ('Ohne Gruppe', now(), 'https://lernen.h-da.de/course/view.php?id=8845', true,
    
    Lukas Köhler's avatar
    Lukas Köhler committed
            (select id from auth_user where username = 'm.roth'), null, null);
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    
    
    
    
    INSERT INTO public.opensubmit_assignment (title, download, created, publish_at, soft_deadline, hard_deadline,
    
    Lukas Köhler's avatar
    Lukas Köhler committed
                                              has_attachment, attachment_test_timeout, attachment_test_validity,
                                              validity_script_download, attachment_test_full,
                                              course_id, "gradingScheme_id", description, max_authors)
    SELECT 'Praktikum 1',
           'https://lernen.h-da.de/pluginfile.php/376828/mod_resource/content/1/Praktikum1.pdf',
           '2019-04-01 07:00:29.652859',
           '2019-04-03 07:00:29.652859',
           null,
           '2020-07-01 09:00:00.000000',
           true,
           30,
           'testscripts/validate.py',
           false,
           '',
           c.id,
           1,
           '',
           1
    FROM (SELECT id FROM opensubmit_course) c;
    
    INSERT INTO public.opensubmit_assignment (title, download, created, publish_at, soft_deadline, hard_deadline,
                                              has_attachment, attachment_test_timeout, attachment_test_validity,
                                              validity_script_download, attachment_test_full,
                                              course_id, "gradingScheme_id", description, max_authors)
    SELECT 'Praktikum 2',
           'https://lernen.h-da.de/pluginfile.php/381212/mod_resource/content/1/Praktikum2.pdf',
           '2019-04-01 07:00:29.652859',
           '2020-04-03 07:00:29.652859',
           null,
           '2020-07-01 09:00:00.000000',
           true,
           30,
           'testscripts/validate.py',
           false,
           '',
           c.id,
           1,
           '',
           1
    
    FROM (SELECT id FROM opensubmit_course) c;
    
    
    INSERT INTO public.opensubmit_assignment (title, download, created, publish_at, soft_deadline, hard_deadline,
                                              has_attachment, attachment_test_timeout, attachment_test_validity,
                                              validity_script_download, attachment_test_full,
                                              course_id, "gradingScheme_id", description, max_authors)
    SELECT 'Praktikum 3',
           'https://lernen.h-da.de/pluginfile.php/381212/mod_resource/content/1/Praktikum3.pdf',
           '2019-04-01 07:00:29.652859',
    
    Lukas Köhler's avatar
    Lukas Köhler committed
           '2019-04-03 07:00:29.652859',
           null,
           '2020-07-01 09:00:00.000000',
           true,
           30,
           'testscripts/validate.py',
           false,
           '',
           c.id,
           1,
           '',
           1
    FROM (SELECT id FROM opensubmit_course) c;
    
    INSERT INTO public.opensubmit_assignment (title, download, created, publish_at, soft_deadline, hard_deadline,
                                              has_attachment, attachment_test_timeout, attachment_test_validity,
                                              validity_script_download, attachment_test_full,
                                              course_id, "gradingScheme_id", description, max_authors)
    SELECT 'Praktikum 4',
           'https://lernen.h-da.de/pluginfile.php/387700/mod_resource/content/0/Praktikum4.pdf',
           '2019-04-01 07:00:29.652859',
    
           '2020-04-03 07:00:29.652859',
           null,
           '2020-07-01 09:00:00.000000',
           true,
           30,
           'testscripts/validate.py',
           false,
           '',
           c.id,
           1,
           '',
           1
    FROM (SELECT id FROM opensubmit_course) c;
    
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    INSERT INTO public.opensubmit_assignment (title, download, created, publish_at, soft_deadline, hard_deadline,
                                              has_attachment, attachment_test_timeout, attachment_test_validity,
                                              validity_script_download, attachment_test_full,
                                              course_id, "gradingScheme_id", description, max_authors)
    SELECT 'Praktikum 5',
           'https://lernen.h-da.de/pluginfile.php/387700/mod_resource/content/0/Praktikum5.pdf',
           '2019-04-01 07:00:29.652859',
           '2020-04-03 07:00:29.652859',
           null,
           '2020-07-01 09:00:00.000000',
           true,
           30,
           'testscripts/validate.py',
           false,
           '',
           c.id,
           1,
           '',
           1
    FROM (SELECT id FROM opensubmit_course) c;
    
    
    
    
    INSERT INTO opensubmit_assignment_test_machines (assignment_id, testmachine_id)
    SELECT a.id, t.id
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    FROM (SELECT id from opensubmit_assignment) a,
    
         (SELECT id from opensubmit_testmachine) t;
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    
    
    
    INSERT INTO opensubmit_course_tutors (course_id, user_id)
    SELECT c.id, u.id
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    FROM (SELECT id from opensubmit_course) c,
         (SELECT id from auth_user where username = 'l.koehler') u;
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    
    INSERT INTO opensubmit_course_tutors (course_id, user_id)
    SELECT c.id, u.id
    
    Lukas Köhler's avatar
    Lukas Köhler committed
    FROM (SELECT id from opensubmit_course) c,
         (SELECT id from auth_user where username = 'm.roth') u;