trungduong0103 / snapie

A cross platform educational mobile application
GNU General Public License v3.0
0 stars 0 forks source link

Model Design #40

Closed s3687636 closed 4 years ago

s3687636 commented 4 years ago
s3687636 commented 4 years ago
Screen Shot 2020-04-03 at 10 48 43

@trungduong0103 @LcNguyn @thienhieu215 please have a look and give me your ideas

trungduong0103 commented 4 years ago
  1. Quiz If the level entity already has status locked, why do we need status locked for quiz ? Why do we need CreateDate and UpdateDate ? We don't have an interface to update quizzes. We don't record attempt for each time user tries to answer a quiz right ? We agreed yesterday that we will flash the right answer to the user if he/she has the wrong answer.
  2. Test Similar to question, we don't need lock status because if the level is locked, we don't have access to tests or quizzes. Same goes with attempt amount. Yesterday we discussed that no level is ever locked, you can complete what ever level you want in a stage. So the point of having a lock status for levels is not necessary. We only need a lock status for Stage.
  3. MultipleChoiceTypeInAnswer, MultipleChoiceRadioButtonSelection, SimpleTest, I need to know their meaning. I'm guessing MultipleChoiceRadioButton is for choosing one between possible answers, but I don't know the rest. We also need Pairs Selection and Spelling Order question, for example: [A], [L], [P], [P], [E], like we discussed yesterday because we don't want make it hard for kids, typing is hard. Lastly, drag and drop from Project Scope Idea, but I don't know if that's doable. The rest is fine, great work, but need further discussion.
s3687636 commented 4 years ago
  1. Quiz If the level entity already has status locked, why do we need status locked for quiz ? Why do we need CreateDate and UpdateDate ? We don't have an interface to update quizzes. We don't record attempt for each time user tries to answer a quiz right ? We agreed yesterday that we will flash the right answer to the user if he/she has the wrong answer.
s3687636 commented 4 years ago

2. Test Similar to question, we don't need lock status because if the level is locked, we don't have access to tests or quizzes. Same goes with attempt amount. Yesterday we discussed that no level is ever locked, you can complete what ever level you want in a stage. So the point of having a lock status for levels is not necessary. We only need a lock status for Stage.

test, in terms of implementation, is just another name of a quiz... the design is open for later changes in the product. as far as it copes with the requirements we came up with, extra info is just there to use or not. this is not as strict as relational database design. They are just JSON structures loosely connected.

s3687636 commented 4 years ago

3. MultipleChoiceTypeInAnswer, MultipleChoiceRadioButtonSelection, SimpleTest, I need to know their meaning.

think of JavaScript dictionary type (JSON). Those are just JSON data. but since we will pass those JSON data into components as property, we need some metadata so that we can render the right component with the required info (required in component prototype). I just put a name there so that we can map between JSON data types with the right component. with that in mind, we can start to implement the components separately, with just a kind of "dummy" data that reflected by the model-specific name. note that name just names, we focus here on the structure data available under that name. we don't focus much on inheritance in javascript; hence, the model will contain all the info of it and it's parents. we also don't focus on "model-driven programming" here, so all the relationships 1:many in the design are loosely implemented: just use JSON array ex: {quizID : { id:fdsafasdfa; type: multiplechoice, question: "question content", choices: [a: "fdfa", b: "fdfafa"]....}

s3687636 commented 4 years ago

all the data JSON file will be available in asyncStorage of the local machine (we download them and store them there). they are stored under "dict" data type automatically according to the document of react-native. I will commit a folder dummy data into our repo tomorrow. For now, I need you guys to review these design structure according to your experience in implementing components.

s3687636 commented 4 years ago

we need some metadata so that we can render the right component

kinds of: if (type is A) then render componentA

thienhieu215 commented 4 years ago
s3687636 commented 4 years ago

3. We also need Pairs Selection and Spelling Order question, Lastly, drag and drop from Project Scope Idea, but I don't know if that's doable.

yes, that is just a design prototype, we definitely have to add more types as you mention. drag and drop is ok. I have research and try it out.

s3687636 commented 4 years ago
  • about the meaning of SimpleTest and MultipleChoiceTypeInAnswer

just a name that represents a JSON data specific structure that components require when render that data.

s3687636 commented 4 years ago
  • type of question we asked users to take a photo?

add more model, and map to another component

s3687636 commented 4 years ago

3. like we discussed yesterday

yes, will soon modify the model accordingly #39 #23 #28

trungduong0103 commented 4 years ago
  1. Quiz If the level entity already has status locked, why do we need status locked for quiz ? Why do we need CreateDate and UpdateDate ? We don't have an interface to update quizzes. We don't record attempt for each time user tries to answer a quiz right ? We agreed yesterday that we will flash the right answer to the user if he/she has the wrong answer.
  • lock for quiz is just for extra layer of secure. we can remove it.
  • createDate and updateDate can be created by our cloud database (Firebase), somethimes it is automatic added.
  • attempts is for statistic purpose (in case we add more functionality later on). it is not for current function. Anyway, it is just kind of JSON data, the components can use it or not. It will not go against what we have discussed about what and how to show it to users.

thanks for clarification, I get it now

trungduong0103 commented 4 years ago

all the data JSON file will be available in asyncStorage of the local machine (we download them and store them there). they are stored under "dict" data type automatically according to the document of react-native.

Why don't we store it in a JS file instead of AsyncStorage ? We can put them in redux store too, just curious.

s3687636 commented 4 years ago

Why don't we store it in a JS file instead of AsyncStorage ? We can put them in redux store too

of course, we will store in JS file (JSON format) went we load the app, from then we can initialize the redux store. But the problem happens when users quit the app: data is not persisted, all data gone. Therefore local storage is a must for the app to run offline, and redux will store it to local storage according to actions.... all the fetch and catch data can be done as async, so users may not need to select ok, cancel...

s3687636 commented 4 years ago

will soon modify the model

Screen Shot 2020-04-03 at 21 40 51
s3687636 commented 4 years ago
Screen Shot 2020-04-03 at 21 38 44
thienhieu215 commented 4 years ago

I think it is clear for me about the model. Thank you for your explanation.