- const pid = req.body.pid;
- let error = "";
- if (!pid.toString().match(/^[0-9]+$/))
- error = "Wrong problem ID";
- let obj = req.body.newProb;
- error = ProblemModel.checkProblem(obj);
- obj.instruction = sanitizeHtml(obj.instruction);
- obj.solution = sanitizeHtml(obj.solution);