Example #1
0
def set_grade_assignment(P, req):
    uid = UR.getUserId(req)
    if not auth.canGrade(uid, P["id_source"], P["id_user"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    retval = {}
    retval["grades"] = annotations.set_grade_assignment(uid, {"id_source": P["id_source"], "id_user":  P["id_user"], "grade": P["grade"]})
    return UR.prepare_response(retval)
Example #2
0
def set_grade_assignment(P, req):
    uid = UR.getUserId(req)
    if not auth.canGrade(uid, P["id_source"], P["id_user"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    retval = {}
    retval["grades"] = annotations.set_grade_assignment(uid, {"id_source": P["id_source"], "id_user":  P["id_user"], "grade": P["grade"]})
    return UR.prepare_response(retval)