fixed proctoring room update in connection setup
This commit is contained in:
parent
9fbc5bdbc1
commit
c863fd0f03
4 changed files with 29 additions and 18 deletions
|
@ -90,9 +90,6 @@ public interface ClientConnectionDAO extends
|
||||||
* @return Result refer to a collection of all ClientConnection records for update or to an error when happened */
|
* @return Result refer to a collection of all ClientConnection records for update or to an error when happened */
|
||||||
Result<Collection<ClientConnectionRecord>> getAllConnectionIdsForRoomUpdateInactive();
|
Result<Collection<ClientConnectionRecord>> getAllConnectionIdsForRoomUpdateInactive();
|
||||||
|
|
||||||
/** Used to re-mark a client connection record for room update in error case. */
|
|
||||||
void setNeedsRoomUpdate(Long connectionId);
|
|
||||||
|
|
||||||
/** Get all ClientConnection that are assigned to a defined proctoring collecting room.
|
/** Get all ClientConnection that are assigned to a defined proctoring collecting room.
|
||||||
*
|
*
|
||||||
* @param roomId The proctoring room identifier
|
* @param roomId The proctoring room identifier
|
||||||
|
@ -132,6 +129,7 @@ public interface ClientConnectionDAO extends
|
||||||
key = "#connectionToken")
|
key = "#connectionToken")
|
||||||
Result<Void> removeFromProctoringRoom(Long connectionId, String connectionToken);
|
Result<Void> removeFromProctoringRoom(Long connectionId, String connectionToken);
|
||||||
|
|
||||||
|
/** Used to re-mark a client connection record for room update in error case. */
|
||||||
Result<Void> markForProctoringUpdate(Long id);
|
Result<Void> markForProctoringUpdate(Long id);
|
||||||
|
|
||||||
/** Deletes the given ClientConnection data.
|
/** Deletes the given ClientConnection data.
|
||||||
|
|
|
@ -285,16 +285,6 @@ public class ClientConnectionDAOImpl implements ClientConnectionDAO {
|
||||||
.onError(TransactionHandler::rollback);
|
.onError(TransactionHandler::rollback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public void setNeedsRoomUpdate(final Long connectionId) {
|
|
||||||
final ClientConnectionRecord updateRecord = new ClientConnectionRecord(
|
|
||||||
connectionId, null, null, null, null, null,
|
|
||||||
null, null, null, null, null, null, null,
|
|
||||||
1);
|
|
||||||
this.clientConnectionRecordMapper.updateByPrimaryKeySelective(updateRecord);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public Result<Collection<ClientConnection>> getRoomConnections(final Long roomId) {
|
public Result<Collection<ClientConnection>> getRoomConnections(final Long roomId) {
|
||||||
|
|
|
@ -66,22 +66,22 @@ public class MockupLmsAPITemplate implements LmsAPITemplate {
|
||||||
"2020-01-01T09:00:00Z", null, "http://lms.mockup.com/api/"));
|
"2020-01-01T09:00:00Z", null, "http://lms.mockup.com/api/"));
|
||||||
this.mockups.add(new QuizData(
|
this.mockups.add(new QuizData(
|
||||||
"quiz2", institutionId, lmsSetupId, lmsType, "Demo Quiz 2 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
"quiz2", institutionId, lmsSetupId, lmsType, "Demo Quiz 2 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
||||||
"2020-01-01T09:00:00Z", "2022-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
|
"2020-01-01T09:00:00Z", "2025-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
|
||||||
this.mockups.add(new QuizData(
|
this.mockups.add(new QuizData(
|
||||||
"quiz3", institutionId, lmsSetupId, lmsType, "Demo Quiz 3 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
"quiz3", institutionId, lmsSetupId, lmsType, "Demo Quiz 3 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
||||||
"2018-07-30T09:00:00Z", "2018-08-01T00:00:00Z", "http://lms.mockup.com/api/"));
|
"2018-07-30T09:00:00Z", "2018-08-01T00:00:00Z", "http://lms.mockup.com/api/"));
|
||||||
this.mockups.add(new QuizData(
|
this.mockups.add(new QuizData(
|
||||||
"quiz4", institutionId, lmsSetupId, lmsType, "Demo Quiz 4 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
"quiz4", institutionId, lmsSetupId, lmsType, "Demo Quiz 4 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
||||||
"2018-01-01T00:00:00Z", "2019-01-01T00:00:00Z", "http://lms.mockup.com/api/"));
|
"2018-01-01T00:00:00Z", "2025-01-01T00:00:00Z", "http://lms.mockup.com/api/"));
|
||||||
this.mockups.add(new QuizData(
|
this.mockups.add(new QuizData(
|
||||||
"quiz5", institutionId, lmsSetupId, lmsType, "Demo Quiz 5 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
"quiz5", institutionId, lmsSetupId, lmsType, "Demo Quiz 5 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
||||||
"2018-01-01T09:00:00Z", "2022-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
|
"2018-01-01T09:00:00Z", "2025-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
|
||||||
this.mockups.add(new QuizData(
|
this.mockups.add(new QuizData(
|
||||||
"quiz6", institutionId, lmsSetupId, lmsType, "Demo Quiz 6 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
"quiz6", institutionId, lmsSetupId, lmsType, "Demo Quiz 6 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
||||||
"2019-01-01T09:00:00Z", "2022-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
|
"2019-01-01T09:00:00Z", "2025-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
|
||||||
this.mockups.add(new QuizData(
|
this.mockups.add(new QuizData(
|
||||||
"quiz7", institutionId, lmsSetupId, lmsType, "Demo Quiz 7 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
"quiz7", institutionId, lmsSetupId, lmsType, "Demo Quiz 7 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
|
||||||
"2018-01-01T09:00:00Z", "2022-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
|
"2018-01-01T09:00:00Z", "2025-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
|
||||||
|
|
||||||
this.mockups.add(new QuizData(
|
this.mockups.add(new QuizData(
|
||||||
"quiz10", institutionId, lmsSetupId, lmsType, "Demo Quiz 10 (MOCKUP)",
|
"quiz10", institutionId, lmsSetupId, lmsType, "Demo Quiz 10 (MOCKUP)",
|
||||||
|
|
|
@ -392,8 +392,15 @@ public class SEBClientConnectionServiceImpl implements SEBClientConnectionServic
|
||||||
.save(connectionToSave)
|
.save(connectionToSave)
|
||||||
.getOrThrow();
|
.getOrThrow();
|
||||||
|
|
||||||
|
// check exam integrity for established connection
|
||||||
checkExamIntegrity(establishedClientConnection.examId);
|
checkExamIntegrity(establishedClientConnection.examId);
|
||||||
|
|
||||||
|
// if proctoring is enabled for exam, mark for room update
|
||||||
|
if (proctoringEnabled) {
|
||||||
|
this.clientConnectionDAO.markForProctoringUpdate(updatedClientConnection.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// flush and reload caches to work with actual connection data
|
||||||
final ClientConnectionDataInternal activeClientConnection =
|
final ClientConnectionDataInternal activeClientConnection =
|
||||||
reloadConnectionCache(connectionToken);
|
reloadConnectionCache(connectionToken);
|
||||||
|
|
||||||
|
@ -493,6 +500,14 @@ public class SEBClientConnectionServiceImpl implements SEBClientConnectionServic
|
||||||
updatedClientConnection = clientConnection;
|
updatedClientConnection = clientConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if proctoring is enabled for exam, mark for room update
|
||||||
|
final Boolean proctoringEnabled = this.examAdminService
|
||||||
|
.isProctoringEnabled(clientConnection.examId)
|
||||||
|
.getOr(false);
|
||||||
|
if (proctoringEnabled) {
|
||||||
|
this.clientConnectionDAO.markForProctoringUpdate(updatedClientConnection.id);
|
||||||
|
}
|
||||||
|
|
||||||
// delete stored ping if this is a distributed setup
|
// delete stored ping if this is a distributed setup
|
||||||
if (this.isDistributedSetup) {
|
if (this.isDistributedSetup) {
|
||||||
this.distributedPingCache
|
this.distributedPingCache
|
||||||
|
@ -547,6 +562,14 @@ public class SEBClientConnectionServiceImpl implements SEBClientConnectionServic
|
||||||
updatedClientConnection = clientConnection;
|
updatedClientConnection = clientConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if proctoring is enabled for exam, mark for room update
|
||||||
|
final Boolean proctoringEnabled = this.examAdminService
|
||||||
|
.isProctoringEnabled(clientConnection.examId)
|
||||||
|
.getOr(false);
|
||||||
|
if (proctoringEnabled) {
|
||||||
|
this.clientConnectionDAO.markForProctoringUpdate(updatedClientConnection.id);
|
||||||
|
}
|
||||||
|
|
||||||
// delete stored ping if this is a distributed setup
|
// delete stored ping if this is a distributed setup
|
||||||
if (this.isDistributedSetup) {
|
if (this.isDistributedSetup) {
|
||||||
this.distributedPingCache
|
this.distributedPingCache
|
||||||
|
|
Loading…
Reference in a new issue