Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kypo-adaptive-training
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MUNI-KYPO-CRP
backend-java
kypo-adaptive-training
Commits
d9248f99
Commit
d9248f99
authored
8 months ago
by
Mário Murín
Browse files
Options
Downloads
Patches
Plain Diff
Fix typos
parent
5eb1bc31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!142
Develop
,
!138
Resolve "Duplicate userRefId causing lockup on a parallel upload"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/cz/muni/ics/kypo/training/adaptive/service/training/TrainingRunService.java
+7
-6
7 additions, 6 deletions
...raining/adaptive/service/training/TrainingRunService.java
with
7 additions
and
6 deletions
src/main/java/cz/muni/ics/kypo/training/adaptive/service/training/TrainingRunService.java
+
7
−
6
View file @
d9248f99
...
@@ -191,10 +191,10 @@ public class TrainingRunService {
...
@@ -191,10 +191,10 @@ public class TrainingRunService {
}
}
/**
/**
* Checks whether any trainin runs exists for particular training instance
* Checks whether any trainin
g
runs exists for particular training instance
*
*
* @param trainingInstanceId the training instance id
* @param trainingInstanceId the training instance id
* @return boolean
boolean
* @return boolean
*/
*/
public
boolean
existsAnyForTrainingInstance
(
Long
trainingInstanceId
)
{
public
boolean
existsAnyForTrainingInstance
(
Long
trainingInstanceId
)
{
return
trainingRunRepository
.
existsAnyForTrainingInstance
(
trainingInstanceId
);
return
trainingRunRepository
.
existsAnyForTrainingInstance
(
trainingInstanceId
);
...
@@ -202,7 +202,7 @@ public class TrainingRunService {
...
@@ -202,7 +202,7 @@ public class TrainingRunService {
/**
/**
* Finds all Training Runs of logged
in user.
* Finds all Training Runs of logged
-
in user.
*
*
* @param pageable pageable parameter with information about pagination.
* @param pageable pageable parameter with information about pagination.
* @return {@link TrainingRun}s of logged in user.
* @return {@link TrainingRun}s of logged in user.
...
@@ -279,7 +279,8 @@ public class TrainingRunService {
...
@@ -279,7 +279,8 @@ public class TrainingRunService {
AdaptiveSmartAssistantInput
smartAssistantInput
=
this
.
gatherInputDataForSmartAssistant
(
trainingRun
,
(
TrainingPhase
)
nextPhase
,
phases
);
AdaptiveSmartAssistantInput
smartAssistantInput
=
this
.
gatherInputDataForSmartAssistant
(
trainingRun
,
(
TrainingPhase
)
nextPhase
,
phases
);
String
accessToken
=
trainingRun
.
getTrainingInstance
().
getAccessToken
();
String
accessToken
=
trainingRun
.
getTrainingInstance
().
getAccessToken
();
Long
userId
=
trainingRun
.
getParticipantRef
().
getUserRefId
();
Long
userId
=
trainingRun
.
getParticipantRef
().
getUserRefId
();
// smart assistant returns order of the tasks counted from 1 and we need to decrease the number by 1, since Java order collections from 0
// smart assistant returns order of the tasks counted from 1, and we need to decrease the number by 1,
// since Java order collections from 0
int
suitableTask
=
this
.
smartAssistantServiceApi
.
findSuitableTaskInPhase
(
smartAssistantInput
,
accessToken
,
userId
).
getSuitableTask
();
int
suitableTask
=
this
.
smartAssistantServiceApi
.
findSuitableTaskInPhase
(
smartAssistantInput
,
accessToken
,
userId
).
getSuitableTask
();
trainingRun
.
setCurrentTask
(((
TrainingPhase
)
nextPhase
).
getTasks
().
get
(
suitableTask
-
1
));
trainingRun
.
setCurrentTask
(((
TrainingPhase
)
nextPhase
).
getTasks
().
get
(
suitableTask
-
1
));
}
else
{
}
else
{
...
@@ -465,11 +466,11 @@ public class TrainingRunService {
...
@@ -465,11 +466,11 @@ public class TrainingRunService {
}
}
/**
/**
* Finds all Training Runs of specific Training Definition of logged
in user.
* Finds all Training Runs of specific Training Definition of logged
-
in user.
*
*
* @param definitionId id of Training Definition
* @param definitionId id of Training Definition
* @param pageable pageable parameter with information about pagination.
* @param pageable pageable parameter with information about pagination.
* @return {@link TrainingRun}s of specific Training Definition of logged
in user
* @return {@link TrainingRun}s of specific Training Definition of logged
-
in user
*/
*/
public
Page
<
TrainingRun
>
findAllByTrainingDefinitionAndParticipant
(
Long
definitionId
,
Pageable
pageable
)
{
public
Page
<
TrainingRun
>
findAllByTrainingDefinitionAndParticipant
(
Long
definitionId
,
Pageable
pageable
)
{
return
trainingRunRepository
.
findAllByTrainingDefinitionIdAndParticipantUserRefId
(
definitionId
,
userManagementServiceApi
.
getLoggedInUserRefId
(),
pageable
);
return
trainingRunRepository
.
findAllByTrainingDefinitionIdAndParticipantUserRefId
(
definitionId
,
userManagementServiceApi
.
getLoggedInUserRefId
(),
pageable
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment