Skip to content

Commit 2b38dcf

Browse files
committed
fix bug
1 parent 0233a9a commit 2b38dcf

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/action/team.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module.exports.getTeamMate = async (contrain) => {
9595
[db.Sequelize.Op.in]: user_id
9696
}
9797
},
98-
attributes: ['name', 'avater', 'email', 'role_id']
98+
attributes: ['name', 'avatar', 'email', 'role_id']
9999
});
100100
team.dataValues.users = users;
101101
return team;

src/utils/parseAnswer.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,13 @@ module.exports.parseAnswer = (choose_answers, correct_answers) =>{
33
if(correct_answers.length !== choose_answers.length){
44
return false;
55
}
6-
7-
};
6+
correct_answers = correct_answers.sort(function(a, b){return a-b});
7+
choose_answers = choose_answers.sort(function(a, b){return a-b});
8+
let i=0;
9+
for(i=0; i < choose_answers.length; i++){
10+
if(choose_answers[i] !== correct_answers[i]){
11+
return false;
12+
}
13+
}
14+
return true;
15+
};

0 commit comments

Comments
 (0)