generated from VLADIMIR/template
add questions
This commit is contained in:
+187
@@ -365,6 +365,38 @@ service EveningDetectiveServer {
|
||||
};
|
||||
}
|
||||
|
||||
rpc AddScenarioQuestion(AddScenarioQuestionReq) returns (AddScenarioQuestionRsp) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/scenarios/{id}/questions"
|
||||
body: "*"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
tags : "Вопросы сценария";
|
||||
summary: "Создать вопрос дела";
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateScenarioQuestion(UpdateScenarioQuestionReq) returns (UpdateScenarioQuestionRsp) {
|
||||
option (google.api.http) = {
|
||||
put : "/api/scenarios/{id}/questions/{code}"
|
||||
body: "*"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
tags : "Вопросы сценария";
|
||||
summary: "Обновить вопрос дела";
|
||||
};
|
||||
}
|
||||
|
||||
rpc DeleteScenarioQuestion(DeleteScenarioQuestionReq) returns (DeleteScenarioQuestionRsp) {
|
||||
option (google.api.http) = {
|
||||
delete: "/api/scenarios/{id}/questions/{code}"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
tags : "Вопросы сценария";
|
||||
summary: "Удалить вопрос дела";
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateScenarioIntro(UpdateScenarioIntroReq) returns (UpdateScenarioIntroRsp) {
|
||||
option (google.api.http) = {
|
||||
put : "/api/scenarios/{id}/introduction"
|
||||
@@ -428,6 +460,16 @@ service EveningDetectiveServer {
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetGameAnswers(GetGameAnswersReq) returns (GetGameAnswersRsp) {
|
||||
option (google.api.http) = {
|
||||
get: "/api/games/{gameId}/answers"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
tags : "Игры";
|
||||
summary: "Получить ответы команд на вопросы дела (для оценки организатором)";
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateGame(UpdateGameReq) returns (UpdateGameRsp) {
|
||||
option (google.api.http) = {
|
||||
put : "/api/games/{id}"
|
||||
@@ -583,6 +625,44 @@ service EveningDetectiveServer {
|
||||
summary: "Удалить последний ход";
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetTeamAnswers(GetTeamAnswersReq) returns (GetTeamAnswersRsp) {
|
||||
option (google.api.http) = {
|
||||
get: "/api/teams/{id}/answers"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
security: {
|
||||
security_requirement: {}
|
||||
}
|
||||
tags : "Ходы";
|
||||
summary: "Получить ответы команды на вопросы дела";
|
||||
};
|
||||
}
|
||||
|
||||
rpc SubmitTeamAnswers(SubmitTeamAnswersReq) returns (SubmitTeamAnswersRsp) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/teams/{id}/answers"
|
||||
body: "*"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
security: {
|
||||
security_requirement: {}
|
||||
}
|
||||
tags : "Ходы";
|
||||
summary: "Отправить ответы команды на вопросы дела";
|
||||
};
|
||||
}
|
||||
|
||||
rpc SetTeamAnswerScore(SetTeamAnswerScoreReq) returns (SetTeamAnswerScoreRsp) {
|
||||
option (google.api.http) = {
|
||||
put : "/api/teams/{id}/answers/{questionCode}/score"
|
||||
body: "*"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
tags : "Игры";
|
||||
summary: "Выставить балл команде за ответ на вопрос дела";
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message PingReq {}
|
||||
@@ -792,6 +872,7 @@ message Scenario {
|
||||
message Story {
|
||||
Introduction introduction = 2;
|
||||
repeated Place places = 1;
|
||||
repeated Question questions = 3;
|
||||
}
|
||||
|
||||
message Introduction {
|
||||
@@ -829,6 +910,43 @@ message Key {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// Вопрос дела - вопрос, на который команда должна ответить в конце игры.
|
||||
// Правильный ответ (answer) виден только автору сценария и организаторам
|
||||
// (при оценке ответов команд), команде не передаётся.
|
||||
message Question {
|
||||
// Код вопроса - используется при отправке ответов командой
|
||||
string code = 1;
|
||||
|
||||
// Текст вопроса
|
||||
string text = 2;
|
||||
|
||||
// Правильный ответ (справка для организатора при оценке)
|
||||
string answer = 3;
|
||||
}
|
||||
|
||||
// Ответ команды на вопрос дела
|
||||
message Answer {
|
||||
// Код вопроса
|
||||
string questionCode = 1;
|
||||
|
||||
// Текст ответа команды
|
||||
string answer = 2;
|
||||
}
|
||||
|
||||
// Ответ команды с баллом (для панели организатора)
|
||||
message AnswerScore {
|
||||
string questionCode = 1;
|
||||
string answer = 2;
|
||||
// Балл, выставленный организатором; отсутствует, если ещё не оценено
|
||||
optional int32 score = 3;
|
||||
}
|
||||
|
||||
// Ответы одной команды на вопросы дела
|
||||
message TeamAnswers {
|
||||
Team team = 1;
|
||||
repeated AnswerScore answers = 2;
|
||||
}
|
||||
|
||||
message UpdateScenarioReq {
|
||||
int32 id = 1;
|
||||
string name = 2;
|
||||
@@ -901,6 +1019,34 @@ message UpdateScenarioIntroRsp {
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
message AddScenarioQuestionReq {
|
||||
int32 id = 1;
|
||||
Question question = 2;
|
||||
}
|
||||
|
||||
message AddScenarioQuestionRsp {
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
message UpdateScenarioQuestionReq {
|
||||
int32 id = 1;
|
||||
string code = 2;
|
||||
Question question = 3;
|
||||
}
|
||||
|
||||
message UpdateScenarioQuestionRsp {
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
message DeleteScenarioQuestionReq {
|
||||
int32 id = 1;
|
||||
string code = 2;
|
||||
}
|
||||
|
||||
message DeleteScenarioQuestionRsp {
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
message DownloadScenarioArchiveReq {
|
||||
int32 id = 1;
|
||||
}
|
||||
@@ -959,6 +1105,16 @@ message GetGameRsp {
|
||||
Game game = 2;
|
||||
}
|
||||
|
||||
message GetGameAnswersReq {
|
||||
int32 gameId = 1;
|
||||
}
|
||||
|
||||
message GetGameAnswersRsp {
|
||||
string error = 1;
|
||||
repeated Question questions = 2;
|
||||
repeated TeamAnswers teams = 3;
|
||||
}
|
||||
|
||||
message UpdateGameReq {
|
||||
int32 id = 1;
|
||||
string name = 2;
|
||||
@@ -1084,3 +1240,34 @@ message DeleteLastTeamActionReq {
|
||||
message DeleteLastTeamActionRsp {
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
message GetTeamAnswersReq {
|
||||
int64 id = 1;
|
||||
string password = 2;
|
||||
}
|
||||
|
||||
message GetTeamAnswersRsp {
|
||||
string error = 1;
|
||||
repeated Answer answers = 2;
|
||||
}
|
||||
|
||||
message SubmitTeamAnswersReq {
|
||||
int64 id = 1;
|
||||
string password = 2;
|
||||
repeated Answer answers = 3;
|
||||
}
|
||||
|
||||
message SubmitTeamAnswersRsp {
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
message SetTeamAnswerScoreReq {
|
||||
int64 id = 1;
|
||||
string questionCode = 2;
|
||||
// Балл; отсутствует — сбросить выставленный балл
|
||||
optional int32 score = 3;
|
||||
}
|
||||
|
||||
message SetTeamAnswerScoreRsp {
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user