Class Activity 9
- Due Sep 30, 2020 by 10am
- Points None
Note: There's nothing to submit to this class assignment, though you will submit homework related to it.
Overview
Right now, we're storing all of the video data in localStorage. Here's what we have:
- videoTitles—an object mapping video ids to titles, e.g., {"vixkei32kf": "My first youtube video", "vlweief3": "A day in the life of an Endicott professor"}
- vid_:id—(there is one entry for each added video) an object containing information about a video with the following keys:
- id—the id of the video (string)
- currentSpeed—the current playback speed of the video (a floating point number)
- currentTime—the number of seconds from the beginning of the video where the video was last stopped (a floating point number)
- questions—an array of question objects, each with the following keys
- id—the question's id, unique among questions for the specific video (integer)
- timestamp—the offset, in seconds, from the beginning of the video (floating point number) where this question should be shown to the user
- freeResponse—whether or not it's a free response question (boolean)
- question—the question text (string)
- nextQuestionId—an ever increasing integer
We want to turn this into a relational data model that we can save efficiently on the server side.
Tasks
We have one main task, and that is to convert this into a relational data model. To get there, we'll answer these questions:
- what tables should we have?
- what columns should those tables contain?
- what should the types of those columns be?
As we assess potential models, we should ensure we can easily respond to the following actions and queries:
- get a list of all video ids and their titles (for the VidQuizzes list view)
- for a given VidQuiz, fetch its information (current speed, current time, questions, etc.)
- add a question to a VidQuiz
- update a VidQuiz question
- get a list of VidQuiz questions in timestamp order
- remove a VidQuiz
- remove a VidQuiz question