Skip to content

Instantly share code, notes, and snippets.

@mooreniemi
Created December 22, 2016 16:25
Show Gist options
  • Save mooreniemi/3928ec87a0a3cd74567cb30c0e23c374 to your computer and use it in GitHub Desktop.
Save mooreniemi/3928ec87a0a3cd74567cb30c0e23c374 to your computer and use it in GitHub Desktop.
diff --git a/Makefile b/Makefile
index b993bbb..20ba783 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+reseed:
+ cd backend && npm run seed:undo && npm run seed
test:
cd backend && npm test
install-frontend:
diff --git a/backend/server/seeders/20161208214926-empty-lesson-content.js b/backend/server/seeders/20161208214926-empty-lesson-content.js
index e81ab26..82b5490 100644
--- a/backend/server/seeders/20161208214926-empty-lesson-content.js
+++ b/backend/server/seeders/20161208214926-empty-lesson-content.js
@@ -6,9 +6,9 @@ import path from 'path';
const NUM_WEEKS = 12;
const LESSONS_PER_WEEK = 7;
const VARIATIONS = ['a', 'b', 'c'];
-const NUM_EXERCISES = NUM_WEEKS * LESSONS_PER_WEEK * VARIATIONS.length;
-const SAMPLE_AUDIO_PATH =
- 'http://www.freesound.org/data/previews/367/367156_2188-lq.mp3';
+// We add another set of lessons per week to account for the kickstarter week.
+const NUM_CONTENTS = (NUM_WEEKS * LESSONS_PER_WEEK * VARIATIONS.length) + LESSONS_PER_WEEK;
+const SAMPLE_AUDIO_PATH = 'https://s3.amazonaws.com/drinkless.development/urge_content/3.1+Nutrition+L1+Audio.mp3';
/**
* Add altering commands here.
@@ -48,7 +48,7 @@ export const up = async function up(queryInterface, Sequelize) {
for (let c = 0; c <= LESSONS_PER_WEEK - 1; c ++) {
let exercise_id = null;
if(c === LESSONS_PER_WEEK - 1) {
- exercise_id = (NUM_WEEKS * LESSONS_PER_WEEK * VARIATIONS.length) + 1;
+ exercise_id = NUM_CONTENTS + 1;
}
await queryInterface.bulkInsert('content', [{
@@ -78,8 +78,7 @@ export const up = async function up(queryInterface, Sequelize) {
if(j === LESSONS_PER_WEEK - 1) {
// If you're on the last lesson of a week, we want to give
// you the starting node that leads you into next week.
- const startNodeId = (NUM_WEEKS * LESSONS_PER_WEEK * VARIATIONS.length) +
- i + 1;
+ const startNodeId = NUM_CONTENTS + i + 1;
exercise_id = startNodeId;
}
@@ -144,8 +143,7 @@ export const up = async function up(queryInterface, Sequelize) {
// questionnaires with (`LESSONS_PER_WEEK` * `VARIATIONS.length`) states
// already assigned. We can associate start states as follows.
for (let i = 0; i < NUM_WEEKS; i++) {
- const startNodeId = (NUM_WEEKS * LESSONS_PER_WEEK * VARIATIONS.length) +
- i + 1;
+ const startNodeId = NUM_CONTENTS + i + 1;
const firstNeighborId = i * LESSONS_PER_WEEK * VARIATIONS.length + 1;
await queryInterface.bulkInsert('urge_graph_nodes', [{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment