PATCH /v2/project_sessions/:project_session_id/scale_teams/:id
Update a scale team for the given Id, associated with the given Project session
PUT /v2/project_sessions/:project_session_id/scale_teams/:id
Update a scale team for the given Id, associated with the given Project session
PATCH /v2/scale_teams/:id
Update a scale team
PUT /v2/scale_teams/:id
Update a scale team
The final_mark of the scale_team is calculated automatically from the answers values. If you want to patch the mark of a project for a student, patching the team.final_mark
is the right way to do. It will recompile the project_user.final_mark
. If you really want to update the final_mark of the scale_team, you need to patch the answers_attributes
.
live_help Notes
This action requires a token resource owner
scoped on projects with enough privileges
or an application with one of theses role(s):
assignment_ind
Advanced tutor
.
settings Params
Param name | Description |
---|---|
project_session_id |
optional
. Must be String
The project_session id |
id |
required
. Must be String
The requested id |
scale_team | optional , nil allowed . Must be a Hash |
scale_team[team_id] |
optional
. Must be Fixnum
The team id. |
scale_team[scale_id] |
optional
. Must be Fixnum
The scale id. |
scale_team[comment] |
optional
. Must be String
The comment. Maximum length is 1024. |
scale_team[flag_id] |
optional
, nil allowed
. Must be Fixnum
The flag id. |
scale_team[final_mark] |
optional
, nil allowed
. Must be Fixnum
The final mark. |
scale_team[truant_id] |
optional
, nil allowed
. Must be Fixnum
The truant id. |
scale_team[answers_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The answers attributes. |
scale_team[answers_attributes][question_id] |
optional
. Must be Fixnum
The question id. Must be unique in the scope of a given scalable entity. |
scale_team[answers_attributes][value] |
optional
, nil allowed
. Must be Fixnum
The value. |
scale_team[answers_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
Examples
PUT /v2/scale_teams/1
{
"scale_team": {
"begin_at": "2017-11-27 09:00:00 UTC",
"scale_id": "1",
"team_id": "68",
"answers_attributes": [
{
"question_id": "1",
"value": "1",
"id": "1"
},
{
"question_id": "2",
"value": "1",
"id": "2"
}
]
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"scale_team":{"begin_at":"2017-11-27 09:00:00 UTC","scale_id":"1","team_id":"68","answers_attributes":[{"question_id":"1","value":"1","id":"1"},{"question_id":"2","value":"1","id":"2"}]}}' "https://api.intra.42.fr/v2/scale_teams/1"
require "oauth2"
UID = "Your application uid"
SECRET = "Your application secret"
client = OAuth2::Client.new(UID, SECRET, site: "https://api.intra.42.fr")
token = client.client_credentials.get_token
params = {scale_team: {begin_at: "2017-11-27 09:00:00 UTC", scale_id: "1", team_id: "68", answers_attributes: [{question_id: "1", value: "1", id: "1"}, {question_id: "2", value: "1", id: "2"}]}}
response = token.put("/v2/scale_teams/1", params: params)
response.status
# => 204
response.parsed
# =>