add proctoring attributes

This commit is contained in:
anhefti 2020-08-20 16:44:40 +02:00
parent 0e293c7602
commit feb3836b12
6 changed files with 136 additions and 14 deletions

View file

@ -18,6 +18,7 @@ public class SEBClientProctoringConnectionData {
public static final String ATTR_SERVER_HOST = "serverHost";
public static final String ATTR_SERVER_URL = "serverURL";
public static final String ATTR_ROOM_NAME = "roomName";
public static final String ATTR_SUBJECT = "subject";
public static final String ATTR_ACCESS_TOKEN = "accessToken";
public static final String ATTR_CONNECTION_URL = "connectionURL";
@ -30,6 +31,9 @@ public class SEBClientProctoringConnectionData {
@JsonProperty(ATTR_ROOM_NAME)
public final String roomName;
@JsonProperty(ATTR_SUBJECT)
public final String subject;
@JsonProperty(ATTR_ACCESS_TOKEN)
public final String accessToken;
@ -41,12 +45,14 @@ public class SEBClientProctoringConnectionData {
@JsonProperty(ATTR_SERVER_HOST) final String serverHost,
@JsonProperty(ATTR_SERVER_URL) final String serverURL,
@JsonProperty(ATTR_ROOM_NAME) final String roomName,
@JsonProperty(ATTR_SUBJECT) final String subject,
@JsonProperty(ATTR_ACCESS_TOKEN) final String accessToken,
@JsonProperty(ATTR_CONNECTION_URL) final String connectionURL) {
this.serverHost = serverHost;
this.serverURL = serverURL;
this.roomName = roomName;
this.subject = subject;
this.accessToken = accessToken;
this.connectionURL = connectionURL;
}
@ -71,6 +77,10 @@ public class SEBClientProctoringConnectionData {
return this.roomName;
}
public String getSubject() {
return this.subject;
}
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
@ -80,6 +90,8 @@ public class SEBClientProctoringConnectionData {
builder.append(this.serverURL);
builder.append(", roomName=");
builder.append(this.roomName);
builder.append(", subject=");
builder.append(this.subject);
builder.append(", accessToken=");
builder.append(this.accessToken);
builder.append(", connectionURL=");

View file

@ -48,14 +48,37 @@ public class ProctoringServlet extends HttpServlet {
"<div id=\"proctoring\"></div> " +
"</body>" +
"<script>" +
" const options = {\r\n" +
" parentNode: document.querySelector('#proctoring'),\r\n" +
" roomName: '%s',\r\n" +
" width: 600,\r\n" +
" height: 400,\r\n" +
" jwt: '%s'\r\n" +
" }\r\n" +
" meetAPI = new JitsiMeetExternalAPI(\"%s\", options);\r\n" +
" const options = {\n" +
" parentNode: document.querySelector('#proctoring'),\n" +
" roomName: '%s',\n" +
// " width: 600,\n" +
" height: 400,\n" +
" jwt: '%s',\n" +
" configOverwrite: { startAudioOnly: false, startWithAudioMuted: true, startWithVideoMuted: true, disable1On1Mode: true },\n" +
" interfaceConfigOverwrite: { " +
"TOOLBAR_BUTTONS: [\r\n" +
" 'microphone', 'camera',\r\n" +
" 'fodeviceselection', 'profile', 'chat', 'recording',\r\n" +
" 'livestreaming', 'settings',\r\n" +
" 'videoquality', 'filmstrip', 'feedback',\r\n" +
" 'tileview', 'help', 'mute-everyone', 'security'\r\n" +
" ],"
+ "SHOW_WATERMARK_FOR_GUESTS: false, "
+ "RECENT_LIST_ENABLED: false, "
+ "HIDE_INVITE_MORE_HEADER: true, "
+ "DISABLE_RINGING: true, "
+ "DISABLE_PRESENCE_STATUS: true, "
+ "DISABLE_JOIN_LEAVE_NOTIFICATIONS: true, "
+ "GENERATE_ROOMNAMES_ON_WELCOME_PAGE: false, "
+ "MOBILE_APP_PROMO: false, "
+ "SHOW_JITSI_WATERMARK: false, "
+ "DISABLE_PRESENCE_STATUS: true, "
+ "DISABLE_RINGING: true, "
+ "DISABLE_VIDEO_BACKGROUND: false, "
+ "filmStripOnly: false }\n" +
" }\n" +
" const meetAPI = new JitsiMeetExternalAPI(\"%s\", options);\n" +
" meetAPI.executeCommand('subject', '%s');\n" +
"</script>" +
"</html>";
// @formatter:on
@ -80,10 +103,13 @@ public class ProctoringServlet extends HttpServlet {
final SEBClientProctoringConnectionData proctoringConnectionData =
(SEBClientProctoringConnectionData) httpSession.getAttribute(SESSION_ATTR_PROCTORING_DATA);
final String accessToken = proctoringConnectionData.getAccessToken();
final String roomName = proctoringConnectionData.roomName;
final String server = "seb-jitsi.ethz.ch";
final String script = String.format(HTML, server, roomName, accessToken, server);
final String script = String.format(
HTML,
proctoringConnectionData.serverHost,
proctoringConnectionData.roomName,
proctoringConnectionData.accessToken,
proctoringConnectionData.serverHost,
proctoringConnectionData.subject);
resp.getOutputStream().println(script);
}

View file

@ -120,6 +120,7 @@ public class ExamJITSIProctoringService implements ExamProctoringService {
this.authorizationService.getUserService().getCurrentUser().getUsername(),
(server) ? "seb-server" : "seb-client",
roomName,
clientConnection.userSessionId,
expTime)
.getOrThrow();
});
@ -133,6 +134,7 @@ public class ExamJITSIProctoringService implements ExamProctoringService {
final String clientName,
final String clientKey,
final String roomName,
final String subject,
final Long expTime) {
return Result.tryCatch(() -> {
@ -161,6 +163,7 @@ public class ExamJITSIProctoringService implements ExamProctoringService {
host,
roomUrl,
roomName,
subject,
token,
connectionURL);
});

View file

@ -1,4 +1,10 @@
INSERT INTO configuration_attribute VALUES
INSERT INTO view (name, columns, position, template_id) VALUES
('proctoring', 12, 12, 0);
SET @proct_view_id = LAST_INSERT_ID();
INSERT IGNORE INTO configuration_attribute VALUES
(1100, 'jitsiMeetAudioMuted', 'CHECKBOX', null, null, null, null, 'true'),
(1101, 'jitsiMeetAudioOnly', 'CHECKBOX', null, null, null, null, 'false'),
(1102, 'jitsiMeetEnable', 'CHECKBOX', null, null, null, null, 'true'),
@ -32,4 +38,7 @@ INSERT INTO configuration_attribute VALUES
(1131, 'jitsiMeetReceiveVideo', 'CHECKBOX', null, null, null, null, 'false'),
(1132, 'jitsiMeetSendAudio', 'CHECKBOX', null, null, null, null, 'true'),
(1133, 'jitsiMeetSendVideo', 'CHECKBOX', null, null, null, null, 'true')
;
;
INSERT INTO orientation (config_attribute_id, template_id, view_id, group_id, x_position, y_position, width, height, title) VALUES
(1102, 0, @proct_view_id, null, 1, 1, 2, 1, 'NONE');

View file

@ -787,6 +787,7 @@ sebserver.examconfig.props.form.views.network=Network
sebserver.examconfig.props.form.views.security=Security
sebserver.examconfig.props.form.views.registry=Registry
sebserver.examconfig.props.form.views.hooked_keys=Hooked Keys
sebserver.examconfig.props.form.views.proctoring=Proctoring
sebserver.examconfig.props.label.hashedAdminPassword=Administrator password
@ -1245,6 +1246,76 @@ sebserver.examconfig.props.label.enableF10=Enable F10
sebserver.examconfig.props.label.enableF11=Enable F11
sebserver.examconfig.props.label.enableF12=Enable F12
sebserver.examconfig.props.label.jitsiMeetAudioMuted=Audio Initially Muted
sebserver.examconfig.props.label.jitsiMeetAudioMuted.tooltip
sebserver.examconfig.props.label.jitsiMeetAudioOnly=Audio Only
sebserver.examconfig.props.label.jitsiMeetAudioOnly.tooltip
sebserver.examconfig.props.label.jitsiMeetEnable=Enable Jitsi Meet
sebserver.examconfig.props.label.jitsiMeetEnable.tooltip
sebserver.examconfig.props.label.jitsiMeetFeatureFlagChat=Enable Chat
sebserver.examconfig.props.label.jitsiMeetFeatureFlagChat.tooltip
sebserver.examconfig.props.label.jitsiMeetFeatureFlagCloseCaptions=Enable Close Captions
sebserver.examconfig.props.label.jitsiMeetFeatureFlagCloseCaptions.tooltip
sebserver.examconfig.props.label.jitsiMeetFeatureFlagDisplayMeetingName=Display Meeting Name
sebserver.examconfig.props.label.jitsiMeetFeatureFlagDisplayMeetingName.tooltip
sebserver.examconfig.props.label.jitsiMeetFeatureFlagRaiseHand=Enable Raise Hand
sebserver.examconfig.props.label.jitsiMeetFeatureFlagRaiseHand.tooltip
sebserver.examconfig.props.label.jitsiMeetFeatureFlagRecording=Allow Recording
sebserver.examconfig.props.label.jitsiMeetFeatureFlagRecording.tooltip
sebserver.examconfig.props.label.jitsiMeetFeatureFlagTileView=Allow Tile View
sebserver.examconfig.props.label.jitsiMeetFeatureFlagTileView.tooltip=Note: Disabling Allow Tile View is not yet functional in this version.
sebserver.examconfig.props.label.jitsiMeetRoom=Room
sebserver.examconfig.props.label.jitsiMeetRoom.tooltip
sebserver.examconfig.props.label.jitsiMeetServerURL=Server URL
sebserver.examconfig.props.label.jitsiMeetServerURL.tooltip
sebserver.examconfig.props.label.jitsiMeetSubject=Subject
sebserver.examconfig.props.label.jitsiMeetSubject.tooltip
sebserver.examconfig.props.label.jitsiMeetToken=Token
sebserver.examconfig.props.label.jitsiMeetToken.tooltip
sebserver.examconfig.props.label.jitsiMeetUserInfoAvatarURL=Avatar URL
sebserver.examconfig.props.label.jitsiMeetUserInfoAvatarURL.tooltip
sebserver.examconfig.props.label.jitsiMeetUserInfoDisplayName=Display Name
sebserver.examconfig.props.label.jitsiMeetUserInfoDisplayName.tooltip
sebserver.examconfig.props.label.jitsiMeetUserInfoEMail=Info Mail
sebserver.examconfig.props.label.jitsiMeetUserInfoEMail.tooltip
sebserver.examconfig.props.label.jitsiMeetVideoMuted=Video Initially Muted
sebserver.examconfig.props.label.jitsiMeetVideoMuted.tooltip
sebserver.examconfig.props.label.jitsiMeetReceiveAudio=Receive Audio
sebserver.examconfig.props.label.jitsiMeetReceiveAudio.tooltip
sebserver.examconfig.props.label.jitsiMeetReceiveVideo=Receive Video
sebserver.examconfig.props.label.jitsiMeetReceiveVideo.tooltip
sebserver.examconfig.props.label.jitsiMeetSendAudio=Send Audio
sebserver.examconfig.props.label.jitsiMeetSendAudio.tooltip
sebserver.examconfig.props.label.jitsiMeetSendVideo=Send Video
sebserver.examconfig.props.label.jitsiMeetSendVideo.tooltip
sebserver.examconfig.props.label.proctoringAIEnable=Enable AI Proctoring
sebserver.examconfig.props.label.proctoringAIEnable.tooltip
sebserver.examconfig.props.label.proctoringDetectFaceCount=Number of Faces
sebserver.examconfig.props.label.proctoringDetectFaceCount.tooltip
sebserver.examconfig.props.label.proctoringDetectFaceCountDisplay=Feedback for Candidate
sebserver.examconfig.props.label.proctoringDetectFaceCountDisplay.tooltip
sebserver.examconfig.props.label.proctoringDetectFacePitch=Face Movement Up & Down (Pitch)
sebserver.examconfig.props.label.proctoringDetectFacePitch.tooltip
sebserver.examconfig.props.label.proctoringDetectFaceYaw=Face Movement Sideways (Yaw)
sebserver.examconfig.props.label.proctoringDetectFaceYaw.tooltip
sebserver.examconfig.props.label.proctoringDetectFaceAngleDisplay=Feedback for Candidate
sebserver.examconfig.props.label.proctoringDetectFaceAngleDisplay.tooltip
sebserver.examconfig.props.label.proctoringDetectTalking=Detect Talking
sebserver.examconfig.props.label.proctoringDetectTalking.tooltip
sebserver.examconfig.props.label.proctoringDetectTalkingDisplay=Feedback for Candidate
sebserver.examconfig.props.label.proctoringDetectTalkingDisplay.tooltips
sebserver.examconfig.props.label.remoteProctoringViewShow=Proctoring View Display Policy
sebserver.examconfig.props.label.remoteProctoringViewShow.tooltip=
sebserver.examconfig.props.label.remoteProctoringViewShow.0=Never
sebserver.examconfig.props.label.remoteProctoringViewShow.1=Allow to Show
sebserver.examconfig.props.label.remoteProctoringViewShow.2=Allow to Hide
sebserver.examconfig.props.label.remoteProctoringViewShow.3=Always
sebserver.examconfig.props.label.showProctoringViewButton=Show Proctoring Button
sebserver.examconfig.props.label.showProctoringViewButton
sebserver.examconfig.props.validation.password.confirm=Please enter correct confirm password
sebserver.examconfig.props.validation.unexpected=Unexpected error happened. Value was not set correctly
sebserver.examconfig.props.validation.IntegerTypeValidator=Invalid number

View file

@ -32,6 +32,7 @@ public class ExamJITSIProctoringServiceTest {
"Test Name",
"test-client",
"SomeRoom",
"Subject",
1609459200L)
.getOrThrow();