Skip to content

Commit

Permalink
#54 Suoritusmuoto should change the Moodle subtools
Browse files Browse the repository at this point in the history
  • Loading branch information
HRemonen committed Mar 14, 2023
1 parent 27d2b0c commit b2b7028
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/client/components/Recommendations/Recommendations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,16 @@ const Recommendations = ({ watch }: InputProps) => {
.map((aTool: ToolType[]) => aTool[0].subtools)
.flat(1) // flatted the arrays into one array

return Array.from(new Set(extractedSubtools))
const courseCompletionMethodQuestion = watch('4')

if (courseCompletionMethodQuestion?.courseCompletionMethodExam)
extractedSubtools.push('tentti', 'tehtävä')
if (courseCompletionMethodQuestion?.courseCompletionMethodDiary)
extractedSubtools.push('tehtävä')
if (courseCompletionMethodQuestion?.courseCompletionMethodAssignment)
extractedSubtools.push('tehtävä')

return Array.from(new Set(extractedSubtools.sort()))
}

const mergedRecommendationData = rawRecommendationData.map((aToolData) => ({
Expand Down

0 comments on commit b2b7028

Please sign in to comment.