Skip to content

Commit

Permalink
Merge pull request #380 from KTH/issues/KUI-1376-fetch-recommended-pr…
Browse files Browse the repository at this point in the history
…erequisites-from-course-info

KUI-1376: Fetch recommended prerequisites from Om Kursen
  • Loading branch information
axelbjo authored Oct 4, 2024
2 parents c901404 + 53bf1a0 commit 813f468
Show file tree
Hide file tree
Showing 16 changed files with 410 additions and 271 deletions.
2 changes: 2 additions & 0 deletions .azure/prod.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"secretNames": {
"value": [
"KURS_PM_DATA_API_KEY",
"KURSINFO_API_KEY",
"REDIS_URI",
"SESSION_SECRET",
"SESSION_KEY",
Expand All @@ -31,6 +32,7 @@
"SERVER_PORT": "3000",
"KURS_PM_DATA_API_URI": "https://api.kth.se/api/kurs-pm-data?defaultTimeout=10000",
"KOPPS_URI": "https://api.kth.se/api/kopps/v2/?defaultTimeout=60000",
"KURSINFO_API_URI": "http://api.kth.se/api/kursinfo?defaultTimeout=10000",
"CAS_SSO_URI": "https://login.kth.se",
"CM_HOST_URL": "https://www.kth.se/cm/",
"NODE_ENV": "production",
Expand Down
2 changes: 2 additions & 0 deletions .azure/ref.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"secretNames": {
"value": [
"KURS_PM_DATA_API_KEY",
"KURSINFO_API_KEY",
"REDIS_URI",
"OIDC_APPLICATION_ID",
"OIDC_CLIENT_SECRET",
Expand All @@ -31,6 +32,7 @@
"SERVER_PORT": "3000",
"KURS_PM_DATA_API_URI": "https://api-r.referens.sys.kth.se/api/kurs-pm-data?defaultTimeout=10000",
"KOPPS_URI": "https://api-r.referens.sys.kth.se/api/kopps/v2/?defaultTimeout=60000",
"KURSINFO_API_URI": "https://api-r.referens.sys.kth.se/api/kursinfo?defaultTimeout=10000",
"CM_HOST_URL": "https://www-r.referens.sys.kth.se/cm/",
"LOGGING_USER": "kurs-pm-data-admin-web",
"LOGGING_LEVEL": "TRACE",
Expand Down
1 change: 1 addition & 0 deletions .env.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
KURS_PM_DATA_API_KEY=[Available in Azure KeyVault]
KURSINFO_API_KEY=[Available in Azure KeyVault]
REDIS_URI=[Available in Azure KeyVault]
SESSION_SECRET=[Generate random string]
OIDC_APPLICATION_ID=[Available in Azure KeyVault]
Expand Down
7 changes: 7 additions & 0 deletions config/serverSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const devSsl = devDefaults(false)
const devUrl = devDefaults('http://localhost:' + devPort)
const devKursPmDataApi = devDefaults('http://api-r.referens.sys.kth.se/api/kurs-pm-data?defaultTimeout=10000') // required=true&
const devKoppsApi = devDefaults('https://api-r.referens.sys.kth.se/api/kopps/v2/?defaultTimeout=10000')
const devKursInfoApi = devDefaults('http://api-r.referens.sys.kth.se/api/kursinfo?defaultTimeout=10000') // required=true&
const devSessionKey = devDefaults('kurs-pm-data-admin-web.sid')
const devSessionUseRedis = devDefaults(true)
const devRedis = devDefaults('redis://localhost:6379/')
Expand Down Expand Up @@ -61,6 +62,7 @@ module.exports = {
// API keys
apiKey: {
kursPmDataApi: getEnv('KURS_PM_DATA_API_KEY', devDefaults('1234')),
kursinfoApi: getEnv('KURSINFO_API_KEY', devDefaults('123489')),
},

// Authentication
Expand All @@ -74,6 +76,7 @@ module.exports = {
// Service API's
nodeApi: {
kursPmDataApi: unpackNodeApiConfig('KURS_PM_DATA_API_URI', devKursPmDataApi),
kursinfoApi: unpackNodeApiConfig('KURSINFO_API_URI', devKursInfoApi),
},

koppsApi: unpackKOPPSConfig('KOPPS_URI', devKoppsApi),
Expand Down Expand Up @@ -111,6 +114,10 @@ module.exports = {
redis: unpackRedisConfig('REDIS_URI', devRedis),
expireTime: getEnv('KOPPS_API_CACHE_EXPIRE_TIME', 60 * 60), // 60 minuteS
},
kursinfoApi: {
redis: unpackRedisConfig('REDIS_URI', devRedis),
expireTime: getEnv('KURSINFO_API_CACHE_EXPIRE_TIME', 2 * 60), // 2 * 60 s = 2 MINUTES
},
},

// UG API auth properties
Expand Down
4 changes: 3 additions & 1 deletion i18n/messages.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module.exports = {
'(c)': 'from Kopps',
'(r)': 'from course round information',
'(s)': 'from course syllabus',
'(o)': 'from the page Before course selection',
errorEmptyHeading: 'You need to name the header',
mandatory: 'Always included',
mandatoryAndEditable: 'Always included',
Expand Down Expand Up @@ -320,8 +321,9 @@ module.exports = {
prerequisites: {
body: `<p><b>Recommended prerequisites</b> describe what the teacher expects the student to have mastered when the course begins.</p>
<p><b>This information helps the student</b> understand which knowledge is crucial to be updated on when the course starts. Clearly defined information makes it easier for the student to review the correct theories and models before the course begins.</p>
<p><b>Content is retrieved from Kopps</b> and can only be edited in <a href="https://app.kth.se/kopps/admin/courses" target="_blank">Kopps</a> by <a href="https://app.kth.se/kopps/admin/userlist" target="_blank">authorized personnel</a> (both links open in new tabs). You can choose not to include the heading in your course memo.</p>`,
<p><b>The content is retrieved from the Page Before course selection</b> and can only be edited via the About course administration tool. If you want to change the content, you need to save your course memo as a draft and go to the function <a href="REPLACE_WITH_ABOUT_COURSE_ADMIN_LINK" target="_blank">Page Before course selection</a > to edit the text. You can choose not to include the title in your course memo.</p>`,
help: `<p>Under this section, you describe what is particularly important for the student to prepare for. You can encourage the student to review knowledge from the "Specific prerequisites" section in the course syllabus, revisit crucial aspects from the "Recommended prerequisites," remind them to order specific literature on time, or install software.</p>`,
link: '/kursinfoadmin/kurser/kurs/edit/<REPLACE_WITH_COURSECODE>?=en',
},
reportingResults: {
body: `<p><b>Reporting of exam results</b> describes when and how the registration of students' results and grades takes place, as well as where the student can access this information.</p>
Expand Down
4 changes: 3 additions & 1 deletion i18n/messages.se.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module.exports = {
'(c)': 'från Kopps',
'(r)': 'från kurstillfällesinformation',
'(s)': 'från kursplan',
'(o)': 'från sidan inför kursval',
errorEmptyHeading: 'Du måste ange en rubrik',
mandatory: 'Inkluderas alltid',
mandatoryAndEditable: `Inkluderas alltid (går att redigera)`,
Expand Down Expand Up @@ -308,8 +309,9 @@ module.exports = {
prerequisites: {
body: `<p><b>Rekommenderade förkunskaper</b> beskriver vad läraren förväntar sig att studenten behärskar när kursomgången startar.</p>
<p><b>Informationen hjälper studenten</b> att förstå vilken kunskap som är viktig att vara uppdaterad på när kursomgången startar. Tydligt avgränsad information gör det lättare för studenten att repetera rätt teorier och modeller inför kursen start.</p>
<p><b>Innehåll hämtas från Kopps</b> och kan enbart redigeras i <a href="https://app.kth.se/kopps/admin/courses" target="_blank">Kopps</a> av <a href="https://app.kth.se/kopps/admin/userlist" target="_blank">personal med behörighet</a> (båda länkarna öppnas i ny flik). Du kan välja att inte inkludera rubriken i ditt kurs-PM.</p>`,
<p><b>Innehåll hämtas från sidan Inför kursval</b> och kan enbart redigeras via Om kursens administrationsverktyg. Vill du ändra innehållet behöver du spara ditt kurs-PM som utkast och gå till funktionen <a href="REPLACE_WITH_ABOUT_COURSE_ADMIN_LINK" target="_blank">Sidan inför kursval</a> för att redigera texten. Du kan välja att inte inkludera rubriken i ditt kurs-PM.</p>`,
help: `<p>Här beskriver du vad som är särskilt viktigt för studenten att förbereda sig på. Du kan här uppmana studenten att repetera kunskap från "Särskild behörighet" i kursplanen, repetera viktiga delar från "Rekommenderade förkunskaper", påminna om att beställa viss kurslitteratur i tid eller installera programvara.</p>`,
link: '/kursinfoadmin/kurser/kurs/edit/<REPLACE_WITH_COURSECODE>?l=sv',
},
reportingResults: {
body: `<p><b>Resultatrapportering</b> beskriver när och hur registrering av studenternas resultat och betyg går till, samt var studenten kan ta del av informationen.</p>
Expand Down
Loading

0 comments on commit 813f468

Please sign in to comment.