breaking(curriculum): add scientific-computing to /learn (#53143) (#53146)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Dario-DC <105294544+Dario-DC@users.noreply.github.com>
Co-authored-by: Zaira <33151350+zairahira@users.noreply.github.com>
This commit is contained in:
Shaun Hamilton
2024-02-28 16:05:23 +02:00
committed by GitHub
parent 5b56bbd1ff
commit d361e128c0
26 changed files with 2633 additions and 216 deletions
+23 -4
View File
@@ -120,11 +120,25 @@ const jsCertProjectIds = [
];
const multifileCertProjectIds = getChallenges()
.filter(challenge => challenge.challengeType === 14)
.filter(
challenge => challenge.challengeType === challengeTypes.multifileCertProject
)
.map(challenge => challenge.id);
const multifilePythonCertProjectIds = getChallenges()
.filter(
challenge =>
challenge.challengeType === challengeTypes.multifilePythonCertProject
)
.map(challenge => challenge.id);
const savableChallenges = getChallenges()
.filter(challenge => challenge.challengeType === 14)
.filter(challenge => {
return (
challenge.challengeType === challengeTypes.multifileCertProject ||
challenge.challengeType === challengeTypes.multifilePythonCertProject
);
})
.map(challenge => challenge.id);
const msTrophyChallenges = getChallenges()
@@ -141,7 +155,8 @@ export function buildUserUpdate(
let completedChallenge = {};
if (
jsCertProjectIds.includes(challengeId) ||
multifileCertProjectIds.includes(challengeId)
multifileCertProjectIds.includes(challengeId) ||
multifilePythonCertProjectIds.includes(challengeId)
) {
completedChallenge = {
..._completedChallenge,
@@ -397,7 +412,11 @@ export async function modernChallengeCompleted(req, res, next) {
// We only need to know the challenge type if it's a project. If it's a
// step or normal challenge we can avoid storing in the database.
if (jsCertProjectIds.includes(id) || multifileCertProjectIds.includes(id)) {
if (
jsCertProjectIds.includes(id) ||
multifileCertProjectIds.includes(id) ||
multifilePythonCertProjectIds.includes(id)
) {
completedChallenge.challengeType = challengeType;
}