Skip to content

Feat spaced repetition#22

Open
Darragh1996 wants to merge 10 commits into
developfrom
feat-spaced-repetition
Open

Feat spaced repetition#22
Darragh1996 wants to merge 10 commits into
developfrom
feat-spaced-repetition

Conversation

@Darragh1996

Copy link
Copy Markdown
Collaborator

Description

Describe change or new feature here.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have performed a self-review of my own code
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works .
  • New and existing unit tests pass locally with my changes

@fegaeze fegaeze temporarily deployed to flashdecks-feat-spaced--4qvb3u April 2, 2020 11:51 Inactive

@sergeikabuldzhanov sergeikabuldzhanov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd appreciate a pr description :D

Comment thread resources/decks/model.js
Comment on lines +221 to +239
exports.setUserDeckScore = (deck_id, user_id, rating_score) => {
return db('deck_ratings').insert({
deck_id: deck_id,
user_id: user_id,
rating_score: rating_score,
});
};

exports.getUserDeckScore = (deck_id, user_id) => {
return db('deck_ratings')
.where({ deck_id, user_id })
.first();
};

exports.updateUserDeckScore = (deck_id, user_id, rating_score) => {
return db('deck_ratings')
.update({ rating_score })
.where({ user_id, deck_id });
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deck_ratings table is a many-to-many for the overall "rating/popularity" of the deck, not for mastery score. Think reddit upvotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants