2018-04-06 14:51:52 +01:00
|
|
|
const html = 0;
|
|
|
|
const js = 1;
|
|
|
|
const backend = 2;
|
|
|
|
const zipline = 3;
|
|
|
|
const frontEndProject = 3;
|
|
|
|
const backEndProject = 4;
|
|
|
|
const bonfire = 5;
|
|
|
|
const modern = 6;
|
|
|
|
const step = 7;
|
|
|
|
const quiz = 8;
|
|
|
|
const invalid = 9;
|
2020-02-25 00:10:32 +05:30
|
|
|
const pythonProject = 10;
|
2020-04-06 14:49:56 -04:00
|
|
|
const video = 11;
|
2022-02-11 09:39:27 -06:00
|
|
|
const codeAllyPractice = 12;
|
|
|
|
const codeAllyCert = 13;
|
2022-01-06 07:26:54 -06:00
|
|
|
const multiFileCertProject = 14;
|
2018-04-06 14:51:52 +01:00
|
|
|
|
2018-04-17 11:33:04 +01:00
|
|
|
// individual exports
|
|
|
|
exports.backend = backend;
|
|
|
|
exports.frontEndProject = frontEndProject;
|
2019-11-04 16:50:14 +03:00
|
|
|
exports.backEndProject = backEndProject;
|
2020-02-25 00:10:32 +05:30
|
|
|
exports.pythonProject = pythonProject;
|
2022-03-22 01:05:38 -05:00
|
|
|
exports.codeAllyCert = codeAllyCert;
|
2018-04-17 11:33:04 +01:00
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
exports.challengeTypes = {
|
|
|
|
html,
|
|
|
|
js,
|
|
|
|
backend,
|
|
|
|
zipline,
|
|
|
|
frontEndProject,
|
|
|
|
backEndProject,
|
2020-02-25 00:10:32 +05:30
|
|
|
pythonProject,
|
2018-04-06 14:51:52 +01:00
|
|
|
bonfire,
|
|
|
|
modern,
|
|
|
|
step,
|
|
|
|
quiz,
|
2020-04-06 14:49:56 -04:00
|
|
|
invalid,
|
2021-06-15 10:37:13 -05:00
|
|
|
video,
|
2022-02-11 09:39:27 -06:00
|
|
|
codeAllyPractice,
|
|
|
|
codeAllyCert,
|
2022-01-06 07:26:54 -06:00
|
|
|
multiFileCertProject
|
2018-04-06 14:51:52 +01:00
|
|
|
};
|
|
|
|
|
2021-12-20 10:36:31 -08:00
|
|
|
// (Oliver) I don't think we need this for codeally projects, so they're ignored
|
|
|
|
// here
|
|
|
|
exports.isProject = challengeType => {
|
|
|
|
if (typeof challengeType !== 'number')
|
|
|
|
throw Error('challengeType must be a number');
|
|
|
|
return (
|
|
|
|
challengeType === frontEndProject ||
|
|
|
|
challengeType === backEndProject ||
|
|
|
|
challengeType === pythonProject
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
// turn challengeType to file ext
|
|
|
|
exports.pathsMap = {
|
|
|
|
[html]: 'html',
|
|
|
|
[js]: 'js',
|
|
|
|
[bonfire]: 'js'
|
|
|
|
};
|
|
|
|
// determine the component to view for each challenge
|
|
|
|
exports.viewTypes = {
|
|
|
|
[html]: 'classic',
|
|
|
|
[js]: 'classic',
|
|
|
|
[bonfire]: 'classic',
|
2019-09-19 12:44:58 +05:30
|
|
|
[frontEndProject]: 'frontend',
|
2019-06-11 18:46:36 +03:00
|
|
|
[backEndProject]: 'backend',
|
2020-04-06 14:49:56 -04:00
|
|
|
[pythonProject]: 'frontend',
|
2018-04-06 14:51:52 +01:00
|
|
|
[modern]: 'modern',
|
|
|
|
[step]: 'step',
|
|
|
|
[quiz]: 'quiz',
|
2020-04-06 14:49:56 -04:00
|
|
|
[backend]: 'backend',
|
2021-06-15 10:37:13 -05:00
|
|
|
[video]: 'video',
|
2022-02-11 09:39:27 -06:00
|
|
|
[codeAllyPractice]: 'codeAlly',
|
|
|
|
[codeAllyCert]: 'codeAlly',
|
2022-01-06 07:26:54 -06:00
|
|
|
[multiFileCertProject]: 'classic'
|
2018-04-06 14:51:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// determine the type of submit function to use for the challenge on completion
|
|
|
|
exports.submitTypes = {
|
|
|
|
[html]: 'tests',
|
|
|
|
[js]: 'tests',
|
|
|
|
[bonfire]: 'tests',
|
|
|
|
// requires just a single url
|
|
|
|
// like codepen.com/my-project
|
|
|
|
[frontEndProject]: 'project.frontEnd',
|
|
|
|
// requires two urls
|
|
|
|
// a hosted URL where the app is running live
|
|
|
|
// project code url like GitHub
|
|
|
|
[backEndProject]: 'project.backEnd',
|
2020-02-25 00:10:32 +05:30
|
|
|
[pythonProject]: 'project.backEnd',
|
2018-04-06 14:51:52 +01:00
|
|
|
[step]: 'step',
|
|
|
|
[quiz]: 'quiz',
|
|
|
|
[backend]: 'backend',
|
2020-04-06 14:49:56 -04:00
|
|
|
[modern]: 'tests',
|
2022-01-06 07:26:54 -06:00
|
|
|
[video]: 'tests',
|
2022-02-11 09:39:27 -06:00
|
|
|
[codeAllyCert]: 'project.frontEnd',
|
2022-01-06 07:26:54 -06:00
|
|
|
[multiFileCertProject]: 'tests'
|
2018-04-06 14:51:52 +01:00
|
|
|
};
|
2018-09-27 13:41:23 +02:00
|
|
|
|
|
|
|
// determine which help forum questions should be posted to
|
2021-06-08 21:27:45 +02:00
|
|
|
exports.helpCategoryMap = require('./help-category-map.json');
|