Added new function to tests

parent f979fe40
......@@ -78,6 +78,22 @@ module.exports.getMany = ids => {
return Test.find({_id: {$in: ids}});
};
module.exports.getForContest = contest => {
return Test.find({contest}).sort({index: 1});
};
module.exports.getForTask = task => {
return Test.find({task}).sort({index: 1});
};
module.exports.getCountForContest = contest => {
return Test.countDocuments({contest});
};
module.exports.getCountForTask = task => {
return Test.countDocuments({task});
};
module.exports.get = id => {
return Test.findOne({_id: id});
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment