diff --git a/client/components/ReportPage/ColorAnswers.js b/client/components/ReportPage/ColorAnswers.js index 2ffcee73..50f4d923 100644 --- a/client/components/ReportPage/ColorAnswers.js +++ b/client/components/ReportPage/ColorAnswers.js @@ -92,6 +92,7 @@ const ColorAnswers = ({ year, allAnswers, questionsList, chosenProgrammes, setAc chosenProgrammes={chosenProgrammes} setActiveTab={setActiveTab} setShowing={setShowing} + form={form} /> )} diff --git a/client/components/ReportPage/PieChart.js b/client/components/ReportPage/PieChart.js index 8e118080..51b90678 100644 --- a/client/components/ReportPage/PieChart.js +++ b/client/components/ReportPage/PieChart.js @@ -31,6 +31,9 @@ export default ({ withoutEmpty: { value: 0, programmes: [] }, total: { value: 0 }, } + if (form === 7) { + colors.gray = { value: 0, programmes: [] } + } answers.forEach(a => { if (!a) return @@ -51,6 +54,9 @@ export default ({ } }) colors.withoutEmpty.value = colors.red.value + colors.green.value + colors.yellow.value + if (form === 7) { + colors.withoutEmpty.value += colors.gray.value + } colors.total.value = colors.withoutEmpty.value + colors.emptyAnswer.value return colors } @@ -88,6 +94,15 @@ export default ({ programmes: colorSums.emptyAnswer.programmes, }, ] + if (form === 7) { + data.push({ + color: colors.gray, + toolTipColor: 'gray', + toolTipHeader: t('gray'), + value: colorSums.gray.value || 0, + programmes: colorSums.gray.programmes, + }) + } return data.sort((a, b) => b.value - a.value) } @@ -123,6 +138,15 @@ export default ({ form === formKeys.EVALUATION_FACULTIES ? { secondLabel: `overview:uniAnswerLevels:${level}` } : { secondLabel: faculty } + + const colorDistribution = () => { + let distribution = `${t('green')} ${colorSums.green.value} | ${t('yellow')} ${colorSums.yellow.value} | ${t('red')} ${colorSums.red.value}` + if (form === 7) { + distribution += ` | ${t('gray')} ${colorSums.gray.value}` + } + return distribution + } + return (
{amountOfResponses()}
+{colorDistribution()}
showWritten(question.id)}> {t('report:clickToCheck')}