55 lines
1.4 KiB
Dart
55 lines
1.4 KiB
Dart
import 'package:manager_api/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(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(QuestionSubDTO(
|
|
chosen: null,
|
|
label: questionDTO.label,
|
|
responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses!),
|
|
resourceId: questionDTO.resourceId,
|
|
source_: questionDTO.source_,
|
|
order: questionDTO.order,
|
|
));
|
|
}
|
|
return questionSubDTO;
|
|
}
|
|
}
|
|
|
|
|