Merge remote-tracking branch 'origin/dev' into chore/login
# Conflicts: # backend/.env.example # backend/package.json # backend/src/app.ts # backend/src/routes/login.ts # backend/src/routes/student.ts # docker-compose.yml # frontend/src/App.vue # frontend/src/views/HomePage.vue # frontend/src/views/LoginPage.vue # package-lock.json
This commit is contained in:
commit
de0199de96
109 changed files with 3789 additions and 1727 deletions
|
@ -1,23 +1,20 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
assignments: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
assignments: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about an assignment with id 'id'
|
||||
// Information about an assignment with id 'id'
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
title: 'Dit is een test assignment',
|
||||
description: 'Een korte beschrijving',
|
||||
groups: [ '0' ],
|
||||
groups: ['0'],
|
||||
learningPath: '0',
|
||||
class: '0',
|
||||
links: {
|
||||
|
@ -25,30 +22,24 @@ router.get('/:id', (req, res) => {
|
|||
submissions: `${req.baseUrl}/${req.params.id}`,
|
||||
},
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/submissions', (req, res) => {
|
||||
res.json({
|
||||
submissions: [
|
||||
'0'
|
||||
],
|
||||
submissions: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/:id/groups', (req, res) => {
|
||||
res.json({
|
||||
groups: [
|
||||
'0'
|
||||
],
|
||||
groups: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/:id/questions', (req, res) => {
|
||||
res.json({
|
||||
questions: [
|
||||
'0'
|
||||
],
|
||||
questions: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,55 +1,46 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
classes: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
classes: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about an class with id 'id'
|
||||
// Information about an class with id 'id'
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
displayName: 'Klas 4B',
|
||||
teachers: [ '0' ],
|
||||
students: [ '0' ],
|
||||
joinRequests: [ '0' ],
|
||||
teachers: ['0'],
|
||||
students: ['0'],
|
||||
joinRequests: ['0'],
|
||||
links: {
|
||||
self: `${req.baseUrl}/${req.params.id}`,
|
||||
classes: `${req.baseUrl}/${req.params.id}/invitations`,
|
||||
questions: `${req.baseUrl}/${req.params.id}/assignments`,
|
||||
students: `${req.baseUrl}/${req.params.id}/students`,
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/invitations', (req, res) => {
|
||||
res.json({
|
||||
invitations: [
|
||||
'0'
|
||||
],
|
||||
invitations: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/assignments', (req, res) => {
|
||||
res.json({
|
||||
assignments: [
|
||||
'0'
|
||||
],
|
||||
assignments: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/students', (req, res) => {
|
||||
res.json({
|
||||
students: [
|
||||
'0'
|
||||
],
|
||||
students: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,34 +1,31 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
groups: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
groups: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about a group (members, ... [TODO DOC])
|
||||
// Information about a group (members, ... [TODO DOC])
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
assignment: '0',
|
||||
students: [ '0' ],
|
||||
submissions: [ '0' ],
|
||||
// reference to other endpoint
|
||||
// should be less hardcoded
|
||||
questions: `/group/${req.params.id}/question`,
|
||||
students: ['0'],
|
||||
submissions: ['0'],
|
||||
// Reference to other endpoint
|
||||
// Should be less hardcoded
|
||||
questions: `/group/${req.params.id}/question`,
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
// the list of questions a group has made
|
||||
// The list of questions a group has made
|
||||
router.get('/:id/question', (req, res) => {
|
||||
res.json({
|
||||
questions: [ '0' ],
|
||||
questions: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
24
backend/src/routes/learningObjects.ts
Normal file
24
backend/src/routes/learningObjects.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import express from 'express';
|
||||
import { getAllLearningObjects, getLearningObject } from '../controllers/learningObjects.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// DWENGO learning objects
|
||||
|
||||
// Queries: hruid(path), full, language
|
||||
// Route to fetch list of learning objects based on hruid of learning path
|
||||
|
||||
// Route 1: list of object hruids
|
||||
// Example 1: http://localhost:3000/learningObject?hruid=un_artificiele_intelligentie
|
||||
|
||||
// Route 2: list of object data
|
||||
// Example 2: http://localhost:3000/learningObject?full=true&hruid=un_artificiele_intelligentie
|
||||
router.get('/', getAllLearningObjects);
|
||||
|
||||
// Parameter: hruid of learning object
|
||||
// Query: language
|
||||
// Route to fetch data of one learning object based on its hruid
|
||||
// Example: http://localhost:3000/learningObject/un_ai7
|
||||
router.get('/:hruid', getLearningObject);
|
||||
|
||||
export default router;
|
27
backend/src/routes/learningPaths.ts
Normal file
27
backend/src/routes/learningPaths.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
import express from 'express';
|
||||
import { getLearningPaths } from '../controllers/learningPaths.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// DWENGO learning paths
|
||||
|
||||
// Route 1: no query
|
||||
// Fetch all learning paths
|
||||
// Example 1: http://localhost:3000/learningPath
|
||||
|
||||
// Unified route for fetching learning paths
|
||||
// Route 2: Query: hruid (list), language
|
||||
// Fetch learning paths based on hruid list
|
||||
// Example 2: http://localhost:3000/learningPath?hruid=pn_werking&hruid=art1
|
||||
|
||||
// Query: search, language
|
||||
// Route to fetch learning paths based on a searchterm
|
||||
// Example 3: http://localhost:3000/learningPath?search=robot
|
||||
|
||||
// Query: theme, anguage
|
||||
// Route to fetch learning paths based on a theme
|
||||
// Example: http://localhost:3000/learningPath?theme=kiks
|
||||
|
||||
router.get('/', getLearningPaths);
|
||||
|
||||
export default router;
|
|
@ -1,17 +1,14 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
questions: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
questions: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about an question with id 'id'
|
||||
// Information about an question with id 'id'
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
|
@ -23,16 +20,14 @@ router.get('/:id', (req, res) => {
|
|||
links: {
|
||||
self: `${req.baseUrl}/${req.params.id}`,
|
||||
answers: `${req.baseUrl}/${req.params.id}/answers`,
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/answers', (req, res) => {
|
||||
res.json({
|
||||
answers: [
|
||||
'0'
|
||||
],
|
||||
})
|
||||
})
|
||||
answers: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
students: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
students: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about a student's profile
|
||||
// Information about a student's profile
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
|
@ -27,33 +24,32 @@ router.get('/:id', (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
// the list of classes a student is in
|
||||
// The list of classes a student is in
|
||||
router.get('/:id/classes', (req, res) => {
|
||||
res.json({
|
||||
classes: [ '0' ],
|
||||
classes: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
// the list of submissions a student has made
|
||||
// The list of submissions a student has made
|
||||
router.get('/:id/submissions', (req, res) => {
|
||||
res.json({
|
||||
submissions: [ '0' ],
|
||||
submissions: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
// the list of assignments a student has
|
||||
// The list of assignments a student has
|
||||
router.get('/:id/assignments', (req, res) => {
|
||||
res.json({
|
||||
assignments: [ '0' ],
|
||||
assignments: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
// the list of groups a student is in
|
||||
// The list of groups a student is in
|
||||
router.get('/:id/groups', (req, res) => {
|
||||
res.json({
|
||||
groups: [ '0' ],
|
||||
groups: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
submissions: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
submissions: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about an submission with id 'id'
|
||||
// Information about an submission with id 'id'
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
|
@ -21,6 +18,6 @@ router.get('/:id', (req, res) => {
|
|||
content: 'Wortel 2 is rationeel',
|
||||
learningObject: '0',
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
teachers: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
teachers: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about a teacher
|
||||
// Information about a teacher
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
|
@ -25,34 +22,27 @@ router.get('/:id', (req, res) => {
|
|||
invitations: `${req.baseUrl}/${req.params.id}/invitations`,
|
||||
},
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
// the questions students asked a teacher
|
||||
// The questions students asked a teacher
|
||||
router.get('/:id/questions', (req, res) => {
|
||||
res.json({
|
||||
questions: [
|
||||
'0'
|
||||
],
|
||||
questions: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
// invitations to other classes a teacher received
|
||||
// Invitations to other classes a teacher received
|
||||
router.get('/:id/invitations', (req, res) => {
|
||||
res.json({
|
||||
invitations: [
|
||||
'0'
|
||||
],
|
||||
invitations: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
// a list with ids of classes a teacher is in
|
||||
// A list with ids of classes a teacher is in
|
||||
router.get('/:id/classes', (req, res) => {
|
||||
res.json({
|
||||
classes: [
|
||||
'0'
|
||||
],
|
||||
classes: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -3,7 +3,12 @@ import { getThemes, getThemeByTitle } from '../controllers/themes.js';
|
|||
|
||||
const router = express.Router();
|
||||
|
||||
// Query: language
|
||||
// Route to fetch list of {key, title, description, image} themes in their respective language
|
||||
router.get('/', getThemes);
|
||||
|
||||
// Arg: theme (key)
|
||||
// Route to fetch list of hruids based on theme
|
||||
router.get('/:theme', getThemeByTitle);
|
||||
|
||||
export default router;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue