Skip to content

Commit fddc475

Browse files
authored
Merge pull request #510 from UniversityOfHelsinkiCS/trunk
bugfix
2 parents a4785eb + 28e0765 commit fddc475

15 files changed

+171
-9
lines changed

Kurki_simulation/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ app.use(bodyParser.urlencoded({ extended: false }));
55
app.use(bodyParser.json());
66

77
app.get('/labtool/courses', (req, res) => {
8-
const responseJson = require('./responses/courses');
8+
const termString = req.query.year + req.query.term
9+
const responseJson = require('./responses/' + termString);
910
res.json(responseJson.courses);
1011
})
1112

@@ -17,7 +18,7 @@ app.get('/labtool/courses/:id', (req, res) => {
1718
})
1819

1920
// If password is "password" and username is listed in
20-
// ./reposonses/users logs in as username.
21+
// ./responses/users logs in as username.
2122
// Otherwise, does not let one log in.
2223
app.post('/login', (req, res) => {
2324

@@ -39,4 +40,4 @@ app.post('/login', (req, res) => {
3940
}
4041
})
4142

42-
app.listen(3002, () => console.log('Fake Kurki listening on port 3002.'));
43+
app.listen(3002, () => console.log('Fake Kurki listening on port 3002.'));
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,5 @@ exports.courses = [
2929
"name": "Aineopintojen harjoituskurssi: Opettajalla ei opiskelijanumeroa",
3030
"starts": "2018-01-16T21:00:00.000Z",
3131
"ends": "2018-03-11T21:00:00.000Z"
32-
33-
}
32+
}
3433
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
exports.courses = [
2+
{
3+
"id": "TKT20010.2018.S.K.1",
4+
"name": "Aineopintojen harjoitustyö: Tietorakenteet ja algoritmit",
5+
"starts": "2018-09-16T21:00:00.000Z",
6+
"ends": "2018-10-11T21:00:00.000Z"
7+
},
8+
{
9+
"id": "TKT20002.2018.S.K.1",
10+
"name": "Ohjelmistotekniikan menetelmät",
11+
"starts": "2018-09-11T21:00:00.000Z",
12+
"ends": "2018-10-29T21:00:00.000Z"
13+
},
14+
{
15+
"id": "TKT20011.2018.S.K.1",
16+
"name": "Aineopintojen harjoitustyö: Tietokantasovellus",
17+
"starts": "2018-09-11T21:00:00.000Z",
18+
"ends": "2018-10-29T21:00:00.000Z"
19+
},
20+
{
21+
"id": "TKT20010.2018.S.K.2",
22+
"name": "Aineopintojen harjoitustyö: Tietorakenteet ja algoritmit",
23+
"starts": "2018-10-16T21:00:00.000Z",
24+
"ends": "2018-12-11T21:00:00.000Z"
25+
},
26+
{
27+
"id": "TKT20011.2018.S.K.2",
28+
"name": "Aineopintojen harjoitustyö: Tietokantasovellus",
29+
"starts": "2018-10-11T21:00:00.000Z",
30+
"ends": "2018-12-29T21:00:00.000Z"
31+
}
32+
]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
exports.courses = [
2+
3+
{
4+
"id": "TKT20011.2018.V.K.1",
5+
"name": "Aineopintojen harjoitustyö: Tietokantasovellus (Alkukesä)",
6+
"starts": "2018-05-11T21:00:00.000Z",
7+
"ends": "2018-06-29T21:00:00.000Z"
8+
},
9+
{
10+
"id": "TKT20010.2018.V.K.1",
11+
"name": "Aineopintojen harjoitustyö: Tietorakenteet ja algoritmit (Alkukesä)",
12+
"starts": "2018-05-16T21:00:00.000Z",
13+
"ends": "2018-06-11T21:00:00.000Z"
14+
},
15+
{
16+
"id": "TKT20011.2018.V.K.2",
17+
"name": "Aineopintojen harjoitustyö: Tietokantasovellus (Loppukesä)",
18+
"starts": "2018-07-27T21:00:00.000Z",
19+
"ends": "2018-08-29T21:00:00.000Z"
20+
},
21+
{
22+
"id": "TKT20010.2018.V.K.2",
23+
"name": "Aineopintojen harjoitustyö: Tietorakenteet ja algoritmit (Loppukesä)",
24+
"starts": "2018-07-27T21:00:00.000Z",
25+
"ends": "2018-08-29T21:00:00.000Z"
26+
}
27+
]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
exports.course = {
2+
"students": [
3+
"014893873",
4+
"014872455",
5+
"014552657",
6+
"014666666",
7+
// otm random opiskelijoilla on vain kaksi opiskelijanumeroa, koska liian myöhään huomattu virhe datan generoinnissa
8+
// ei pitäisi vaikuttaa sovelluksen toimintaan
9+
"015492103",
10+
"015689338"
11+
],
12+
"teachers": [
13+
"paaopettaja"
14+
]
15+
}

Kurki_simulation/responses/TKT20010.2018.K.A.1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
exports.course = {
22
"students": [
3-
"014578343",
3+
"014578343",
44
"014553242",
55
"014623598",
66
"014666666",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
exports.course = {
2+
"students": [
3+
"014578343",
4+
"014553242",
5+
"014623598",
6+
"014666666",
7+
"012345678"
8+
],
9+
"teachers": [
10+
"paaopettaja"
11+
]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
exports.course = {
2+
"students": [
3+
"014578343",
4+
"014553242",
5+
"014623598",
6+
"014666666",
7+
"012345678"
8+
],
9+
"teachers": [
10+
"paaopettaja"
11+
]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
exports.course = {
2+
"students": [
3+
"014578343",
4+
"014553242",
5+
"014623598",
6+
"014666666",
7+
"012345678"
8+
],
9+
"teachers": [
10+
"paaopettaja"
11+
]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
exports.course = {
2+
"students": [
3+
"014578343",
4+
"014553242",
5+
"014623598",
6+
"014666666",
7+
"012345678"
8+
],
9+
"teachers": [
10+
"paaopettaja"
11+
]
12+
}

0 commit comments

Comments
 (0)