Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
ARSnova LMS Connector
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
ARSnova
ARSnova LMS Connector
Commits
1105640e
Commit
1105640e
authored
Sep 15, 2014
by
Andreas Gärtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added verification if a leaf node (tst) is flagged as online.
parent
c6b2bad6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
connector-service/src/main/java/de/thm/arsnova/connector/dao/IliasConnectorDaoImpl.java
...a/de/thm/arsnova/connector/dao/IliasConnectorDaoImpl.java
+21
-0
connector-service/src/main/java/de/thm/arsnova/connector/dao/UniRepDao.java
...src/main/java/de/thm/arsnova/connector/dao/UniRepDao.java
+7
-0
connector-service/src/main/java/de/thm/arsnova/connector/services/UniRepServiceImpl.java
.../de/thm/arsnova/connector/services/UniRepServiceImpl.java
+1
-1
No files found.
connector-service/src/main/java/de/thm/arsnova/connector/dao/IliasConnectorDaoImpl.java
View file @
1105640e
...
...
@@ -203,6 +203,27 @@ public class IliasConnectorDaoImpl implements UniRepDao {
}
);
}
@Override
public
boolean
isTestOnline
(
final
int
refId
)
{
final
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
(
dataSource
);
return
jdbcTemplate
.
queryForObject
(
"SELECT online_status FROM tree AS t1 "
+
"JOIN tree AS t2 ON t2.lft BETWEEN t1.lft AND t1.rgt AND t1.tree = t2.tree "
+
"JOIN object_reference AS r ON r.ref_id=t2.child "
+
"JOIN object_data as d ON d.obj_id=r.obj_id "
+
"JOIN tst_tests as tests ON tests.obj_fi=r.obj_id "
+
"WHERE t1.child = ?"
,
new
String
[]
{
String
.
valueOf
(
refId
)},
new
RowMapper
<
Boolean
>()
{
@Override
public
Boolean
mapRow
(
final
ResultSet
resultSet
,
final
int
row
)
throws
SQLException
{
return
resultSet
.
getBoolean
(
"online_status"
);
}
}
);
}
@Override
public
boolean
isRandomQuestionSet
(
final
int
refId
)
{
...
...
connector-service/src/main/java/de/thm/arsnova/connector/dao/UniRepDao.java
View file @
1105640e
...
...
@@ -38,6 +38,13 @@ public interface UniRepDao {
* @return A map with reference id - meta data value pairs
*/
Map
<
String
,
String
>
getReferenceIdsWithMetaDataFlag
(
String
metaDataTitle
);
/** Returns TRUE if referenced repository object is a test which is flagged as online
*
* @param refId The reference id of the test to be checked
* @return TRUE if this object is a test which is flagged as online
*/
boolean
isTestOnline
(
int
refId
);
/** Returns TRUE if referenced repository object is a test with random question selection
*
...
...
connector-service/src/main/java/de/thm/arsnova/connector/services/UniRepServiceImpl.java
View file @
1105640e
...
...
@@ -95,7 +95,7 @@ public class UniRepServiceImpl implements UniRepService {
}
if
(
node
.
getChildren
()
==
null
||
node
.
getChildren
().
size
()
==
0
)
{
if
(
node
.
getQuestionCount
()
==
0
)
{
if
(
node
.
getQuestionCount
()
==
0
||
!
uniRepDao
.
isTestOnline
(
node
.
getId
())
)
{
it
.
remove
();
hasRemovedNodes
=
true
;
continue
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment