- Use real questions now

- Convert JSON to other format
This commit is contained in:
2021-06-10 12:45:56 +02:00
parent d47ca1be66
commit 0a55ef7db8
5 changed files with 3500 additions and 73 deletions

View File

@@ -4,7 +4,7 @@ let app = express();
let server = require('http').createServer(app);
let {Server} = require("socket.io");
let io = new Server(server);
let cards = JSON.parse(fs.readFileSync(__dirname + '/../data/cards.json'));
let cards = JSON.parse(fs.readFileSync(__dirname + '/../data/fragen_10_06_21_final_new_format.json'));
let port = 5000;
server.listen(port, function () {
@@ -100,7 +100,6 @@ function getRandomCard(difficulty) {
let filtered_cards = cards.filter(card => {
return card.difficulty === difficulty;
});
return shuffleAnswers(filtered_cards[Math.floor(Math.random() * filtered_cards.length)]);
}