Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fltrail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
fides
fltrail
Commits
bc56231d
Commit
bc56231d
authored
6 years ago
by
Axel
Browse files
Options
Downloads
Patches
Plain Diff
fix: corrected path
parent
782c158a
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
gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/QuizView.java
+9
-7
9 additions, 7 deletions
...tsdam/gf/modules/assessment/controller/view/QuizView.java
with
9 additions
and
7 deletions
gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/QuizView.java
+
9
−
7
View file @
bc56231d
...
...
@@ -2,8 +2,6 @@ package unipotsdam.gf.modules.assessment.controller.view;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
unipotsdam.gf.modules.assessment.controller.model.Quiz
;
import
unipotsdam.gf.modules.communication.model.SampleAnswer
;
import
unipotsdam.gf.modules.communication.service.SampleService
;
import
unipotsdam.gf.modules.communication.view.SampleView
;
import
javax.ws.rs.GET
;
...
...
@@ -11,9 +9,9 @@ import javax.ws.rs.Path;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
@Path
(
"/rest"
)
class
QuizView
{
...
...
@@ -21,14 +19,18 @@ class QuizView {
@GET
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"/quiz/{projectId}/{quizId}"
)
public
Quiz
exampleQuiz
(
@PathParam
(
"projectId"
)
String
name
,
@PathParam
(
"quizId"
)
String
quiz
)
{
@Path
(
"quiz/{projectId}/{quizId}"
)
public
Response
exampleQuiz
(
@PathParam
(
"projectId"
)
String
name
,
@PathParam
(
"quizId"
)
String
quiz
)
{
String
[]
correctAnswers
=
new
String
[
2
];
correctAnswers
[
0
]
=
"42"
;
correctAnswers
[
1
]
=
"24"
;
String
[]
wrongAnswers
=
{
"a god created creature"
,
"a some of my mistakes"
};
String
[]
wrongAnswers
=
{
"a god created creature"
,
"a sum of my mistakes"
};
if
(
false
){
return
Response
.
status
(
Response
.
Status
.
NOT_FOUND
).
entity
(
"Entity not found for UUID: "
+
name
).
build
();
}
Quiz
sampleQuiz
=
new
Quiz
(
"multiple"
,
"Who am I and if so, how many?"
,
correctAnswers
,
wrongAnswers
);
log
.
info
(
"HelloWorldview helloWorld Method answered: "
+
sampleQuiz
.
toString
());
return
sampleQuiz
;
return
Response
.
ok
(
sampleQuiz
.
toString
(),
MediaType
.
APPLICATION_JSON
).
build
()
;
}
}
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