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
2f5d7104
Commit
2f5d7104
authored
9 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1671: validate the value of the index (posid) against the available list of responses
parent
01bebc71
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/ims/qti/editor/FIBItemController.java
+15
-7
15 additions, 7 deletions
src/main/java/org/olat/ims/qti/editor/FIBItemController.java
with
15 additions
and
7 deletions
src/main/java/org/olat/ims/qti/editor/FIBItemController.java
+
15
−
7
View file @
2f5d7104
...
...
@@ -109,26 +109,34 @@ public class FIBItemController extends BasicController implements ControllerEven
int
posid
=
0
;
if
(
sPosid
!=
null
)
posid
=
Integer
.
parseInt
(
sPosid
);
if
(
cmd
.
equals
(
"up"
))
{
if
(
posid
>
0
)
{
List
<
Response
>
elements
=
item
.
getQuestion
().
getResponses
()
;
List
<
Response
>
elements
=
item
.
getQuestion
().
getResponses
();
if
(
posid
>
0
&&
posid
<
item
.
getQuestion
().
getResponses
()
.
size
())
{
Response
obj
=
elements
.
remove
(
posid
);
elements
.
add
(
posid
-
1
,
obj
);
}
else
{
logError
(
"posid doesn't match responses length: "
+
posid
+
"/"
+
elements
.
size
(),
null
);
}
}
else
if
(
cmd
.
equals
(
"down"
))
{
List
<
Response
>
elements
=
item
.
getQuestion
().
getResponses
();
if
(
posid
<
elements
.
size
()
-
1
)
{
if
(
posid
>=
0
&&
posid
<
elements
.
size
()
-
1
)
{
Response
obj
=
elements
.
remove
(
posid
);
elements
.
add
(
posid
+
1
,
obj
);
}
else
{
logError
(
"posid doesn't match responses length: "
+
posid
+
"/"
+
elements
.
size
(),
null
);
}
}
else
if
(
cmd
.
equals
(
"editq"
))
{
editQuestion
=
item
.
getQuestion
().
getQuestion
();
displayMaterialFormController
(
ureq
,
editQuestion
,
restrictedEdit
);
}
else
if
(
cmd
.
equals
(
"editr"
))
{
editResponse
=
item
.
getQuestion
().
getResponses
().
get
(
posid
);
Material
responseMat
=
item
.
getQuestion
().
getResponses
().
get
(
posid
).
getContent
();
displayMaterialFormController
(
ureq
,
responseMat
,
restrictedEdit
);
List
<
Response
>
elements
=
item
.
getQuestion
().
getResponses
();
if
(
posid
>=
0
&&
posid
<
elements
.
size
())
{
editResponse
=
elements
.
get
(
posid
);
Material
responseMat
=
elements
.
get
(
posid
).
getContent
();
displayMaterialFormController
(
ureq
,
responseMat
,
restrictedEdit
);
}
else
{
logError
(
"posid doesn't match responses length: "
+
posid
+
"/"
+
elements
.
size
(),
null
);
}
}
else
if
(
cmd
.
equals
(
"addtext"
))
{
FIBQuestion
fib
=
(
FIBQuestion
)
item
.
getQuestion
();
FIBResponse
response
=
new
FIBResponse
();
...
...
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