1

We are developing an e-learning website where you can practice LearnItems (typically words of a foreign language). The concept is very similar to Memrise.

When a user practices a LearnItem, a Result object is created (it contains the date of the answer, plus a flag to indicate if the answer given by the user was correct)

The LearnItems are grouped into LearnItemLists, and a user can choose to create his/her own LearnItemList, or use an existing one (e.g. LearnItemList "The 1000 most common english words", which has 1000 LearnItems)

This is where we have differing opinions in the team. When a user wants to use an existing LearnItemList, created by someone else, then

Version A:

We store the same LearnItemList instance for every user that subscribed to the same LearnItemList. This means that we have to store the results for each User+LearnItem in a separate structure, since a LearnItem belongs to several users.

Version B:

Deep copy all LearnItemLists.

We copy the LearnItemList with all its LearnItems to each user that subscribed. This way we can store the Results for the LearnItem for the given user simply by referencing User.LearnItemList.LearnItem.Results

Both versions have pros and cons, but in general, which one makes more sense?

9
  • Can users modify lists they subscribe to? Should they receive updates? Would an update merge with local modifications? Can users modify custom lists created by someone else? Would such modifications be visible to the original author? Answering these use cases may help you make a decision. – axl Jun 12 '16 at 14:26
  • How are you persisting these LearnItems? In a database? Not knowing anything else about your application (or the questions that @axl just asked), I prefer that the answers be in a different table, and that you refer to the LearnItems by LearnItemID and UserID in the answers. Why? Because that's how databases work. – Robert Harvey Jun 12 '16 at 14:26
  • @Robert Harvey: yes, they are stored in a database – user1437649 Jun 12 '16 at 14:28
  • @axl: These are the exact questions we are arguing about – user1437649 Jun 12 '16 at 14:31
  • Can a user practice the same LearItemList multiple times? If a user can take the same list multiple times, it can be advantageous to store the results separately. – Bart van Ingen Schenau Jun 12 '16 at 14:35
1

I would store single instances of learn items bit have learnItemLists per user.

Ie

LearnItem
{
    String Id
    ....
}

User
{
    LearnItemList[] LearnItemLists
}

LearnItemList
{
    UserId
    Name
    String[] LearnItemIds
}

The key thing for me is that the user can make their own lists and presumably edit them.

Therefor if I want to use an existing list I will need to make my own copy of it.

I dont need my own copies of the learnItems themselves though, just the Id, as these are the same for all users

1
  • If the lists are persistent data structures, there's no problem with users sharing the same list (since editing a list returns a new object, possibly sharing some of the data). – itsbruce Jun 12 '16 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.