mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 00:21:19 +00:00
55 lines
1.4 KiB
Dart
55 lines
1.4 KiB
Dart
import 'package:managerapi/api.dart';
|
|
|
|
class ResponseSubDTO {
|
|
List<TranslationDTO> label;
|
|
bool isGood;
|
|
int order;
|
|
|
|
ResponseSubDTO({this.label, this.isGood, this.order});
|
|
|
|
|
|
//ResponseSubDTO(List<TranslationDTO> label, bool isGood, int order) : super();
|
|
|
|
List<ResponseSubDTO> fromJSON(List<ResponseDTO> responsesDTO) {
|
|
List<ResponseSubDTO> responsesSubDTO = <ResponseSubDTO>[];
|
|
for(ResponseDTO responseDTO in responsesDTO)
|
|
{
|
|
responsesSubDTO.add(new ResponseSubDTO(
|
|
label: responseDTO.label,
|
|
isGood: responseDTO.isGood,
|
|
order: responseDTO.order,
|
|
));
|
|
}
|
|
return responsesSubDTO;
|
|
}
|
|
}
|
|
|
|
class QuestionSubDTO {
|
|
List<TranslationDTO> label;
|
|
List<ResponseSubDTO> responsesSubDTO;
|
|
int chosen;
|
|
String resourceId;
|
|
String source_;
|
|
int order;
|
|
|
|
QuestionSubDTO({this.label, this.responsesSubDTO, this.chosen, this.resourceId, this.source_, this.order});
|
|
|
|
List<QuestionSubDTO> fromJSON(List<QuestionDTO> questionsDTO) {
|
|
List<QuestionSubDTO> questionSubDTO = <QuestionSubDTO>[];
|
|
for(QuestionDTO questionDTO in questionsDTO)
|
|
{
|
|
questionSubDTO.add(new QuestionSubDTO(
|
|
chosen: null,
|
|
label: questionDTO.label,
|
|
responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses),
|
|
resourceId: questionDTO.resourceId,
|
|
source_: questionDTO.source_,
|
|
order: questionDTO.order,
|
|
));
|
|
}
|
|
return questionSubDTO;
|
|
}
|
|
}
|
|
|
|
|