@view_config(route_name='increase_value', renderer='json', request_method="POST")
@view_config(route_name='increase_value_with_key', renderer='json', request_method="POST")
def increase_value(request):
    
    user_id = int(request.matchdict["user_id"])
    try:
        value = float(request.POST["value"])
    except:
        raise BadRequest("Invalid value provided")
    
    key = request.matchdict["key"] if request.matchdict.has_key("key") else ""
    variable_name = request.matchdict["variable_name"]
    
    user = User.get_user(user_id)
    if not user:
        raise NotFound("user not found")
    
    variable = Variable.get_variable_by_name(variable_name)
    if not variable:
        raise NotFound("variable not found")
    
    Value.increase_value(variable_name, user, value, key) 
    
    output = _get_progress(user,force_generation=True)[1]
    
    for aid in output["achievements"].keys():
        if len(output["achievements"][aid]["new_levels"])>0:
            del output["achievements"][aid]["levels"]
            del output["achievements"][aid]["priority"]
            del output["achievements"][aid]["goals"]
        else:
            del output["achievements"][aid]
    return output
increase a value for the user
dataset/ETHPy150Open ActiDoo/gamification-engine/gengine/views.py/increase_value