Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
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
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
db733b4a
Commit
db733b4a
authored
9 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1593: pre process the efficiency statement in the upgrader
parent
f66aacc7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/upgrade/OLATUpgrade_11_0_0.java
+27
-1
27 additions, 1 deletion
src/main/java/org/olat/upgrade/OLATUpgrade_11_0_0.java
with
27 additions
and
1 deletion
src/main/java/org/olat/upgrade/OLATUpgrade_11_0_0.java
+
27
−
1
View file @
db733b4a
...
@@ -126,6 +126,7 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade {
...
@@ -126,6 +126,7 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade {
private
static
final
int
BATCH_SIZE
=
50
;
private
static
final
int
BATCH_SIZE
=
50
;
private
static
final
String
ASSESSMENT_DATAS
=
"ASSESSMENT PROPERTY TABLE"
;
private
static
final
String
ASSESSMENT_DATAS
=
"ASSESSMENT PROPERTY TABLE"
;
private
static
final
String
EFFICIENCY_STATEMENT_DATAS
=
"EFFICIENCY STATEMENT TABLE"
;
private
static
final
String
VERSION
=
"OLAT_11.0.0"
;
private
static
final
String
VERSION
=
"OLAT_11.0.0"
;
private
final
Map
<
Long
,
Boolean
>
qtiEssayMap
=
new
HashMap
<>();
private
final
Map
<
Long
,
Boolean
>
qtiEssayMap
=
new
HashMap
<>();
...
@@ -170,6 +171,7 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade {
...
@@ -170,6 +171,7 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade {
}
}
boolean
allOk
=
true
;
boolean
allOk
=
true
;
allOk
&=
upgradeEfficiencyStatementTable
(
upgradeManager
,
uhd
);
allOk
&=
upgradeAssessmentPropertyTable
(
upgradeManager
,
uhd
);
allOk
&=
upgradeAssessmentPropertyTable
(
upgradeManager
,
uhd
);
uhd
.
setInstallationComplete
(
allOk
);
uhd
.
setInstallationComplete
(
allOk
);
...
@@ -181,6 +183,31 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade {
...
@@ -181,6 +183,31 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade {
}
}
return
allOk
;
return
allOk
;
}
}
private
boolean
upgradeEfficiencyStatementTable
(
UpgradeManager
upgradeManager
,
UpgradeHistoryData
uhd
)
{
boolean
allOk
=
true
;
if
(!
uhd
.
getBooleanDataValue
(
EFFICIENCY_STATEMENT_DATAS
))
{
int
counter
=
0
;
final
Roles
roles
=
new
Roles
(
true
,
true
,
true
,
true
,
false
,
true
,
false
);
final
SearchRepositoryEntryParameters
params
=
new
SearchRepositoryEntryParameters
();
params
.
setRoles
(
roles
);
params
.
setResourceTypes
(
Collections
.
singletonList
(
"CourseModule"
));
List
<
RepositoryEntry
>
courses
;
do
{
courses
=
repositoryManager
.
genericANDQueryWithRolesRestriction
(
params
,
counter
,
50
,
true
);
for
(
RepositoryEntry
course:
courses
)
{
convertUserEfficiencyStatemen
(
course
);
}
counter
+=
courses
.
size
();
log
.
audit
(
"Efficiency statement data migration processed: "
+
courses
.
size
()
+
", total processed ("
+
counter
+
")"
);
dbInstance
.
commitAndCloseSession
();
}
while
(
courses
.
size
()
==
BATCH_SIZE
);
uhd
.
setBooleanDataValue
(
EFFICIENCY_STATEMENT_DATAS
,
allOk
);
upgradeManager
.
setUpgradesHistory
(
uhd
,
VERSION
);
}
return
allOk
;
}
private
boolean
upgradeAssessmentPropertyTable
(
UpgradeManager
upgradeManager
,
UpgradeHistoryData
uhd
)
{
private
boolean
upgradeAssessmentPropertyTable
(
UpgradeManager
upgradeManager
,
UpgradeHistoryData
uhd
)
{
boolean
allOk
=
true
;
boolean
allOk
=
true
;
...
@@ -195,7 +222,6 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade {
...
@@ -195,7 +222,6 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade {
do
{
do
{
courses
=
repositoryManager
.
genericANDQueryWithRolesRestriction
(
params
,
counter
,
50
,
true
);
courses
=
repositoryManager
.
genericANDQueryWithRolesRestriction
(
params
,
counter
,
50
,
true
);
for
(
RepositoryEntry
course:
courses
)
{
for
(
RepositoryEntry
course:
courses
)
{
convertUserEfficiencyStatemen
(
course
);
allOk
&=
processCourseAssessmentData
(
course
);
allOk
&=
processCourseAssessmentData
(
course
);
}
}
counter
+=
courses
.
size
();
counter
+=
courses
.
size
();
...
...
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