Skip to content
Snippets Groups Projects
Commit b6525e59 authored by Pavel Šeda's avatar Pavel Šeda
Browse files

Merge branch...

Merge branch '49-cannot-proceed-to-the-next-phase-if-the-question-phase-relation-has-not-been-set' into 'master'

phases without questions work

Closes #49

See merge request !51
parents 4c336080 9fda5aaf
No related branches found
No related tags found
1 merge request!51phases without questions work
Pipeline #88744 passed with stages
in 3 minutes and 24 seconds
......@@ -270,7 +270,6 @@ public class TrainingRunService {
.collect(Collectors.toList());
List<TrainingPhaseQuestionsFulfillment> questionnairesFulfillment = this.trainingPhaseQuestionsFulfillmentRepository.findByTrainingPhasesAndTrainingRun(trainingPhasesIds, trainingRunId);
return decisionMatrixRows.stream().map(row -> {
DecisionMatrixRowForAssistantDTO decisionMatrixRowForAssistantDTO = new DecisionMatrixRowForAssistantDTO();
decisionMatrixRowForAssistantDTO.setId(row.getId());
......@@ -282,11 +281,17 @@ public class TrainingRunService {
decisionMatrixRowForAssistantDTO.setQuestionnaireAnswered(row.getQuestionnaireAnswered());
decisionMatrixRowForAssistantDTO.setSolutionDisplayed(row.getSolutionDisplayed());
decisionMatrixRowForAssistantDTO.setWrongAnswers(row.getWrongAnswers());
decisionMatrixRowForAssistantDTO.setRelatedPhaseInfo(getPhaseInfo(orderedTrainingPhases.get(row.getOrder()), questionnairesFulfillment.get(row.getOrder()).isFulfilled()));
decisionMatrixRowForAssistantDTO.setRelatedPhaseInfo(getPhaseInfo(orderedTrainingPhases.get(row.getOrder()), getFulfilled(questionnairesFulfillment, row.getOrder())));
return decisionMatrixRowForAssistantDTO;
}).collect(Collectors.toList());
}
private boolean getFulfilled(List<TrainingPhaseQuestionsFulfillment> questionnairesFulfillment, int order){
if (questionnairesFulfillment.isEmpty())
return true;
return questionnairesFulfillment.get(order).isFulfilled();
}
private RelatedPhaseInfoDTO getPhaseInfo(AbstractPhase abstractPhase, Boolean trainingPhaseQuestionsFulfillment) {
RelatedPhaseInfoDTO relatedPhaseInfoDTO = new RelatedPhaseInfoDTO();
relatedPhaseInfoDTO.setId(abstractPhase.getId());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment