add license
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
@startuml domain-layer
|
||||
skinparam classAttributeIconSize 0
|
||||
skinparam nodesep 20
|
||||
skinparam ranksep 30
|
||||
skinparam defaultFontSize 9
|
||||
skinparam wrapWidth 150
|
||||
|
||||
scale 2000 width
|
||||
package "domain" #DDFFDD {
|
||||
|
||||
class Task <<Aggregate Root>> {
|
||||
-id: TaskId
|
||||
-name: TaskName
|
||||
-description: Description
|
||||
-scripts: Map<ScriptType, Script>
|
||||
+create(): Task
|
||||
+setScript(script)
|
||||
+canVerify(): boolean
|
||||
}
|
||||
|
||||
class TaskId <<VO>>
|
||||
class TaskName <<VO>>
|
||||
class Description <<VO>>
|
||||
class Script <<VO>> {
|
||||
+isExecutable(): boolean
|
||||
}
|
||||
enum ScriptType {
|
||||
INITIALIZATION
|
||||
VERIFICATION
|
||||
DELETION
|
||||
}
|
||||
|
||||
interface TaskRepository <<Port>> {
|
||||
+findByContextId(uuid): Optional<Task>
|
||||
+save(task): Task
|
||||
}
|
||||
|
||||
interface ScriptExecutor <<Port>> {
|
||||
+runVerificationScript(id, script): boolean
|
||||
}
|
||||
|
||||
interface LMSGateway <<Port>> {
|
||||
+exchangeForAccessToken(clientId): String
|
||||
}
|
||||
|
||||
interface HistoryRepository <<Port>> {
|
||||
+logAction(deployId, contextId, type, msg)
|
||||
}
|
||||
}
|
||||
|
||||
Task *-- TaskId
|
||||
Task *-- TaskName
|
||||
Task *-- Description
|
||||
Task *-- Script
|
||||
Script -- ScriptType
|
||||
|
||||
TaskRepository ..> Task
|
||||
|
||||
Task <.down... "TaskServiceImpl\n(application)" : uses
|
||||
TaskRepository <|.down.... "TaskRepositoryAdapter\n(infrastructure)" : implements
|
||||
ScriptExecutor <|.down.... "BashScriptAdapter\n(infrastructure)" : implements
|
||||
LMSGateway <|.down.... "LMSRestAdapter\n(infrastructure)" : implements
|
||||
HistoryRepository <|.down.... "HistoryJpaAdapter\n(infrastructure)" : implements
|
||||
|
||||
@enduml
|
||||
@@ -0,0 +1,124 @@
|
||||
@startuml lti-grading-flow
|
||||
skinparam defaultFontSize 10
|
||||
skinparam sequenceMessageAlign center
|
||||
scale 1200 width
|
||||
|
||||
title LTI 1.3 - Отправка оценки в LMS (Assignment and Grade Services)
|
||||
|
||||
actor "Студент" as Student
|
||||
participant "TaskController" as Controller #DDDDFF
|
||||
participant "TaskServiceImpl" as TaskService #DDDDFF
|
||||
participant "ScriptExecutor\n(BashAdapter)" as ScriptExecutor #FFDDDD
|
||||
participant "LMSGateway\n(LMSRestAdapter)" as LMSGateway #FFDDDD
|
||||
participant "ResultServiceImpl" as ResultService #DDDDFF
|
||||
participant "JwtService" as JwtService #DDDDFF
|
||||
participant "LMS\n(Canvas/Moodle)" as LMS #EEEEEE
|
||||
|
||||
== Отправка задания на проверку ==
|
||||
|
||||
Student -> Controller: POST /tool/lti/submit
|
||||
activate Controller
|
||||
|
||||
Controller -> TaskService: checkTask(CheckTaskRequest)
|
||||
activate TaskService
|
||||
note right
|
||||
CheckTaskRequest содержит:
|
||||
- contextId (UUID задачи)
|
||||
- clientId (LMS client)
|
||||
- idToken (JWT с данными пользователя)
|
||||
end note
|
||||
|
||||
TaskService -> TaskService: findByContextId(contextId)
|
||||
TaskService -> TaskService: getVerificationScript()
|
||||
|
||||
TaskService -> ScriptExecutor: runVerificationScript(contextId, script)
|
||||
activate ScriptExecutor
|
||||
note right
|
||||
Запуск bash скрипта
|
||||
с проверками:
|
||||
- Docker контейнеры
|
||||
- Kubernetes ресурсы
|
||||
- Тесты приложения
|
||||
end note
|
||||
ScriptExecutor --> TaskService: boolean (true/false)
|
||||
deactivate ScriptExecutor
|
||||
|
||||
TaskService -> LMSGateway: exchangeForAccessToken(clientId)
|
||||
activate LMSGateway
|
||||
|
||||
LMSGateway -> LMSGateway: generateClientAssertion(clientId)
|
||||
note right
|
||||
JWT assertion для OAuth 2.0
|
||||
с приватным ключом
|
||||
end note
|
||||
|
||||
LMSGateway -> LMS: POST /lti/token\nContent-Type: application/x-www-form-urlencoded
|
||||
note right
|
||||
Body:
|
||||
- grant_type: client_credentials
|
||||
- client_assertion_type: jwt-bearer
|
||||
- client_assertion: <JWT>
|
||||
- scope: AGS scopes
|
||||
end note
|
||||
activate LMS
|
||||
|
||||
LMS --> LMSGateway: access_token
|
||||
deactivate LMS
|
||||
LMSGateway --> TaskService: accessToken
|
||||
deactivate LMSGateway
|
||||
|
||||
TaskService -> ResultService: setResult(accessToken, idToken, passed)
|
||||
activate ResultService
|
||||
|
||||
ResultService -> JwtService: getTokenPayload(idToken)
|
||||
activate JwtService
|
||||
JwtService --> ResultService: IdTokenPayload
|
||||
deactivate JwtService
|
||||
note right
|
||||
IdTokenPayload содержит:
|
||||
- sub (user ID)
|
||||
- tokenEndpoint.lineitem
|
||||
(URL для отправки оценки)
|
||||
end note
|
||||
|
||||
ResultService -> ResultService: buildResultRequest(passed)
|
||||
note right
|
||||
ResultRequest:
|
||||
- scoreGiven: 1 или 0
|
||||
- scoreMaximum: 1
|
||||
- activityProgress: Completed
|
||||
- gradingProgress: FullyGraded
|
||||
- timestamp: now()
|
||||
- userId: sub
|
||||
end note
|
||||
|
||||
ResultService -> LMS: POST {lineitem}/scores/result\nAuthorization: Bearer {accessToken}\nContent-Type: application/vnd.ims.lis.v1.score+json
|
||||
activate LMS
|
||||
note right
|
||||
LTI Advantage
|
||||
Assignment and Grade Services (AGS)
|
||||
|
||||
Отправка оценки согласно
|
||||
IMS LTI 1.3 спецификации
|
||||
end note
|
||||
|
||||
LMS --> ResultService: 200 OK (оценка сохранена)
|
||||
deactivate LMS
|
||||
|
||||
ResultService --> TaskService: void
|
||||
deactivate ResultService
|
||||
|
||||
TaskService --> Controller: ResultResponse("success"/"failed")
|
||||
deactivate TaskService
|
||||
|
||||
Controller --> Student: HTTP 202 Accepted\n{"status": "success"}
|
||||
deactivate Controller
|
||||
|
||||
== Результат в LMS ==
|
||||
|
||||
Student -> LMS: Просмотр оценок
|
||||
activate LMS
|
||||
LMS --> Student: Оценка: 1/1 (100%) или 0/1 (0%)
|
||||
deactivate LMS
|
||||
|
||||
@enduml
|
||||
Reference in New Issue
Block a user