Archived
Add plugin
This commit is contained in:
1 parent
2053c12eee
commit
58fac72355
5 files changed
+128
No files matched your search
@@ -0,0 +1,29 @@
|
||||
export class OpenEndedQuestion {
|
||||
constructor (id, question, solution, creator, created, ratings, difficulty) {
|
||||
this.id = id
|
||||
this.question = question
|
||||
this.solution = solution
|
||||
this.creator = creator
|
||||
this.created = created
|
||||
this.ratings = ratings
|
||||
this.difficulty = difficulty
|
||||
}
|
||||
}
|
||||
|
||||
// Firestore data converter
|
||||
export const OpenEndedQuestionConverter = {
|
||||
toFirestore: (openEndedQuestion) => {
|
||||
return {
|
||||
frage: openEndedQuestion.question,
|
||||
musterloesung: openEndedQuestion.solution,
|
||||
ersteller: openEndedQuestion.creator,
|
||||
erstellt: openEndedQuestion.created,
|
||||
bewertungen: openEndedQuestion.ratings,
|
||||
schwierigkeit: openEndedQuestion.difficulty
|
||||
}
|
||||
},
|
||||
fromFirestore: (snapshot, options) => {
|
||||
const data = snapshot.data(options)
|
||||
return new OpenEndedQuestion(snapshot.id, data.frage, data.musterloesung, data.ersteller, data.erstellt, data.bewertungen, data.schwierigkeit)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user