Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sonsoleslp committed Sep 4, 2020
1 parent e43321b commit 08cc403
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
9 changes: 5 additions & 4 deletions controllers/analytics_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ exports.download = async (req, res) => {
exports.downloadRaw = async (req, res) => {
const {escapeRoom, query} = req;
const {turnId} = query;
console.log(req.query)

console.log(req.query);
try {
escapeRoom.puzzles = await getERPuzzles(escapeRoom.id);
const puzzleIdToOrder = {};
Expand All @@ -568,8 +569,8 @@ exports.downloadRaw = async (req, res) => {
teamSize,
"turnoId": team.turno.id,
"startTime": convertDate(startTime),
"timestamp": '',
"minute": '',
"timestamp": "",
"minute": "",
"event": "",
"hintId": "",
"hintContent": "",
Expand Down Expand Up @@ -602,7 +603,7 @@ exports.downloadRaw = async (req, res) => {
"timestamp": convertDate(hintTS),
"minute": Math.round(100 * (hintTS - startTime) / 1000 / 60) / 100,
"hintId": h.hint ? `${puzzleIdToOrder[h.hint.puzzleId]}.${h.hint.order + 1}` : "",
"hintCategory": h.hint ? (h.hint.category || "") : "",
"hintCategory": h.hint ? h.hint.category || "" : "",
"hintContent": h.hint ? h.hint.content : "",
"hintQuizScore": parseInt(h.score, 10)
});
Expand Down
2 changes: 1 addition & 1 deletion helpers/csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ exports.createCsvFile = (res, content, title = `results-${Date.now()}`, field =
res.write(`\uFEFF${csvText}`);
res.end();
},
{"delimiter": {field}, defaultValue: ''}
{"delimiter": {field}, "defaultValue": ""}
);
};
22 changes: 12 additions & 10 deletions queries/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ exports.teamComplete = (escapeRoomId, turnId, order, waiting = false) => {

if (order) {
if (order === "order") {
where.order = [[
{
"model": models.puzzle,
"as": "retos"
},
"order",
"ASC"
]];
where.order = [
[
{
"model": models.puzzle,
"as": "retos"
},
"order",
"ASC"
]
];
} else {
where.order = [
Sequelize.literal(order),
Expand Down Expand Up @@ -105,8 +107,8 @@ exports.puzzlesByTeam = (escapeRoomId, turnId, hints = false) => {

if (hints) {
options.include.push({
model: models.requestedHint,
include: [{model: models.hint}]
"model": models.requestedHint,
"include": [{"model": models.hint}]
});
}
if (turnId) {
Expand Down

0 comments on commit 08cc403

Please sign in to comment.