Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Plan
Issues
27
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
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
ARSnova
ARSnova Backend
Commits
33008507
Commit
33008507
authored
12 years ago
by
Christoph Thelen
Browse files
Options
Downloads
Plain Diff
Merge of changes for #4026 and #4029.
parents
55358aec
6a19b0f6
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
+9
-4
9 additions, 4 deletions
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
src/main/java/de/thm/arsnova/socket/message/Question.java
+18
-0
18 additions, 0 deletions
src/main/java/de/thm/arsnova/socket/message/Question.java
with
27 additions
and
4 deletions
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
+
9
−
4
View file @
33008507
...
@@ -188,7 +188,12 @@ public class CouchDBDao implements IDatabaseDao {
...
@@ -188,7 +188,12 @@ public class CouchDBDao implements IDatabaseDao {
}
}
@Override
@Override
public
List
<
Question
>
getSkillQuestions
(
String
session
,
String
sort
)
{
public
List
<
Question
>
getSkillQuestions
(
String
sessionKeyword
,
String
sort
)
{
Session
session
=
this
.
getSessionFromKeyword
(
sessionKeyword
);
if
(
session
==
null
)
{
return
null
;
}
String
viewName
=
""
;
String
viewName
=
""
;
if
(
sort
!=
null
&&
sort
.
equals
(
"text"
))
{
if
(
sort
!=
null
&&
sort
.
equals
(
"text"
))
{
viewName
=
"skill_question/by_session_sorted_by_subject_and_text"
;
viewName
=
"skill_question/by_session_sorted_by_subject_and_text"
;
...
@@ -197,9 +202,9 @@ public class CouchDBDao implements IDatabaseDao {
...
@@ -197,9 +202,9 @@ public class CouchDBDao implements IDatabaseDao {
}
}
try
{
try
{
View
view
=
new
View
(
viewName
);
View
view
=
new
View
(
viewName
);
view
.
setStartKey
(
"["
+
URLEncoder
.
encode
(
"\""
+
session
+
"\""
,
"UTF-8"
)
+
"]"
);
view
.
setStartKey
(
"["
+
URLEncoder
.
encode
(
"\""
+
session
.
get_id
()
+
"\""
,
"UTF-8"
)
+
"]"
);
view
.
setEndKey
(
"["
+
URLEncoder
.
encode
(
"\""
+
session
+
"\",{}"
,
"UTF-8"
)
+
"]"
);
view
.
setEndKey
(
"["
+
URLEncoder
.
encode
(
"\""
+
session
.
get_id
()
+
"\",{}"
,
"UTF-8"
)
+
"]"
);
ViewResults
questions
=
this
.
getDatabase
().
view
(
view
);
ViewResults
questions
=
this
.
getDatabase
().
view
(
view
);
if
(
questions
==
null
||
questions
.
isEmpty
())
{
if
(
questions
==
null
||
questions
.
isEmpty
())
{
return
null
;
return
null
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/thm/arsnova/socket/message/Question.java
+
18
−
0
View file @
33008507
...
@@ -37,6 +37,8 @@ public class Question {
...
@@ -37,6 +37,8 @@ public class Question {
private
int
number
;
private
int
number
;
private
int
duration
;
private
int
duration
;
private
String
_id
;
private
String
_rev
;
public
String
getType
()
{
public
String
getType
()
{
...
@@ -135,6 +137,22 @@ public class Question {
...
@@ -135,6 +137,22 @@ public class Question {
this
.
duration
=
duration
;
this
.
duration
=
duration
;
}
}
public
String
get_id
()
{
return
_id
;
}
public
void
set_id
(
String
_id
)
{
this
.
_id
=
_id
;
}
public
String
get_rev
()
{
return
_rev
;
}
public
void
set_rev
(
String
_rev
)
{
this
.
_rev
=
_rev
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"Question type '"
+
this
.
questionType
+
"': "
+
this
.
subject
+
";\n"
+
this
.
text
+
return
"Question type '"
+
this
.
questionType
+
"': "
+
this
.
subject
+
";\n"
+
this
.
text
+
...
...
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