Created
November 18, 2019 19:56
-
-
Save AnIrishDuck/5cd9445c3664b290ee85e2064470be3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT date_trunc('month', date(q.created_at)) AS month, COUNT(DISTINCT r.artifact_id) AS with_outcomes, COUNT(DISTINCT q.id) AS total FROM quizzes q | |
LEFT OUTER JOIN learning_outcome_results r ON (r.g_shard_id = q.g_shard_id AND r.artifact_id = q.id AND r.artifact_type = 'Quizzes::QuizSubmission') | |
WHERE date(q.created_at) > date('2017-07-01') | |
GROUP BY date_trunc('month', date(q.created_at)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT date_trunc('month', date(ra.created_at)) AS month, SUM(IF(regexp_like(ra.data, 'learning_outcome_id:\s+\d'), 1, 0)) AS with_outcomes, COUNT(ra.id) AS total | |
FROM rubric_assessments ra | |
WHERE date(ra.created_at) > date('2017-07-01') | |
GROUP BY date_trunc('month', date(ra.created_at)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment