Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
Paul-Christian Volkmer
ARSnova Backend
Commits
ead69b77
Commit
ead69b77
authored
12 years ago
by
Christoph Thelen
Browse files
Options
Downloads
Patches
Plain Diff
Questions are sorted and returned in full
parent
a1becf0a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
+6
-8
6 additions, 8 deletions
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
with
6 additions
and
8 deletions
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
+
6
−
8
View file @
ead69b77
...
...
@@ -218,17 +218,15 @@ public class CouchDBDao implements IDatabaseDao {
try
{
if
(
session
.
getCreator
().
equals
(
user
.
getUsername
()))
{
view
=
new
View
(
"skill_question/by_session_sorted_by_subject_and_text"
);
view
.
setStartKey
(
"["
+
URLEncoder
.
encode
(
"\""
+
session
.
get_id
()
+
"\""
,
"UTF-8"
)
+
"]"
);
view
.
setEndKey
(
"["
+
URLEncoder
.
encode
(
"\""
+
session
.
get_id
()
+
"\",{}"
,
"UTF-8"
)
+
"]"
);
}
else
{
if
(
user
.
getType
().
equals
(
User
.
THM
))
{
view
=
new
View
(
"skill_question/by_session_for_thm"
);
view
=
new
View
(
"skill_question/by_session_for_thm
_full
"
);
}
else
{
view
=
new
View
(
"skill_question/by_session_for_all"
);
view
=
new
View
(
"skill_question/by_session_for_all
_full
"
);
}
view
.
setKey
(
URLEncoder
.
encode
(
"\""
+
session
.
get_id
()
+
"\""
,
"UTF-8"
));
}
view
.
setStartKey
(
"["
+
URLEncoder
.
encode
(
"\""
+
session
.
get_id
()
+
"\""
,
"UTF-8"
)
+
"]"
);
view
.
setEndKey
(
"["
+
URLEncoder
.
encode
(
"\""
+
session
.
get_id
()
+
"\",{}"
,
"UTF-8"
)
+
"]"
);
ViewResults
questions
=
this
.
getDatabase
().
view
(
view
);
if
(
questions
==
null
||
questions
.
isEmpty
())
{
...
...
@@ -968,10 +966,10 @@ public class CouchDBDao implements IDatabaseDao {
"["
+
URLEncoder
.
encode
(
"\""
+
user
.
getUsername
()
+
"\",\""
+
s
.
get_id
()
+
"\""
,
"UTF-8"
)
+
"]"
);
ViewResults
results
=
this
.
getDatabase
().
view
(
view
);
List
<
Answer
>
answers
=
new
ArrayList
<
Answer
>();
if
(
results
.
getResults
().
isEmpty
())
{
throw
new
NotFoundException
()
;
return
answers
;
}
List
<
Answer
>
answers
=
new
ArrayList
<
Answer
>();
for
(
Document
d
:
results
.
getResults
())
{
Answer
a
=
(
Answer
)
JSONObject
.
toBean
(
d
.
getJSONObject
().
getJSONObject
(
"value"
),
Answer
.
class
);
a
.
set_id
(
d
.
getId
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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