- }
- else
- {
- ProblemModel.getAll((err,problems) => {
- res.json(err || {problems:problems});
+ } else if (!!cursor && !!cursor.match(/^[0-9]+$/)) {
+ const onlyMine = (req.query["mode"] == "mine");
+ const uid = parseInt(req.query["uid"]);
+ ProblemModel.getNext(uid, onlyMine, cursor, (err, problems) => {
+ res.json(err || { problems: problems });