Commit 8a816343 authored by Marten Kenbeek's avatar Marten Kenbeek
Browse files

Removed coursera app.

parent b140b712
from django.apps import AppConfig
class CourseraConfig(AppConfig):
name = "coursera"
This diff is collapsed.
# Generated by Django 2.1.1 on 2018-09-20 09:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0001_initial")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW course_memberships_view
AS
SELECT
MD5(MD5(MD5(eitdigital_user_id) || course_id) || course_membership_ts)::varchar(50) as id,
eitdigital_user_id,
course_id,
course_membership_role,
course_membership_ts
FROM
course_memberships
""",
"""
CREATE UNIQUE INDEX ON course_memberships_view (id)
""",
"""
CREATE INDEX ON course_memberships_view (course_id, course_membership_role)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_memberships_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-24 08:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0002_create_course_membership_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW course_branch_modules_view
AS
SELECT
MD5(MD5(course_branch_id) || course_module_id)::varchar(50) as module_id,
course_branch_id,
course_module_id,
course_branch_module_order,
course_branch_module_name,
course_branch_module_desc
FROM
course_branch_modules;
""",
"""
CREATE UNIQUE INDEX ON course_branch_modules_view (module_id)
""",
"""
CREATE INDEX ON course_branch_modules_view (course_branch_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_branch_modules_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-24 11:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0003_create_course_branch_modules_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW
course_grades_view
AS
SELECT
MD5(MD5(MD5(eitdigital_user_id) || course_id) || course_grade_ts)::varchar(50) as id,
eitdigital_user_id,
course_id,
course_grade_ts,
course_passing_state_desc,
course_grade_overall_passed_items,
course_grade_overall,
course_grade_verified_passed_items,
course_grade_verified
FROM
course_grades
JOIN course_passing_states USING (course_passing_state_id)
""",
"""
CREATE UNIQUE INDEX ON course_grades_view (id)
""",
"""
CREATE INDEX ON course_grades_view (course_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_grades_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-25 10:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("coursera", "0004_create_course_grades_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW course_branch_lessons_view
AS
SELECT
MD5(MD5(course_branch_id) || course_lesson_id)::varchar(50) as lesson_id,
course_branch_id,
course_lesson_id,
MD5(MD5(course_branch_id) || course_module_id)::varchar(50) as module_id,
course_branch_lesson_order,
course_branch_lesson_name
FROM
course_branch_lessons;
""",
"""
CREATE UNIQUE INDEX ON course_branch_lessons_view (lesson_id)
""",
"""
CREATE INDEX ON course_branch_lessons_view (module_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_branch_lessons_view
""",
),
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW course_branch_items_view
AS
SELECT
MD5(MD5(course_branch_id) || course_item_id)::varchar(50) as item_id,
course_branch_id,
course_item_id,
MD5(MD5(course_branch_id) || course_lesson_id)::varchar(50) as lesson_id,
course_branch_item_order,
course_item_type_id,
course_branch_item_name,
course_branch_item_optional,
atom_id,
atom_version_id,
course_branch_atom_is_frozen
FROM
course_branch_items;
""",
"""
CREATE UNIQUE INDEX ON course_branch_items_view (item_id)
""",
"""
CREATE INDEX ON course_branch_items_view (lesson_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_branch_items_view
""",
),
]
# Generated by Django 2.1.1 on 2018-09-25 11:07
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0005_create_lessons_items_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW
course_progress_view
AS
SELECT
MD5(MD5(MD5(MD5(MD5(MD5(course_id) || course_branch_id) || course_item_id) || eitdigital_user_id) || course_progress_state_type_id) || course_progress_ts)::varchar(50) as id,
course_id,
MD5(MD5(course_branch_id) || course_item_id)::varchar(50) as item_id,
eitdigital_user_id,
course_progress_state_type_id,
course_progress_ts
FROM
course_progress
JOIN course_branches USING (course_id)
JOIN course_branch_modules USING (course_branch_id)
JOIN course_branch_lessons USING (course_branch_id, course_module_id)
JOIN course_branch_items USING (course_branch_id, course_lesson_id, course_item_id)
""",
"""
CREATE UNIQUE INDEX ON course_progress_view (id)
""",
"""
CREATE INDEX ON course_progress_view (course_id)
""",
"""
CREATE INDEX ON course_progress_view (item_id)
""",
"""
CREATE INDEX ON course_progress_view (eitdigital_user_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_progress_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-25 14:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0006_create_course_progress_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW course_branch_item_assessments_view
AS
SELECT
MD5(MD5(course_item_id) || assessment_id)::varchar(50) as id,
course_branch_id,
MD5(MD5(course_branch_id) || course_item_id)::varchar(50) as item_id,
assessment_id
FROM
course_branch_item_assessments;
""",
"""
CREATE UNIQUE INDEX ON course_branch_item_assessments_view (id)
""",
"""
CREATE INDEX ON course_branch_item_assessments_view (item_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_branch_item_assessments_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-26 07:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0007_create_item_assessment_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW course_branch_item_programming_assignments_view
AS
SELECT
MD5(MD5(course_item_id) || programming_assignment_id)::varchar(50) as id,
course_branch_id,
MD5(MD5(course_branch_id) || course_item_id)::varchar(50) as item_id,
programming_assignment_id
FROM
course_branch_item_programming_assignments
""",
"""
CREATE UNIQUE INDEX ON course_branch_item_programming_assignments_view (id)
""",
"""
CREATE INDEX ON course_branch_item_programming_assignments_view (item_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_branch_item_programming_assignments_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-26 07:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0008_create_item_assignment_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW course_branch_item_peer_assignments_view
AS
SELECT
MD5(MD5(course_item_id) || peer_assignment_id)::varchar(50) as id,
course_branch_id,
MD5(MD5(course_branch_id) || course_item_id)::varchar(50) as item_id,
peer_assignment_id
FROM
course_branch_item_peer_assignments;
""",
"""
CREATE UNIQUE INDEX ON course_branch_item_peer_assignments_view (id)
""",
"""
CREATE INDEX ON course_branch_item_peer_assignments_view (item_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS course_branch_item_peer_assignments_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-26 08:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0009_create_item_peer_assignment_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW feedback_course_ratings_view
AS
SELECT
MD5(MD5(MD5(MD5(course_id) || eitdigital_user_id) || feedback_system) || feedback_ts) as id,
course_id,
eitdigital_user_id,
feedback_system,
feedback_rating,
feedback_max_rating,
feedback_ts
FROM
feedback_course_ratings;
""",
"""
CREATE UNIQUE INDEX ON feedback_course_ratings_view (id)
""",
"""
CREATE INDEX ON feedback_course_ratings_view (course_id)
""",
"""
CREATE INDEX ON feedback_course_ratings_view (eitdigital_user_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS feedback_course_ratings_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-26 12:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0010_create_feedback_course_rating_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW IF NOT EXISTS
last_activity_view
AS
SELECT
DISTINCT ON (course_id, eitdigital_user_id)
MD5(MD5(MD5(MD5(MD5(course_id) || course_item_id) || eitdigital_user_id) || course_progress_state_type_id) || course_progress_ts)::varchar(50) as id,
course_id,
MD5(MD5(course_branch_id) || course_item_id)::varchar(50) as item_id,
eitdigital_user_id,
course_progress_state_type_id,
course_progress_ts
FROM
course_progress
JOIN course_branches USING (course_id)
JOIN course_branch_modules USING (course_branch_id)
JOIN course_branch_lessons USING (course_branch_id, course_module_id)
JOIN course_branch_items USING (course_branch_id, course_lesson_id, course_item_id)
ORDER BY
course_id,
eitdigital_user_id,
course_branch_module_order DESC
""",
"""
CREATE UNIQUE INDEX ON last_activity_view (id)
""",
"""
CREATE INDEX ON last_activity_view (course_id)
""",
"""
CREATE INDEX ON last_activity_view (item_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW last_activity_view
""",
)
]
# Generated by Django 2.1.1 on 2018-09-26 13:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0011_create_last_activity_view")]
operations = [
migrations.RunSQL(
sql=[
"""
CREATE MATERIALIZED VIEW IF NOT EXISTS
last_activity_per_module
AS
SELECT
MD5(MD5(MD5(module_id) || last_activity_view.id) || eitdigital_user_id)::varchar(50) as id,
module_id,
last_activity_view.id::varchar(50) as last_activity_id,
eitdigital_user_id,
course_progress_ts
FROM
course_branch_modules_view
JOIN course_branches USING (course_branch_id)
JOIN course_branch_lessons_view USING (course_branch_id, module_id)
JOIN course_branch_items_view USING (course_branch_id, lesson_id)
JOIN last_activity_view USING (course_id, item_id)
LEFT JOIN course_grades USING (course_id, eitdigital_user_id)
WHERE
course_passing_state_id IS NULL
OR course_passing_state_id NOT IN (1, 2)
""",
"""
CREATE UNIQUE INDEX ON last_activity_per_module (id)
""",
"""
CREATE INDEX ON last_activity_per_module (module_id)
""",
"""
CREATE INDEX ON last_activity_per_module (last_activity_id)
""",
"""
CREATE INDEX ON last_activity_per_module (eitdigital_user_id)
""",
],
reverse_sql="""
DROP MATERIALIZED VIEW IF EXISTS last_activity_per_module
""",
)
]
# Generated by Django 2.1.1 on 2018-09-28 11:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("coursera", "0012_create_leavers_per_module_view")]
operations = [
migrations.RunSQL(
[
"""
CREATE MATERIALIZED VIEW
module_first_activity_view
AS
SELECT DISTINCT ON (module_id, eitdigital_user_id)
MD5(MD5(module_id) || eitdigital_user_id)::varchar(50) as id,
module_id,
eitdigital_user_id,
course_progress_ts
FROM
course_branch_modules_view
JOIN course_branch_lessons_view USING (module_id)
JOIN course_branch_items_view USING (lesson_id)
JOIN course_progress_view USING (item_id)
ORDER BY
module_id,
eitdigital_user_id,
course_progress_ts ASC
""",
"""
CREATE UNIQUE INDEX ON module_first_activity_view (id)
""",
"""
CREATE UNIQUE INDEX ON module_first_activity_view (module_id, eitdigital_user_id)
""",
"""
CREATE INDEX ON module_first_activity_view (course_progress_ts)
""",
],
reverse_sql="DROP MATERIALIZED VIEW IF EXISTS module_first_activity_view",
),
migrations.RunSQL(
[
"""
CREATE MATERIALIZED VIEW
module_last_activity_view
AS
SELECT DISTINCT ON (module_id, eitdigital_user_id)
MD5(MD5(module_id) || eitdigital_user_id)::varchar(50) as id,
module_id,
eitdigital_user_id,
course_progress_ts
FROM
course_branch_modules_view
JOIN course_branch_lessons_view USING (module_id)
JOIN course_branch_items_view USING (lesson_id)
JOIN course_progress_view USING (item_id)
ORDER BY
module_id,
eitdigital_user_id,
course_progress_ts DESC
""",
"""
CREATE UNIQUE INDEX ON module_last_activity_view (id)
""",
"""
CREATE UNIQUE INDEX ON module_last_activity_view (module_id, eitdigital_user_id)
""",
"""
CREATE INDEX ON module_last_activity_view (course_progress_ts)
""",
],
reverse_sql="DROP MATERIALIZED VIEW IF EXISTS module_last_activity_view",
),
]
from .activities import *
from .course_structure import *
from .courses import *
from .feedback import *
from .grades import *
from .sessions import *
from .users import *
from django.db import models
__all__ = [
"CourseProgress",
"LastActivity",
"LastActivityPerModule",
"ModuleFirstActivity",
"ModuleLastActivity",
]
class CourseProgress(models.Model):
id = models.CharField(max_length=50, primary_key=True)
course = models.ForeignKey(
"Course",