Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
arsnova-click-v2-backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
ARSnova
arsnova-click-v2-backend
Commits
4471bcfe
Commit
4471bcfe
authored
Aug 23, 2019
by
Christopher Mark Fullarton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes invalid type of questions
parent
f8eb2c5e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
src/db/quiz/QuizDAO.ts
src/db/quiz/QuizDAO.ts
+4
-2
src/entities/answer/AnswerValidator.ts
src/entities/answer/AnswerValidator.ts
+1
-1
src/entities/question/QuizValidator.ts
src/entities/question/QuizValidator.ts
+1
-1
No files found.
src/db/quiz/QuizDAO.ts
View file @
4471bcfe
...
...
@@ -276,8 +276,10 @@ class QuizDAO extends AbstractDAO<Array<IQuizEntity>> {
}
});
obj
.
TYPE
=
obj
.
type
;
delete
obj
.
type
;
if
(
obj
.
hasOwnProperty
(
'
type
'
))
{
obj
.
TYPE
=
obj
.
type
;
delete
obj
.
type
;
}
return
obj
;
}
...
...
src/entities/answer/AnswerValidator.ts
View file @
4471bcfe
...
...
@@ -10,6 +10,6 @@ export const getAnswerForType = (type: AnswerType, data?: object): AbstractAnswe
case
AnswerType
.
FreeTextAnswerOption
:
return
new
FreeTextAnswerEntity
(
data
);
default
:
throw
new
Error
(
`Cannot buil
t question
with type:
${
type
}
`
);
throw
new
Error
(
`Cannot buil
d answer
with type:
${
type
}
`
);
}
};
src/entities/question/QuizValidator.ts
View file @
4471bcfe
...
...
@@ -28,6 +28,6 @@ export const getQuestionForType = (type: QuestionType | string, data = {}): Abst
case
QuestionType
.
SurveyQuestion
:
return
new
SurveyQuestionEntity
(
data
);
default
:
throw
new
Error
(
`Cannot buil
t
question with type:
${
type
}
`
);
throw
new
Error
(
`Cannot buil
d
question with type:
${
type
}
`
);
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment