diff --git a/i18n/messages.en.js b/i18n/messages.en.js index 02855a41..99954f65 100644 --- a/i18n/messages.en.js +++ b/i18n/messages.en.js @@ -185,8 +185,7 @@ module.exports = { }, equipment: { body: `

Equipment describes what equipment is not provided by KTH and is needed to follow the course offering.

-

This information helps the student acquire the right equipment before the start of the course offering.

-

The content is retrieved from Kopps if there is information about equipment already entered. You can choose to retain that information in your course memo or add new information.

`, +

This information helps the student acquire the right equipment before the start of the course offering.

`, help: `

Under this section, you describe the equipment that students need to complete the course, if it is not provided by KTH. Writing tools and literature are not considered equipment.

`, }, examiner: { @@ -293,15 +292,13 @@ module.exports = { }, possibilityToAddition: { body: `

Opportunity to raise an approved grade via renewed examination describes if it is possible to raise an approved grade on this course and the terms for raising the grade.

-

This information helps the student to understand if it is possible to raise an approved grade via renewed examination in this course offering.

-

Content is retrieved from Kopps if there is information about Opportunity to raise an approved grade via renewed examination entered. You can choose to retain that information in your course memo or add new information.

`, +

This information helps the student to understand if it is possible to raise an approved grade via renewed examination in this course offering.

`, help: `

Under this section, you describe if it is possible to raise an approved grade via renewed examination on this course offering and the terms for that. Also describe how the student can apply for a renewed examination. If it is not possible to raise an approved grade via renewed examination on this course offering it may be beneficial to indicate this.

`, }, possibilityToCompletion: { body: `

Opportunity to complete the requirements via supplementary examination describes whether there is a chance for supplementary examination in this course offering and if completion can be done only up to a grade E or to a higher grade.

-

This information helps the student to understand if it is possible to complete the requirements via supplementary examination and, if so, the conditions for completion in this course offering.

-

Content is retrieved from Kopps if there is information about Opportunity to complete the requirements via supplementary examination entered. You can choose to retain that information in your course memo or add new information.

`, +

This information helps the student to understand if it is possible to complete the requirements via supplementary examination and, if so, the conditions for completion in this course offering.

`, help: `

Under this section, you describe if it is possible to complete the requirements via supplementary examination on this course offering and, if so, the applicable conditions. Also describe if it is possible to complete the requirements via supplementary examination on each module.

All modules in a course with differentiated grading scale must offer an opportunity to complete the requirements via supplementary examination from Fx to Pass. Opportunity to complete the requirements via supplementary examination can be offered by the examiner for modules with grading scale P/F.

It is often better to describe opportunity to complete the requirements via supplementary examination for the modules under the heading Examination.

`, diff --git a/i18n/messages.se.js b/i18n/messages.se.js index bb07d4c6..3b2a57cb 100644 --- a/i18n/messages.se.js +++ b/i18n/messages.se.js @@ -174,8 +174,7 @@ module.exports = { }, equipment: { body: `

Utrustning beskriver vilken utrustning som inte tillhandahålls av KTH och som behövs för att kunna följa kursomgången.

-

Informationen hjälper studenten att skaffa rätt utrustning inför kursomgångens start.

-

Innehåll hämtas från Kopps om det finns uppgifter om utrustning inlagt. Du kan välja att behålla den informationen i ditt kurs-PM, eller skriva in ny information.

`, +

Informationen hjälper studenten att skaffa rätt utrustning inför kursomgångens start.

`, help: `

Här beskriver du vilken utrustning som studenten behöver för att genomföra kursen, om den inte tillhandahålls av KTH. Skrivdon och litteratur räknas inte till utrustning.

`, }, examination: { @@ -282,14 +281,12 @@ module.exports = { }, possibilityToAddition: { body: `

Möjlighet till plussning beskriver om plussning är möjligt på kursomgången, eventuella villkor för plussning och hur plussning går till.

-

Informationen hjälper studenten att förstå om det finns möjlighet till plussning på denna kursomgång.

-

Innehåll hämtas från Kopps om det finns uppgifter om möjlighet till plussning inlagt. Du kan välja att behålla den informationen i ditt kurs-PM, eller skriva in ny information.

`, +

Informationen hjälper studenten att förstå om det finns möjlighet till plussning på denna kursomgång.

`, help: `

Här beskriver du om det finns möjlighet till plussning på denna kursomgång och i så fall vilka villkor som gäller för det och hur studenten ansöker om att få plussa. Om möjlighet till plussning inte är möjlig för denna kursomgång kan det vara bra att ange detta.

`, }, possibilityToCompletion: { body: `

Möjlighet till komplettering beskriver om det finns möjlighet till komplettering på denna kursomgång och om komplettering kan göras endast till betyg E eller till högre betyg.

-

Informationen hjälper studenten att förstå om det finns möjlighet till komplettering på denna kursomgång och i så fall villkoren för komplettering.

-

Innehåll hämtas från Kopps om det finns uppgifter om möjlighet till komplettering inlagt. Du kan välja att behålla den informationen i ditt kurs-PM, eller skriva in ny information.

`, +

Informationen hjälper studenten att förstå om det finns möjlighet till komplettering på denna kursomgång och i så fall villkoren för komplettering.

`, help: `

Under rubriken beskriver du om det finns möjlighet till komplettering på denna kursomgång och i så fall vilka villkor som gäller. Beskriv också vad som gäller för kursens moduler.

För modul med betygsskala A-F måste möjlighet till komplettering från Fx till Godkänt ges. För modul med betygsskala P/F kan det erbjudas av examinator.

Det kan i många fall vara mer tydligt att istället beskriva möjlighet till komplettering om varje modul under rubriken Examination.

`, diff --git a/server/controllers/memoCtrl.js b/server/controllers/memoCtrl.js index ef1e93b1..4c0b9c92 100644 --- a/server/controllers/memoCtrl.js +++ b/server/controllers/memoCtrl.js @@ -20,11 +20,11 @@ const combineDefaultValues = (freshMemoData, koppsFreshData) => { const updatedWithDefaults = { ...freshMemoData, // eslint-disable-next-line no-use-before-define - equipment: equipment || koppsFreshData.equipmentTemplate || '', + equipment: equipment || '', scheduleDetails: scheduleDetails || '', literature: literature || koppsFreshData.literatureTemplate || '', - possibilityToCompletion: possibilityToCompletion || koppsFreshData.possibilityToCompletionTemplate || '', - possibilityToAddition: possibilityToAddition || koppsFreshData.possibilityToAdditionTemplate || '', + possibilityToCompletion: possibilityToCompletion || '', + possibilityToAddition: possibilityToAddition || '', } return updatedWithDefaults @@ -33,10 +33,7 @@ const combineDefaultValues = (freshMemoData, koppsFreshData) => { const removeTemplatesFromKoppsFreshData = async koppsFreshData => { // no map() // to send cleaned up koppsFreshData to client side end then to api - await delete koppsFreshData.equipmentTemplate await delete koppsFreshData.literatureTemplate - await delete koppsFreshData.possibilityToCompletionTemplate - await delete koppsFreshData.possibilityToAdditionTemplate return koppsFreshData } diff --git a/server/koppsApi.js b/server/koppsApi.js index dd5fade3..27ae7368 100644 --- a/server/koppsApi.js +++ b/server/koppsApi.js @@ -222,11 +222,8 @@ function _getCommonInfo(resBody) { gradingScale, title: c.title || '', titleOther: c.titleOther || '', - possibilityToCompletionTemplate: c.possibilityToCompletion || '', - possibilityToAdditionTemplate: c.possibilityToAddition || '', schemaUrls: schemaUrls || '', literatureTemplate: c.courseLiterature || '', - equipmentTemplate: c.requiredEquipment || '', } } diff --git a/test/unit/kopps-parseSyllabus.test.js b/test/unit/kopps-parseSyllabus.test.js index 651c46e8..eed6e1df 100644 --- a/test/unit/kopps-parseSyllabus.test.js +++ b/test/unit/kopps-parseSyllabus.test.js @@ -214,7 +214,6 @@ test('parse an older syllabus 20192 information for 20212 without breaking if TE "credits": 7.5, "departmentName": "ITM/Hållbar produktionsutveckling", "educationalTypeId": null, - "equipmentTemplate": "", "ethicalApproach": "", "examComments": "Examinator beslutar, baserat på rekommendation från KTH:s samordnare för funktionsnedsättning, om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning.

Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

Examinator beslutar, i samråd med KTH:s samordnare för funktionsnedsättning (Funka), om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning. Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

", "examination": "

Examinator beslutar, baserat på rekommendation från KTH:s samordnare för funktionsnedsättning, om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning.

Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

Examinator beslutar, i samråd med KTH:s samordnare för funktionsnedsättning (Funka), om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning. Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

", @@ -225,8 +224,6 @@ test('parse an older syllabus 20192 information for 20212 without breaking if TE "otherRequirementsForFinalGrade": "

Närvaro vid specificerade obligatoriska kurstillfällen (eller genomförd kompensationsuppgift till dessa) är krav för slutlig betygsättning.

", "permanentDisability": "

Om du har en funktionsnedsättning kan du få stöd via Funka:

Funka- stöd för studenter med funktionsnedsättningar

", - "possibilityToAdditionTemplate": "", - "possibilityToCompletionTemplate": "", "recruitmentText": "", "schemaUrls": [ "https://www.kth.se/social/course/ML1616/subgroup/ht-2022-tiips-7/calendar/", @@ -258,7 +255,6 @@ test('parse the latest syllabus 20222 for 20222', () => { "credits": 7.5, "departmentName": "ITM/Hållbar produktionsutveckling", "educationalTypeId": null, - "equipmentTemplate": "", "ethicalApproach": "", "examComments": "Examinator beslutar, baserat på rekommendation från KTH:s samordnare för funktionsnedsättning, om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning.

Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

Examinator beslutar, i samråd med KTH:s samordnare för funktionsnedsättning (Funka), om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning. Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

TENA är ett valfritt examinationsmoment för att uppnå högre betyg än E på kursen.

", "examination": "

Examinator beslutar, baserat på rekommendation från KTH:s samordnare för funktionsnedsättning, om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning.

Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

Examinator beslutar, i samråd med KTH:s samordnare för funktionsnedsättning (Funka), om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning. Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

TENA är ett valfritt examinationsmoment för att uppnå högre betyg än E på kursen.

", @@ -269,8 +265,6 @@ test('parse the latest syllabus 20222 for 20222', () => { "otherRequirementsForFinalGrade": "

Närvaro vid specificerade obligatoriska kurstillfällen (eller genomförd kompensationsuppgift till dessa) är krav för slutlig betygsättning.

", "permanentDisability": "

Om du har en funktionsnedsättning kan du få stöd via Funka:

Funka- stöd för studenter med funktionsnedsättningar

", - "possibilityToAdditionTemplate": "", - "possibilityToCompletionTemplate": "", "recruitmentText": "", "schemaUrls": [ "https://www.kth.se/social/course/ML1616/subgroup/ht-2022-tiips-7/calendar/", @@ -298,7 +292,6 @@ test('parse the latest syllabus 20222 for 20231', () => { "credits": 7.5, "departmentName": "ITM/Hållbar produktionsutveckling", "educationalTypeId": null, - "equipmentTemplate": "", "ethicalApproach": "", "examComments": "Examinator beslutar, baserat på rekommendation från KTH:s samordnare för funktionsnedsättning, om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning.

Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

Examinator beslutar, i samråd med KTH:s samordnare för funktionsnedsättning (Funka), om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning. Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

TENA är ett valfritt examinationsmoment för att uppnå högre betyg än E på kursen.

", "examination": "

Examinator beslutar, baserat på rekommendation från KTH:s samordnare för funktionsnedsättning, om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning.

Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

Examinator beslutar, i samråd med KTH:s samordnare för funktionsnedsättning (Funka), om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning. Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

TENA är ett valfritt examinationsmoment för att uppnå högre betyg än E på kursen.

", @@ -309,8 +302,6 @@ test('parse the latest syllabus 20222 for 20231', () => { "otherRequirementsForFinalGrade": "

Närvaro vid specificerade obligatoriska kurstillfällen (eller genomförd kompensationsuppgift till dessa) är krav för slutlig betygsättning.

", "permanentDisability": "

Om du har en funktionsnedsättning kan du få stöd via Funka:

Funka- stöd för studenter med funktionsnedsättningar

", - "possibilityToAdditionTemplate": "", - "possibilityToCompletionTemplate": "", "recruitmentText": "", "schemaUrls": [ "https://www.kth.se/social/course/ML1616/subgroup/ht-2022-tiips-7/calendar/", diff --git a/test/unit/memoCtrl.test.js b/test/unit/memoCtrl.test.js index bbdd0533..2404353d 100644 --- a/test/unit/memoCtrl.test.js +++ b/test/unit/memoCtrl.test.js @@ -11,14 +11,11 @@ const mockedApi = (withValues = false) => ({ : '', }) const mockedKoppsTemplates = { - possibilityToCompletionTemplate: '

Text fetched from kopps and can be edited, removed

', - possibilityToAdditionTemplate: '

Text fetched from kopps and can be edited, removed

', schemaUrls: [ 'https://www-r.referens.sys.kth.se/social/course/SF1624/subgroup/ht-2020-cdepr1-mfl-2/calendar/', 'https://www-r.referens.sys.kth.se/social/course/SF1624/subgroup/ht-2020-cbiot2-mfl/calendar/', ], literatureTemplate: '

Text fetched from kopps and can be edited, removed

', - equipmentTemplate: '

Text fetched from kopps and can be edited, removed

', examinationModules: '

Written Exam ( wTEN1 )

', } const mockedCourseInfo = { @@ -52,37 +49,18 @@ const memoCtrl = require('../../server/controllers/memoCtrl') describe('Contol functions for combining data', () => { test('Update fetch data with default data from kopps if some api data has no values, except examinationSubSection', done => { const emptyApiData = mockedApi() - const memoLangAbbr = 'en' const updatedMemoData = memoCtrl.combineDefaultValues(emptyApiData, mockedKoppsTemplates) - const { - examinationSubSection, - equipment, - scheduleDetails, - literature, - possibilityToCompletion, - possibilityToAddition, - } = updatedMemoData + const { examinationSubSection, literature } = updatedMemoData expect(examinationSubSection).toBe(emptyApiData.examinationSubSection) - expect(equipment).toBe(mockedKoppsTemplates.equipmentTemplate) expect(literature).toBe(mockedKoppsTemplates.literatureTemplate) - expect(possibilityToCompletion).toBe(mockedKoppsTemplates.possibilityToCompletionTemplate) - expect(possibilityToAddition).toBe(mockedKoppsTemplates.possibilityToAdditionTemplate) - done() }) test('Update fetch data with default data from kopps if some api data has no values', done => { const filledInApiData = mockedApi(true) - const memoLangAbbr = 'en' const updatedMemoData = memoCtrl.combineDefaultValues(filledInApiData, mockedKoppsTemplates) - const { - examinationSubSection, - equipment, - scheduleDetails, - literature, - possibilityToCompletion, - possibilityToAddition, - } = updatedMemoData + const { examinationSubSection, equipment, literature, possibilityToCompletion, possibilityToAddition } = + updatedMemoData expect(examinationSubSection).toBe(filledInApiData.examinationSubSection) expect(equipment).toBe(filledInApiData.equipment) expect(literature).toBe(filledInApiData.literature) @@ -93,18 +71,14 @@ describe('Contol functions for combining data', () => { }) test('Kopps data cleaned up from templates', done => { - const newKoppsData = memoCtrl.removeTemplatesFromKoppsFreshData(mockedKoppsTemplates) - expect(newKoppsData.equipmentTemplate).toBe(undefined) + const newKoppsData = memoCtrl.removeTemplatesFromKoppsFreshData(JSON.parse(JSON.stringify(mockedKoppsTemplates))) expect(newKoppsData.literatureTemplate).toBe(undefined) - expect(newKoppsData.possibilityToCompletionTemplate).toBe(undefined) - expect(newKoppsData.possibilityToAdditionTemplate).toBe(undefined) - done() }) test('Merge kopps data and api data, memo api data replaces kopps data', async () => { const newKoppsData = await memoCtrl.mergeKoppsCourseAndMemoData( - mockedKoppsTemplates, + JSON.parse(JSON.stringify(mockedKoppsTemplates)), mockedCourseInfo, mockedApi(true) ) @@ -128,7 +102,7 @@ describe('Contol functions for combining data', () => { test('Merge kopps data and api data, memo api has empty values', async () => { const newKoppsData = await memoCtrl.mergeKoppsCourseAndMemoData( - mockedKoppsTemplates, + JSON.parse(JSON.stringify(mockedKoppsTemplates)), mockedCourseInfo, mockedApi(false) ) @@ -137,7 +111,7 @@ describe('Contol functions for combining data', () => { "equipment": "", "examinationModules": "

Written Exam ( wTEN1 )

", "examinationSubSection": "", - "literature": "", + "literature": "

Text fetched from kopps and can be edited, removed

", "possibilityToAddition": "", "possibilityToCompletion": "", "prerequisites": "Some recommended prerequisites",