From 08f6bd6bfd05606a005719c7d8170173078f257a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A4kinen=20Sasu=20S?= Date: Tue, 4 Jun 2019 14:31:58 +0300 Subject: [PATCH 1/4] change median graduation time from productivity to population throughput --- .../src/services/studytrack.js | 56 +++++++++---------- .../src/services/studytrack.test.js | 17 ++---- .../ProductivityTable/index.jsx | 4 +- .../StudyProgramme/ThroughputTable/index.jsx | 6 +- 4 files changed, 39 insertions(+), 44 deletions(-) diff --git a/services/backend/oodikone2-backend/src/services/studytrack.js b/services/backend/oodikone2-backend/src/services/studytrack.js index 0ded470547..88f1b8923d 100644 --- a/services/backend/oodikone2-backend/src/services/studytrack.js +++ b/services/backend/oodikone2-backend/src/services/studytrack.js @@ -133,22 +133,6 @@ const graduatedStatsFromStudyrights = studyrights => { } graduationTimes = [...graduationTimes, timeToGraduation || 0] }) - const median = (values) => { - if (values.length === 0) return 0 - - values.sort((a, b) => a - b) - - var half = Math.floor(values.length / 2) - - if (values.length % 2) - return values[half] - - return (values[half - 1] + values[half]) / 2.0 - } - Object.keys(stats).forEach(year => { - stats[year].medianGraduationTime = median(stats[year].timesToGraduation) - }) - stats['medianGraduationTime'] = median(graduationTimes) return stats } @@ -207,7 +191,7 @@ const combineStatistics = (creditStats, studyrightStats, thesisStats) => { Object.keys(stats).forEach(year => { const thesis = thesisStats[year] || {} stats[year].graduated = studyrightStats[year] ? studyrightStats[year].graduated : 0 - stats[year].medianGraduationTime = studyrightStats[year] ? studyrightStats[year].medianGraduationTime : 0 + // stats[year].medianGraduationTime = studyrightStats[year] ? studyrightStats[year].medianGraduationTime : 0 stats[year].bThesis = thesis.bThesis || 0 stats[year].mThesis = thesis.mThesis || 0 }) @@ -381,11 +365,11 @@ const getCreditsFromStudyprogrammeStudents = async (studytrack, startDate, stude const productivityStats = async (studentnumbers, startDate, studytrack, endDate) => { return Promise.all([creditsAfter(studentnumbers, startDate), - graduationsFromClass(studentnumbers, studytrack), - thesesFromClass(studentnumbers, startDate, studytrack), - gendersFromClass(studentnumbers), - countriesFromClass(studentnumbers), - tranferredToStudyprogram(studentnumbers, startDate, studytrack, endDate)]) + graduationsFromClass(studentnumbers, studytrack), + thesesFromClass(studentnumbers, startDate, studytrack), + gendersFromClass(studentnumbers), + countriesFromClass(studentnumbers), + tranferredToStudyprogram(studentnumbers, startDate, studytrack, endDate)]) } const getYears = (since) => { @@ -417,7 +401,19 @@ const throughputStatsForStudytrack = async (studytrack, since) => { const years = getYears(since) // studyprogramme starts with K if bachelors and M if masters const graduationTimeLimit = studytrack[0] === 'K' ? 36 : 24 + const median = (values) => { + if (values.length === 0) return 0 + + values.sort((a, b) => a - b) + + var half = Math.floor(values.length / 2) + if (values.length % 2) + return values[half] + + return (values[half - 1] + values[half]) / 2.0 + } + let allGraduationTimes = [] const arr = await Promise.all(years.map(async year => { const startDate = `${year}-${semesterStart['FALL']}` const endDate = `${moment(year, 'YYYY').add(1, 'years').format('YYYY')}-${semesterEnd['SPRING']}` @@ -427,8 +423,6 @@ const throughputStatsForStudytrack = async (studytrack, since) => { await productivityStats(studentnumbers, startDate, studytrack, endDate) delete genders[null] delete countries[null] - const test = creditsForStudyprogramme.map(formatCredit) - console.log(test) const creditValues = credits.reduce((acc, curr) => { acc.mte30 = curr >= 30 ? acc.mte30 + 1 : acc.mte30 @@ -451,20 +445,24 @@ const throughputStatsForStudytrack = async (studytrack, since) => { totals.countries[countryKey] + Number(countries[countryKey]) : Number(countries[countryKey]) }) - const inTargetTime = graduated.filter(g => - moment(g.enddate).diff(g.startstududate, 'months') <= graduationTimeLimit).length - + const graduationTimes = graduated.map(g => moment(g.enddate).diff(g.studystartdate, 'months')) + const inTargetTime = graduationTimes.filter(time => + time <= graduationTimeLimit).length + allGraduationTimes = [...allGraduationTimes, ...graduationTimes] + totals.thesisM = theses.MASTER ? totals.thesisM + theses.MASTER : totals.thesisM totals.thesisB = theses.BACHELOR ? totals.thesisB + theses.BACHELOR : totals.thesisB totals.students = totals.students + credits.length totals.graduated = totals.graduated + graduated.length, - totals.inTargetTime = totals.inTargetTime + inTargetTime, - totals.transferred = totals.transferred + transferred.count + totals.medianGraduationTime = median(allGraduationTimes) + totals.inTargetTime = totals.inTargetTime + inTargetTime + totals.transferred = totals.transferred + transferred.count return { year: `${year}-${year + 1}`, credits: credits.map(cr => cr === null ? 0 : cr), creditsForStudyprogramme: creditsForStudyprogramme.map(cr => cr === null ? 0 : cr), graduated: graduated.length, + medianGraduationTime: median(graduationTimes), inTargetTime, thesisM: theses.MASTER || 0, thesisB: theses.BACHELOR || 0, diff --git a/services/backend/oodikone2-backend/src/services/studytrack.test.js b/services/backend/oodikone2-backend/src/services/studytrack.test.js index 0650f0196b..98934fb7a8 100644 --- a/services/backend/oodikone2-backend/src/services/studytrack.test.js +++ b/services/backend/oodikone2-backend/src/services/studytrack.test.js @@ -125,8 +125,8 @@ test('graduatedStatsFromStudyrights calculates stats correctly', () => { ] const stats = graduatedStatsFromStudyrights(studyrights) expect(stats).toMatchObject({ - 2015: { graduated: 2., medianGraduationTime: 0, timesToGraduation: [ 0, 0 ]}, - 2014: { graduated: 1., medianGraduationTime: 0, timesToGraduation: [ 0 ]} + 2015: { graduated: 2. }, + 2014: { graduated: 1. } }) }) @@ -137,8 +137,8 @@ test('combineStatistics returns correctly formatted array', () => { 2014: { year: 2014, credits: 20 } } const studyrightStats = { - 2015: { graduated: 2, medianGraduationTime: 1.5, timesToGraduation: [1, 2] }, - 2016: { graduated: 1, medianGraduationTime: 0, timesToGraduation: [ 0 ] } + 2015: { graduated: 2 }, + 2016: { graduated: 1 } } const thesisStats = { 2014: { mThesis: 1 }, @@ -150,7 +150,6 @@ test('combineStatistics returns correctly formatted array', () => { mThesis: 2, bThesis: 1, credits: 40, - medianGraduationTime: 1.5, graduated: 2 }) expect(stats).toContainEqual({ @@ -159,7 +158,6 @@ test('combineStatistics returns correctly formatted array', () => { bThesis: 0, credits: 20, graduated: 0, - medianGraduationTime: 0 }) expect(stats).toContainEqual({ year: 2016, @@ -167,7 +165,6 @@ test('combineStatistics returns correctly formatted array', () => { bThesis: 0, credits: 5, graduated: 1, - medianGraduationTime: 0 }) }) @@ -178,16 +175,14 @@ test('productivityStatsForStudytrack integrates', async () => { graduated: 0, bThesis: 0, mThesis: 1, - credits: 40, - medianGraduationTime: 0 + credits: 40 }) expect(stats.data).toContainEqual({ year: 2016, graduated: 1, mThesis: 0, bThesis: 0, - credits: 5, - medianGraduationTime: 0 + credits: 5 }) }) diff --git a/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx b/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx index 60d396ea54..aa7ddac30f 100644 --- a/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx +++ b/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx @@ -12,13 +12,12 @@ const ProductivityTable = ({ productivity, thesis, loading, error, studyprogramm if (thesis) { thesisTypes = thesis.map(t => t.thesisType) } - const headerList = ['Year', 'Credits', thesisTypes.includes('MASTER') && 'Masters Thesis', thesisTypes.includes('BACHELOR') && 'Bachelors Thesis', 'Graduated', 'Graduation median time'].filter(_ => _) + const headerList = ['Year', 'Credits', thesisTypes.includes('MASTER') && 'Masters Thesis', thesisTypes.includes('BACHELOR') && 'Bachelors Thesis', 'Graduated'].filter(_ => _) const refresh = () => { callApi('/v2/studyprogrammes/productivity/recalculate', 'get', null, { code: studyprogramme }) .then(() => { dispatchGetProductivity(studyprogramme) }) } - console.log(productivity) return (
@@ -70,7 +69,6 @@ const ProductivityTable = ({ productivity, thesis, loading, error, studyprogramm {year.mThesis} )} {year.graduated} - {year.medianGraduationTime} months )) : null} diff --git a/services/oodikone2-frontend/src/components/StudyProgramme/ThroughputTable/index.jsx b/services/oodikone2-frontend/src/components/StudyProgramme/ThroughputTable/index.jsx index 46f4a9af4b..7103347c0e 100644 --- a/services/oodikone2-frontend/src/components/StudyProgramme/ThroughputTable/index.jsx +++ b/services/oodikone2-frontend/src/components/StudyProgramme/ThroughputTable/index.jsx @@ -67,7 +67,7 @@ const ThroughputTable = ({ history, throughput, thesis, loading, error, studypro Students : Students } - Graduated + Graduated Transferred to this program { @@ -88,6 +88,8 @@ const ThroughputTable = ({ history, throughput, thesis, loading, error, studypro {genders.map(gender => )} Graduated overall Graduated in time + Graduation median time + {renderCountries ? countries.map(country => ) : null} @@ -121,6 +123,7 @@ const ThroughputTable = ({ history, throughput, thesis, loading, error, studypro ))} {year.graduated} {year.inTargetTime} + {year.medianGraduationTime ? `${year.medianGraduationTime} months` : '∞'} {year.transferred} {renderCountries ? countries.map(country => ( @@ -152,6 +155,7 @@ const ThroughputTable = ({ history, throughput, thesis, loading, error, studypro ))} {throughput.totals.graduated} {throughput.totals.inTargetTime} + {throughput.totals.medianGraduationTime ? `${throughput.totals.medianGraduationTime} months` : '∞'} {throughput.totals.transferred} {renderCountries ? Object.keys(throughput.totals.countries).map(countryKey => ( From 693d6773496eddece792b422c600b5a1ad081b3b Mon Sep 17 00:00:00 2001 From: esakemp Date: Tue, 4 Jun 2019 14:45:13 +0300 Subject: [PATCH 2/4] mergele, percentage --- .../src/services/studytrack.js | 59 +++++++++++++------ .../src/services/studytrack.test.js | 18 ++++-- .../ProductivityTable/index.jsx | 36 ++++++----- 3 files changed, 74 insertions(+), 39 deletions(-) diff --git a/services/backend/oodikone2-backend/src/services/studytrack.js b/services/backend/oodikone2-backend/src/services/studytrack.js index 88f1b8923d..d2b9d6cc10 100644 --- a/services/backend/oodikone2-backend/src/services/studytrack.js +++ b/services/backend/oodikone2-backend/src/services/studytrack.js @@ -21,7 +21,7 @@ const formatCredit = credit => { return { id, year, credits } } -const fuckup = (provider, since, studentnumbers) => Credit.findAll({ +const getCreditsForStudentsInThatProgram = (provider, since, studentnumbers, failed) => Credit.findAll({ attributes: ['id', 'course_code', 'credits', 'attainment_date', 'student_studentnumber'], include: { model: Course, @@ -48,9 +48,12 @@ const fuckup = (provider, since, studentnumbers) => Credit.findAll({ }, student_studentnumber: { [Op.in]: studentnumbers + }, + grade: { + [Op.notIn]: failed } } -}).map(formatCredit) +}) const getCreditsForProvider = (provider, since) => Credit.findAll({ attributes: ['id', 'course_code', 'credits', 'attainment_date'], @@ -129,7 +132,7 @@ const graduatedStatsFromStudyrights = studyrights => { stats[year] = { graduated: graduated + 1, timesToGraduation: stats[year] ? - [...stats[year].timesToGraduation, timeToGraduation || 0] : [ timeToGraduation || 0] + [...stats[year].timesToGraduation, timeToGraduation || 0] : [timeToGraduation || 0] } graduationTimes = [...graduationTimes, timeToGraduation || 0] }) @@ -186,7 +189,7 @@ const thesisProductivityForStudytrack = async code => { return thesisProductivityFromCredits(credits) } -const combineStatistics = (creditStats, studyrightStats, thesisStats) => { +const combineStatistics = (creditStats, studyrightStats, thesisStats, creditsForPercentage) => { const stats = { ...creditStats } Object.keys(stats).forEach(year => { const thesis = thesisStats[year] || {} @@ -194,25 +197,30 @@ const combineStatistics = (creditStats, studyrightStats, thesisStats) => { // stats[year].medianGraduationTime = studyrightStats[year] ? studyrightStats[year].medianGraduationTime : 0 stats[year].bThesis = thesis.bThesis || 0 stats[year].mThesis = thesis.mThesis || 0 + stats[year].creditsForPercentage = creditsForPercentage[year] || 0 }) return Object.values(stats) } -// providercode here const productivityStatsForStudytrack = async (studytrack, since) => { const providercode = studytrackToProviderCode(studytrack) + const year = new Date(since).getFullYear() + const startDate = `${year}-${semesterStart['FALL']}` + const endDate = `${moment(since, 'YYYY').add(1, 'years').format('YYYY')}-${semesterEnd['SPRING']}` + const studentnumbers = await studentnumbersWithAllStudyrightElements([studytrack], startDate, endDate, false, false) const promises = [ graduatedStatsForStudytrack(studytrack, since), productivityStatsForProvider(providercode, since), - thesisProductivityForStudytrack(studytrack) + thesisProductivityForStudytrack(studytrack), + getCreditsFromStudyprogrammeStudents(studytrack, since, studentnumbers) ] - const [studyrightStats, creditStats, thesisStats] = await Promise.all( + const [studyrightStats, creditStats, thesisStats, creditsForPercentage] = await Promise.all( promises ) return { id: studytrack, status: null, - data: combineStatistics(creditStats, studyrightStats, thesisStats) + data: combineStatistics(creditStats, studyrightStats, thesisStats, creditsForPercentage) } } @@ -357,19 +365,32 @@ const tranferredToStudyprogram = async (studentnumbers, startDate, studytrack, e }) } +const formatCreditsForPercentage = (credits) => { + return credits.map(formatCredit).reduce(function (acc, curr) { + var key = curr['year'] + if (!acc[key]) { + acc[key] = [] + } + acc[key] = Number(acc[key]) + Number(curr.credits) + return acc + }, {}) +} + const getCreditsFromStudyprogrammeStudents = async (studytrack, startDate, studentnumbers) => { const providercode = studytrackToProviderCode(studytrack) - const test = await fuckup(providercode, startDate, studentnumbers) - return test.map(formatCredit) + const failed = ['0', 'Hyl.', 'Luop', 'Eisa'] + const credits = await getCreditsForStudentsInThatProgram(providercode, startDate, studentnumbers, failed) + const formattedStudentCredits = formatCreditsForPercentage(credits) + return formattedStudentCredits } const productivityStats = async (studentnumbers, startDate, studytrack, endDate) => { return Promise.all([creditsAfter(studentnumbers, startDate), - graduationsFromClass(studentnumbers, studytrack), - thesesFromClass(studentnumbers, startDate, studytrack), - gendersFromClass(studentnumbers), - countriesFromClass(studentnumbers), - tranferredToStudyprogram(studentnumbers, startDate, studytrack, endDate)]) + graduationsFromClass(studentnumbers, studytrack), + thesesFromClass(studentnumbers, startDate, studytrack), + gendersFromClass(studentnumbers), + countriesFromClass(studentnumbers), + tranferredToStudyprogram(studentnumbers, startDate, studytrack, endDate)]) } const getYears = (since) => { @@ -419,11 +440,11 @@ const throughputStatsForStudytrack = async (studytrack, since) => { const endDate = `${moment(year, 'YYYY').add(1, 'years').format('YYYY')}-${semesterEnd['SPRING']}` const studentnumbers = await studentnumbersWithAllStudyrightElements([studytrack], startDate, endDate, false, false) const creditsForStudyprogramme = await getCreditsFromStudyprogrammeStudents(studytrack, startDate, studentnumbers) + const [credits, graduated, theses, genders, countries, transferred] = await productivityStats(studentnumbers, startDate, studytrack, endDate) delete genders[null] delete countries[null] - const creditValues = credits.reduce((acc, curr) => { acc.mte30 = curr >= 30 ? acc.mte30 + 1 : acc.mte30 acc.mte60 = curr >= 60 ? acc.mte60 + 1 : acc.mte60 @@ -449,18 +470,18 @@ const throughputStatsForStudytrack = async (studytrack, since) => { const inTargetTime = graduationTimes.filter(time => time <= graduationTimeLimit).length allGraduationTimes = [...allGraduationTimes, ...graduationTimes] - + totals.thesisM = theses.MASTER ? totals.thesisM + theses.MASTER : totals.thesisM totals.thesisB = theses.BACHELOR ? totals.thesisB + theses.BACHELOR : totals.thesisB totals.students = totals.students + credits.length totals.graduated = totals.graduated + graduated.length, - totals.medianGraduationTime = median(allGraduationTimes) + totals.medianGraduationTime = median(allGraduationTimes) totals.inTargetTime = totals.inTargetTime + inTargetTime totals.transferred = totals.transferred + transferred.count return { year: `${year}-${year + 1}`, credits: credits.map(cr => cr === null ? 0 : cr), - creditsForStudyprogramme: creditsForStudyprogramme.map(cr => cr === null ? 0 : cr), + creditsForStudyprogramme: creditsForStudyprogramme, graduated: graduated.length, medianGraduationTime: median(graduationTimes), inTargetTime, diff --git a/services/backend/oodikone2-backend/src/services/studytrack.test.js b/services/backend/oodikone2-backend/src/services/studytrack.test.js index 98934fb7a8..3e6db98994 100644 --- a/services/backend/oodikone2-backend/src/services/studytrack.test.js +++ b/services/backend/oodikone2-backend/src/services/studytrack.test.js @@ -144,13 +144,19 @@ test('combineStatistics returns correctly formatted array', () => { 2014: { mThesis: 1 }, 2015: { mThesis: 2, bThesis: 1 } } - const stats = combineStatistics(creditStats, studyrightStats, thesisStats) + const creditsForPercentage = { + 2014: 10, + 2015: 22 + } + + const stats = combineStatistics(creditStats, studyrightStats, thesisStats, creditsForPercentage) expect(stats).toContainEqual({ year: 2015, mThesis: 2, bThesis: 1, credits: 40, - graduated: 2 + graduated: 2, + creditsForPercentage: 22 }) expect(stats).toContainEqual({ year: 2014, @@ -158,6 +164,7 @@ test('combineStatistics returns correctly formatted array', () => { bThesis: 0, credits: 20, graduated: 0, + creditsForPercentage: 10 }) expect(stats).toContainEqual({ year: 2016, @@ -165,6 +172,7 @@ test('combineStatistics returns correctly formatted array', () => { bThesis: 0, credits: 5, graduated: 1, + creditsForPercentage: 0 }) }) @@ -175,14 +183,16 @@ test('productivityStatsForStudytrack integrates', async () => { graduated: 0, bThesis: 0, mThesis: 1, - credits: 40 + credits: 40, + creditsForPercentage: 0 }) expect(stats.data).toContainEqual({ year: 2016, graduated: 1, mThesis: 0, bThesis: 0, - credits: 5 + credits: 5, + creditsForPercentage: 0 }) }) diff --git a/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx b/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx index aa7ddac30f..9b73cdc14d 100644 --- a/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx +++ b/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx @@ -7,6 +7,7 @@ import { callApi } from '../../../apiConnection' import { getProductivity } from '../../../redux/productivity' const ProductivityTable = ({ productivity, thesis, loading, error, studyprogramme, dispatchGetProductivity }) => { + console.log('eeaaat shit') if (error) return

Oh no so error {error}

let thesisTypes = [] if (thesis) { @@ -31,7 +32,7 @@ const ProductivityTable = ({ productivity, thesis, loading, error, studyprogramm productivity.lastUpdated ? moment(productivity.lastUpdated).format('HH:mm:ss MM-DD-YYYY') : 'unknown' - } ${productivity.status || ''}`} + } ${productivity.status || ''}`} )} @@ -57,20 +58,22 @@ const ProductivityTable = ({ productivity, thesis, loading, error, studyprogramm {productivity && productivity.data ? productivity.data - .sort((year1, year2) => year2.year - year1.year) - .map(year => ( - - {year.year} - {Math.floor(year.credits)} - {thesisTypes.includes('BACHELOR') && ( - {year.bThesis} - )} - {thesisTypes.includes('MASTER') && ( - {year.mThesis} - )} - {year.graduated} - - )) + .sort((year1, year2) => year2.year - year1.year) + .map(year => ( + + {year.year} + {Math.floor(year.credits)} + {thesisTypes.includes('BACHELOR') && ( + {year.bThesis} + )} + {thesisTypes.includes('MASTER') && ( + {year.mThesis} + )} + {year.graduated} + {/* {year.creditsForPercetage} */} + + + )) : null} @@ -87,7 +90,8 @@ ProductivityTable.propTypes = { credits: number, mThesis: number, bThesis: number, - graduated: number + graduated: number, + creditsForPercetage: number })) }), thesis: arrayOf(shape({ From d6558a93e9105d055c3bdc45aa84206cc68fcb25 Mon Sep 17 00:00:00 2001 From: esakemp <40692959+esakemp@users.noreply.github.com> Date: Tue, 4 Jun 2019 15:13:05 +0300 Subject: [PATCH 3/4] whoopsie --- .../src/components/StudyProgramme/ProductivityTable/index.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx b/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx index 9b73cdc14d..6aa0803c86 100644 --- a/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx +++ b/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx @@ -7,7 +7,6 @@ import { callApi } from '../../../apiConnection' import { getProductivity } from '../../../redux/productivity' const ProductivityTable = ({ productivity, thesis, loading, error, studyprogramme, dispatchGetProductivity }) => { - console.log('eeaaat shit') if (error) return

Oh no so error {error}

let thesisTypes = [] if (thesis) { From b5a1953ce24034ef1d600d971ebdc7084d2b312f Mon Sep 17 00:00:00 2001 From: esakemp Date: Tue, 4 Jun 2019 15:36:32 +0300 Subject: [PATCH 4/4] show new numbers in overview --- .../components/StudyProgramme/ProductivityTable/index.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx b/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx index 6aa0803c86..5048195b6b 100644 --- a/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx +++ b/services/oodikone2-frontend/src/components/StudyProgramme/ProductivityTable/index.jsx @@ -12,7 +12,7 @@ const ProductivityTable = ({ productivity, thesis, loading, error, studyprogramm if (thesis) { thesisTypes = thesis.map(t => t.thesisType) } - const headerList = ['Year', 'Credits', thesisTypes.includes('MASTER') && 'Masters Thesis', thesisTypes.includes('BACHELOR') && 'Bachelors Thesis', 'Graduated'].filter(_ => _) + const headerList = ['Year', 'Credits', thesisTypes.includes('MASTER') && 'Masters Thesis', thesisTypes.includes('BACHELOR') && 'Bachelors Thesis', 'Graduated', 'Credits given to students in selected programme'].filter(_ => _) const refresh = () => { callApi('/v2/studyprogrammes/productivity/recalculate', 'get', null, { code: studyprogramme }) @@ -69,8 +69,7 @@ const ProductivityTable = ({ productivity, thesis, loading, error, studyprogramm {year.mThesis} )} {year.graduated} - {/* {year.creditsForPercetage} */} - + {year.creditsForPercentage} )) : null} @@ -90,7 +89,7 @@ ProductivityTable.propTypes = { mThesis: number, bThesis: number, graduated: number, - creditsForPercetage: number + creditsForPercentage: number })) }), thesis: arrayOf(shape({