Search is not available for this dataset
hexsha
stringlengths
40
40
repo
stringlengths
6
126
path
stringlengths
6
1.02k
license
sequence
language
stringclasses
1 value
identifier
stringlengths
1
220
return_type
stringlengths
1
110
original_string
stringlengths
39
223k
original_docstring
stringlengths
16
34.8k
docstring
stringlengths
11
3.41k
docstring_tokens
sequence
code
stringlengths
26
223k
code_tokens
sequence
short_docstring
stringlengths
0
3.02k
short_docstring_tokens
sequence
comment
sequence
parameters
list
docstring_params
dict
input_ids
sequence
attention_mask
sequence
labels
sequence
7988432f8cf12612e57298ede78ce096f39f5da8
ls1intum/Artemis
src/test/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactoryTest.java
[ "MIT" ]
Java
createNotificationBasedOnCourse_withNotificationType_CourseArchiveFinished
null
@Test public void createNotificationBasedOnCourse_withNotificationType_CourseArchiveFinished() { notificationType = NotificationType.COURSE_ARCHIVE_FINISHED; expectedTitle = COURSE_ARCHIVE_FINISHED_TITLE; expectedText = "The course \"" + course.getTitle() + "\" has been archived."; expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("courseArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.COURSE); }
/** * Tests the functionality that deals with notifications that have the notification type of COURSE_ARCHIVE_FINISHED. * I.e. notifications that are created when the process of archiving a course has finished. */
Tests the functionality that deals with notifications that have the notification type of COURSE_ARCHIVE_FINISHED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "COURSE_ARCHIVE_FINISHED", "." ]
@Test public void createNotificationBasedOnCourse_withNotificationType_CourseArchiveFinished() { notificationType = NotificationType.COURSE_ARCHIVE_FINISHED; expectedTitle = COURSE_ARCHIVE_FINISHED_TITLE; expectedText = "The course \"" + course.getTitle() + "\" has been archived."; expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("courseArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.COURSE); }
[ "@", "Test", "public", "void", "createNotificationBasedOnCourse_withNotificationType_CourseArchiveFinished", "(", ")", "{", "notificationType", "=", "NotificationType", ".", "COURSE_ARCHIVE_FINISHED", ";", "expectedTitle", "=", "COURSE_ARCHIVE_FINISHED_TITLE", ";", "expectedText", "=", "\"The course \\\"\"", "+", "course", ".", "getTitle", "(", ")", "+", "\"\\\" has been archived.\"", ";", "expectedPriority", "=", "NotificationPriority", ".", "MEDIUM", ";", "expectedTarget", "=", "createDefaultExpectedTarget", "(", "\"courseArchiveUpdated\"", ",", "\"courses\"", ",", "courseId", ")", ";", "createAndCheckNotification", "(", "Base", ".", "COURSE", ")", ";", "}" ]
Tests the functionality that deals with notifications that have the notification type of COURSE_ARCHIVE_FINISHED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "COURSE_ARCHIVE_FINISHED", "." ]
[]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 4709, 203, 565, 1071, 918, 752, 4386, 9802, 1398, 39, 3117, 67, 1918, 4386, 559, 67, 39, 3117, 7465, 10577, 1435, 288, 203, 3639, 3851, 559, 273, 8050, 559, 18, 3865, 23875, 67, 10586, 5354, 67, 23259, 2056, 31, 203, 203, 3639, 2665, 4247, 273, 7910, 23875, 67, 10586, 5354, 67, 23259, 2056, 67, 14123, 31, 203, 3639, 2665, 1528, 273, 315, 1986, 4362, 11843, 397, 4362, 18, 588, 4247, 1435, 397, 7023, 711, 2118, 23276, 1199, 31, 203, 3639, 2665, 8183, 273, 8050, 8183, 18, 15971, 2799, 31, 203, 3639, 2665, 2326, 273, 27346, 6861, 2326, 2932, 5566, 7465, 7381, 3113, 315, 15804, 3113, 4362, 548, 1769, 203, 203, 3639, 30545, 1564, 4386, 12, 2171, 18, 3865, 23875, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 7766, 87, 326, 14176, 716, 443, 1031, 598, 9208, 716, 1240, 326, 3851, 618, 434, 7910, 23875, 67, 10586, 5354, 67, 23259, 2056, 18, 203, 377, 380, 467, 18, 73, 18, 9208, 716, 854, 2522, 1347, 326, 1207, 434, 6637, 9288, 279, 4362, 711, 6708, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7988432f8cf12612e57298ede78ce096f39f5da8
ls1intum/Artemis
src/test/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactoryTest.java
[ "MIT" ]
Java
createNotificationBasedOnCourse_withNotificationType_CourseArchiveFailed
null
@Test public void createNotificationBasedOnCourse_withNotificationType_CourseArchiveFailed() { notificationType = NotificationType.COURSE_ARCHIVE_FAILED; expectedTitle = COURSE_ARCHIVE_FAILED_TITLE; expectedText = "The was a problem archiving course \"" + course.getTitle() + "\": <br/><br/>" + String.join("<br/><br/>", archiveErrors); expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("courseArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.COURSE); }
/** * Tests the functionality that deals with notifications that have the notification type of COURSE_ARCHIVE_FAILED. * I.e. notifications that are created when the process of archiving a course has failed. */
Tests the functionality that deals with notifications that have the notification type of COURSE_ARCHIVE_FAILED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "COURSE_ARCHIVE_FAILED", "." ]
@Test public void createNotificationBasedOnCourse_withNotificationType_CourseArchiveFailed() { notificationType = NotificationType.COURSE_ARCHIVE_FAILED; expectedTitle = COURSE_ARCHIVE_FAILED_TITLE; expectedText = "The was a problem archiving course \"" + course.getTitle() + "\": <br/><br/>" + String.join("<br/><br/>", archiveErrors); expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("courseArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.COURSE); }
[ "@", "Test", "public", "void", "createNotificationBasedOnCourse_withNotificationType_CourseArchiveFailed", "(", ")", "{", "notificationType", "=", "NotificationType", ".", "COURSE_ARCHIVE_FAILED", ";", "expectedTitle", "=", "COURSE_ARCHIVE_FAILED_TITLE", ";", "expectedText", "=", "\"The was a problem archiving course \\\"\"", "+", "course", ".", "getTitle", "(", ")", "+", "\"\\\": <br/><br/>\"", "+", "String", ".", "join", "(", "\"<br/><br/>\"", ",", "archiveErrors", ")", ";", "expectedPriority", "=", "NotificationPriority", ".", "MEDIUM", ";", "expectedTarget", "=", "createDefaultExpectedTarget", "(", "\"courseArchiveUpdated\"", ",", "\"courses\"", ",", "courseId", ")", ";", "createAndCheckNotification", "(", "Base", ".", "COURSE", ")", ";", "}" ]
Tests the functionality that deals with notifications that have the notification type of COURSE_ARCHIVE_FAILED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "COURSE_ARCHIVE_FAILED", "." ]
[]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 4709, 203, 565, 1071, 918, 752, 4386, 9802, 1398, 39, 3117, 67, 1918, 4386, 559, 67, 39, 3117, 7465, 2925, 1435, 288, 203, 3639, 3851, 559, 273, 8050, 559, 18, 3865, 23875, 67, 10586, 5354, 67, 11965, 31, 203, 203, 3639, 2665, 4247, 273, 7910, 23875, 67, 10586, 5354, 67, 11965, 67, 14123, 31, 203, 3639, 2665, 1528, 273, 315, 1986, 1703, 279, 6199, 6637, 9288, 4362, 11843, 397, 4362, 18, 588, 4247, 1435, 397, 1548, 6877, 411, 2848, 19, 4438, 2848, 26293, 397, 514, 18, 5701, 2932, 32, 2848, 19, 4438, 2848, 26293, 16, 5052, 4229, 1769, 203, 3639, 2665, 8183, 273, 8050, 8183, 18, 15971, 2799, 31, 203, 3639, 2665, 2326, 273, 27346, 6861, 2326, 2932, 5566, 7465, 7381, 3113, 315, 15804, 3113, 4362, 548, 1769, 203, 203, 3639, 30545, 1564, 4386, 12, 2171, 18, 3865, 23875, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 7766, 87, 326, 14176, 716, 443, 1031, 598, 9208, 716, 1240, 326, 3851, 618, 434, 7910, 23875, 67, 10586, 5354, 67, 11965, 18, 203, 377, 380, 467, 18, 73, 18, 9208, 716, 854, 2522, 1347, 326, 1207, 434, 6637, 9288, 279, 4362, 711, 2535, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7988432f8cf12612e57298ede78ce096f39f5da8
ls1intum/Artemis
src/test/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactoryTest.java
[ "MIT" ]
Java
createNotificationBasedOnExam_withNotificationType_ExamArchiveStarted
null
@Test public void createNotificationBasedOnExam_withNotificationType_ExamArchiveStarted() { notificationType = NotificationType.EXAM_ARCHIVE_STARTED; expectedTitle = EXAM_ARCHIVE_STARTED_TITLE; expectedText = "The exam \"" + exam.getTitle() + "\" is being archived."; expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("examArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.EXAM); }
/** * Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_STARTED. * I.e. notifications that are created when the process of archiving an exam has been started. */
Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_STARTED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "EXAM_ARCHIVE_STARTED", "." ]
@Test public void createNotificationBasedOnExam_withNotificationType_ExamArchiveStarted() { notificationType = NotificationType.EXAM_ARCHIVE_STARTED; expectedTitle = EXAM_ARCHIVE_STARTED_TITLE; expectedText = "The exam \"" + exam.getTitle() + "\" is being archived."; expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("examArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.EXAM); }
[ "@", "Test", "public", "void", "createNotificationBasedOnExam_withNotificationType_ExamArchiveStarted", "(", ")", "{", "notificationType", "=", "NotificationType", ".", "EXAM_ARCHIVE_STARTED", ";", "expectedTitle", "=", "EXAM_ARCHIVE_STARTED_TITLE", ";", "expectedText", "=", "\"The exam \\\"\"", "+", "exam", ".", "getTitle", "(", ")", "+", "\"\\\" is being archived.\"", ";", "expectedPriority", "=", "NotificationPriority", ".", "MEDIUM", ";", "expectedTarget", "=", "createDefaultExpectedTarget", "(", "\"examArchiveUpdated\"", ",", "\"courses\"", ",", "courseId", ")", ";", "createAndCheckNotification", "(", "Base", ".", "EXAM", ")", ";", "}" ]
Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_STARTED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "EXAM_ARCHIVE_STARTED", "." ]
[]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 4709, 203, 565, 1071, 918, 752, 4386, 9802, 1398, 424, 301, 67, 1918, 4386, 559, 67, 424, 301, 7465, 9217, 1435, 288, 203, 3639, 3851, 559, 273, 8050, 559, 18, 2294, 2192, 67, 10586, 5354, 67, 20943, 6404, 31, 203, 203, 3639, 2665, 4247, 273, 5675, 2192, 67, 10586, 5354, 67, 20943, 6404, 67, 14123, 31, 203, 3639, 2665, 1528, 273, 315, 1986, 19707, 11843, 397, 19707, 18, 588, 4247, 1435, 397, 7023, 353, 3832, 23276, 1199, 31, 203, 3639, 2665, 8183, 273, 8050, 8183, 18, 15971, 2799, 31, 203, 3639, 2665, 2326, 273, 27346, 6861, 2326, 2932, 338, 301, 7465, 7381, 3113, 315, 15804, 3113, 4362, 548, 1769, 203, 203, 3639, 30545, 1564, 4386, 12, 2171, 18, 2294, 2192, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 ]
[ 1, 26873, 203, 377, 380, 7766, 87, 326, 14176, 716, 443, 1031, 598, 9208, 716, 1240, 326, 3851, 618, 434, 5675, 2192, 67, 10586, 5354, 67, 20943, 6404, 18, 203, 377, 380, 467, 18, 73, 18, 9208, 716, 854, 2522, 1347, 326, 1207, 434, 6637, 9288, 392, 19707, 711, 2118, 5746, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7988432f8cf12612e57298ede78ce096f39f5da8
ls1intum/Artemis
src/test/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactoryTest.java
[ "MIT" ]
Java
createNotificationBasedOnExam_withNotificationType_ExamArchiveFinished
null
@Test public void createNotificationBasedOnExam_withNotificationType_ExamArchiveFinished() { notificationType = NotificationType.EXAM_ARCHIVE_FINISHED; expectedTitle = EXAM_ARCHIVE_FINISHED_TITLE; expectedText = "The exam \"" + exam.getTitle() + "\" has been archived."; expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("examArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.EXAM); }
/** * Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_FINISHED. * I.e. notifications that are created when the process of archiving an exam has finished. */
Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_FINISHED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "EXAM_ARCHIVE_FINISHED", "." ]
@Test public void createNotificationBasedOnExam_withNotificationType_ExamArchiveFinished() { notificationType = NotificationType.EXAM_ARCHIVE_FINISHED; expectedTitle = EXAM_ARCHIVE_FINISHED_TITLE; expectedText = "The exam \"" + exam.getTitle() + "\" has been archived."; expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("examArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.EXAM); }
[ "@", "Test", "public", "void", "createNotificationBasedOnExam_withNotificationType_ExamArchiveFinished", "(", ")", "{", "notificationType", "=", "NotificationType", ".", "EXAM_ARCHIVE_FINISHED", ";", "expectedTitle", "=", "EXAM_ARCHIVE_FINISHED_TITLE", ";", "expectedText", "=", "\"The exam \\\"\"", "+", "exam", ".", "getTitle", "(", ")", "+", "\"\\\" has been archived.\"", ";", "expectedPriority", "=", "NotificationPriority", ".", "MEDIUM", ";", "expectedTarget", "=", "createDefaultExpectedTarget", "(", "\"examArchiveUpdated\"", ",", "\"courses\"", ",", "courseId", ")", ";", "createAndCheckNotification", "(", "Base", ".", "EXAM", ")", ";", "}" ]
Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_FINISHED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "EXAM_ARCHIVE_FINISHED", "." ]
[]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 4709, 203, 565, 1071, 918, 752, 4386, 9802, 1398, 424, 301, 67, 1918, 4386, 559, 67, 424, 301, 7465, 10577, 1435, 288, 203, 3639, 3851, 559, 273, 8050, 559, 18, 2294, 2192, 67, 10586, 5354, 67, 23259, 2056, 31, 203, 203, 3639, 2665, 4247, 273, 5675, 2192, 67, 10586, 5354, 67, 23259, 2056, 67, 14123, 31, 203, 3639, 2665, 1528, 273, 315, 1986, 19707, 11843, 397, 19707, 18, 588, 4247, 1435, 397, 7023, 711, 2118, 23276, 1199, 31, 203, 3639, 2665, 8183, 273, 8050, 8183, 18, 15971, 2799, 31, 203, 3639, 2665, 2326, 273, 27346, 6861, 2326, 2932, 338, 301, 7465, 7381, 3113, 315, 15804, 3113, 4362,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 7766, 87, 326, 14176, 716, 443, 1031, 598, 9208, 716, 1240, 326, 3851, 618, 434, 5675, 2192, 67, 10586, 5354, 67, 23259, 2056, 18, 203, 377, 380, 467, 18, 73, 18, 9208, 716, 854, 2522, 1347, 326, 1207, 434, 6637, 9288, 392, 19707, 711, 6708, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7988432f8cf12612e57298ede78ce096f39f5da8
ls1intum/Artemis
src/test/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactoryTest.java
[ "MIT" ]
Java
createNotificationBasedOnExam_withNotificationType_ExamArchiveFailed
null
@Test public void createNotificationBasedOnExam_withNotificationType_ExamArchiveFailed() { notificationType = NotificationType.EXAM_ARCHIVE_FAILED; expectedTitle = EXAM_ARCHIVE_FAILED_TITLE; expectedText = "The was a problem archiving exam \"" + exam.getTitle() + "\": <br/><br/>" + String.join("<br/><br/>", archiveErrors); expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("examArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.EXAM); }
/** * Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_FAILED. * I.e. notifications that are created when the process of archiving an exam has failed. */
Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_FAILED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "EXAM_ARCHIVE_FAILED", "." ]
@Test public void createNotificationBasedOnExam_withNotificationType_ExamArchiveFailed() { notificationType = NotificationType.EXAM_ARCHIVE_FAILED; expectedTitle = EXAM_ARCHIVE_FAILED_TITLE; expectedText = "The was a problem archiving exam \"" + exam.getTitle() + "\": <br/><br/>" + String.join("<br/><br/>", archiveErrors); expectedPriority = NotificationPriority.MEDIUM; expectedTarget = createDefaultExpectedTarget("examArchiveUpdated", "courses", courseId); createAndCheckNotification(Base.EXAM); }
[ "@", "Test", "public", "void", "createNotificationBasedOnExam_withNotificationType_ExamArchiveFailed", "(", ")", "{", "notificationType", "=", "NotificationType", ".", "EXAM_ARCHIVE_FAILED", ";", "expectedTitle", "=", "EXAM_ARCHIVE_FAILED_TITLE", ";", "expectedText", "=", "\"The was a problem archiving exam \\\"\"", "+", "exam", ".", "getTitle", "(", ")", "+", "\"\\\": <br/><br/>\"", "+", "String", ".", "join", "(", "\"<br/><br/>\"", ",", "archiveErrors", ")", ";", "expectedPriority", "=", "NotificationPriority", ".", "MEDIUM", ";", "expectedTarget", "=", "createDefaultExpectedTarget", "(", "\"examArchiveUpdated\"", ",", "\"courses\"", ",", "courseId", ")", ";", "createAndCheckNotification", "(", "Base", ".", "EXAM", ")", ";", "}" ]
Tests the functionality that deals with notifications that have the notification type of EXAM_ARCHIVE_FAILED.
[ "Tests", "the", "functionality", "that", "deals", "with", "notifications", "that", "have", "the", "notification", "type", "of", "EXAM_ARCHIVE_FAILED", "." ]
[]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 4709, 203, 565, 1071, 918, 752, 4386, 9802, 1398, 424, 301, 67, 1918, 4386, 559, 67, 424, 301, 7465, 2925, 1435, 288, 203, 3639, 3851, 559, 273, 8050, 559, 18, 2294, 2192, 67, 10586, 5354, 67, 11965, 31, 203, 203, 3639, 2665, 4247, 273, 5675, 2192, 67, 10586, 5354, 67, 11965, 67, 14123, 31, 203, 3639, 2665, 1528, 273, 315, 1986, 1703, 279, 6199, 6637, 9288, 19707, 11843, 397, 19707, 18, 588, 4247, 1435, 397, 1548, 6877, 411, 2848, 19, 4438, 2848, 26293, 397, 514, 18, 5701, 2932, 32, 2848, 19, 4438, 2848, 26293, 16, 5052, 4229, 1769, 203, 3639, 2665, 8183, 273, 8050, 8183, 18, 15971, 2799, 31, 203, 3639, 2665, 2326, 273, 27346, 6861, 2326, 2932, 338, 301, 7465, 7381, 3113, 315, 15804, 3113, 4362, 548, 1769, 203, 203, 3639, 30545, 1564, 4386, 12, 2171, 18, 2294, 2192, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 7766, 87, 326, 14176, 716, 443, 1031, 598, 9208, 716, 1240, 326, 3851, 618, 434, 5675, 2192, 67, 10586, 5354, 67, 11965, 18, 203, 377, 380, 467, 18, 73, 18, 9208, 716, 854, 2522, 1347, 326, 1207, 434, 6637, 9288, 392, 19707, 711, 2535, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
aa3bf1a91d3c19d6696b3f9969d4acd2a9ba88ab
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ExerciseResource.java
[ "MIT" ]
Java
reset
null
@DeleteMapping(value = "/exercises/{exerciseId}/reset") @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Void> reset(@PathVariable Long exerciseId) { log.debug("REST request to reset Exercise : {}", exerciseId); Exercise exercise = exerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, exercise, null); exerciseService.reset(exercise); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, "exercise", exerciseId.toString())).build(); }
/** * Reset the exercise by deleting all its participations /exercises/:exerciseId/reset This can be used by all exercise types, however they can also provide custom implementations * * @param exerciseId exercise to delete * @return the ResponseEntity with status 200 (OK) */
Reset the exercise by deleting all its participations /exercises/:exerciseId/reset This can be used by all exercise types, however they can also provide custom implementations @param exerciseId exercise to delete @return the ResponseEntity with status 200 (OK)
[ "Reset", "the", "exercise", "by", "deleting", "all", "its", "participations", "/", "exercises", "/", ":", "exerciseId", "/", "reset", "This", "can", "be", "used", "by", "all", "exercise", "types", "however", "they", "can", "also", "provide", "custom", "implementations", "@param", "exerciseId", "exercise", "to", "delete", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")" ]
@DeleteMapping(value = "/exercises/{exerciseId}/reset") @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Void> reset(@PathVariable Long exerciseId) { log.debug("REST request to reset Exercise : {}", exerciseId); Exercise exercise = exerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, exercise, null); exerciseService.reset(exercise); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, "exercise", exerciseId.toString())).build(); }
[ "@", "DeleteMapping", "(", "value", "=", "\"/exercises/{exerciseId}/reset\"", ")", "@", "PreAuthorize", "(", "\"hasRole('INSTRUCTOR')\"", ")", "public", "ResponseEntity", "<", "Void", ">", "reset", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "log", ".", "debug", "(", "\"REST request to reset Exercise : {}\"", ",", "exerciseId", ")", ";", "Exercise", "exercise", "=", "exerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "INSTRUCTOR", ",", "exercise", ",", "null", ")", ";", "exerciseService", ".", "reset", "(", "exercise", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityUpdateAlert", "(", "applicationName", ",", "true", ",", "\"exercise\"", ",", "exerciseId", ".", "toString", "(", ")", ")", ")", ".", "build", "(", ")", ";", "}" ]
Reset the exercise by deleting all its participations /exercises/:exerciseId/reset This can be used by all exercise types, however they can also provide custom implementations @param exerciseId exercise to delete @return the ResponseEntity with status 200 (OK)
[ "Reset", "the", "exercise", "by", "deleting", "all", "its", "participations", "/", "exercises", "/", ":", "exerciseId", "/", "reset", "This", "can", "be", "used", "by", "all", "exercise", "types", "however", "they", "can", "also", "provide", "custom", "implementations", "@param", "exerciseId", "exercise", "to", "delete", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")" ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 2613, 3233, 12, 1132, 273, 2206, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 6208, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 706, 13915, 916, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 2715, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 2715, 1312, 20603, 294, 3728, 16, 24165, 548, 1769, 203, 3639, 1312, 20603, 24165, 273, 24165, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 706, 13915, 916, 16, 24165, 16, 446, 1769, 203, 3639, 24165, 1179, 18, 6208, 12, 8913, 30708, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 2485, 12, 1864, 1304, 18, 2640, 1943, 1891, 13298, 12, 3685, 461, 16, 638, 16, 315, 8913, 30708, 3113, 24165, 548, 18, 10492, 10756, 2934, 3510, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 7151, 326, 24165, 635, 12993, 777, 2097, 30891, 1012, 342, 8913, 71, 6141, 16880, 8913, 30708, 548, 19, 6208, 1220, 848, 506, 1399, 635, 777, 24165, 1953, 16, 14025, 2898, 848, 2546, 5615, 1679, 16164, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 24165, 358, 1430, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
aa3bf1a91d3c19d6696b3f9969d4acd2a9ba88ab
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ExerciseResource.java
[ "MIT" ]
Java
cleanup
null
@DeleteMapping(value = "/exercises/{exerciseId}/cleanup") @PreAuthorize("hasRole('INSTRUCTOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> cleanup(@PathVariable Long exerciseId, @RequestParam(defaultValue = "false") boolean deleteRepositories) { log.info("Start to cleanup build plans for Exercise: {}, delete repositories: {}", exerciseId, deleteRepositories); Exercise exercise = exerciseRepository.findByIdElseThrow(exerciseId); if (!authCheckService.isAtLeastInstructorForExercise(exercise)) { return forbidden(); } exerciseService.cleanup(exerciseId, deleteRepositories); log.info("Cleanup build plans was successful for Exercise : {}", exerciseId); return ResponseEntity.ok().build(); }
/** * DELETE /exercises/:exerciseId/cleanup : delete all build plans (except BASE) of all participations belonging to this exercise. Optionally delete and archive all repositories * * @param exerciseId exercise to delete build plans for * @param deleteRepositories whether repositories should be deleted or not * @return ResponseEntity with status */
DELETE /exercises/:exerciseId/cleanup : delete all build plans (except BASE) of all participations belonging to this exercise. Optionally delete and archive all repositories @param exerciseId exercise to delete build plans for @param deleteRepositories whether repositories should be deleted or not @return ResponseEntity with status
[ "DELETE", "/", "exercises", "/", ":", "exerciseId", "/", "cleanup", ":", "delete", "all", "build", "plans", "(", "except", "BASE", ")", "of", "all", "participations", "belonging", "to", "this", "exercise", ".", "Optionally", "delete", "and", "archive", "all", "repositories", "@param", "exerciseId", "exercise", "to", "delete", "build", "plans", "for", "@param", "deleteRepositories", "whether", "repositories", "should", "be", "deleted", "or", "not", "@return", "ResponseEntity", "with", "status" ]
@DeleteMapping(value = "/exercises/{exerciseId}/cleanup") @PreAuthorize("hasRole('INSTRUCTOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> cleanup(@PathVariable Long exerciseId, @RequestParam(defaultValue = "false") boolean deleteRepositories) { log.info("Start to cleanup build plans for Exercise: {}, delete repositories: {}", exerciseId, deleteRepositories); Exercise exercise = exerciseRepository.findByIdElseThrow(exerciseId); if (!authCheckService.isAtLeastInstructorForExercise(exercise)) { return forbidden(); } exerciseService.cleanup(exerciseId, deleteRepositories); log.info("Cleanup build plans was successful for Exercise : {}", exerciseId); return ResponseEntity.ok().build(); }
[ "@", "DeleteMapping", "(", "value", "=", "\"/exercises/{exerciseId}/cleanup\"", ")", "@", "PreAuthorize", "(", "\"hasRole('INSTRUCTOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "Resource", ">", "cleanup", "(", "@", "PathVariable", "Long", "exerciseId", ",", "@", "RequestParam", "(", "defaultValue", "=", "\"false\"", ")", "boolean", "deleteRepositories", ")", "{", "log", ".", "info", "(", "\"Start to cleanup build plans for Exercise: {}, delete repositories: {}\"", ",", "exerciseId", ",", "deleteRepositories", ")", ";", "Exercise", "exercise", "=", "exerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "if", "(", "!", "authCheckService", ".", "isAtLeastInstructorForExercise", "(", "exercise", ")", ")", "{", "return", "forbidden", "(", ")", ";", "}", "exerciseService", ".", "cleanup", "(", "exerciseId", ",", "deleteRepositories", ")", ";", "log", ".", "info", "(", "\"Cleanup build plans was successful for Exercise : {}\"", ",", "exerciseId", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "build", "(", ")", ";", "}" ]
DELETE /exercises/:exerciseId/cleanup : delete all build plans (except BASE) of all participations belonging to this exercise.
[ "DELETE", "/", "exercises", "/", ":", "exerciseId", "/", "cleanup", ":", "delete", "all", "build", "plans", "(", "except", "BASE", ")", "of", "all", "participations", "belonging", "to", "this", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" }, { "param": "deleteRepositories", "type": "boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "deleteRepositories", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 2613, 3233, 12, 1132, 273, 2206, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 16732, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 706, 13915, 916, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 1420, 34, 6686, 26964, 743, 3092, 3407, 24165, 548, 16, 632, 691, 786, 12, 27652, 273, 315, 5743, 7923, 1250, 1430, 18429, 13, 288, 203, 3639, 613, 18, 1376, 2932, 1685, 358, 6686, 1361, 21440, 364, 1312, 20603, 30, 10615, 1430, 14531, 30, 3728, 16, 24165, 548, 16, 1430, 18429, 1769, 203, 3639, 1312, 20603, 24165, 273, 24165, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 309, 16051, 1944, 1564, 1179, 18, 291, 25070, 382, 2732, 1290, 424, 20603, 12, 8913, 30708, 3719, 288, 203, 5411, 327, 17987, 5621, 203, 3639, 289, 203, 3639, 24165, 1179, 18, 16732, 12, 8913, 30708, 548, 16, 1430, 18429, 1769, 203, 3639, 613, 18, 1376, 2932, 15007, 1361, 21440, 1703, 6873, 364, 1312, 20603, 294, 3728, 16, 24165, 548, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 3510, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 8568, 342, 8913, 71, 6141, 16880, 8913, 30708, 548, 19, 16732, 294, 1430, 777, 1361, 21440, 261, 14137, 10250, 13, 434, 777, 30891, 1012, 17622, 358, 333, 24165, 18, 20720, 1430, 471, 5052, 777, 14531, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 540, 24165, 358, 1430, 1361, 21440, 364, 203, 377, 380, 632, 891, 1430, 18429, 2856, 14531, 1410, 506, 4282, 578, 486, 203, 377, 380, 632, 2463, 2306, 1943, 598, 1267, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
aa3bf1a91d3c19d6696b3f9969d4acd2a9ba88ab
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ExerciseResource.java
[ "MIT" ]
Java
toggleSecondCorrectionEnabled
null
@PutMapping(value = "/exercises/{exerciseId}/toggle-second-correction") @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Boolean> toggleSecondCorrectionEnabled(@PathVariable Long exerciseId) { log.debug("toggleSecondCorrectionEnabled for exercise with id: {}", exerciseId); Exercise exercise = exerciseRepository.findByIdElseThrow(exerciseId); if (exercise == null) { throw new EntityNotFoundException("Exercise not found with id " + exerciseId); } if (!authCheckService.isAtLeastInstructorForExercise(exercise)) { return forbidden(); } return ResponseEntity.ok(exerciseRepository.toggleSecondCorrection(exercise)); }
/** * GET /exercises/:exerciseId/toggle-second-correction * * @param exerciseId the exerciseId of the exercise to get the repos from * @return the ResponseEntity with status 200 (OK) and with body the exercise, or with status 404 (Not Found) */
GET /exercises/:exerciseId/toggle-second-correction @param exerciseId the exerciseId of the exercise to get the repos from @return the ResponseEntity with status 200 (OK) and with body the exercise, or with status 404 (Not Found)
[ "GET", "/", "exercises", "/", ":", "exerciseId", "/", "toggle", "-", "second", "-", "correction", "@param", "exerciseId", "the", "exerciseId", "of", "the", "exercise", "to", "get", "the", "repos", "from", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "and", "with", "body", "the", "exercise", "or", "with", "status", "404", "(", "Not", "Found", ")" ]
@PutMapping(value = "/exercises/{exerciseId}/toggle-second-correction") @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Boolean> toggleSecondCorrectionEnabled(@PathVariable Long exerciseId) { log.debug("toggleSecondCorrectionEnabled for exercise with id: {}", exerciseId); Exercise exercise = exerciseRepository.findByIdElseThrow(exerciseId); if (exercise == null) { throw new EntityNotFoundException("Exercise not found with id " + exerciseId); } if (!authCheckService.isAtLeastInstructorForExercise(exercise)) { return forbidden(); } return ResponseEntity.ok(exerciseRepository.toggleSecondCorrection(exercise)); }
[ "@", "PutMapping", "(", "value", "=", "\"/exercises/{exerciseId}/toggle-second-correction\"", ")", "@", "PreAuthorize", "(", "\"hasRole('INSTRUCTOR')\"", ")", "public", "ResponseEntity", "<", "Boolean", ">", "toggleSecondCorrectionEnabled", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "log", ".", "debug", "(", "\"toggleSecondCorrectionEnabled for exercise with id: {}\"", ",", "exerciseId", ")", ";", "Exercise", "exercise", "=", "exerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "if", "(", "exercise", "==", "null", ")", "{", "throw", "new", "EntityNotFoundException", "(", "\"Exercise not found with id \"", "+", "exerciseId", ")", ";", "}", "if", "(", "!", "authCheckService", ".", "isAtLeastInstructorForExercise", "(", "exercise", ")", ")", "{", "return", "forbidden", "(", ")", ";", "}", "return", "ResponseEntity", ".", "ok", "(", "exerciseRepository", ".", "toggleSecondCorrection", "(", "exercise", ")", ")", ";", "}" ]
GET /exercises/:exerciseId/toggle-second-correction @param exerciseId the exerciseId of the exercise to get the repos from @return the ResponseEntity with status 200 (OK) and with body the exercise, or with status 404 (Not Found)
[ "GET", "/", "exercises", "/", ":", "exerciseId", "/", "toggle", "-", "second", "-", "correction", "@param", "exerciseId", "the", "exerciseId", "of", "the", "exercise", "to", "get", "the", "repos", "from", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "and", "with", "body", "the", "exercise", "or", "with", "status", "404", "(", "Not", "Found", ")" ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 1132, 273, 2206, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 14401, 17, 8538, 17, 20916, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 706, 13915, 916, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 5507, 34, 10486, 8211, 20884, 1526, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 613, 18, 4148, 2932, 14401, 8211, 20884, 1526, 364, 24165, 598, 612, 30, 3728, 16, 24165, 548, 1769, 203, 3639, 1312, 20603, 24165, 273, 24165, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 309, 261, 8913, 30708, 422, 446, 13, 288, 203, 5411, 604, 394, 3887, 3990, 2932, 424, 20603, 486, 1392, 598, 612, 315, 397, 24165, 548, 1769, 203, 3639, 289, 203, 3639, 309, 16051, 1944, 1564, 1179, 18, 291, 25070, 382, 2732, 1290, 424, 20603, 12, 8913, 30708, 3719, 288, 203, 5411, 327, 17987, 5621, 203, 3639, 289, 203, 3639, 327, 2306, 1943, 18, 601, 12, 8913, 30708, 3305, 18, 14401, 8211, 20884, 12, 8913, 30708, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4978, 342, 8913, 71, 6141, 16880, 8913, 30708, 548, 19, 14401, 17, 8538, 17, 20916, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 24165, 548, 434, 326, 24165, 358, 336, 326, 13686, 628, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 471, 598, 1417, 326, 24165, 16, 578, 598, 1267, 7709, 261, 1248, 10750, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByCourseIdWithLatestResultForTemplateSolutionParticipations
null
@Query(""" SELECT pe FROM ProgrammingExercise pe LEFT JOIN FETCH pe.templateParticipation tp LEFT JOIN FETCH pe.solutionParticipation sp LEFT JOIN FETCH tp.results tpr LEFT JOIN FETCH sp.results spr WHERE pe.course.id = :#{#courseId} AND (tpr.id = (SELECT MAX(re1.id) FROM tp.results re1) OR tpr.id IS NULL) AND (spr.id = (SELECT MAX(re2.id) FROM sp.results re2) OR spr.id IS NULL) """) List<ProgrammingExercise> findByCourseIdWithLatestResultForTemplateSolutionParticipations(@Param("courseId") Long courseId);
/** * Does a max join on the result table for each participation by result id (the newer the result id, the newer the result). * This makes sure that we only receive the latest result for the template and the solution participation if they exist. * * @param courseId the course the returned programming exercises belong to. * @return all exercises for the given course with only the latest results for solution and template each (if present). */
Does a max join on the result table for each participation by result id (the newer the result id, the newer the result). This makes sure that we only receive the latest result for the template and the solution participation if they exist. @param courseId the course the returned programming exercises belong to. @return all exercises for the given course with only the latest results for solution and template each (if present).
[ "Does", "a", "max", "join", "on", "the", "result", "table", "for", "each", "participation", "by", "result", "id", "(", "the", "newer", "the", "result", "id", "the", "newer", "the", "result", ")", ".", "This", "makes", "sure", "that", "we", "only", "receive", "the", "latest", "result", "for", "the", "template", "and", "the", "solution", "participation", "if", "they", "exist", ".", "@param", "courseId", "the", "course", "the", "returned", "programming", "exercises", "belong", "to", ".", "@return", "all", "exercises", "for", "the", "given", "course", "with", "only", "the", "latest", "results", "for", "solution", "and", "template", "each", "(", "if", "present", ")", "." ]
@Query(""" SELECT pe FROM ProgrammingExercise pe LEFT JOIN FETCH pe.templateParticipation tp LEFT JOIN FETCH pe.solutionParticipation sp LEFT JOIN FETCH tp.results tpr LEFT JOIN FETCH sp.results spr WHERE pe.course.id = :#{#courseId} AND (tpr.id = (SELECT MAX(re1.id) FROM tp.results re1) OR tpr.id IS NULL) AND (spr.id = (SELECT MAX(re2.id) FROM sp.results re2) OR spr.id IS NULL) """) List<ProgrammingExercise> findByCourseIdWithLatestResultForTemplateSolutionParticipations(@Param("courseId") Long courseId);
[ "@", "Query", "(", "\"\"\"\n SELECT pe FROM ProgrammingExercise pe\n LEFT JOIN FETCH pe.templateParticipation tp\n LEFT JOIN FETCH pe.solutionParticipation sp\n LEFT JOIN FETCH tp.results tpr\n LEFT JOIN FETCH sp.results spr\n WHERE pe.course.id = :#{#courseId}\n AND (tpr.id = (SELECT MAX(re1.id) FROM tp.results re1) OR tpr.id IS NULL)\n AND (spr.id = (SELECT MAX(re2.id) FROM sp.results re2) OR spr.id IS NULL)\n \"\"\"", ")", "List", "<", "ProgrammingExercise", ">", "findByCourseIdWithLatestResultForTemplateSolutionParticipations", "(", "@", "Param", "(", "\"courseId\"", ")", "Long", "courseId", ")", ";" ]
Does a max join on the result table for each participation by result id (the newer the result id, the newer the result).
[ "Does", "a", "max", "join", "on", "the", "result", "table", "for", "each", "participation", "by", "result", "id", "(", "the", "newer", "the", "result", "id", "the", "newer", "the", "result", ")", "." ]
[]
[ { "param": "courseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "courseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 2804, 4571, 13586, 11987, 424, 20603, 2804, 203, 5411, 9686, 7645, 10994, 2804, 18, 3202, 1988, 24629, 367, 8071, 203, 5411, 9686, 7645, 10994, 2804, 18, 13385, 1988, 24629, 367, 1694, 203, 5411, 9686, 7645, 10994, 8071, 18, 4717, 268, 683, 203, 5411, 9686, 7645, 10994, 1694, 18, 4717, 272, 683, 203, 5411, 4852, 2804, 18, 5566, 18, 350, 273, 294, 3642, 7, 5566, 548, 97, 203, 7734, 4116, 261, 88, 683, 18, 350, 273, 261, 4803, 4552, 12, 266, 21, 18, 350, 13, 4571, 8071, 18, 4717, 283, 21, 13, 4869, 268, 683, 18, 350, 4437, 3206, 13, 203, 7734, 4116, 261, 87, 683, 18, 350, 273, 261, 4803, 4552, 12, 266, 22, 18, 350, 13, 4571, 1694, 18, 4717, 283, 22, 13, 4869, 272, 683, 18, 350, 4437, 3206, 13, 203, 5411, 3536, 13, 203, 565, 987, 32, 9459, 11987, 424, 20603, 34, 6224, 39, 3117, 548, 1190, 18650, 1253, 1290, 2283, 16135, 1988, 24629, 1012, 26964, 786, 2932, 5566, 548, 7923, 3407, 4362, 548, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 943, 1233, 603, 326, 563, 1014, 364, 1517, 30891, 367, 635, 563, 612, 261, 5787, 16069, 326, 563, 612, 16, 326, 16069, 326, 563, 2934, 203, 377, 380, 1220, 7297, 3071, 716, 732, 1338, 6798, 326, 4891, 563, 364, 326, 1542, 471, 326, 6959, 30891, 367, 309, 2898, 1005, 18, 203, 377, 380, 203, 377, 380, 632, 891, 4362, 548, 326, 4362, 326, 2106, 5402, 11987, 431, 12610, 6141, 10957, 358, 18, 203, 377, 380, 632, 2463, 777, 431, 12610, 6141, 364, 326, 864, 4362, 598, 1338, 326, 4891, 1686, 364, 6959, 471, 1542, 1517, 261, 430, 3430, 2934, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findWithTemplateAndSolutionParticipationLatestResultById
null
@Query(""" SELECT DISTINCT pe FROM ProgrammingExercise pe LEFT JOIN FETCH pe.templateParticipation tp LEFT JOIN FETCH pe.solutionParticipation sp LEFT JOIN FETCH tp.results AS tpr LEFT JOIN FETCH sp.results AS spr LEFT JOIN FETCH tpr.feedbacks LEFT JOIN FETCH spr.feedbacks LEFT JOIN FETCH tpr.submission LEFT JOIN FETCH spr.submission WHERE pe.id = :#{#exerciseId} AND (tpr.id = (SELECT MAX(re1.id) FROM tp.results re1) OR tpr.id IS NULL) AND (spr.id = (SELECT MAX(re2.id) FROM sp.results re2) OR spr.id IS NULL) """) Optional<ProgrammingExercise> findWithTemplateAndSolutionParticipationLatestResultById(@Param("exerciseId") Long exerciseId);
/** * Get a programmingExercise with template and solution participation, each with the latest result and feedbacks. * * @param exerciseId the id of the exercise that should be fetched. * @return the exercise with the given ID, if found. */
Get a programmingExercise with template and solution participation, each with the latest result and feedbacks. @param exerciseId the id of the exercise that should be fetched. @return the exercise with the given ID, if found.
[ "Get", "a", "programmingExercise", "with", "template", "and", "solution", "participation", "each", "with", "the", "latest", "result", "and", "feedbacks", ".", "@param", "exerciseId", "the", "id", "of", "the", "exercise", "that", "should", "be", "fetched", ".", "@return", "the", "exercise", "with", "the", "given", "ID", "if", "found", "." ]
@Query(""" SELECT DISTINCT pe FROM ProgrammingExercise pe LEFT JOIN FETCH pe.templateParticipation tp LEFT JOIN FETCH pe.solutionParticipation sp LEFT JOIN FETCH tp.results AS tpr LEFT JOIN FETCH sp.results AS spr LEFT JOIN FETCH tpr.feedbacks LEFT JOIN FETCH spr.feedbacks LEFT JOIN FETCH tpr.submission LEFT JOIN FETCH spr.submission WHERE pe.id = :#{#exerciseId} AND (tpr.id = (SELECT MAX(re1.id) FROM tp.results re1) OR tpr.id IS NULL) AND (spr.id = (SELECT MAX(re2.id) FROM sp.results re2) OR spr.id IS NULL) """) Optional<ProgrammingExercise> findWithTemplateAndSolutionParticipationLatestResultById(@Param("exerciseId") Long exerciseId);
[ "@", "Query", "(", "\"\"\"\n SELECT DISTINCT pe FROM ProgrammingExercise pe\n LEFT JOIN FETCH pe.templateParticipation tp\n LEFT JOIN FETCH pe.solutionParticipation sp\n LEFT JOIN FETCH tp.results AS tpr\n LEFT JOIN FETCH sp.results AS spr\n LEFT JOIN FETCH tpr.feedbacks\n LEFT JOIN FETCH spr.feedbacks\n LEFT JOIN FETCH tpr.submission\n LEFT JOIN FETCH spr.submission\n WHERE pe.id = :#{#exerciseId}\n AND (tpr.id = (SELECT MAX(re1.id) FROM tp.results re1) OR tpr.id IS NULL)\n AND (spr.id = (SELECT MAX(re2.id) FROM sp.results re2) OR spr.id IS NULL)\n \"\"\"", ")", "Optional", "<", "ProgrammingExercise", ">", "findWithTemplateAndSolutionParticipationLatestResultById", "(", "@", "Param", "(", "\"exerciseId\"", ")", "Long", "exerciseId", ")", ";" ]
Get a programmingExercise with template and solution participation, each with the latest result and feedbacks.
[ "Get", "a", "programmingExercise", "with", "template", "and", "solution", "participation", "each", "with", "the", "latest", "result", "and", "feedbacks", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 23286, 2804, 4571, 13586, 11987, 424, 20603, 2804, 203, 5411, 9686, 7645, 10994, 2804, 18, 3202, 1988, 24629, 367, 8071, 203, 5411, 9686, 7645, 10994, 2804, 18, 13385, 1988, 24629, 367, 1694, 203, 5411, 9686, 7645, 10994, 8071, 18, 4717, 5355, 268, 683, 203, 5411, 9686, 7645, 10994, 1694, 18, 4717, 5355, 272, 683, 203, 5411, 9686, 7645, 10994, 268, 683, 18, 12571, 87, 203, 5411, 9686, 7645, 10994, 272, 683, 18, 12571, 87, 203, 5411, 9686, 7645, 10994, 268, 683, 18, 12684, 203, 5411, 9686, 7645, 10994, 272, 683, 18, 12684, 203, 5411, 4852, 2804, 18, 350, 273, 294, 3642, 7, 8913, 30708, 548, 97, 203, 7734, 4116, 261, 88, 683, 18, 350, 273, 261, 4803, 4552, 12, 266, 21, 18, 350, 13, 4571, 8071, 18, 4717, 283, 21, 13, 4869, 268, 683, 18, 350, 4437, 3206, 13, 203, 7734, 4116, 261, 87, 683, 18, 350, 273, 261, 4803, 4552, 12, 266, 22, 18, 350, 13, 4571, 1694, 18, 4717, 283, 22, 13, 4869, 272, 683, 18, 350, 4437, 3206, 13, 203, 5411, 3536, 13, 203, 565, 4055, 32, 9459, 11987, 424, 20603, 34, 1104, 1190, 2283, 1876, 16135, 1988, 24629, 367, 18650, 1253, 5132, 26964, 786, 2932, 8913, 30708, 548, 7923, 3407, 24165, 548, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 968, 279, 5402, 11987, 424, 20603, 598, 1542, 471, 6959, 30891, 367, 16, 1517, 598, 326, 4891, 563, 471, 10762, 87, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 612, 434, 326, 24165, 716, 1410, 506, 12807, 18, 203, 377, 380, 632, 2463, 326, 24165, 598, 326, 864, 1599, 16, 309, 1392, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findAllToBeScheduled
null
@Query(""" select distinct pe from ProgrammingExercise pe where pe.releaseDate > :#{#now} or pe.buildAndTestStudentSubmissionsAfterDueDate > :#{#now} or (pe.assessmentType <> 'AUTOMATIC' and pe.dueDate > :#{#now}) """) List<ProgrammingExercise> findAllToBeScheduled(@Param("now") ZonedDateTime now);
/** * Get all programming exercises that need to be scheduled: Those must satisfy one of the following requirements: * <ol> * <li>The release date is in the future --> Schedule combine template commits</li> * <li>The build and test student submissions after deadline date is in the future</li> * <li>Manual assessment is enabled and the due date is in the future</li> * </ol> * * @param now the current time * @return List of the exercises that should be scheduled */
Get all programming exercises that need to be scheduled: Those must satisfy one of the following requirements: The release date is in the future --> Schedule combine template commits The build and test student submissions after deadline date is in the future Manual assessment is enabled and the due date is in the future @param now the current time @return List of the exercises that should be scheduled
[ "Get", "all", "programming", "exercises", "that", "need", "to", "be", "scheduled", ":", "Those", "must", "satisfy", "one", "of", "the", "following", "requirements", ":", "The", "release", "date", "is", "in", "the", "future", "--", ">", "Schedule", "combine", "template", "commits", "The", "build", "and", "test", "student", "submissions", "after", "deadline", "date", "is", "in", "the", "future", "Manual", "assessment", "is", "enabled", "and", "the", "due", "date", "is", "in", "the", "future", "@param", "now", "the", "current", "time", "@return", "List", "of", "the", "exercises", "that", "should", "be", "scheduled" ]
@Query(""" select distinct pe from ProgrammingExercise pe where pe.releaseDate > :#{#now} or pe.buildAndTestStudentSubmissionsAfterDueDate > :#{#now} or (pe.assessmentType <> 'AUTOMATIC' and pe.dueDate > :#{#now}) """) List<ProgrammingExercise> findAllToBeScheduled(@Param("now") ZonedDateTime now);
[ "@", "Query", "(", "\"\"\"\n select distinct pe from ProgrammingExercise pe\n where pe.releaseDate > :#{#now}\n or pe.buildAndTestStudentSubmissionsAfterDueDate > :#{#now}\n or (pe.assessmentType <> 'AUTOMATIC' and pe.dueDate > :#{#now})\n \"\"\"", ")", "List", "<", "ProgrammingExercise", ">", "findAllToBeScheduled", "(", "@", "Param", "(", "\"now\"", ")", "ZonedDateTime", "now", ")", ";" ]
Get all programming exercises that need to be scheduled: Those must satisfy one of the following requirements: <ol> <li>The release date is in the future --> Schedule combine template commits</li> <li>The build and test student submissions after deadline date is in the future</li> <li>Manual assessment is enabled and the due date is in the future</li> </ol>
[ "Get", "all", "programming", "exercises", "that", "need", "to", "be", "scheduled", ":", "Those", "must", "satisfy", "one", "of", "the", "following", "requirements", ":", "<ol", ">", "<li", ">", "The", "release", "date", "is", "in", "the", "future", "--", ">", "Schedule", "combine", "template", "commits<", "/", "li", ">", "<li", ">", "The", "build", "and", "test", "student", "submissions", "after", "deadline", "date", "is", "in", "the", "future<", "/", "li", ">", "<li", ">", "Manual", "assessment", "is", "enabled", "and", "the", "due", "date", "is", "in", "the", "future<", "/", "li", ">", "<", "/", "ol", ">" ]
[]
[ { "param": "now", "type": "ZonedDateTime" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "now", "type": "ZonedDateTime", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 2027, 10217, 2804, 628, 13586, 11987, 424, 20603, 2804, 203, 5411, 1625, 2804, 18, 9340, 1626, 405, 294, 3642, 7, 3338, 97, 203, 7734, 578, 2804, 18, 3510, 1876, 4709, 19943, 319, 1676, 7300, 4436, 30023, 1626, 405, 294, 3642, 7, 3338, 97, 203, 7734, 578, 261, 347, 18, 18222, 559, 2813, 296, 37, 1693, 1872, 11781, 11, 471, 2804, 18, 24334, 1626, 405, 294, 3642, 7, 3338, 6792, 203, 5411, 3536, 13, 203, 565, 987, 32, 9459, 11987, 424, 20603, 34, 11135, 15360, 10660, 26964, 786, 2932, 3338, 7923, 24869, 2037, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 968, 777, 5402, 11987, 431, 12610, 6141, 716, 1608, 358, 506, 9755, 30, 935, 2584, 1297, 18866, 1245, 434, 326, 3751, 8433, 30, 203, 377, 380, 411, 355, 34, 203, 377, 380, 411, 549, 34, 1986, 3992, 1509, 353, 316, 326, 3563, 15431, 10674, 8661, 1542, 14335, 1757, 549, 34, 203, 377, 380, 411, 549, 34, 1986, 1361, 471, 1842, 18110, 22071, 1839, 14096, 1509, 353, 316, 326, 3563, 1757, 549, 34, 203, 377, 380, 411, 549, 34, 25139, 14158, 353, 3696, 471, 326, 6541, 1509, 353, 316, 326, 3563, 1757, 549, 34, 203, 377, 380, 7765, 355, 34, 203, 377, 380, 203, 377, 380, 632, 891, 2037, 326, 783, 813, 203, 377, 380, 632, 2463, 987, 434, 326, 431, 12610, 6141, 2 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByTitleInExerciseOrCourseAndUserHasAccessToCourse
null
@Query(""" SELECT pe FROM ProgrammingExercise pe WHERE pe.shortName IS NOT NULL AND ( pe.id IN ( SELECT coursePe.id FROM ProgrammingExercise coursePe WHERE (coursePe.course.instructorGroupName IN :groups OR coursePe.course.editorGroupName IN :groups) AND (coursePe.title LIKE %:partialTitle% OR coursePe.course.title LIKE %:partialCourseTitle%) ) OR pe.id IN ( SELECT examPe.id FROM ProgrammingExercise examPe WHERE (examPe.exerciseGroup.exam.course.instructorGroupName IN :groups OR examPe.exerciseGroup.exam.course.editorGroupName IN :groups) AND (examPe.title LIKE %:partialTitle% OR examPe.exerciseGroup.exam.course.title LIKE %:partialCourseTitle%) ) ) """) Page<ProgrammingExercise> findByTitleInExerciseOrCourseAndUserHasAccessToCourse(@Param("partialTitle") String partialTitle, @Param("partialCourseTitle") String partialCourseTitle, @Param("groups") Set<String> groups, Pageable pageable);
/** * Query which fetches all the programming exercises for which the user is instructor in the course and matching the search criteria. * As JPQL doesn't support unions, the distinction for course exercises and exam exercises is made with sub queries. * * @param partialTitle exercise title search term * @param partialCourseTitle course title search term * @param groups user groups * @param pageable Pageable * @return Page with search results */
Query which fetches all the programming exercises for which the user is instructor in the course and matching the search criteria. As JPQL doesn't support unions, the distinction for course exercises and exam exercises is made with sub queries.
[ "Query", "which", "fetches", "all", "the", "programming", "exercises", "for", "which", "the", "user", "is", "instructor", "in", "the", "course", "and", "matching", "the", "search", "criteria", ".", "As", "JPQL", "doesn", "'", "t", "support", "unions", "the", "distinction", "for", "course", "exercises", "and", "exam", "exercises", "is", "made", "with", "sub", "queries", "." ]
@Query(""" SELECT pe FROM ProgrammingExercise pe WHERE pe.shortName IS NOT NULL AND ( pe.id IN ( SELECT coursePe.id FROM ProgrammingExercise coursePe WHERE (coursePe.course.instructorGroupName IN :groups OR coursePe.course.editorGroupName IN :groups) AND (coursePe.title LIKE %:partialTitle% OR coursePe.course.title LIKE %:partialCourseTitle%) ) OR pe.id IN ( SELECT examPe.id FROM ProgrammingExercise examPe WHERE (examPe.exerciseGroup.exam.course.instructorGroupName IN :groups OR examPe.exerciseGroup.exam.course.editorGroupName IN :groups) AND (examPe.title LIKE %:partialTitle% OR examPe.exerciseGroup.exam.course.title LIKE %:partialCourseTitle%) ) ) """) Page<ProgrammingExercise> findByTitleInExerciseOrCourseAndUserHasAccessToCourse(@Param("partialTitle") String partialTitle, @Param("partialCourseTitle") String partialCourseTitle, @Param("groups") Set<String> groups, Pageable pageable);
[ "@", "Query", "(", "\"\"\"\n SELECT pe FROM ProgrammingExercise pe\n WHERE pe.shortName IS NOT NULL AND (\n pe.id IN (\n SELECT coursePe.id\n FROM ProgrammingExercise coursePe\n WHERE (coursePe.course.instructorGroupName IN :groups OR coursePe.course.editorGroupName IN :groups)\n AND (coursePe.title LIKE %:partialTitle% OR coursePe.course.title LIKE %:partialCourseTitle%)\n ) OR pe.id IN (\n SELECT examPe.id\n FROM ProgrammingExercise examPe\n WHERE (examPe.exerciseGroup.exam.course.instructorGroupName IN :groups OR examPe.exerciseGroup.exam.course.editorGroupName IN :groups)\n AND (examPe.title LIKE %:partialTitle% OR examPe.exerciseGroup.exam.course.title LIKE %:partialCourseTitle%)\n )\n )\n \"\"\"", ")", "Page", "<", "ProgrammingExercise", ">", "findByTitleInExerciseOrCourseAndUserHasAccessToCourse", "(", "@", "Param", "(", "\"partialTitle\"", ")", "String", "partialTitle", ",", "@", "Param", "(", "\"partialCourseTitle\"", ")", "String", "partialCourseTitle", ",", "@", "Param", "(", "\"groups\"", ")", "Set", "<", "String", ">", "groups", ",", "Pageable", "pageable", ")", ";" ]
Query which fetches all the programming exercises for which the user is instructor in the course and matching the search criteria.
[ "Query", "which", "fetches", "all", "the", "programming", "exercises", "for", "which", "the", "user", "is", "instructor", "in", "the", "course", "and", "matching", "the", "search", "criteria", "." ]
[]
[ { "param": "partialTitle", "type": "String" }, { "param": "partialCourseTitle", "type": "String" }, { "param": "groups", "type": "Set<String>" }, { "param": "pageable", "type": "Pageable" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "partialTitle", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "partialCourseTitle", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "groups", "type": "Set<String>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pageable", "type": "Pageable", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 2804, 4571, 13586, 11987, 424, 20603, 2804, 203, 5411, 4852, 2804, 18, 6620, 461, 4437, 4269, 3206, 4116, 261, 203, 7734, 2804, 18, 350, 2120, 261, 203, 10792, 9111, 4362, 11227, 18, 350, 203, 10792, 4571, 13586, 11987, 424, 20603, 4362, 11227, 203, 10792, 4852, 261, 5566, 11227, 18, 5566, 18, 267, 2732, 3943, 2120, 294, 4650, 4869, 4362, 11227, 18, 5566, 18, 9177, 3943, 2120, 294, 4650, 13, 203, 13491, 4116, 261, 5566, 11227, 18, 2649, 13161, 738, 30, 11601, 4247, 9, 4869, 4362, 11227, 18, 5566, 18, 2649, 13161, 738, 30, 11601, 39, 3117, 4247, 9, 13, 203, 7734, 262, 4869, 2804, 18, 350, 2120, 261, 203, 10792, 9111, 19707, 11227, 18, 350, 203, 10792, 4571, 13586, 11987, 424, 20603, 19707, 11227, 203, 10792, 4852, 261, 338, 301, 11227, 18, 8913, 30708, 1114, 18, 338, 301, 18, 5566, 18, 267, 2732, 3943, 2120, 294, 4650, 4869, 19707, 11227, 18, 8913, 30708, 1114, 18, 338, 301, 18, 5566, 18, 9177, 3943, 2120, 294, 4650, 13, 203, 13491, 4116, 261, 338, 301, 11227, 18, 2649, 13161, 738, 30, 11601, 4247, 9, 4869, 19707, 11227, 18, 8913, 30708, 1114, 18, 338, 301, 18, 5566, 18, 2649, 13161, 738, 30, 11601, 39, 3117, 4247, 9, 13, 203, 7734, 262, 203, 5411, 262, 203, 5411, 3536, 13, 203, 565, 3460, 32, 9459, 11987, 424, 20603, 34, 6224, 4247, 382, 424, 20603, 1162, 39, 3117, 1876, 1299, 5582, 1862, 774, 39, 3117, 26964, 786,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2770, 1492, 17675, 777, 326, 5402, 11987, 431, 12610, 6141, 364, 1492, 326, 729, 353, 316, 2732, 316, 326, 4362, 471, 3607, 326, 1623, 3582, 18, 203, 377, 380, 2970, 804, 52, 2024, 3302, 1404, 2865, 640, 1115, 16, 326, 2411, 267, 349, 364, 4362, 431, 12610, 6141, 471, 19707, 431, 12610, 6141, 353, 7165, 598, 720, 6218, 18, 203, 377, 380, 203, 377, 380, 632, 891, 4702, 4247, 4202, 24165, 2077, 1623, 2481, 203, 377, 380, 632, 891, 4702, 39, 3117, 4247, 4362, 2077, 1623, 2481, 203, 377, 380, 632, 891, 3252, 2398, 729, 3252, 203, 377, 380, 632, 891, 1363, 429, 6647, 3460, 429, 203, 377, 380, 632, 2463, 3460, 598, 1623, 1686, 203, 377, 1195, 2, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findAllByDueDateAfterDateWithTestsAfterDueDateWithoutBuildStudentSubmissionsDate
null
@Query(""" SELECT DISTINCT pe FROM ProgrammingExercise pe LEFT JOIN pe.testCases tc WHERE pe.dueDate > :#{#now} AND pe.buildAndTestStudentSubmissionsAfterDueDate IS NULL AND tc.visibility = 'AFTER_DUE_DATE' """) List<ProgrammingExercise> findAllByDueDateAfterDateWithTestsAfterDueDateWithoutBuildStudentSubmissionsDate(@Param("now") ZonedDateTime now);
/** * Returns all programming exercises that have a due date after {@code now} and have tests marked with * {@link de.tum.in.www1.artemis.domain.enumeration.Visibility#AFTER_DUE_DATE} but no buildAndTestStudentSubmissionsAfterDueDate. * * @param now the time after which the due date of the exercise has to be * @return List<ProgrammingExercise> (can be empty) */
Returns all programming exercises that have a due date after now and have tests marked with de.tum.in.www1.artemis.domain.enumeration.Visibility#AFTER_DUE_DATE but no buildAndTestStudentSubmissionsAfterDueDate. @param now the time after which the due date of the exercise has to be @return List (can be empty)
[ "Returns", "all", "programming", "exercises", "that", "have", "a", "due", "date", "after", "now", "and", "have", "tests", "marked", "with", "de", ".", "tum", ".", "in", ".", "www1", ".", "artemis", ".", "domain", ".", "enumeration", ".", "Visibility#AFTER_DUE_DATE", "but", "no", "buildAndTestStudentSubmissionsAfterDueDate", ".", "@param", "now", "the", "time", "after", "which", "the", "due", "date", "of", "the", "exercise", "has", "to", "be", "@return", "List", "(", "can", "be", "empty", ")" ]
@Query(""" SELECT DISTINCT pe FROM ProgrammingExercise pe LEFT JOIN pe.testCases tc WHERE pe.dueDate > :#{#now} AND pe.buildAndTestStudentSubmissionsAfterDueDate IS NULL AND tc.visibility = 'AFTER_DUE_DATE' """) List<ProgrammingExercise> findAllByDueDateAfterDateWithTestsAfterDueDateWithoutBuildStudentSubmissionsDate(@Param("now") ZonedDateTime now);
[ "@", "Query", "(", "\"\"\"\n SELECT DISTINCT pe FROM ProgrammingExercise pe\n LEFT JOIN pe.testCases tc\n WHERE pe.dueDate > :#{#now}\n AND pe.buildAndTestStudentSubmissionsAfterDueDate IS NULL\n AND tc.visibility = 'AFTER_DUE_DATE'\n \"\"\"", ")", "List", "<", "ProgrammingExercise", ">", "findAllByDueDateAfterDateWithTestsAfterDueDateWithoutBuildStudentSubmissionsDate", "(", "@", "Param", "(", "\"now\"", ")", "ZonedDateTime", "now", ")", ";" ]
Returns all programming exercises that have a due date after {@code now} and have tests marked with {@link de.tum.in.www1.artemis.domain.enumeration.Visibility#AFTER_DUE_DATE} but no buildAndTestStudentSubmissionsAfterDueDate.
[ "Returns", "all", "programming", "exercises", "that", "have", "a", "due", "date", "after", "{", "@code", "now", "}", "and", "have", "tests", "marked", "with", "{", "@link", "de", ".", "tum", ".", "in", ".", "www1", ".", "artemis", ".", "domain", ".", "enumeration", ".", "Visibility#AFTER_DUE_DATE", "}", "but", "no", "buildAndTestStudentSubmissionsAfterDueDate", "." ]
[]
[ { "param": "now", "type": "ZonedDateTime" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "now", "type": "ZonedDateTime", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 23286, 2804, 4571, 13586, 11987, 424, 20603, 2804, 203, 5411, 9686, 7645, 2804, 18, 3813, 30744, 1715, 203, 5411, 4852, 2804, 18, 24334, 1626, 405, 294, 3642, 7, 3338, 97, 203, 7734, 4116, 2804, 18, 3510, 1876, 4709, 19943, 319, 1676, 7300, 4436, 30023, 1626, 4437, 3206, 203, 7734, 4116, 1715, 18, 14422, 273, 296, 18249, 67, 40, 1821, 67, 4594, 11, 203, 5411, 3536, 13, 203, 565, 987, 32, 9459, 11987, 424, 20603, 34, 11135, 858, 30023, 1626, 4436, 1626, 1190, 14650, 4436, 30023, 1626, 8073, 3116, 19943, 319, 1676, 7300, 1626, 26964, 786, 2932, 3338, 7923, 24869, 2037, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2860, 777, 5402, 11987, 431, 12610, 6141, 716, 1240, 279, 6541, 1509, 1839, 8901, 710, 2037, 97, 471, 1240, 7434, 9350, 598, 203, 377, 380, 8901, 1232, 443, 18, 88, 379, 18, 267, 18, 5591, 21, 18, 485, 351, 291, 18, 4308, 18, 7924, 7067, 18, 10135, 7, 18249, 67, 40, 1821, 67, 4594, 97, 1496, 1158, 1361, 1876, 4709, 19943, 319, 1676, 7300, 4436, 30023, 1626, 18, 203, 377, 380, 203, 377, 380, 632, 891, 2037, 326, 813, 1839, 1492, 326, 6541, 1509, 434, 326, 24165, 711, 358, 506, 203, 377, 380, 632, 2463, 987, 32, 9459, 11987, 424, 20603, 34, 261, 4169, 506, 1008, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countSubmissionsByExerciseIdSubmitted
null
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.id = :#{#exerciseId} AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) """) long countSubmissionsByExerciseIdSubmitted(@Param("exerciseId") Long exerciseId);
/** * In distinction to other exercise types, students can have multiple submissions in a programming exercise. * We therefore have to check here that a submission exists, that was submitted before the deadline. * * @param exerciseId the exercise id we are interested in * @return the number of distinct submissions belonging to the exercise id */
In distinction to other exercise types, students can have multiple submissions in a programming exercise. We therefore have to check here that a submission exists, that was submitted before the deadline. @param exerciseId the exercise id we are interested in @return the number of distinct submissions belonging to the exercise id
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", ".", "We", "therefore", "have", "to", "check", "here", "that", "a", "submission", "exists", "that", "was", "submitted", "before", "the", "deadline", ".", "@param", "exerciseId", "the", "exercise", "id", "we", "are", "interested", "in", "@return", "the", "number", "of", "distinct", "submissions", "belonging", "to", "the", "exercise", "id" ]
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.id = :#{#exerciseId} AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) """) long countSubmissionsByExerciseIdSubmitted(@Param("exerciseId") Long exerciseId);
[ "@", "Query", "(", "\"\"\"\n SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p\n JOIN p.submissions s\n WHERE p.exercise.id = :#{#exerciseId}\n AND s.submitted = TRUE\n AND (s.type <> 'ILLEGAL' OR s.type IS NULL)\n \"\"\"", ")", "long", "countSubmissionsByExerciseIdSubmitted", "(", "@", "Param", "(", "\"exerciseId\"", ")", "Long", "exerciseId", ")", ";" ]
In distinction to other exercise types, students can have multiple submissions in a programming exercise.
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 12666, 261, 2565, 17807, 293, 13, 4571, 13586, 11987, 424, 20603, 19943, 319, 1988, 24629, 367, 293, 203, 5411, 7645, 293, 18, 25675, 272, 203, 5411, 4852, 293, 18, 8913, 30708, 18, 350, 273, 294, 3642, 7, 8913, 30708, 548, 97, 203, 7734, 4116, 272, 18, 31575, 273, 5383, 203, 7734, 4116, 261, 87, 18, 723, 2813, 296, 2627, 19384, 1013, 11, 4869, 272, 18, 723, 4437, 3206, 13, 203, 5411, 3536, 13, 203, 565, 1525, 1056, 1676, 7300, 858, 424, 20603, 548, 28882, 26964, 786, 2932, 8913, 30708, 548, 7923, 3407, 24165, 548, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 657, 2411, 267, 349, 358, 1308, 24165, 1953, 16, 10068, 4877, 848, 1240, 3229, 22071, 316, 279, 5402, 11987, 24165, 18, 203, 377, 380, 1660, 13526, 1240, 358, 866, 2674, 716, 279, 8515, 1704, 16, 716, 1703, 9638, 1865, 326, 14096, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 24165, 612, 732, 854, 20506, 316, 203, 377, 380, 632, 2463, 326, 1300, 434, 10217, 22071, 17622, 358, 326, 24165, 612, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countLegalSubmissionsByExerciseIdSubmittedIgnoreTestRunSubmissions
null
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.id = :#{#exerciseId} AND p.testRun = FALSE AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) """) long countLegalSubmissionsByExerciseIdSubmittedIgnoreTestRunSubmissions(@Param("exerciseId") Long exerciseId);
/** * In distinction to other exercise types, students can have multiple submissions in a programming exercise. * We therefore have to check here that a submission exists, that was submitted before the deadline. * Should be used for exam dashboard to ignore test run submissions. * * @param exerciseId the exercise id we are interested in * @return the number of distinct submissions belonging to the exercise id */
In distinction to other exercise types, students can have multiple submissions in a programming exercise. We therefore have to check here that a submission exists, that was submitted before the deadline. Should be used for exam dashboard to ignore test run submissions. @param exerciseId the exercise id we are interested in @return the number of distinct submissions belonging to the exercise id
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", ".", "We", "therefore", "have", "to", "check", "here", "that", "a", "submission", "exists", "that", "was", "submitted", "before", "the", "deadline", ".", "Should", "be", "used", "for", "exam", "dashboard", "to", "ignore", "test", "run", "submissions", ".", "@param", "exerciseId", "the", "exercise", "id", "we", "are", "interested", "in", "@return", "the", "number", "of", "distinct", "submissions", "belonging", "to", "the", "exercise", "id" ]
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.id = :#{#exerciseId} AND p.testRun = FALSE AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) """) long countLegalSubmissionsByExerciseIdSubmittedIgnoreTestRunSubmissions(@Param("exerciseId") Long exerciseId);
[ "@", "Query", "(", "\"\"\"\n SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p\n JOIN p.submissions s\n WHERE p.exercise.id = :#{#exerciseId}\n AND p.testRun = FALSE\n AND s.submitted = TRUE\n AND (s.type <> 'ILLEGAL' OR s.type IS NULL)\n \"\"\"", ")", "long", "countLegalSubmissionsByExerciseIdSubmittedIgnoreTestRunSubmissions", "(", "@", "Param", "(", "\"exerciseId\"", ")", "Long", "exerciseId", ")", ";" ]
In distinction to other exercise types, students can have multiple submissions in a programming exercise.
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 12666, 261, 2565, 17807, 293, 13, 4571, 13586, 11987, 424, 20603, 19943, 319, 1988, 24629, 367, 293, 203, 5411, 7645, 293, 18, 25675, 272, 203, 5411, 4852, 293, 18, 8913, 30708, 18, 350, 273, 294, 3642, 7, 8913, 30708, 548, 97, 203, 7734, 4116, 293, 18, 3813, 1997, 273, 4934, 203, 7734, 4116, 272, 18, 31575, 273, 5383, 203, 7734, 4116, 261, 87, 18, 723, 2813, 296, 2627, 19384, 1013, 11, 4869, 272, 18, 723, 4437, 3206, 13, 203, 5411, 3536, 13, 203, 565, 1525, 1056, 30697, 1676, 7300, 858, 424, 20603, 548, 28882, 3777, 4709, 1997, 1676, 7300, 26964, 786, 2932, 8913, 30708, 548, 7923, 3407, 24165, 548, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 657, 2411, 267, 349, 358, 1308, 24165, 1953, 16, 10068, 4877, 848, 1240, 3229, 22071, 316, 279, 5402, 11987, 24165, 18, 203, 377, 380, 1660, 13526, 1240, 358, 866, 2674, 716, 279, 8515, 1704, 16, 716, 1703, 9638, 1865, 326, 14096, 18, 203, 377, 380, 9363, 506, 1399, 364, 19707, 11825, 358, 2305, 1842, 1086, 22071, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 24165, 612, 732, 854, 20506, 316, 203, 377, 380, 632, 2463, 326, 1300, 434, 10217, 22071, 17622, 358, 326, 24165, 612, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countSubmissionsByExerciseIdsSubmittedIgnoreTestRun
null
@Query(""" SELECT new de.tum.in.www1.artemis.domain.assessment.dashboard.ExerciseMapEntry( p.exercise.id, count(DISTINCT p) ) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.id IN :exerciseIds AND p.testRun = FALSE AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) GROUP BY p.exercise.id """) List<ExerciseMapEntry> countSubmissionsByExerciseIdsSubmittedIgnoreTestRun(@Param("exerciseIds") Set<Long> exerciseIds);
/** * In distinction to other exercise types, students can have multiple submissions in a programming exercise. * We therefore have to check here that a submission exists, that was submitted before the deadline. * Should be used for exam dashboard to ignore test run submissions. * * @param exerciseIds the exercise ids we are interested in * @return the number of distinct submissions belonging to the exercise id */
In distinction to other exercise types, students can have multiple submissions in a programming exercise. We therefore have to check here that a submission exists, that was submitted before the deadline. Should be used for exam dashboard to ignore test run submissions. @param exerciseIds the exercise ids we are interested in @return the number of distinct submissions belonging to the exercise id
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", ".", "We", "therefore", "have", "to", "check", "here", "that", "a", "submission", "exists", "that", "was", "submitted", "before", "the", "deadline", ".", "Should", "be", "used", "for", "exam", "dashboard", "to", "ignore", "test", "run", "submissions", ".", "@param", "exerciseIds", "the", "exercise", "ids", "we", "are", "interested", "in", "@return", "the", "number", "of", "distinct", "submissions", "belonging", "to", "the", "exercise", "id" ]
@Query(""" SELECT new de.tum.in.www1.artemis.domain.assessment.dashboard.ExerciseMapEntry( p.exercise.id, count(DISTINCT p) ) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.id IN :exerciseIds AND p.testRun = FALSE AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) GROUP BY p.exercise.id """) List<ExerciseMapEntry> countSubmissionsByExerciseIdsSubmittedIgnoreTestRun(@Param("exerciseIds") Set<Long> exerciseIds);
[ "@", "Query", "(", "\"\"\"\n SELECT new de.tum.in.www1.artemis.domain.assessment.dashboard.ExerciseMapEntry(\n p.exercise.id,\n count(DISTINCT p)\n )\n FROM ProgrammingExerciseStudentParticipation p\n JOIN p.submissions s\n WHERE p.exercise.id IN :exerciseIds\n AND p.testRun = FALSE\n AND s.submitted = TRUE\n AND (s.type <> 'ILLEGAL' OR s.type IS NULL)\n GROUP BY p.exercise.id\n \"\"\"", ")", "List", "<", "ExerciseMapEntry", ">", "countSubmissionsByExerciseIdsSubmittedIgnoreTestRun", "(", "@", "Param", "(", "\"exerciseIds\"", ")", "Set", "<", "Long", ">", "exerciseIds", ")", ";" ]
In distinction to other exercise types, students can have multiple submissions in a programming exercise.
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", "." ]
[]
[ { "param": "exerciseIds", "type": "Set<Long>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseIds", "type": "Set<Long>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 394, 443, 18, 88, 379, 18, 267, 18, 5591, 21, 18, 485, 351, 291, 18, 4308, 18, 18222, 18, 13479, 18, 424, 20603, 863, 1622, 12, 203, 7734, 293, 18, 8913, 30708, 18, 350, 16, 203, 7734, 1056, 12, 2565, 17807, 293, 13, 203, 5411, 262, 203, 5411, 4571, 13586, 11987, 424, 20603, 19943, 319, 1988, 24629, 367, 293, 203, 5411, 7645, 293, 18, 25675, 272, 203, 5411, 4852, 293, 18, 8913, 30708, 18, 350, 2120, 294, 8913, 30708, 2673, 203, 7734, 4116, 293, 18, 3813, 1997, 273, 4934, 203, 7734, 4116, 272, 18, 31575, 273, 5383, 203, 7734, 4116, 261, 87, 18, 723, 2813, 296, 2627, 19384, 1013, 11, 4869, 272, 18, 723, 4437, 3206, 13, 203, 5411, 13839, 6953, 293, 18, 8913, 30708, 18, 350, 203, 5411, 3536, 13, 203, 565, 987, 32, 424, 20603, 863, 1622, 34, 1056, 1676, 7300, 858, 424, 20603, 2673, 28882, 3777, 4709, 1997, 26964, 786, 2932, 8913, 30708, 2673, 7923, 1000, 32, 3708, 34, 24165, 2673, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 657, 2411, 267, 349, 358, 1308, 24165, 1953, 16, 10068, 4877, 848, 1240, 3229, 22071, 316, 279, 5402, 11987, 24165, 18, 203, 377, 380, 1660, 13526, 1240, 358, 866, 2674, 716, 279, 8515, 1704, 16, 716, 1703, 9638, 1865, 326, 14096, 18, 203, 377, 380, 9363, 506, 1399, 364, 19707, 11825, 358, 2305, 1842, 1086, 22071, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 2673, 326, 24165, 3258, 732, 854, 20506, 316, 203, 377, 380, 632, 2463, 326, 1300, 434, 10217, 22071, 17622, 358, 326, 24165, 612, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countAssessmentsByExerciseIdSubmitted
null
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p LEFT JOIN p.results r WHERE p.exercise.id = :#{#exerciseId} AND r.submission.submitted = TRUE AND (r.submission.type <> 'ILLEGAL' OR r.submission.type IS NULL) AND r.assessor IS NOT NULL AND r.completionDate IS NOT NULL """) long countAssessmentsByExerciseIdSubmitted(@Param("exerciseId") Long exerciseId);
/** * needs improvement * In distinction to other exercise types, students can have multiple submissions in a programming exercise. * We therefore have to check here that a submission exists, that was submitted before the deadline. * * @param exerciseId the exercise id we are interested in * @return the number of distinct submissions belonging to the exercise id that are assessed */
needs improvement In distinction to other exercise types, students can have multiple submissions in a programming exercise. We therefore have to check here that a submission exists, that was submitted before the deadline. @param exerciseId the exercise id we are interested in @return the number of distinct submissions belonging to the exercise id that are assessed
[ "needs", "improvement", "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", ".", "We", "therefore", "have", "to", "check", "here", "that", "a", "submission", "exists", "that", "was", "submitted", "before", "the", "deadline", ".", "@param", "exerciseId", "the", "exercise", "id", "we", "are", "interested", "in", "@return", "the", "number", "of", "distinct", "submissions", "belonging", "to", "the", "exercise", "id", "that", "are", "assessed" ]
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p LEFT JOIN p.results r WHERE p.exercise.id = :#{#exerciseId} AND r.submission.submitted = TRUE AND (r.submission.type <> 'ILLEGAL' OR r.submission.type IS NULL) AND r.assessor IS NOT NULL AND r.completionDate IS NOT NULL """) long countAssessmentsByExerciseIdSubmitted(@Param("exerciseId") Long exerciseId);
[ "@", "Query", "(", "\"\"\"\n SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p\n LEFT JOIN p.results r\n WHERE p.exercise.id = :#{#exerciseId}\n AND r.submission.submitted = TRUE\n AND (r.submission.type <> 'ILLEGAL' OR r.submission.type IS NULL)\n AND r.assessor IS NOT NULL\n AND r.completionDate IS NOT NULL\n \"\"\"", ")", "long", "countAssessmentsByExerciseIdSubmitted", "(", "@", "Param", "(", "\"exerciseId\"", ")", "Long", "exerciseId", ")", ";" ]
needs improvement In distinction to other exercise types, students can have multiple submissions in a programming exercise.
[ "needs", "improvement", "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 12666, 261, 2565, 17807, 293, 13, 4571, 13586, 11987, 424, 20603, 19943, 319, 1988, 24629, 367, 293, 203, 5411, 9686, 7645, 293, 18, 4717, 436, 203, 5411, 4852, 293, 18, 8913, 30708, 18, 350, 273, 294, 3642, 7, 8913, 30708, 548, 97, 203, 7734, 4116, 436, 18, 12684, 18, 31575, 273, 5383, 203, 7734, 4116, 261, 86, 18, 12684, 18, 723, 2813, 296, 2627, 19384, 1013, 11, 4869, 436, 18, 12684, 18, 723, 4437, 3206, 13, 203, 7734, 4116, 436, 18, 428, 403, 280, 4437, 4269, 3206, 203, 7734, 4116, 436, 18, 11469, 1626, 4437, 4269, 3206, 203, 5411, 3536, 13, 203, 565, 1525, 1056, 2610, 403, 1346, 858, 424, 20603, 548, 28882, 26964, 786, 2932, 8913, 30708, 548, 7923, 3407, 24165, 548, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4260, 13069, 22627, 203, 377, 380, 657, 2411, 267, 349, 358, 1308, 24165, 1953, 16, 10068, 4877, 848, 1240, 3229, 22071, 316, 279, 5402, 11987, 24165, 18, 203, 377, 380, 1660, 13526, 1240, 358, 866, 2674, 716, 279, 8515, 1704, 16, 716, 1703, 9638, 1865, 326, 14096, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 24165, 612, 732, 854, 20506, 316, 203, 377, 380, 632, 2463, 326, 1300, 434, 10217, 22071, 17622, 358, 326, 24165, 612, 716, 854, 1551, 281, 730, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countAssessmentsByExerciseIdSubmittedIgnoreTestRunSubmissions
null
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p LEFT JOIN p.results r WHERE p.exercise.id = :#{#exerciseId} AND p.testRun = FALSE AND r.submission.submitted = TRUE AND (r.submission.type <> 'ILLEGAL' OR r.submission.type IS NULL) AND r.assessor IS NOT NULL AND r.completionDate IS NOT NULL """) long countAssessmentsByExerciseIdSubmittedIgnoreTestRunSubmissions(@Param("exerciseId") Long exerciseId);
/** * In distinction to other exercise types, students can have multiple submissions in a programming exercise. * We therefore have to check here that a submission exists, that was submitted before the deadline. * Should be used for exam dashboard to ignore test run submissions. * * @param exerciseId the exercise id we are interested in * @return the number of distinct submissions belonging to the exercise id that are assessed */
In distinction to other exercise types, students can have multiple submissions in a programming exercise. We therefore have to check here that a submission exists, that was submitted before the deadline. Should be used for exam dashboard to ignore test run submissions. @param exerciseId the exercise id we are interested in @return the number of distinct submissions belonging to the exercise id that are assessed
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", ".", "We", "therefore", "have", "to", "check", "here", "that", "a", "submission", "exists", "that", "was", "submitted", "before", "the", "deadline", ".", "Should", "be", "used", "for", "exam", "dashboard", "to", "ignore", "test", "run", "submissions", ".", "@param", "exerciseId", "the", "exercise", "id", "we", "are", "interested", "in", "@return", "the", "number", "of", "distinct", "submissions", "belonging", "to", "the", "exercise", "id", "that", "are", "assessed" ]
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p LEFT JOIN p.results r WHERE p.exercise.id = :#{#exerciseId} AND p.testRun = FALSE AND r.submission.submitted = TRUE AND (r.submission.type <> 'ILLEGAL' OR r.submission.type IS NULL) AND r.assessor IS NOT NULL AND r.completionDate IS NOT NULL """) long countAssessmentsByExerciseIdSubmittedIgnoreTestRunSubmissions(@Param("exerciseId") Long exerciseId);
[ "@", "Query", "(", "\"\"\"\n SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p\n LEFT JOIN p.results r\n WHERE p.exercise.id = :#{#exerciseId}\n AND p.testRun = FALSE\n AND r.submission.submitted = TRUE\n AND (r.submission.type <> 'ILLEGAL' OR r.submission.type IS NULL)\n AND r.assessor IS NOT NULL\n AND r.completionDate IS NOT NULL\n \"\"\"", ")", "long", "countAssessmentsByExerciseIdSubmittedIgnoreTestRunSubmissions", "(", "@", "Param", "(", "\"exerciseId\"", ")", "Long", "exerciseId", ")", ";" ]
In distinction to other exercise types, students can have multiple submissions in a programming exercise.
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 12666, 261, 2565, 17807, 293, 13, 4571, 13586, 11987, 424, 20603, 19943, 319, 1988, 24629, 367, 293, 203, 5411, 9686, 7645, 293, 18, 4717, 436, 203, 5411, 4852, 293, 18, 8913, 30708, 18, 350, 273, 294, 3642, 7, 8913, 30708, 548, 97, 203, 7734, 4116, 293, 18, 3813, 1997, 273, 4934, 203, 7734, 4116, 436, 18, 12684, 18, 31575, 273, 5383, 203, 7734, 4116, 261, 86, 18, 12684, 18, 723, 2813, 296, 2627, 19384, 1013, 11, 4869, 436, 18, 12684, 18, 723, 4437, 3206, 13, 203, 7734, 4116, 436, 18, 428, 403, 280, 4437, 4269, 3206, 203, 7734, 4116, 436, 18, 11469, 1626, 4437, 4269, 3206, 203, 7734, 3536, 13, 203, 565, 1525, 1056, 2610, 403, 1346, 858, 424, 20603, 548, 28882, 3777, 4709, 1997, 1676, 7300, 26964, 786, 2932, 8913, 30708, 548, 7923, 3407, 24165, 548, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 657, 2411, 267, 349, 358, 1308, 24165, 1953, 16, 10068, 4877, 848, 1240, 3229, 22071, 316, 279, 5402, 11987, 24165, 18, 203, 377, 380, 1660, 13526, 1240, 358, 866, 2674, 716, 279, 8515, 1704, 16, 716, 1703, 9638, 1865, 326, 14096, 18, 203, 377, 380, 9363, 506, 1399, 364, 19707, 11825, 358, 2305, 1842, 1086, 22071, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 24165, 612, 732, 854, 20506, 316, 203, 377, 380, 632, 2463, 326, 1300, 434, 10217, 22071, 17622, 358, 326, 24165, 612, 716, 854, 1551, 281, 730, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countLegalSubmissionsByExamIdSubmitted
null
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.assessmentType <> 'AUTOMATIC' AND p.exercise.exerciseGroup.exam.id = :#{#examId} AND s IS NOT EMPTY AND (s.type <> 'ILLEGAL' OR s.type is null) """) long countLegalSubmissionsByExamIdSubmitted(@Param("examId") Long examId);
/** * In distinction to other exercise types, students can have multiple submissions in a programming exercise. * We therefore have to check here if any submission of the student was submitted before the deadline. * * @param examId the exam id we are interested in * @return the number of latest submissions belonging to a participation belonging to the exam id, which have the submitted flag set to true and the submission date before the exercise due date, or no exercise * due date at all (only exercises with manual or semi automatic correction are considered) */
In distinction to other exercise types, students can have multiple submissions in a programming exercise. We therefore have to check here if any submission of the student was submitted before the deadline. @param examId the exam id we are interested in @return the number of latest submissions belonging to a participation belonging to the exam id, which have the submitted flag set to true and the submission date before the exercise due date, or no exercise due date at all (only exercises with manual or semi automatic correction are considered)
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", ".", "We", "therefore", "have", "to", "check", "here", "if", "any", "submission", "of", "the", "student", "was", "submitted", "before", "the", "deadline", ".", "@param", "examId", "the", "exam", "id", "we", "are", "interested", "in", "@return", "the", "number", "of", "latest", "submissions", "belonging", "to", "a", "participation", "belonging", "to", "the", "exam", "id", "which", "have", "the", "submitted", "flag", "set", "to", "true", "and", "the", "submission", "date", "before", "the", "exercise", "due", "date", "or", "no", "exercise", "due", "date", "at", "all", "(", "only", "exercises", "with", "manual", "or", "semi", "automatic", "correction", "are", "considered", ")" ]
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.assessmentType <> 'AUTOMATIC' AND p.exercise.exerciseGroup.exam.id = :#{#examId} AND s IS NOT EMPTY AND (s.type <> 'ILLEGAL' OR s.type is null) """) long countLegalSubmissionsByExamIdSubmitted(@Param("examId") Long examId);
[ "@", "Query", "(", "\"\"\"\n SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p\n JOIN p.submissions s\n WHERE p.exercise.assessmentType <> 'AUTOMATIC'\n AND p.exercise.exerciseGroup.exam.id = :#{#examId}\n AND s IS NOT EMPTY\n AND (s.type <> 'ILLEGAL' OR s.type is null)\n \"\"\"", ")", "long", "countLegalSubmissionsByExamIdSubmitted", "(", "@", "Param", "(", "\"examId\"", ")", "Long", "examId", ")", ";" ]
In distinction to other exercise types, students can have multiple submissions in a programming exercise.
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", "." ]
[]
[ { "param": "examId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "examId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 12666, 261, 2565, 17807, 293, 13, 4571, 13586, 11987, 424, 20603, 19943, 319, 1988, 24629, 367, 293, 203, 5411, 7645, 293, 18, 25675, 272, 203, 5411, 4852, 293, 18, 8913, 30708, 18, 18222, 559, 2813, 296, 37, 1693, 1872, 11781, 11, 203, 7734, 4116, 293, 18, 8913, 30708, 18, 8913, 30708, 1114, 18, 338, 301, 18, 350, 273, 294, 3642, 7, 338, 301, 548, 97, 203, 7734, 4116, 272, 4437, 4269, 8984, 203, 7734, 4116, 261, 87, 18, 723, 2813, 296, 2627, 19384, 1013, 11, 4869, 272, 18, 723, 353, 446, 13, 203, 5411, 3536, 13, 203, 565, 1525, 1056, 30697, 1676, 7300, 858, 424, 301, 548, 28882, 26964, 786, 2932, 338, 301, 548, 7923, 3407, 19707, 548, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 657, 2411, 267, 349, 358, 1308, 24165, 1953, 16, 10068, 4877, 848, 1240, 3229, 22071, 316, 279, 5402, 11987, 24165, 18, 203, 377, 380, 1660, 13526, 1240, 358, 866, 2674, 309, 1281, 8515, 434, 326, 18110, 1703, 9638, 1865, 326, 14096, 18, 203, 377, 380, 203, 377, 380, 632, 891, 19707, 548, 326, 19707, 612, 732, 854, 20506, 316, 203, 377, 380, 632, 2463, 326, 1300, 434, 4891, 22071, 17622, 358, 279, 30891, 367, 17622, 358, 326, 19707, 612, 16, 1492, 1240, 326, 9638, 2982, 444, 358, 638, 471, 326, 8515, 1509, 1865, 326, 24165, 6541, 1509, 16, 578, 1158, 24165, 203, 377, 380, 540, 6541, 1509, 622, 777, 261, 3700, 431, 12610, 6141, 598, 11297, 578, 23161, 5859, 15104, 854, 7399, 2 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countLegalSubmissionsByCourseIdSubmitted
null
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.assessmentType <> 'AUTOMATIC' AND p.exercise.course.id = :#{#courseId} AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) """) long countLegalSubmissionsByCourseIdSubmitted(@Param("courseId") Long courseId);
/** * In distinction to other exercise types, students can have multiple submissions in a programming exercise. * We therefore have to check here if any submission of the student was submitted before the deadline. * * @param courseId the course id we are interested in * @return the number of submissions belonging to the course id, which have the submitted flag set to true and the submission date before the exercise due date, or no exercise * due date at all (only exercises with manual or semi automatic correction are considered) */
In distinction to other exercise types, students can have multiple submissions in a programming exercise. We therefore have to check here if any submission of the student was submitted before the deadline. @param courseId the course id we are interested in @return the number of submissions belonging to the course id, which have the submitted flag set to true and the submission date before the exercise due date, or no exercise due date at all (only exercises with manual or semi automatic correction are considered)
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", ".", "We", "therefore", "have", "to", "check", "here", "if", "any", "submission", "of", "the", "student", "was", "submitted", "before", "the", "deadline", ".", "@param", "courseId", "the", "course", "id", "we", "are", "interested", "in", "@return", "the", "number", "of", "submissions", "belonging", "to", "the", "course", "id", "which", "have", "the", "submitted", "flag", "set", "to", "true", "and", "the", "submission", "date", "before", "the", "exercise", "due", "date", "or", "no", "exercise", "due", "date", "at", "all", "(", "only", "exercises", "with", "manual", "or", "semi", "automatic", "correction", "are", "considered", ")" ]
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.assessmentType <> 'AUTOMATIC' AND p.exercise.course.id = :#{#courseId} AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) """) long countLegalSubmissionsByCourseIdSubmitted(@Param("courseId") Long courseId);
[ "@", "Query", "(", "\"\"\"\n SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p\n JOIN p.submissions s\n WHERE p.exercise.assessmentType <> 'AUTOMATIC'\n AND p.exercise.course.id = :#{#courseId}\n AND s.submitted = TRUE\n AND (s.type <> 'ILLEGAL' OR s.type IS NULL)\n \"\"\"", ")", "long", "countLegalSubmissionsByCourseIdSubmitted", "(", "@", "Param", "(", "\"courseId\"", ")", "Long", "courseId", ")", ";" ]
In distinction to other exercise types, students can have multiple submissions in a programming exercise.
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", "." ]
[]
[ { "param": "courseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "courseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 12666, 261, 2565, 17807, 293, 13, 4571, 13586, 11987, 424, 20603, 19943, 319, 1988, 24629, 367, 293, 203, 5411, 7645, 293, 18, 25675, 272, 203, 5411, 4852, 293, 18, 8913, 30708, 18, 18222, 559, 2813, 296, 37, 1693, 1872, 11781, 11, 203, 7734, 4116, 293, 18, 8913, 30708, 18, 5566, 18, 350, 273, 294, 3642, 7, 5566, 548, 97, 203, 7734, 4116, 272, 18, 31575, 273, 5383, 203, 7734, 4116, 261, 87, 18, 723, 2813, 296, 2627, 19384, 1013, 11, 4869, 272, 18, 723, 4437, 3206, 13, 203, 5411, 3536, 13, 203, 565, 1525, 1056, 30697, 1676, 7300, 858, 39, 3117, 548, 28882, 26964, 786, 2932, 5566, 548, 7923, 3407, 4362, 548, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 657, 2411, 267, 349, 358, 1308, 24165, 1953, 16, 10068, 4877, 848, 1240, 3229, 22071, 316, 279, 5402, 11987, 24165, 18, 203, 377, 380, 1660, 13526, 1240, 358, 866, 2674, 309, 1281, 8515, 434, 326, 18110, 1703, 9638, 1865, 326, 14096, 18, 203, 377, 380, 203, 377, 380, 632, 891, 4362, 548, 326, 4362, 612, 732, 854, 20506, 316, 203, 377, 380, 632, 2463, 326, 1300, 434, 22071, 17622, 358, 326, 4362, 612, 16, 1492, 1240, 326, 9638, 2982, 444, 358, 638, 471, 326, 8515, 1509, 1865, 326, 24165, 6541, 1509, 16, 578, 1158, 24165, 203, 377, 380, 540, 6541, 1509, 622, 777, 261, 3700, 431, 12610, 6141, 598, 11297, 578, 23161, 5859, 15104, 854, 7399, 13, 203, 377, 1195, 2, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countAllSubmissionsByExerciseIdsSubmitted
null
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.assessmentType <> 'AUTOMATIC' AND p.exercise.id IN :exerciseIds AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) """) long countAllSubmissionsByExerciseIdsSubmitted(@Param("exerciseIds") Set<Long> exerciseIds);
/** * In distinction to other exercise types, students can have multiple submissions in a programming exercise. * We therefore have to check here if any submission of the student was submitted before the deadline. * * @param exerciseIds the exercise ids of the course we are interested in * @return the number of submissions belonging to the course id, which have the submitted flag set to true (only exercises with manual or semi automatic correction are considered) */
In distinction to other exercise types, students can have multiple submissions in a programming exercise. We therefore have to check here if any submission of the student was submitted before the deadline. @param exerciseIds the exercise ids of the course we are interested in @return the number of submissions belonging to the course id, which have the submitted flag set to true (only exercises with manual or semi automatic correction are considered)
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", ".", "We", "therefore", "have", "to", "check", "here", "if", "any", "submission", "of", "the", "student", "was", "submitted", "before", "the", "deadline", ".", "@param", "exerciseIds", "the", "exercise", "ids", "of", "the", "course", "we", "are", "interested", "in", "@return", "the", "number", "of", "submissions", "belonging", "to", "the", "course", "id", "which", "have", "the", "submitted", "flag", "set", "to", "true", "(", "only", "exercises", "with", "manual", "or", "semi", "automatic", "correction", "are", "considered", ")" ]
@Query(""" SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p JOIN p.submissions s WHERE p.exercise.assessmentType <> 'AUTOMATIC' AND p.exercise.id IN :exerciseIds AND s.submitted = TRUE AND (s.type <> 'ILLEGAL' OR s.type IS NULL) """) long countAllSubmissionsByExerciseIdsSubmitted(@Param("exerciseIds") Set<Long> exerciseIds);
[ "@", "Query", "(", "\"\"\"\n SELECT COUNT (DISTINCT p) FROM ProgrammingExerciseStudentParticipation p\n JOIN p.submissions s\n WHERE p.exercise.assessmentType <> 'AUTOMATIC'\n AND p.exercise.id IN :exerciseIds\n AND s.submitted = TRUE\n AND (s.type <> 'ILLEGAL' OR s.type IS NULL)\n \"\"\"", ")", "long", "countAllSubmissionsByExerciseIdsSubmitted", "(", "@", "Param", "(", "\"exerciseIds\"", ")", "Set", "<", "Long", ">", "exerciseIds", ")", ";" ]
In distinction to other exercise types, students can have multiple submissions in a programming exercise.
[ "In", "distinction", "to", "other", "exercise", "types", "students", "can", "have", "multiple", "submissions", "in", "a", "programming", "exercise", "." ]
[]
[ { "param": "exerciseIds", "type": "Set<Long>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseIds", "type": "Set<Long>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 12666, 261, 2565, 17807, 293, 13, 4571, 13586, 11987, 424, 20603, 19943, 319, 1988, 24629, 367, 293, 203, 5411, 7645, 293, 18, 25675, 272, 203, 5411, 4852, 293, 18, 8913, 30708, 18, 18222, 559, 2813, 296, 37, 1693, 1872, 11781, 11, 203, 7734, 4116, 293, 18, 8913, 30708, 18, 350, 2120, 294, 8913, 30708, 2673, 203, 7734, 4116, 272, 18, 31575, 273, 5383, 203, 7734, 4116, 261, 87, 18, 723, 2813, 296, 2627, 19384, 1013, 11, 4869, 272, 18, 723, 4437, 3206, 13, 203, 5411, 3536, 13, 203, 565, 1525, 1056, 1595, 1676, 7300, 858, 424, 20603, 2673, 28882, 26964, 786, 2932, 8913, 30708, 2673, 7923, 1000, 32, 3708, 34, 24165, 2673, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 657, 2411, 267, 349, 358, 1308, 24165, 1953, 16, 10068, 4877, 848, 1240, 3229, 22071, 316, 279, 5402, 11987, 24165, 18, 203, 377, 380, 1660, 13526, 1240, 358, 866, 2674, 309, 1281, 8515, 434, 326, 18110, 1703, 9638, 1865, 326, 14096, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 2673, 326, 24165, 3258, 434, 326, 4362, 732, 854, 20506, 316, 203, 377, 380, 632, 2463, 326, 1300, 434, 22071, 17622, 358, 326, 4362, 612, 16, 1492, 1240, 326, 9638, 2982, 444, 358, 638, 261, 3700, 431, 12610, 6141, 598, 11297, 578, 23161, 5859, 15104, 854, 7399, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findAllByInstructorOrEditorOrTAGroupNameIn
null
@Query(""" SELECT pe FROM ProgrammingExercise pe LEFT JOIN pe.course c1 LEFT JOIN pe.exerciseGroup eg LEFT JOIN eg.exam ex LEFT JOIN ex.course c2 WHERE c1.instructorGroupName IN :#{#groupNames} OR c1.editorGroupName IN :#{#groupNames} OR c1.teachingAssistantGroupName IN :#{#groupNames} OR c2.instructorGroupName IN :#{#groupNames} OR c2.editorGroupName IN :#{#groupNames} OR c2.teachingAssistantGroupName IN :#{#groupNames} """) List<ProgrammingExercise> findAllByInstructorOrEditorOrTAGroupNameIn(@Param("groupNames") Set<String> groupNames);
// Multiple different indirection in the WHERE clause (e.g. pe.course.instructorGroupName and ex.course.instructorGroupName) would not work
Multiple different indirection in the WHERE clause would not work
[ "Multiple", "different", "indirection", "in", "the", "WHERE", "clause", "would", "not", "work" ]
@Query(""" SELECT pe FROM ProgrammingExercise pe LEFT JOIN pe.course c1 LEFT JOIN pe.exerciseGroup eg LEFT JOIN eg.exam ex LEFT JOIN ex.course c2 WHERE c1.instructorGroupName IN :#{#groupNames} OR c1.editorGroupName IN :#{#groupNames} OR c1.teachingAssistantGroupName IN :#{#groupNames} OR c2.instructorGroupName IN :#{#groupNames} OR c2.editorGroupName IN :#{#groupNames} OR c2.teachingAssistantGroupName IN :#{#groupNames} """) List<ProgrammingExercise> findAllByInstructorOrEditorOrTAGroupNameIn(@Param("groupNames") Set<String> groupNames);
[ "@", "Query", "(", "\"\"\"\n SELECT pe FROM ProgrammingExercise pe LEFT JOIN pe.course c1 LEFT JOIN pe.exerciseGroup eg LEFT JOIN eg.exam ex LEFT JOIN ex.course c2\n WHERE c1.instructorGroupName IN :#{#groupNames}\n OR c1.editorGroupName IN :#{#groupNames}\n OR c1.teachingAssistantGroupName IN :#{#groupNames}\n OR c2.instructorGroupName IN :#{#groupNames}\n OR c2.editorGroupName IN :#{#groupNames}\n OR c2.teachingAssistantGroupName IN :#{#groupNames}\n \"\"\"", ")", "List", "<", "ProgrammingExercise", ">", "findAllByInstructorOrEditorOrTAGroupNameIn", "(", "@", "Param", "(", "\"groupNames\"", ")", "Set", "<", "String", ">", "groupNames", ")", ";" ]
Multiple different indirection in the WHERE clause (e.g.
[ "Multiple", "different", "indirection", "in", "the", "WHERE", "clause", "(", "e", ".", "g", "." ]
[]
[ { "param": "groupNames", "type": "Set<String>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "groupNames", "type": "Set<String>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 2804, 4571, 13586, 11987, 424, 20603, 2804, 9686, 7645, 2804, 18, 5566, 276, 21, 9686, 7645, 2804, 18, 8913, 30708, 1114, 9130, 9686, 7645, 9130, 18, 338, 301, 431, 9686, 7645, 431, 18, 5566, 276, 22, 203, 5411, 4852, 276, 21, 18, 267, 2732, 3943, 2120, 294, 3642, 7, 1655, 1557, 97, 203, 7734, 4869, 276, 21, 18, 9177, 3943, 2120, 294, 3642, 7, 1655, 1557, 97, 203, 7734, 4869, 276, 21, 18, 736, 497, 310, 2610, 17175, 3943, 2120, 294, 3642, 7, 1655, 1557, 97, 203, 7734, 4869, 276, 22, 18, 267, 2732, 3943, 2120, 294, 3642, 7, 1655, 1557, 97, 203, 7734, 4869, 276, 22, 18, 9177, 3943, 2120, 294, 3642, 7, 1655, 1557, 97, 203, 7734, 4869, 276, 22, 18, 736, 497, 310, 2610, 17175, 3943, 2120, 294, 3642, 7, 1655, 1557, 97, 203, 5411, 3536, 13, 203, 565, 987, 32, 9459, 11987, 424, 20603, 34, 11135, 858, 382, 2732, 1162, 6946, 1162, 9833, 3943, 382, 26964, 786, 2932, 1655, 1557, 7923, 1000, 32, 780, 34, 1041, 1557, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 759, 13531, 3775, 1547, 2769, 316, 326, 4852, 6591, 261, 73, 18, 75, 18, 2804, 18, 5566, 18, 267, 2732, 3943, 471, 431, 18, 5566, 18, 267, 2732, 3943, 13, 4102, 486, 1440, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findAllProgrammingExercisesInCourseOrInExamsOfCourse
null
@Query(""" SELECT pe FROM ProgrammingExercise pe LEFT JOIN pe.exerciseGroup eg LEFT JOIN eg.exam ex WHERE pe.course = :#{#course} OR ex.course = :#{#course} """) List<ProgrammingExercise> findAllProgrammingExercisesInCourseOrInExamsOfCourse(@Param("course") Course course);
// Note: we have to use left join here to avoid issues in the where clause, see the explanation above
we have to use left join here to avoid issues in the where clause, see the explanation above
[ "we", "have", "to", "use", "left", "join", "here", "to", "avoid", "issues", "in", "the", "where", "clause", "see", "the", "explanation", "above" ]
@Query(""" SELECT pe FROM ProgrammingExercise pe LEFT JOIN pe.exerciseGroup eg LEFT JOIN eg.exam ex WHERE pe.course = :#{#course} OR ex.course = :#{#course} """) List<ProgrammingExercise> findAllProgrammingExercisesInCourseOrInExamsOfCourse(@Param("course") Course course);
[ "@", "Query", "(", "\"\"\"\n SELECT pe FROM ProgrammingExercise pe LEFT JOIN pe.exerciseGroup eg LEFT JOIN eg.exam ex\n WHERE pe.course = :#{#course}\n OR ex.course = :#{#course}\n \"\"\"", ")", "List", "<", "ProgrammingExercise", ">", "findAllProgrammingExercisesInCourseOrInExamsOfCourse", "(", "@", "Param", "(", "\"course\"", ")", "Course", "course", ")", ";" ]
Note: we have to use left join here to avoid issues in the where clause, see the explanation above
[ "Note", ":", "we", "have", "to", "use", "left", "join", "here", "to", "avoid", "issues", "in", "the", "where", "clause", "see", "the", "explanation", "above" ]
[]
[ { "param": "course", "type": "Course" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "course", "type": "Course", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 1138, 2932, 3660, 203, 5411, 9111, 2804, 4571, 13586, 11987, 424, 20603, 2804, 9686, 7645, 2804, 18, 8913, 30708, 1114, 9130, 9686, 7645, 9130, 18, 338, 301, 431, 203, 5411, 4852, 2804, 18, 5566, 273, 294, 3642, 7, 5566, 97, 203, 7734, 4869, 431, 18, 5566, 273, 294, 3642, 7, 5566, 97, 203, 5411, 3536, 13, 203, 565, 987, 32, 9459, 11987, 424, 20603, 34, 11135, 9459, 11987, 424, 12610, 6141, 382, 39, 3117, 1162, 382, 424, 301, 87, 951, 39, 3117, 26964, 786, 2932, 5566, 7923, 385, 3117, 4362, 1769, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 759, 3609, 30, 732, 1240, 358, 999, 2002, 1233, 2674, 358, 4543, 8296, 316, 326, 1625, 6591, 16, 2621, 326, 21285, 5721, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByIdWithTemplateAndSolutionParticipationElseThrow
ProgrammingExercise
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationElseThrow(Long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
/** * Find a programming exercise by its id, including template and solution but without results. * TODO: we should remove this method later on and use 'findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow' in all places, * they have same functionality. * * @param programmingExerciseId of the programming exercise. * @return The programming exercise related to the given id * @throws EntityNotFoundException the programming exercise could not be found. */
Find a programming exercise by its id, including template and solution but without results. TODO: we should remove this method later on and use 'findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow' in all places, they have same functionality. @param programmingExerciseId of the programming exercise. @return The programming exercise related to the given id @throws EntityNotFoundException the programming exercise could not be found.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "including", "template", "and", "solution", "but", "without", "results", ".", "TODO", ":", "we", "should", "remove", "this", "method", "later", "on", "and", "use", "'", "findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow", "'", "in", "all", "places", "they", "have", "same", "functionality", ".", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", ".", "@return", "The", "programming", "exercise", "related", "to", "the", "given", "id", "@throws", "EntityNotFoundException", "the", "programming", "exercise", "could", "not", "be", "found", "." ]
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationElseThrow(Long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
[ "@", "NotNull", "default", "ProgrammingExercise", "findByIdWithTemplateAndSolutionParticipationElseThrow", "(", "Long", "programmingExerciseId", ")", "throws", "EntityNotFoundException", "{", "Optional", "<", "ProgrammingExercise", ">", "programmingExercise", "=", "findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById", "(", "programmingExerciseId", ")", ";", "return", "programmingExercise", ".", "orElseThrow", "(", "(", ")", "->", "new", "EntityNotFoundException", "(", "\"Programming Exercise\"", ",", "programmingExerciseId", ")", ")", ";", "}" ]
Find a programming exercise by its id, including template and solution but without results.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "including", "template", "and", "solution", "but", "without", "results", "." ]
[]
[ { "param": "programmingExerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 5962, 203, 565, 805, 13586, 11987, 424, 20603, 23131, 1190, 2283, 1876, 16135, 1988, 24629, 367, 12427, 8282, 12, 3708, 5402, 11987, 424, 20603, 548, 13, 1216, 3887, 3990, 288, 203, 3639, 4055, 32, 9459, 11987, 424, 20603, 34, 5402, 11987, 424, 20603, 273, 1104, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 5132, 12, 12890, 11987, 424, 20603, 548, 1769, 203, 3639, 327, 5402, 11987, 424, 20603, 18, 280, 12427, 8282, 12, 1435, 317, 394, 3887, 3990, 2932, 9459, 11987, 1312, 20603, 3113, 5402, 11987, 424, 20603, 548, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4163, 279, 5402, 11987, 24165, 635, 2097, 612, 16, 6508, 1542, 471, 6959, 1496, 2887, 1686, 18, 203, 377, 380, 2660, 30, 732, 1410, 1206, 333, 707, 5137, 603, 471, 999, 296, 4720, 5132, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 12427, 8282, 11, 316, 777, 12576, 16, 203, 377, 380, 225, 2898, 1240, 1967, 14176, 18, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 548, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 632, 2463, 1021, 5402, 11987, 24165, 3746, 358, 326, 864, 612, 203, 377, 380, 632, 15069, 3887, 3990, 326, 5402, 11987, 24165, 3377, 486, 506, 1392, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByIdWithTemplateAndSolutionParticipationWithResultsElseThrow
ProgrammingExercise
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationWithResultsElseThrow(Long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationLatestResultById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
/** * Find a programming exercise by its id, including template and solution participation and their latest results. * * @param programmingExerciseId of the programming exercise. * @return The programming exercise related to the given id * @throws EntityNotFoundException the programming exercise could not be found. */
Find a programming exercise by its id, including template and solution participation and their latest results. @param programmingExerciseId of the programming exercise. @return The programming exercise related to the given id @throws EntityNotFoundException the programming exercise could not be found.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "including", "template", "and", "solution", "participation", "and", "their", "latest", "results", ".", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", ".", "@return", "The", "programming", "exercise", "related", "to", "the", "given", "id", "@throws", "EntityNotFoundException", "the", "programming", "exercise", "could", "not", "be", "found", "." ]
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationWithResultsElseThrow(Long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationLatestResultById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
[ "@", "NotNull", "default", "ProgrammingExercise", "findByIdWithTemplateAndSolutionParticipationWithResultsElseThrow", "(", "Long", "programmingExerciseId", ")", "throws", "EntityNotFoundException", "{", "Optional", "<", "ProgrammingExercise", ">", "programmingExercise", "=", "findWithTemplateAndSolutionParticipationLatestResultById", "(", "programmingExerciseId", ")", ";", "return", "programmingExercise", ".", "orElseThrow", "(", "(", ")", "->", "new", "EntityNotFoundException", "(", "\"Programming Exercise\"", ",", "programmingExerciseId", ")", ")", ";", "}" ]
Find a programming exercise by its id, including template and solution participation and their latest results.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "including", "template", "and", "solution", "participation", "and", "their", "latest", "results", "." ]
[]
[ { "param": "programmingExerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 5962, 203, 565, 805, 13586, 11987, 424, 20603, 23131, 1190, 2283, 1876, 16135, 1988, 24629, 367, 1190, 3447, 12427, 8282, 12, 3708, 5402, 11987, 424, 20603, 548, 13, 1216, 3887, 3990, 288, 203, 3639, 4055, 32, 9459, 11987, 424, 20603, 34, 5402, 11987, 424, 20603, 273, 1104, 1190, 2283, 1876, 16135, 1988, 24629, 367, 18650, 1253, 5132, 12, 12890, 11987, 424, 20603, 548, 1769, 203, 3639, 327, 5402, 11987, 424, 20603, 18, 280, 12427, 8282, 12, 1435, 317, 394, 3887, 3990, 2932, 9459, 11987, 1312, 20603, 3113, 5402, 11987, 424, 20603, 548, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4163, 279, 5402, 11987, 24165, 635, 2097, 612, 16, 6508, 1542, 471, 6959, 30891, 367, 471, 3675, 4891, 1686, 18, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 548, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 632, 2463, 1021, 5402, 11987, 24165, 3746, 358, 326, 864, 612, 203, 377, 380, 632, 15069, 3887, 3990, 326, 5402, 11987, 24165, 3377, 486, 506, 1392, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByIdWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesElseThrow
ProgrammingExercise
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesElseThrow(Long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
/** * Find a programming exercise by its id, including auxiliary repositories, template and solution participation and * their latest results. * * @param programmingExerciseId of the programming exercise. * @return The programming exercise related to the given id * @throws EntityNotFoundException the programming exercise could not be found. */
Find a programming exercise by its id, including auxiliary repositories, template and solution participation and their latest results. @param programmingExerciseId of the programming exercise. @return The programming exercise related to the given id @throws EntityNotFoundException the programming exercise could not be found.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "including", "auxiliary", "repositories", "template", "and", "solution", "participation", "and", "their", "latest", "results", ".", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", ".", "@return", "The", "programming", "exercise", "related", "to", "the", "given", "id", "@throws", "EntityNotFoundException", "the", "programming", "exercise", "could", "not", "be", "found", "." ]
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesElseThrow(Long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
[ "@", "NotNull", "default", "ProgrammingExercise", "findByIdWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesElseThrow", "(", "Long", "programmingExerciseId", ")", "throws", "EntityNotFoundException", "{", "Optional", "<", "ProgrammingExercise", ">", "programmingExercise", "=", "findWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesById", "(", "programmingExerciseId", ")", ";", "return", "programmingExercise", ".", "orElseThrow", "(", "(", ")", "->", "new", "EntityNotFoundException", "(", "\"Programming Exercise\"", ",", "programmingExerciseId", ")", ")", ";", "}" ]
Find a programming exercise by its id, including auxiliary repositories, template and solution participation and their latest results.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "including", "auxiliary", "repositories", "template", "and", "solution", "participation", "and", "their", "latest", "results", "." ]
[]
[ { "param": "programmingExerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 5962, 203, 565, 805, 13586, 11987, 424, 20603, 23131, 1190, 2283, 1876, 16135, 1988, 24629, 367, 1876, 21981, 20606, 18429, 12427, 8282, 12, 3708, 5402, 11987, 424, 20603, 548, 13, 1216, 3887, 3990, 288, 203, 3639, 4055, 32, 9459, 11987, 424, 20603, 34, 5402, 11987, 424, 20603, 273, 1104, 1190, 2283, 1876, 16135, 1988, 24629, 367, 1876, 21981, 20606, 18429, 5132, 12, 12890, 11987, 424, 20603, 548, 1769, 203, 3639, 327, 5402, 11987, 424, 20603, 18, 280, 12427, 8282, 12, 1435, 317, 394, 3887, 3990, 2932, 9459, 11987, 1312, 20603, 3113, 5402, 11987, 424, 20603, 548, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4163, 279, 5402, 11987, 24165, 635, 2097, 612, 16, 6508, 9397, 20606, 14531, 16, 1542, 471, 6959, 30891, 367, 471, 203, 377, 380, 3675, 4891, 1686, 18, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 548, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 632, 2463, 1021, 5402, 11987, 24165, 3746, 358, 326, 864, 612, 203, 377, 380, 632, 15069, 3887, 3990, 326, 5402, 11987, 24165, 3377, 486, 506, 1392, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByIdWithStudentParticipationsAndLegalSubmissionsElseThrow
ProgrammingExercise
@NotNull default ProgrammingExercise findByIdWithStudentParticipationsAndLegalSubmissionsElseThrow(long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithEagerStudentParticipationsStudentAndLegalSubmissionsById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
/** * Find a programming exercise by its id, with eagerly loaded template and solution participation and auxiliary repositories * * @param programmingExerciseId of the programming exercise. * @return The programming exercise related to the given id * @throws EntityNotFoundException the programming exercise could not be found. */
Find a programming exercise by its id, with eagerly loaded template and solution participation and auxiliary repositories @param programmingExerciseId of the programming exercise. @return The programming exercise related to the given id @throws EntityNotFoundException the programming exercise could not be found.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "with", "eagerly", "loaded", "template", "and", "solution", "participation", "and", "auxiliary", "repositories", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", ".", "@return", "The", "programming", "exercise", "related", "to", "the", "given", "id", "@throws", "EntityNotFoundException", "the", "programming", "exercise", "could", "not", "be", "found", "." ]
@NotNull default ProgrammingExercise findByIdWithStudentParticipationsAndLegalSubmissionsElseThrow(long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithEagerStudentParticipationsStudentAndLegalSubmissionsById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
[ "@", "NotNull", "default", "ProgrammingExercise", "findByIdWithStudentParticipationsAndLegalSubmissionsElseThrow", "(", "long", "programmingExerciseId", ")", "throws", "EntityNotFoundException", "{", "Optional", "<", "ProgrammingExercise", ">", "programmingExercise", "=", "findWithEagerStudentParticipationsStudentAndLegalSubmissionsById", "(", "programmingExerciseId", ")", ";", "return", "programmingExercise", ".", "orElseThrow", "(", "(", ")", "->", "new", "EntityNotFoundException", "(", "\"Programming Exercise\"", ",", "programmingExerciseId", ")", ")", ";", "}" ]
Find a programming exercise by its id, with eagerly loaded template and solution participation and auxiliary repositories @param programmingExerciseId of the programming exercise.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "with", "eagerly", "loaded", "template", "and", "solution", "participation", "and", "auxiliary", "repositories", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", "." ]
[]
[ { "param": "programmingExerciseId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 5962, 203, 565, 805, 13586, 11987, 424, 20603, 23131, 1190, 19943, 319, 1988, 24629, 1012, 1876, 30697, 1676, 7300, 12427, 8282, 12, 5748, 5402, 11987, 424, 20603, 548, 13, 1216, 3887, 3990, 288, 203, 3639, 4055, 32, 9459, 11987, 424, 20603, 34, 5402, 11987, 424, 20603, 273, 1104, 1190, 41, 6817, 19943, 319, 1988, 24629, 1012, 19943, 319, 1876, 30697, 1676, 7300, 5132, 12, 12890, 11987, 424, 20603, 548, 1769, 203, 3639, 327, 5402, 11987, 424, 20603, 18, 280, 12427, 8282, 12, 1435, 317, 394, 3887, 3990, 2932, 9459, 11987, 1312, 20603, 3113, 5402, 11987, 424, 20603, 548, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 1, 26873, 203, 377, 380, 4163, 279, 5402, 11987, 24165, 635, 2097, 612, 16, 598, 18853, 715, 4203, 1542, 471, 6959, 30891, 367, 471, 9397, 20606, 14531, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 548, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 632, 2463, 1021, 5402, 11987, 24165, 3746, 358, 326, 864, 612, 203, 377, 380, 632, 15069, 3887, 3990, 326, 5402, 11987, 24165, 3377, 486, 506, 1392, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countLegalSubmissionsByExerciseIdSubmitted
null
default long countLegalSubmissionsByExerciseIdSubmitted(Long exerciseId, boolean ignoreTestRuns) { if (ignoreTestRuns) { return countLegalSubmissionsByExerciseIdSubmittedIgnoreTestRunSubmissions(exerciseId); } else { return countSubmissionsByExerciseIdSubmitted(exerciseId); } }
/** * @param exerciseId the exercise we are interested in * @param ignoreTestRuns should be set for exam exercises * @return the number of programming submissions which should be assessed * We don't need to check for the submission date, because students cannot participate in programming exercises with manual assessment after their due date */
@param exerciseId the exercise we are interested in @param ignoreTestRuns should be set for exam exercises @return the number of programming submissions which should be assessed We don't need to check for the submission date, because students cannot participate in programming exercises with manual assessment after their due date
[ "@param", "exerciseId", "the", "exercise", "we", "are", "interested", "in", "@param", "ignoreTestRuns", "should", "be", "set", "for", "exam", "exercises", "@return", "the", "number", "of", "programming", "submissions", "which", "should", "be", "assessed", "We", "don", "'", "t", "need", "to", "check", "for", "the", "submission", "date", "because", "students", "cannot", "participate", "in", "programming", "exercises", "with", "manual", "assessment", "after", "their", "due", "date" ]
default long countLegalSubmissionsByExerciseIdSubmitted(Long exerciseId, boolean ignoreTestRuns) { if (ignoreTestRuns) { return countLegalSubmissionsByExerciseIdSubmittedIgnoreTestRunSubmissions(exerciseId); } else { return countSubmissionsByExerciseIdSubmitted(exerciseId); } }
[ "default", "long", "countLegalSubmissionsByExerciseIdSubmitted", "(", "Long", "exerciseId", ",", "boolean", "ignoreTestRuns", ")", "{", "if", "(", "ignoreTestRuns", ")", "{", "return", "countLegalSubmissionsByExerciseIdSubmittedIgnoreTestRunSubmissions", "(", "exerciseId", ")", ";", "}", "else", "{", "return", "countSubmissionsByExerciseIdSubmitted", "(", "exerciseId", ")", ";", "}", "}" ]
@param exerciseId the exercise we are interested in @param ignoreTestRuns should be set for exam exercises @return the number of programming submissions which should be assessed We don't need to check for the submission date, because students cannot participate in programming exercises with manual assessment after their due date
[ "@param", "exerciseId", "the", "exercise", "we", "are", "interested", "in", "@param", "ignoreTestRuns", "should", "be", "set", "for", "exam", "exercises", "@return", "the", "number", "of", "programming", "submissions", "which", "should", "be", "assessed", "We", "don", "'", "t", "need", "to", "check", "for", "the", "submission", "date", "because", "students", "cannot", "participate", "in", "programming", "exercises", "with", "manual", "assessment", "after", "their", "due", "date" ]
[]
[ { "param": "exerciseId", "type": "Long" }, { "param": "ignoreTestRuns", "type": "boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ignoreTestRuns", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 805, 1525, 1056, 30697, 1676, 7300, 858, 424, 20603, 548, 28882, 12, 3708, 24165, 548, 16, 1250, 2305, 4709, 9361, 13, 288, 203, 3639, 309, 261, 6185, 4709, 9361, 13, 288, 203, 5411, 327, 1056, 30697, 1676, 7300, 858, 424, 20603,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 203, 377, 380, 632, 2463, 326, 1300, 434, 5402, 11987, 22071, 1492, 1410, 506, 1551, 281, 730, 203, 377, 380, 1660, 2727, 1404, 1608, 358, 866, 364, 326, 8515, 1509, 16, 2724, 10068, 4877, 2780, 30891, 340, 316, 5402, 11987, 431, 12610, 6141, 598, 11297, 14158, 1839, 3675, 6541, 1509, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
countAssessmentsByExerciseIdSubmitted
null
default long countAssessmentsByExerciseIdSubmitted(Long exerciseId, boolean ignoreTestRuns) { if (ignoreTestRuns) { return countAssessmentsByExerciseIdSubmittedIgnoreTestRunSubmissions(exerciseId); } else { return countAssessmentsByExerciseIdSubmitted(exerciseId); } }
/** * @param exerciseId the exercise we are interested in * @param ignoreTestRuns should be set for exam exercises * @return the number of assessed programming submissions * We don't need to check for the submission date, because students cannot participate in programming exercises with manual assessment after their due date */
@param exerciseId the exercise we are interested in @param ignoreTestRuns should be set for exam exercises @return the number of assessed programming submissions We don't need to check for the submission date, because students cannot participate in programming exercises with manual assessment after their due date
[ "@param", "exerciseId", "the", "exercise", "we", "are", "interested", "in", "@param", "ignoreTestRuns", "should", "be", "set", "for", "exam", "exercises", "@return", "the", "number", "of", "assessed", "programming", "submissions", "We", "don", "'", "t", "need", "to", "check", "for", "the", "submission", "date", "because", "students", "cannot", "participate", "in", "programming", "exercises", "with", "manual", "assessment", "after", "their", "due", "date" ]
default long countAssessmentsByExerciseIdSubmitted(Long exerciseId, boolean ignoreTestRuns) { if (ignoreTestRuns) { return countAssessmentsByExerciseIdSubmittedIgnoreTestRunSubmissions(exerciseId); } else { return countAssessmentsByExerciseIdSubmitted(exerciseId); } }
[ "default", "long", "countAssessmentsByExerciseIdSubmitted", "(", "Long", "exerciseId", ",", "boolean", "ignoreTestRuns", ")", "{", "if", "(", "ignoreTestRuns", ")", "{", "return", "countAssessmentsByExerciseIdSubmittedIgnoreTestRunSubmissions", "(", "exerciseId", ")", ";", "}", "else", "{", "return", "countAssessmentsByExerciseIdSubmitted", "(", "exerciseId", ")", ";", "}", "}" ]
@param exerciseId the exercise we are interested in @param ignoreTestRuns should be set for exam exercises @return the number of assessed programming submissions We don't need to check for the submission date, because students cannot participate in programming exercises with manual assessment after their due date
[ "@param", "exerciseId", "the", "exercise", "we", "are", "interested", "in", "@param", "ignoreTestRuns", "should", "be", "set", "for", "exam", "exercises", "@return", "the", "number", "of", "assessed", "programming", "submissions", "We", "don", "'", "t", "need", "to", "check", "for", "the", "submission", "date", "because", "students", "cannot", "participate", "in", "programming", "exercises", "with", "manual", "assessment", "after", "their", "due", "date" ]
[]
[ { "param": "exerciseId", "type": "Long" }, { "param": "ignoreTestRuns", "type": "boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ignoreTestRuns", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 805, 1525, 1056, 2610, 403, 1346, 858, 424, 20603, 548, 28882, 12, 3708, 24165, 548, 16, 1250, 2305, 4709, 9361, 13, 288, 203, 3639, 309, 261, 6185, 4709, 9361, 13, 288, 203, 5411, 327, 1056, 2610, 403, 1346, 858, 424, 20603, 548, 28882, 3777, 4709, 1997, 1676, 7300, 12, 8913, 30708, 548, 1769, 203, 3639, 289, 203, 3639, 469, 288, 203, 5411, 327, 1056, 2610, 403, 1346, 858, 424, 20603, 548, 28882, 12, 8913, 30708, 548, 1769, 203, 3639, 289, 203, 565, 289, 2, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 632, 891, 24165, 548, 377, 326, 24165, 732, 854, 20506, 316, 203, 377, 380, 632, 891, 2305, 4709, 9361, 1410, 506, 444, 364, 19707, 431, 12610, 6141, 203, 377, 380, 632, 2463, 326, 1300, 434, 1551, 281, 730, 5402, 11987, 22071, 203, 377, 380, 1660, 2727, 1404, 1608, 358, 866, 364, 326, 8515, 1509, 16, 2724, 10068, 4877, 2780, 30891, 340, 316, 5402, 11987, 431, 12610, 6141, 598, 11297, 14158, 1839, 3675, 6541, 1509, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow
ProgrammingExercise
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
/** * Find a programming exercise by its id, with eagerly loaded template and solution participation, team assignment config and categories * * @param programmingExerciseId of the programming exercise. * @return The programming exercise related to the given id * @throws EntityNotFoundException the programming exercise could not be found. */
Find a programming exercise by its id, with eagerly loaded template and solution participation, team assignment config and categories @param programmingExerciseId of the programming exercise. @return The programming exercise related to the given id @throws EntityNotFoundException the programming exercise could not be found.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "with", "eagerly", "loaded", "template", "and", "solution", "participation", "team", "assignment", "config", "and", "categories", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", ".", "@return", "The", "programming", "exercise", "related", "to", "the", "given", "id", "@throws", "EntityNotFoundException", "the", "programming", "exercise", "could", "not", "be", "found", "." ]
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
[ "@", "NotNull", "default", "ProgrammingExercise", "findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow", "(", "long", "programmingExerciseId", ")", "throws", "EntityNotFoundException", "{", "Optional", "<", "ProgrammingExercise", ">", "programmingExercise", "=", "findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById", "(", "programmingExerciseId", ")", ";", "return", "programmingExercise", ".", "orElseThrow", "(", "(", ")", "->", "new", "EntityNotFoundException", "(", "\"Programming Exercise\"", ",", "programmingExerciseId", ")", ")", ";", "}" ]
Find a programming exercise by its id, with eagerly loaded template and solution participation, team assignment config and categories @param programmingExerciseId of the programming exercise.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "with", "eagerly", "loaded", "template", "and", "solution", "participation", "team", "assignment", "config", "and", "categories", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", "." ]
[]
[ { "param": "programmingExerciseId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 5962, 203, 565, 805, 13586, 11987, 424, 20603, 23131, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 12427, 8282, 12, 5748, 5402, 11987, 424, 20603, 548, 13, 1216, 3887, 3990, 288, 203, 3639, 4055, 32, 9459, 11987, 424, 20603, 34, 5402, 11987, 424, 20603, 273, 1104, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 5132, 12, 12890, 11987, 424, 20603, 548, 1769, 203, 3639, 327, 5402, 11987, 424, 20603, 18, 280, 12427, 8282, 12, 1435, 317, 394, 3887, 3990, 2932, 9459, 11987, 1312, 20603, 3113, 5402, 11987, 424, 20603, 548, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4163, 279, 5402, 11987, 24165, 635, 2097, 612, 16, 598, 18853, 715, 4203, 1542, 471, 6959, 30891, 367, 16, 5927, 6661, 642, 471, 6477, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 548, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 632, 2463, 1021, 5402, 11987, 24165, 3746, 358, 326, 864, 612, 203, 377, 380, 632, 15069, 3887, 3990, 326, 5402, 11987, 24165, 3377, 486, 506, 1392, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByIdWithTemplateAndSolutionParticipationSubmissionsAndResultsElseThrow
ProgrammingExercise
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationSubmissionsAndResultsElseThrow(long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationSubmissionsAndResultsById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
/** * Find a programming exercise by its id, with eagerly loaded template and solution participation, submissions and results * * @param programmingExerciseId of the programming exercise. * @return The programming exercise related to the given id * @throws EntityNotFoundException the programming exercise could not be found. */
Find a programming exercise by its id, with eagerly loaded template and solution participation, submissions and results @param programmingExerciseId of the programming exercise. @return The programming exercise related to the given id @throws EntityNotFoundException the programming exercise could not be found.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "with", "eagerly", "loaded", "template", "and", "solution", "participation", "submissions", "and", "results", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", ".", "@return", "The", "programming", "exercise", "related", "to", "the", "given", "id", "@throws", "EntityNotFoundException", "the", "programming", "exercise", "could", "not", "be", "found", "." ]
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationSubmissionsAndResultsElseThrow(long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationSubmissionsAndResultsById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
[ "@", "NotNull", "default", "ProgrammingExercise", "findByIdWithTemplateAndSolutionParticipationSubmissionsAndResultsElseThrow", "(", "long", "programmingExerciseId", ")", "throws", "EntityNotFoundException", "{", "Optional", "<", "ProgrammingExercise", ">", "programmingExercise", "=", "findWithTemplateAndSolutionParticipationSubmissionsAndResultsById", "(", "programmingExerciseId", ")", ";", "return", "programmingExercise", ".", "orElseThrow", "(", "(", ")", "->", "new", "EntityNotFoundException", "(", "\"Programming Exercise\"", ",", "programmingExerciseId", ")", ")", ";", "}" ]
Find a programming exercise by its id, with eagerly loaded template and solution participation, submissions and results @param programmingExerciseId of the programming exercise.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "with", "eagerly", "loaded", "template", "and", "solution", "participation", "submissions", "and", "results", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", "." ]
[]
[ { "param": "programmingExerciseId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 5962, 203, 565, 805, 13586, 11987, 424, 20603, 23131, 1190, 2283, 1876, 16135, 1988, 24629, 367, 1676, 7300, 1876, 3447, 12427, 8282, 12, 5748, 5402, 11987, 424, 20603, 548, 13, 1216, 3887, 3990, 288, 203, 3639, 4055, 32, 9459, 11987, 424, 20603, 34, 5402, 11987, 424, 20603, 273, 1104, 1190, 2283, 1876, 16135, 1988, 24629, 367, 1676, 7300, 1876, 3447, 5132, 12, 12890, 11987, 424, 20603, 548, 1769, 203, 3639, 327, 5402, 11987, 424, 20603, 18, 280, 12427, 8282, 12, 1435, 317, 394, 3887, 3990, 2932, 9459, 11987, 1312, 20603, 3113, 5402, 11987, 424, 20603, 548, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4163, 279, 5402, 11987, 24165, 635, 2097, 612, 16, 598, 18853, 715, 4203, 1542, 471, 6959, 30891, 367, 16, 22071, 471, 1686, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 548, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 632, 2463, 1021, 5402, 11987, 24165, 3746, 358, 326, 864, 612, 203, 377, 380, 632, 15069, 3887, 3990, 326, 5402, 11987, 24165, 3377, 486, 506, 1392, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
43b3b9e7f4ec18e71d2a5b0f87c9f594534bf6d2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseRepository.java
[ "MIT" ]
Java
findByIdWithTemplateAndSolutionParticipationLatestResultElseThrow
ProgrammingExercise
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationLatestResultElseThrow(long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationLatestResultById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
/** * Find a programming exercise by its id, with eagerly loaded template and solution participation, and latest result * * @param programmingExerciseId of the programming exercise. * @return The programming exercise related to the given id * @throws EntityNotFoundException the programming exercise could not be found. */
Find a programming exercise by its id, with eagerly loaded template and solution participation, and latest result @param programmingExerciseId of the programming exercise. @return The programming exercise related to the given id @throws EntityNotFoundException the programming exercise could not be found.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "with", "eagerly", "loaded", "template", "and", "solution", "participation", "and", "latest", "result", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", ".", "@return", "The", "programming", "exercise", "related", "to", "the", "given", "id", "@throws", "EntityNotFoundException", "the", "programming", "exercise", "could", "not", "be", "found", "." ]
@NotNull default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationLatestResultElseThrow(long programmingExerciseId) throws EntityNotFoundException { Optional<ProgrammingExercise> programmingExercise = findWithTemplateAndSolutionParticipationLatestResultById(programmingExerciseId); return programmingExercise.orElseThrow(() -> new EntityNotFoundException("Programming Exercise", programmingExerciseId)); }
[ "@", "NotNull", "default", "ProgrammingExercise", "findByIdWithTemplateAndSolutionParticipationLatestResultElseThrow", "(", "long", "programmingExerciseId", ")", "throws", "EntityNotFoundException", "{", "Optional", "<", "ProgrammingExercise", ">", "programmingExercise", "=", "findWithTemplateAndSolutionParticipationLatestResultById", "(", "programmingExerciseId", ")", ";", "return", "programmingExercise", ".", "orElseThrow", "(", "(", ")", "->", "new", "EntityNotFoundException", "(", "\"Programming Exercise\"", ",", "programmingExerciseId", ")", ")", ";", "}" ]
Find a programming exercise by its id, with eagerly loaded template and solution participation, and latest result @param programmingExerciseId of the programming exercise.
[ "Find", "a", "programming", "exercise", "by", "its", "id", "with", "eagerly", "loaded", "template", "and", "solution", "participation", "and", "latest", "result", "@param", "programmingExerciseId", "of", "the", "programming", "exercise", "." ]
[]
[ { "param": "programmingExerciseId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 5962, 203, 565, 805, 13586, 11987, 424, 20603, 23131, 1190, 2283, 1876, 16135, 1988, 24629, 367, 18650, 1253, 12427, 8282, 12, 5748, 5402, 11987, 424, 20603, 548, 13, 1216, 3887, 3990, 288, 203, 3639, 4055, 32, 9459, 11987, 424, 20603, 34, 5402, 11987, 424, 20603, 273, 1104, 1190, 2283, 1876, 16135, 1988, 24629, 367, 18650, 1253, 5132, 12, 12890, 11987, 424, 20603, 548, 1769, 203, 3639, 327, 5402, 11987, 424, 20603, 18, 280, 12427, 8282, 12, 1435, 317, 394, 3887, 3990, 2932, 9459, 11987, 1312, 20603, 3113, 5402, 11987, 424, 20603, 548, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4163, 279, 5402, 11987, 24165, 635, 2097, 612, 16, 598, 18853, 715, 4203, 1542, 471, 6959, 30891, 367, 16, 471, 4891, 563, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 548, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 632, 2463, 1021, 5402, 11987, 24165, 3746, 358, 326, 864, 612, 203, 377, 380, 632, 15069, 3887, 3990, 326, 5402, 11987, 24165, 3377, 486, 506, 1392, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7d1758888d66eb652f2603eb64619ac8549c1a1a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactory.java
[ "MIT" ]
Java
createNotification
GroupNotification
public static GroupNotification createNotification(Attachment attachment, User author, GroupNotificationType groupNotificationType, NotificationType notificationType, String notificationText) { String title, text; if (notificationType == NotificationType.ATTACHMENT_CHANGE) { title = NotificationTitleTypeConstants.ATTACHMENT_CHANGE_TITLE; text = "Attachment \"" + attachment.getName() + "\" updated."; } else { throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } if (notificationText != null) { text = notificationText; } Lecture lecture; // we get the lecture either from the directly connected lecture or from the attachment unit if (attachment.getAttachmentUnit() != null) { lecture = attachment.getAttachmentUnit().getLecture(); } else { lecture = attachment.getLecture(); } Course course = lecture.getCourse(); GroupNotification notification = new GroupNotification(course, title, text, author, groupNotificationType); notification.setTarget(notification.getAttachmentUpdated(lecture)); return notification; }
/** * Creates an instance of GroupNotification based on the passed parameters. * * @param attachment for which a notification should be created * @param author of the notification * @param groupNotificationType user group type the notification should target * @param notificationType type of the notification that should be created * @param notificationText custom notification text * @return an instance of GroupNotification */
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
public static GroupNotification createNotification(Attachment attachment, User author, GroupNotificationType groupNotificationType, NotificationType notificationType, String notificationText) { String title, text; if (notificationType == NotificationType.ATTACHMENT_CHANGE) { title = NotificationTitleTypeConstants.ATTACHMENT_CHANGE_TITLE; text = "Attachment \"" + attachment.getName() + "\" updated."; } else { throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } if (notificationText != null) { text = notificationText; } Lecture lecture; if (attachment.getAttachmentUnit() != null) { lecture = attachment.getAttachmentUnit().getLecture(); } else { lecture = attachment.getLecture(); } Course course = lecture.getCourse(); GroupNotification notification = new GroupNotification(course, title, text, author, groupNotificationType); notification.setTarget(notification.getAttachmentUpdated(lecture)); return notification; }
[ "public", "static", "GroupNotification", "createNotification", "(", "Attachment", "attachment", ",", "User", "author", ",", "GroupNotificationType", "groupNotificationType", ",", "NotificationType", "notificationType", ",", "String", "notificationText", ")", "{", "String", "title", ",", "text", ";", "if", "(", "notificationType", "==", "NotificationType", ".", "ATTACHMENT_CHANGE", ")", "{", "title", "=", "NotificationTitleTypeConstants", ".", "ATTACHMENT_CHANGE_TITLE", ";", "text", "=", "\"Attachment \\\"\"", "+", "attachment", ".", "getName", "(", ")", "+", "\"\\\" updated.\"", ";", "}", "else", "{", "throw", "new", "UnsupportedOperationException", "(", "\"Unsupported NotificationType: \"", "+", "notificationType", ")", ";", "}", "if", "(", "notificationText", "!=", "null", ")", "{", "text", "=", "notificationText", ";", "}", "Lecture", "lecture", ";", "if", "(", "attachment", ".", "getAttachmentUnit", "(", ")", "!=", "null", ")", "{", "lecture", "=", "attachment", ".", "getAttachmentUnit", "(", ")", ".", "getLecture", "(", ")", ";", "}", "else", "{", "lecture", "=", "attachment", ".", "getLecture", "(", ")", ";", "}", "Course", "course", "=", "lecture", ".", "getCourse", "(", ")", ";", "GroupNotification", "notification", "=", "new", "GroupNotification", "(", "course", ",", "title", ",", "text", ",", "author", ",", "groupNotificationType", ")", ";", "notification", ".", "setTarget", "(", "notification", ".", "getAttachmentUpdated", "(", "lecture", ")", ")", ";", "return", "notification", ";", "}" ]
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
[ "// we get the lecture either from the directly connected lecture or from the attachment unit" ]
[ { "param": "attachment", "type": "Attachment" }, { "param": "author", "type": "User" }, { "param": "groupNotificationType", "type": "GroupNotificationType" }, { "param": "notificationType", "type": "NotificationType" }, { "param": "notificationText", "type": "String" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "attachment", "type": "Attachment", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "author", "type": "User", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "groupNotificationType", "type": "GroupNotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationType", "type": "NotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationText", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 760, 3756, 4386, 752, 4386, 12, 6803, 6042, 16, 2177, 2869, 16, 3756, 4386, 559, 1041, 4386, 559, 16, 8050, 559, 3851, 559, 16, 203, 5411, 514, 3851, 1528, 13, 288, 203, 3639, 514, 2077, 16, 977, 31, 203, 3639, 309, 261, 9927, 559, 422, 8050, 559, 18, 789, 9833, 1792, 3212, 67, 14473, 13, 288, 203, 5411, 2077, 273, 8050, 4247, 559, 2918, 18, 789, 9833, 1792, 3212, 67, 14473, 67, 14123, 31, 203, 5411, 977, 273, 315, 6803, 11843, 397, 6042, 18, 17994, 1435, 397, 7023, 3526, 1199, 31, 203, 3639, 289, 203, 3639, 469, 288, 203, 5411, 604, 394, 13172, 2932, 8544, 8050, 559, 30, 315, 397, 3851, 559, 1769, 203, 3639, 289, 203, 203, 3639, 309, 261, 9927, 1528, 480, 446, 13, 288, 203, 5411, 977, 273, 3851, 1528, 31, 203, 3639, 289, 203, 203, 3639, 511, 386, 594, 884, 299, 594, 31, 203, 3639, 368, 732, 336, 326, 884, 299, 594, 3344, 628, 326, 5122, 5840, 884, 299, 594, 578, 628, 326, 6042, 2836, 203, 3639, 309, 261, 11461, 18, 588, 6803, 2802, 1435, 480, 446, 13, 288, 203, 5411, 884, 299, 594, 273, 6042, 18, 588, 6803, 2802, 7675, 588, 48, 386, 594, 5621, 203, 3639, 289, 203, 3639, 469, 288, 203, 5411, 884, 299, 594, 273, 6042, 18, 588, 48, 386, 594, 5621, 203, 3639, 289, 203, 3639, 385, 3117, 4362, 273, 884, 299, 594, 18, 588, 39, 3117, 5621, 203, 3639, 3756, 4386, 3851, 273, 394, 3756, 4386, 12, 5566, 16, 2077, 16, 977, 16, 2869, 16, 1041, 4386, 559, 1769, 203, 203, 3639, 3851, 18, 542, 2326, 12, 9927, 18, 588, 6803, 7381, 12, 1582, 594, 10019, 203, 203, 3639, 327, 3851, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 10210, 392, 791, 434, 3756, 4386, 2511, 603, 326, 2275, 1472, 18, 203, 377, 380, 203, 377, 380, 632, 891, 6042, 5411, 364, 1492, 279, 3851, 1410, 506, 2522, 203, 377, 380, 632, 891, 2869, 7734, 434, 326, 3851, 203, 377, 380, 632, 891, 1041, 4386, 559, 729, 1041, 618, 326, 3851, 1410, 1018, 203, 377, 380, 632, 891, 3851, 559, 1377, 618, 434, 326, 3851, 716, 1410, 506, 2522, 203, 377, 380, 632, 891, 3851, 1528, 1377, 1679, 3851, 977, 203, 377, 380, 632, 2463, 392, 791, 434, 3756, 4386, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7d1758888d66eb652f2603eb64619ac8549c1a1a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactory.java
[ "MIT" ]
Java
createNotification
GroupNotification
public static GroupNotification createNotification(Exercise exercise, User author, GroupNotificationType groupNotificationType, NotificationType notificationType, String notificationText) { String title, text; switch (notificationType) { case EXERCISE_CREATED -> { title = NotificationTitleTypeConstants.EXERCISE_CREATED_TITLE; text = "A new exercise \"" + exercise.getTitle() + "\" got created."; } case EXERCISE_PRACTICE -> { title = NotificationTitleTypeConstants.EXERCISE_PRACTICE_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" is now open for practice."; } case QUIZ_EXERCISE_STARTED -> { title = NotificationTitleTypeConstants.QUIZ_EXERCISE_STARTED_TITLE; text = "Quiz \"" + exercise.getTitle() + "\" just started."; } case EXERCISE_UPDATED -> { if (exercise.isExamExercise()) { title = NotificationTitleTypeConstants.LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE; text = "Exam Exercise \"" + exercise.getTitle() + "\" updated."; } else { title = NotificationTitleTypeConstants.EXERCISE_UPDATED_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" updated."; } } case DUPLICATE_TEST_CASE -> { title = NotificationTitleTypeConstants.DUPLICATE_TEST_CASE_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" has multiple test cases with the same name."; } case ILLEGAL_SUBMISSION -> { title = NotificationTitleTypeConstants.ILLEGAL_SUBMISSION_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" has illegal submissions of students."; } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } // Catches 3 different use cases : notificationText exists for 1) non-exam exercise update & 2) live exam exercise update with a notification text // 3) hidden/silent live exam exercise update without a set notificationText, thus no pop-up will be visible for the students if (notificationText != null || NotificationTitleTypeConstants.LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE.equals(title)) { text = notificationText; } GroupNotification notification = new GroupNotification(exercise.getCourseViaExerciseGroupOrCourseMember(), title, text, author, groupNotificationType); // Exercises for exams if (exercise.isExamExercise()) { if (NotificationTitleTypeConstants.LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE.equals(title)) { notification.setTarget(notification.getExamExerciseTargetWithExerciseUpdate(exercise)); notification.setPriority(NotificationPriority.HIGH); } else if (exercise instanceof ProgrammingExercise) { notification.setTarget(notification.getExamProgrammingExerciseOrTestCaseTarget((ProgrammingExercise) exercise, "exerciseUpdated")); } } // Exercises for courses (not for exams) else if (notificationType == NotificationType.EXERCISE_CREATED) { notification.setTarget(notification.getExerciseCreatedTarget(exercise)); } else if (notificationType == NotificationType.DUPLICATE_TEST_CASE) { notification.setTarget(notification.getExamProgrammingExerciseOrTestCaseTarget((ProgrammingExercise) exercise, "duplicateTestCase")); } else { notification.setTarget(notification.getExerciseUpdatedTarget(exercise)); } return notification; }
/** * Creates an instance of GroupNotification based on the passed parameters. * * @param exercise for which a notification should be created * @param author of the notification * @param groupNotificationType user group type the notification should target * @param notificationType type of the notification that should be created * @param notificationText custom notification text * @return an instance of GroupNotification */
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
public static GroupNotification createNotification(Exercise exercise, User author, GroupNotificationType groupNotificationType, NotificationType notificationType, String notificationText) { String title, text; switch (notificationType) { case EXERCISE_CREATED -> { title = NotificationTitleTypeConstants.EXERCISE_CREATED_TITLE; text = "A new exercise \"" + exercise.getTitle() + "\" got created."; } case EXERCISE_PRACTICE -> { title = NotificationTitleTypeConstants.EXERCISE_PRACTICE_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" is now open for practice."; } case QUIZ_EXERCISE_STARTED -> { title = NotificationTitleTypeConstants.QUIZ_EXERCISE_STARTED_TITLE; text = "Quiz \"" + exercise.getTitle() + "\" just started."; } case EXERCISE_UPDATED -> { if (exercise.isExamExercise()) { title = NotificationTitleTypeConstants.LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE; text = "Exam Exercise \"" + exercise.getTitle() + "\" updated."; } else { title = NotificationTitleTypeConstants.EXERCISE_UPDATED_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" updated."; } } case DUPLICATE_TEST_CASE -> { title = NotificationTitleTypeConstants.DUPLICATE_TEST_CASE_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" has multiple test cases with the same name."; } case ILLEGAL_SUBMISSION -> { title = NotificationTitleTypeConstants.ILLEGAL_SUBMISSION_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" has illegal submissions of students."; } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } if (notificationText != null || NotificationTitleTypeConstants.LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE.equals(title)) { text = notificationText; } GroupNotification notification = new GroupNotification(exercise.getCourseViaExerciseGroupOrCourseMember(), title, text, author, groupNotificationType); if (exercise.isExamExercise()) { if (NotificationTitleTypeConstants.LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE.equals(title)) { notification.setTarget(notification.getExamExerciseTargetWithExerciseUpdate(exercise)); notification.setPriority(NotificationPriority.HIGH); } else if (exercise instanceof ProgrammingExercise) { notification.setTarget(notification.getExamProgrammingExerciseOrTestCaseTarget((ProgrammingExercise) exercise, "exerciseUpdated")); } } else if (notificationType == NotificationType.EXERCISE_CREATED) { notification.setTarget(notification.getExerciseCreatedTarget(exercise)); } else if (notificationType == NotificationType.DUPLICATE_TEST_CASE) { notification.setTarget(notification.getExamProgrammingExerciseOrTestCaseTarget((ProgrammingExercise) exercise, "duplicateTestCase")); } else { notification.setTarget(notification.getExerciseUpdatedTarget(exercise)); } return notification; }
[ "public", "static", "GroupNotification", "createNotification", "(", "Exercise", "exercise", ",", "User", "author", ",", "GroupNotificationType", "groupNotificationType", ",", "NotificationType", "notificationType", ",", "String", "notificationText", ")", "{", "String", "title", ",", "text", ";", "switch", "(", "notificationType", ")", "{", "case", "EXERCISE_CREATED", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "EXERCISE_CREATED_TITLE", ";", "text", "=", "\"A new exercise \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" got created.\"", ";", "}", "case", "EXERCISE_PRACTICE", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "EXERCISE_PRACTICE_TITLE", ";", "text", "=", "\"Exercise \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" is now open for practice.\"", ";", "}", "case", "QUIZ_EXERCISE_STARTED", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "QUIZ_EXERCISE_STARTED_TITLE", ";", "text", "=", "\"Quiz \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" just started.\"", ";", "}", "case", "EXERCISE_UPDATED", "->", "{", "if", "(", "exercise", ".", "isExamExercise", "(", ")", ")", "{", "title", "=", "NotificationTitleTypeConstants", ".", "LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE", ";", "text", "=", "\"Exam Exercise \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" updated.\"", ";", "}", "else", "{", "title", "=", "NotificationTitleTypeConstants", ".", "EXERCISE_UPDATED_TITLE", ";", "text", "=", "\"Exercise \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" updated.\"", ";", "}", "}", "case", "DUPLICATE_TEST_CASE", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "DUPLICATE_TEST_CASE_TITLE", ";", "text", "=", "\"Exercise \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" has multiple test cases with the same name.\"", ";", "}", "case", "ILLEGAL_SUBMISSION", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "ILLEGAL_SUBMISSION_TITLE", ";", "text", "=", "\"Exercise \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" has illegal submissions of students.\"", ";", "}", "default", "->", "throw", "new", "UnsupportedOperationException", "(", "\"Unsupported NotificationType: \"", "+", "notificationType", ")", ";", "}", "if", "(", "notificationText", "!=", "null", "||", "NotificationTitleTypeConstants", ".", "LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE", ".", "equals", "(", "title", ")", ")", "{", "text", "=", "notificationText", ";", "}", "GroupNotification", "notification", "=", "new", "GroupNotification", "(", "exercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ",", "title", ",", "text", ",", "author", ",", "groupNotificationType", ")", ";", "if", "(", "exercise", ".", "isExamExercise", "(", ")", ")", "{", "if", "(", "NotificationTitleTypeConstants", ".", "LIVE_EXAM_EXERCISE_UPDATE_NOTIFICATION_TITLE", ".", "equals", "(", "title", ")", ")", "{", "notification", ".", "setTarget", "(", "notification", ".", "getExamExerciseTargetWithExerciseUpdate", "(", "exercise", ")", ")", ";", "notification", ".", "setPriority", "(", "NotificationPriority", ".", "HIGH", ")", ";", "}", "else", "if", "(", "exercise", "instanceof", "ProgrammingExercise", ")", "{", "notification", ".", "setTarget", "(", "notification", ".", "getExamProgrammingExerciseOrTestCaseTarget", "(", "(", "ProgrammingExercise", ")", "exercise", ",", "\"exerciseUpdated\"", ")", ")", ";", "}", "}", "else", "if", "(", "notificationType", "==", "NotificationType", ".", "EXERCISE_CREATED", ")", "{", "notification", ".", "setTarget", "(", "notification", ".", "getExerciseCreatedTarget", "(", "exercise", ")", ")", ";", "}", "else", "if", "(", "notificationType", "==", "NotificationType", ".", "DUPLICATE_TEST_CASE", ")", "{", "notification", ".", "setTarget", "(", "notification", ".", "getExamProgrammingExerciseOrTestCaseTarget", "(", "(", "ProgrammingExercise", ")", "exercise", ",", "\"duplicateTestCase\"", ")", ")", ";", "}", "else", "{", "notification", ".", "setTarget", "(", "notification", ".", "getExerciseUpdatedTarget", "(", "exercise", ")", ")", ";", "}", "return", "notification", ";", "}" ]
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
[ "// Catches 3 different use cases : notificationText exists for 1) non-exam exercise update & 2) live exam exercise update with a notification text", "// 3) hidden/silent live exam exercise update without a set notificationText, thus no pop-up will be visible for the students", "// Exercises for exams", "// Exercises for courses (not for exams)" ]
[ { "param": "exercise", "type": "Exercise" }, { "param": "author", "type": "User" }, { "param": "groupNotificationType", "type": "GroupNotificationType" }, { "param": "notificationType", "type": "NotificationType" }, { "param": "notificationText", "type": "String" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exercise", "type": "Exercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "author", "type": "User", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "groupNotificationType", "type": "GroupNotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationType", "type": "NotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationText", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 760, 3756, 4386, 752, 4386, 12, 424, 20603, 24165, 16, 2177, 2869, 16, 3756, 4386, 559, 1041, 4386, 559, 16, 8050, 559, 3851, 559, 16, 203, 5411, 514, 3851, 1528, 13, 288, 203, 3639, 514, 2077, 16, 977, 31, 203, 3639, 1620, 261, 9927, 559, 13, 288, 203, 5411, 648, 5675, 654, 7266, 1090, 67, 18546, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 2294, 654, 7266, 1090, 67, 18546, 67, 14123, 31, 203, 7734, 977, 273, 315, 37, 394, 24165, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 2363, 2522, 1199, 31, 203, 5411, 289, 203, 5411, 648, 5675, 654, 7266, 1090, 67, 52, 2849, 1268, 11774, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 2294, 654, 7266, 1090, 67, 52, 2849, 1268, 11774, 67, 14123, 31, 203, 7734, 977, 273, 315, 424, 20603, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 353, 2037, 1696, 364, 27164, 1199, 31, 203, 5411, 289, 203, 5411, 648, 2238, 5370, 62, 67, 2294, 654, 7266, 1090, 67, 20943, 6404, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 3500, 6867, 67, 2294, 654, 7266, 1090, 67, 20943, 6404, 67, 14123, 31, 203, 7734, 977, 273, 315, 928, 452, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 2537, 5746, 1199, 31, 203, 5411, 289, 203, 5411, 648, 5675, 654, 7266, 1090, 67, 8217, 40, 317, 288, 203, 7734, 309, 261, 8913, 30708, 18, 291, 424, 301, 424, 20603, 10756, 288, 203, 10792, 2077, 273, 8050, 4247, 559, 2918, 18, 2053, 3412, 67, 2294, 2192, 67, 2294, 654, 7266, 1090, 67, 8217, 67, 4400, 14865, 67, 14123, 31, 203, 10792, 977, 273, 315, 424, 301, 1312, 20603, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 3526, 1199, 31, 203, 7734, 289, 203, 7734, 469, 288, 203, 10792, 2077, 273, 8050, 4247, 559, 2918, 18, 2294, 654, 7266, 1090, 67, 8217, 40, 67, 14123, 31, 203, 10792, 977, 273, 315, 424, 20603, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 3526, 1199, 31, 203, 7734, 289, 203, 5411, 289, 203, 5411, 648, 24559, 26042, 67, 16961, 67, 13415, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 30387, 26042, 67, 16961, 67, 13415, 67, 14123, 31, 203, 7734, 977, 273, 315, 424, 20603, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 711, 3229, 1842, 6088, 598, 326, 1967, 508, 1199, 31, 203, 5411, 289, 203, 5411, 648, 467, 48, 19384, 1013, 67, 8362, 15566, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 2627, 19384, 1013, 67, 8362, 15566, 67, 14123, 31, 203, 7734, 977, 273, 315, 424, 20603, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 711, 16720, 22071, 434, 10068, 4877, 1199, 31, 203, 5411, 289, 203, 203, 5411, 805, 317, 604, 394, 13172, 2932, 8544, 8050, 559, 30, 315, 397, 3851, 559, 1769, 203, 3639, 289, 203, 203, 3639, 368, 21984, 281, 890, 3775, 999, 6088, 294, 3851, 1528, 1704, 364, 404, 13, 1661, 17, 338, 301, 24165, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 10210, 392, 791, 434, 3756, 4386, 2511, 603, 326, 2275, 1472, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 2868, 364, 1492, 279, 3851, 1410, 506, 2522, 203, 377, 380, 632, 891, 2869, 7734, 434, 326, 3851, 203, 377, 380, 632, 891, 1041, 4386, 559, 729, 1041, 618, 326, 3851, 1410, 1018, 203, 377, 380, 632, 891, 3851, 559, 1377, 618, 434, 326, 3851, 716, 1410, 506, 2522, 203, 377, 380, 632, 891, 3851, 1528, 1377, 1679, 3851, 977, 203, 377, 380, 632, 2463, 392, 791, 434, 3756, 4386, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7d1758888d66eb652f2603eb64619ac8549c1a1a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactory.java
[ "MIT" ]
Java
createNotification
GroupNotification
public static GroupNotification createNotification(Post post, User author, GroupNotificationType groupNotificationType, NotificationType notificationType) { String title, text; Course course; switch (notificationType) { case NEW_POST_FOR_EXERCISE -> { Exercise exercise = post.getExercise(); title = NotificationTitleTypeConstants.NEW_POST_FOR_EXERCISE_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" got a new post."; course = exercise.getCourseViaExerciseGroupOrCourseMember(); } case NEW_POST_FOR_LECTURE -> { Lecture lecture = post.getLecture(); title = NotificationTitleTypeConstants.NEW_POST_FOR_LECTURE_TITLE; text = "Lecture \"" + lecture.getTitle() + "\" got a new post."; course = lecture.getCourse(); } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } GroupNotification notification = new GroupNotification(course, title, text, author, groupNotificationType); if (notificationType == NotificationType.NEW_POST_FOR_EXERCISE) { notification.setTarget(notification.getExercisePostTarget(post.getExercise())); } else { notification.setTarget(notification.getLecturePostTarget(post.getLecture())); } return notification; }
/** * Creates an instance of GroupNotification based on the passed parameters. * * @param post for which a notification should be created * @param author of the notification * @param groupNotificationType user group type the notification should target * @param notificationType type of the notification that should be created * @return an instance of GroupNotification */
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
public static GroupNotification createNotification(Post post, User author, GroupNotificationType groupNotificationType, NotificationType notificationType) { String title, text; Course course; switch (notificationType) { case NEW_POST_FOR_EXERCISE -> { Exercise exercise = post.getExercise(); title = NotificationTitleTypeConstants.NEW_POST_FOR_EXERCISE_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" got a new post."; course = exercise.getCourseViaExerciseGroupOrCourseMember(); } case NEW_POST_FOR_LECTURE -> { Lecture lecture = post.getLecture(); title = NotificationTitleTypeConstants.NEW_POST_FOR_LECTURE_TITLE; text = "Lecture \"" + lecture.getTitle() + "\" got a new post."; course = lecture.getCourse(); } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } GroupNotification notification = new GroupNotification(course, title, text, author, groupNotificationType); if (notificationType == NotificationType.NEW_POST_FOR_EXERCISE) { notification.setTarget(notification.getExercisePostTarget(post.getExercise())); } else { notification.setTarget(notification.getLecturePostTarget(post.getLecture())); } return notification; }
[ "public", "static", "GroupNotification", "createNotification", "(", "Post", "post", ",", "User", "author", ",", "GroupNotificationType", "groupNotificationType", ",", "NotificationType", "notificationType", ")", "{", "String", "title", ",", "text", ";", "Course", "course", ";", "switch", "(", "notificationType", ")", "{", "case", "NEW_POST_FOR_EXERCISE", "->", "{", "Exercise", "exercise", "=", "post", ".", "getExercise", "(", ")", ";", "title", "=", "NotificationTitleTypeConstants", ".", "NEW_POST_FOR_EXERCISE_TITLE", ";", "text", "=", "\"Exercise \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" got a new post.\"", ";", "course", "=", "exercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ";", "}", "case", "NEW_POST_FOR_LECTURE", "->", "{", "Lecture", "lecture", "=", "post", ".", "getLecture", "(", ")", ";", "title", "=", "NotificationTitleTypeConstants", ".", "NEW_POST_FOR_LECTURE_TITLE", ";", "text", "=", "\"Lecture \\\"\"", "+", "lecture", ".", "getTitle", "(", ")", "+", "\"\\\" got a new post.\"", ";", "course", "=", "lecture", ".", "getCourse", "(", ")", ";", "}", "default", "->", "throw", "new", "UnsupportedOperationException", "(", "\"Unsupported NotificationType: \"", "+", "notificationType", ")", ";", "}", "GroupNotification", "notification", "=", "new", "GroupNotification", "(", "course", ",", "title", ",", "text", ",", "author", ",", "groupNotificationType", ")", ";", "if", "(", "notificationType", "==", "NotificationType", ".", "NEW_POST_FOR_EXERCISE", ")", "{", "notification", ".", "setTarget", "(", "notification", ".", "getExercisePostTarget", "(", "post", ".", "getExercise", "(", ")", ")", ")", ";", "}", "else", "{", "notification", ".", "setTarget", "(", "notification", ".", "getLecturePostTarget", "(", "post", ".", "getLecture", "(", ")", ")", ")", ";", "}", "return", "notification", ";", "}" ]
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
[]
[ { "param": "post", "type": "Post" }, { "param": "author", "type": "User" }, { "param": "groupNotificationType", "type": "GroupNotificationType" }, { "param": "notificationType", "type": "NotificationType" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "post", "type": "Post", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "author", "type": "User", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "groupNotificationType", "type": "GroupNotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationType", "type": "NotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 760, 3756, 4386, 752, 4386, 12, 3349, 1603, 16, 2177, 2869, 16, 3756, 4386, 559, 1041, 4386, 559, 16, 8050, 559, 3851, 559, 13, 288, 203, 3639, 514, 2077, 16, 977, 31, 203, 3639, 385, 3117, 4362, 31, 203, 3639, 1620, 261, 9927, 559, 13, 288, 203, 5411, 648, 12887, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 317, 288, 203, 7734, 1312, 20603, 24165, 273, 1603, 18, 588, 424, 20603, 5621, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 12917, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 67, 14123, 31, 203, 7734, 977, 273, 315, 424, 20603, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 2363, 279, 394, 1603, 1199, 31, 203, 7734, 4362, 273, 24165, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 5621, 203, 5411, 289, 203, 5411, 648, 12887, 67, 3798, 67, 7473, 67, 3918, 4830, 317, 288, 203, 7734, 511, 386, 594, 884, 299, 594, 273, 1603, 18, 588, 48, 386, 594, 5621, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 12917, 67, 3798, 67, 7473, 67, 3918, 4830, 67, 14123, 31, 203, 7734, 977, 273, 315, 48, 386, 594, 11843, 397, 884, 299, 594, 18, 588, 4247, 1435, 397, 7023, 2363, 279, 394, 1603, 1199, 31, 203, 7734, 4362, 273, 884, 299, 594, 18, 588, 39, 3117, 5621, 203, 5411, 289, 203, 5411, 805, 317, 604, 394, 13172, 2932, 8544, 8050, 559, 30, 315, 397, 3851, 559, 1769, 203, 3639, 289, 203, 203, 3639, 3756, 4386, 3851, 273, 394, 3756, 4386, 12, 5566, 16, 2077, 16, 977, 16, 2869, 16, 1041, 4386, 559, 1769, 203, 203, 3639, 309, 261, 9927, 559, 422, 8050, 559, 18, 12917, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 13, 288, 203, 5411, 3851, 18, 542, 2326, 12, 9927, 18, 588, 424, 20603, 3349, 2326, 12, 2767, 18, 588, 424, 20603, 1435, 10019, 203, 3639, 289, 203, 3639, 469, 288, 203, 5411, 3851, 18, 542, 2326, 12, 9927, 18, 588, 48, 386, 594, 3349, 2326, 12, 2767, 18, 588, 48, 386, 594, 1435, 10019, 203, 3639, 289, 203, 203, 3639, 327, 3851, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 10210, 392, 791, 434, 3756, 4386, 2511, 603, 326, 2275, 1472, 18, 203, 377, 380, 203, 377, 380, 632, 891, 1603, 2868, 364, 1492, 279, 3851, 1410, 506, 2522, 203, 377, 380, 632, 891, 2869, 7734, 434, 326, 3851, 203, 377, 380, 632, 891, 1041, 4386, 559, 729, 1041, 618, 326, 3851, 1410, 1018, 203, 377, 380, 632, 891, 3851, 559, 1377, 618, 434, 326, 3851, 716, 1410, 506, 2522, 203, 377, 380, 632, 2463, 392, 791, 434, 3756, 4386, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7d1758888d66eb652f2603eb64619ac8549c1a1a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactory.java
[ "MIT" ]
Java
createNotification
GroupNotification
public static GroupNotification createNotification(AnswerPost answerPost, User author, GroupNotificationType groupNotificationType, NotificationType notificationType) { String text, title; Course course; switch (notificationType) { case NEW_ANSWER_POST_FOR_EXERCISE -> { Exercise exercise = answerPost.getPost().getExercise(); title = NotificationTitleTypeConstants.NEW_ANSWER_POST_FOR_EXERCISE_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" got a new reply."; course = exercise.getCourseViaExerciseGroupOrCourseMember(); } case NEW_ANSWER_POST_FOR_LECTURE -> { Lecture lecture = answerPost.getPost().getLecture(); title = NotificationTitleTypeConstants.NEW_ANSWER_POST_FOR_LECTURE_TITLE; text = "Lecture \"" + lecture.getTitle() + "\" got a new reply."; course = lecture.getCourse(); } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } GroupNotification notification = new GroupNotification(course, title, text, author, groupNotificationType); if (notificationType == NotificationType.NEW_ANSWER_POST_FOR_EXERCISE) { notification.setTarget(notification.getExerciseAnswerPostTarget(answerPost.getPost().getExercise())); } else { notification.setTarget(notification.getLectureAnswerPostTarget(answerPost.getPost().getLecture())); } return notification; }
/** * Creates an instance of GroupNotification based on the passed parameters. * * @param answerPost for which a notification should be created * @param author of the notification * @param groupNotificationType user group type the notification should target * @param notificationType type of the notification that should be created * @return an instance of GroupNotification */
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
public static GroupNotification createNotification(AnswerPost answerPost, User author, GroupNotificationType groupNotificationType, NotificationType notificationType) { String text, title; Course course; switch (notificationType) { case NEW_ANSWER_POST_FOR_EXERCISE -> { Exercise exercise = answerPost.getPost().getExercise(); title = NotificationTitleTypeConstants.NEW_ANSWER_POST_FOR_EXERCISE_TITLE; text = "Exercise \"" + exercise.getTitle() + "\" got a new reply."; course = exercise.getCourseViaExerciseGroupOrCourseMember(); } case NEW_ANSWER_POST_FOR_LECTURE -> { Lecture lecture = answerPost.getPost().getLecture(); title = NotificationTitleTypeConstants.NEW_ANSWER_POST_FOR_LECTURE_TITLE; text = "Lecture \"" + lecture.getTitle() + "\" got a new reply."; course = lecture.getCourse(); } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } GroupNotification notification = new GroupNotification(course, title, text, author, groupNotificationType); if (notificationType == NotificationType.NEW_ANSWER_POST_FOR_EXERCISE) { notification.setTarget(notification.getExerciseAnswerPostTarget(answerPost.getPost().getExercise())); } else { notification.setTarget(notification.getLectureAnswerPostTarget(answerPost.getPost().getLecture())); } return notification; }
[ "public", "static", "GroupNotification", "createNotification", "(", "AnswerPost", "answerPost", ",", "User", "author", ",", "GroupNotificationType", "groupNotificationType", ",", "NotificationType", "notificationType", ")", "{", "String", "text", ",", "title", ";", "Course", "course", ";", "switch", "(", "notificationType", ")", "{", "case", "NEW_ANSWER_POST_FOR_EXERCISE", "->", "{", "Exercise", "exercise", "=", "answerPost", ".", "getPost", "(", ")", ".", "getExercise", "(", ")", ";", "title", "=", "NotificationTitleTypeConstants", ".", "NEW_ANSWER_POST_FOR_EXERCISE_TITLE", ";", "text", "=", "\"Exercise \\\"\"", "+", "exercise", ".", "getTitle", "(", ")", "+", "\"\\\" got a new reply.\"", ";", "course", "=", "exercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ";", "}", "case", "NEW_ANSWER_POST_FOR_LECTURE", "->", "{", "Lecture", "lecture", "=", "answerPost", ".", "getPost", "(", ")", ".", "getLecture", "(", ")", ";", "title", "=", "NotificationTitleTypeConstants", ".", "NEW_ANSWER_POST_FOR_LECTURE_TITLE", ";", "text", "=", "\"Lecture \\\"\"", "+", "lecture", ".", "getTitle", "(", ")", "+", "\"\\\" got a new reply.\"", ";", "course", "=", "lecture", ".", "getCourse", "(", ")", ";", "}", "default", "->", "throw", "new", "UnsupportedOperationException", "(", "\"Unsupported NotificationType: \"", "+", "notificationType", ")", ";", "}", "GroupNotification", "notification", "=", "new", "GroupNotification", "(", "course", ",", "title", ",", "text", ",", "author", ",", "groupNotificationType", ")", ";", "if", "(", "notificationType", "==", "NotificationType", ".", "NEW_ANSWER_POST_FOR_EXERCISE", ")", "{", "notification", ".", "setTarget", "(", "notification", ".", "getExerciseAnswerPostTarget", "(", "answerPost", ".", "getPost", "(", ")", ".", "getExercise", "(", ")", ")", ")", ";", "}", "else", "{", "notification", ".", "setTarget", "(", "notification", ".", "getLectureAnswerPostTarget", "(", "answerPost", ".", "getPost", "(", ")", ".", "getLecture", "(", ")", ")", ")", ";", "}", "return", "notification", ";", "}" ]
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
[]
[ { "param": "answerPost", "type": "AnswerPost" }, { "param": "author", "type": "User" }, { "param": "groupNotificationType", "type": "GroupNotificationType" }, { "param": "notificationType", "type": "NotificationType" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "answerPost", "type": "AnswerPost", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "author", "type": "User", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "groupNotificationType", "type": "GroupNotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationType", "type": "NotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 760, 3756, 4386, 752, 4386, 12, 13203, 3349, 5803, 3349, 16, 2177, 2869, 16, 3756, 4386, 559, 1041, 4386, 559, 16, 8050, 559, 3851, 559, 13, 288, 203, 3639, 514, 977, 16, 2077, 31, 203, 3639, 385, 3117, 4362, 31, 203, 3639, 1620, 261, 9927, 559, 13, 288, 203, 5411, 648, 12887, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 317, 288, 203, 7734, 1312, 20603, 24165, 273, 5803, 3349, 18, 588, 3349, 7675, 588, 424, 20603, 5621, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 12917, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 67, 14123, 31, 203, 7734, 977, 273, 315, 424, 20603, 11843, 397, 24165, 18, 588, 4247, 1435, 397, 7023, 2363, 279, 394, 4332, 1199, 31, 203, 7734, 4362, 273, 24165, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 5621, 203, 5411, 289, 203, 5411, 648, 12887, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 3918, 4830, 317, 288, 203, 7734, 511, 386, 594, 884, 299, 594, 273, 5803, 3349, 18, 588, 3349, 7675, 588, 48, 386, 594, 5621, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 12917, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 3918, 4830, 67, 14123, 31, 203, 7734, 977, 273, 315, 48, 386, 594, 11843, 397, 884, 299, 594, 18, 588, 4247, 1435, 397, 7023, 2363, 279, 394, 4332, 1199, 31, 203, 7734, 4362, 273, 884, 299, 594, 18, 588, 39, 3117, 5621, 203, 5411, 289, 203, 5411, 805, 317, 604, 394, 13172, 2932, 8544, 8050, 559, 30, 315, 397, 3851, 559, 1769, 203, 3639, 289, 203, 203, 3639, 3756, 4386, 3851, 273, 394, 3756, 4386, 12, 5566, 16, 2077, 16, 977, 16, 2869, 16, 1041, 4386, 559, 1769, 203, 203, 3639, 309, 261, 9927, 559, 422, 8050, 559, 18, 12917, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 13, 288, 203, 5411, 3851, 18, 542, 2326, 12, 9927, 18, 588, 424, 20603, 13203, 3349, 2326, 12, 13490, 3349, 18, 588, 3349, 7675, 588, 424, 20603, 1435, 10019, 203, 3639, 289, 203, 3639, 469, 288, 203, 5411, 3851, 18, 542, 2326, 12, 9927, 18, 588, 48, 386, 594, 13203, 3349, 2326, 12, 13490, 3349, 18, 588, 3349, 7675, 588, 48, 386, 594, 1435, 10019, 203, 3639, 289, 203, 203, 3639, 327, 3851, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 10210, 392, 791, 434, 3756, 4386, 2511, 603, 326, 2275, 1472, 18, 203, 377, 380, 203, 377, 380, 632, 891, 5803, 3349, 5411, 364, 1492, 279, 3851, 1410, 506, 2522, 203, 377, 380, 632, 891, 2869, 7734, 434, 326, 3851, 203, 377, 380, 632, 891, 1041, 4386, 559, 729, 1041, 618, 326, 3851, 1410, 1018, 203, 377, 380, 632, 891, 3851, 559, 1377, 618, 434, 326, 3851, 716, 1410, 506, 2522, 203, 377, 380, 632, 2463, 392, 791, 434, 3756, 4386, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7d1758888d66eb652f2603eb64619ac8549c1a1a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactory.java
[ "MIT" ]
Java
createNotification
GroupNotification
public static GroupNotification createNotification(Course course, User author, GroupNotificationType groupNotificationType, NotificationType notificationType, List<String> archiveErrors) { String title, text; switch (notificationType) { case COURSE_ARCHIVE_STARTED -> { title = NotificationTitleTypeConstants.COURSE_ARCHIVE_STARTED_TITLE; text = "The course \"" + course.getTitle() + "\" is being archived."; } case COURSE_ARCHIVE_FINISHED -> { title = NotificationTitleTypeConstants.COURSE_ARCHIVE_FINISHED_TITLE; text = "The course \"" + course.getTitle() + "\" has been archived."; if (!archiveErrors.isEmpty()) { text += " Some exercises couldn't be included in the archive:<br/><br/>" + String.join("<br/><br/>", archiveErrors); } } case COURSE_ARCHIVE_FAILED -> { title = NotificationTitleTypeConstants.COURSE_ARCHIVE_FAILED_TITLE; text = "The was a problem archiving course \"" + course.getTitle() + "\": <br/><br/>" + String.join("<br/><br/>", archiveErrors); } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } GroupNotification notification = new GroupNotification(course, title, text, author, groupNotificationType); notification.setTarget(notification.getCourseTarget(course, "courseArchiveUpdated")); return notification; }
/** * Creates an instance of GroupNotification based on the passed parameters. * * @param course the course being archived * @param author of the notification * @param groupNotificationType user group type the notification should target * @param notificationType type of the notification that should be created * @param archiveErrors a list of errors that occurred during archiving * @return an instance of GroupNotification */
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
public static GroupNotification createNotification(Course course, User author, GroupNotificationType groupNotificationType, NotificationType notificationType, List<String> archiveErrors) { String title, text; switch (notificationType) { case COURSE_ARCHIVE_STARTED -> { title = NotificationTitleTypeConstants.COURSE_ARCHIVE_STARTED_TITLE; text = "The course \"" + course.getTitle() + "\" is being archived."; } case COURSE_ARCHIVE_FINISHED -> { title = NotificationTitleTypeConstants.COURSE_ARCHIVE_FINISHED_TITLE; text = "The course \"" + course.getTitle() + "\" has been archived."; if (!archiveErrors.isEmpty()) { text += " Some exercises couldn't be included in the archive:<br/><br/>" + String.join("<br/><br/>", archiveErrors); } } case COURSE_ARCHIVE_FAILED -> { title = NotificationTitleTypeConstants.COURSE_ARCHIVE_FAILED_TITLE; text = "The was a problem archiving course \"" + course.getTitle() + "\": <br/><br/>" + String.join("<br/><br/>", archiveErrors); } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } GroupNotification notification = new GroupNotification(course, title, text, author, groupNotificationType); notification.setTarget(notification.getCourseTarget(course, "courseArchiveUpdated")); return notification; }
[ "public", "static", "GroupNotification", "createNotification", "(", "Course", "course", ",", "User", "author", ",", "GroupNotificationType", "groupNotificationType", ",", "NotificationType", "notificationType", ",", "List", "<", "String", ">", "archiveErrors", ")", "{", "String", "title", ",", "text", ";", "switch", "(", "notificationType", ")", "{", "case", "COURSE_ARCHIVE_STARTED", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "COURSE_ARCHIVE_STARTED_TITLE", ";", "text", "=", "\"The course \\\"\"", "+", "course", ".", "getTitle", "(", ")", "+", "\"\\\" is being archived.\"", ";", "}", "case", "COURSE_ARCHIVE_FINISHED", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "COURSE_ARCHIVE_FINISHED_TITLE", ";", "text", "=", "\"The course \\\"\"", "+", "course", ".", "getTitle", "(", ")", "+", "\"\\\" has been archived.\"", ";", "if", "(", "!", "archiveErrors", ".", "isEmpty", "(", ")", ")", "{", "text", "+=", "\" Some exercises couldn't be included in the archive:<br/><br/>\"", "+", "String", ".", "join", "(", "\"<br/><br/>\"", ",", "archiveErrors", ")", ";", "}", "}", "case", "COURSE_ARCHIVE_FAILED", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "COURSE_ARCHIVE_FAILED_TITLE", ";", "text", "=", "\"The was a problem archiving course \\\"\"", "+", "course", ".", "getTitle", "(", ")", "+", "\"\\\": <br/><br/>\"", "+", "String", ".", "join", "(", "\"<br/><br/>\"", ",", "archiveErrors", ")", ";", "}", "default", "->", "throw", "new", "UnsupportedOperationException", "(", "\"Unsupported NotificationType: \"", "+", "notificationType", ")", ";", "}", "GroupNotification", "notification", "=", "new", "GroupNotification", "(", "course", ",", "title", ",", "text", ",", "author", ",", "groupNotificationType", ")", ";", "notification", ".", "setTarget", "(", "notification", ".", "getCourseTarget", "(", "course", ",", "\"courseArchiveUpdated\"", ")", ")", ";", "return", "notification", ";", "}" ]
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
[]
[ { "param": "course", "type": "Course" }, { "param": "author", "type": "User" }, { "param": "groupNotificationType", "type": "GroupNotificationType" }, { "param": "notificationType", "type": "NotificationType" }, { "param": "archiveErrors", "type": "List<String>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "course", "type": "Course", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "author", "type": "User", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "groupNotificationType", "type": "GroupNotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationType", "type": "NotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "archiveErrors", "type": "List<String>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 760, 3756, 4386, 752, 4386, 12, 39, 3117, 4362, 16, 2177, 2869, 16, 3756, 4386, 559, 1041, 4386, 559, 16, 8050, 559, 3851, 559, 16, 203, 5411, 987, 32, 780, 34, 5052, 4229, 13, 288, 203, 3639, 514, 2077, 16, 977, 31, 203, 3639, 1620, 261, 9927, 559, 13, 288, 203, 5411, 648, 7910, 23875, 67, 10586, 5354, 67, 20943, 6404, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 3865, 23875, 67, 10586, 5354, 67, 20943, 6404, 67, 14123, 31, 203, 7734, 977, 273, 315, 1986, 4362, 11843, 397, 4362, 18, 588, 4247, 1435, 397, 7023, 353, 3832, 23276, 1199, 31, 203, 5411, 289, 203, 5411, 648, 7910, 23875, 67, 10586, 5354, 67, 23259, 2056, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 3865, 23875, 67, 10586, 5354, 67, 23259, 2056, 67, 14123, 31, 203, 7734, 977, 273, 315, 1986, 4362, 11843, 397, 4362, 18, 588, 4247, 1435, 397, 7023, 711, 2118, 23276, 1199, 31, 203, 203, 7734, 309, 16051, 10686, 4229, 18, 291, 1921, 10756, 288, 203, 10792, 977, 1011, 315, 10548, 431, 12610, 6141, 17991, 1404, 506, 5849, 316, 326, 5052, 22292, 2848, 19, 4438, 2848, 26293, 397, 514, 18, 5701, 2932, 32, 2848, 19, 4438, 2848, 26293, 16, 5052, 4229, 1769, 203, 7734, 289, 203, 5411, 289, 203, 5411, 648, 7910, 23875, 67, 10586, 5354, 67, 11965, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 3865, 23875, 67, 10586, 5354, 67, 11965, 67, 14123, 31, 203, 7734, 977, 273, 315, 1986, 1703, 279, 6199, 6637, 9288, 4362, 11843, 397, 4362, 18, 588, 4247, 1435, 397, 1548, 6877, 411, 2848, 19, 4438, 2848, 26293, 397, 514, 18, 5701, 2932, 32, 2848, 19, 4438, 2848, 26293, 16, 5052, 4229, 1769, 203, 5411, 289, 203, 5411, 805, 317, 604, 394, 13172, 2932, 8544, 8050, 559, 30, 315, 397, 3851, 559, 1769, 203, 3639, 289, 203, 203, 3639, 3756, 4386, 3851, 273, 394, 3756, 4386, 12, 5566, 16, 2077, 16, 977, 16, 2869,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 10210, 392, 791, 434, 3756, 4386, 2511, 603, 326, 2275, 1472, 18, 203, 377, 380, 203, 377, 380, 632, 891, 4362, 7734, 326, 4362, 3832, 23276, 203, 377, 380, 632, 891, 2869, 7734, 434, 326, 3851, 203, 377, 380, 632, 891, 1041, 4386, 559, 729, 1041, 618, 326, 3851, 1410, 1018, 203, 377, 380, 632, 891, 3851, 559, 1377, 618, 434, 326, 3851, 716, 1410, 506, 2522, 203, 377, 380, 632, 891, 5052, 4229, 540, 279, 666, 434, 1334, 716, 7841, 4982, 6637, 9288, 203, 377, 380, 632, 2463, 392, 791, 434, 3756, 4386, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
7d1758888d66eb652f2603eb64619ac8549c1a1a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactory.java
[ "MIT" ]
Java
createNotification
GroupNotification
public static GroupNotification createNotification(Exam exam, User author, GroupNotificationType groupNotificationType, NotificationType notificationType, List<String> archiveErrors) { String title, text; switch (notificationType) { case EXAM_ARCHIVE_STARTED -> { title = NotificationTitleTypeConstants.EXAM_ARCHIVE_STARTED_TITLE; text = "The exam \"" + exam.getTitle() + "\" is being archived."; } case EXAM_ARCHIVE_FINISHED -> { title = NotificationTitleTypeConstants.EXAM_ARCHIVE_FINISHED_TITLE; text = "The exam \"" + exam.getTitle() + "\" has been archived."; if (!archiveErrors.isEmpty()) { text += " Some exercises couldn't be included in the archive:<br/><br/>" + String.join("<br/><br/>", archiveErrors); } } case EXAM_ARCHIVE_FAILED -> { title = NotificationTitleTypeConstants.EXAM_ARCHIVE_FAILED_TITLE; text = "The was a problem archiving exam \"" + exam.getTitle() + "\": <br/><br/>" + String.join("<br/><br/>", archiveErrors); } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } GroupNotification notification = new GroupNotification(exam.getCourse(), title, text, author, groupNotificationType); notification.setTarget(notification.getCourseTarget(exam.getCourse(), "examArchiveUpdated")); return notification; }
/** * Creates an instance of GroupNotification based on the passed parameters. * * @param exam the exam being archived * @param author of the notification * @param groupNotificationType user group type the notification should target * @param notificationType type of the notification that should be created * @param archiveErrors a list of errors that occurred during archiving * @return an instance of GroupNotification */
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
public static GroupNotification createNotification(Exam exam, User author, GroupNotificationType groupNotificationType, NotificationType notificationType, List<String> archiveErrors) { String title, text; switch (notificationType) { case EXAM_ARCHIVE_STARTED -> { title = NotificationTitleTypeConstants.EXAM_ARCHIVE_STARTED_TITLE; text = "The exam \"" + exam.getTitle() + "\" is being archived."; } case EXAM_ARCHIVE_FINISHED -> { title = NotificationTitleTypeConstants.EXAM_ARCHIVE_FINISHED_TITLE; text = "The exam \"" + exam.getTitle() + "\" has been archived."; if (!archiveErrors.isEmpty()) { text += " Some exercises couldn't be included in the archive:<br/><br/>" + String.join("<br/><br/>", archiveErrors); } } case EXAM_ARCHIVE_FAILED -> { title = NotificationTitleTypeConstants.EXAM_ARCHIVE_FAILED_TITLE; text = "The was a problem archiving exam \"" + exam.getTitle() + "\": <br/><br/>" + String.join("<br/><br/>", archiveErrors); } default -> throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); } GroupNotification notification = new GroupNotification(exam.getCourse(), title, text, author, groupNotificationType); notification.setTarget(notification.getCourseTarget(exam.getCourse(), "examArchiveUpdated")); return notification; }
[ "public", "static", "GroupNotification", "createNotification", "(", "Exam", "exam", ",", "User", "author", ",", "GroupNotificationType", "groupNotificationType", ",", "NotificationType", "notificationType", ",", "List", "<", "String", ">", "archiveErrors", ")", "{", "String", "title", ",", "text", ";", "switch", "(", "notificationType", ")", "{", "case", "EXAM_ARCHIVE_STARTED", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "EXAM_ARCHIVE_STARTED_TITLE", ";", "text", "=", "\"The exam \\\"\"", "+", "exam", ".", "getTitle", "(", ")", "+", "\"\\\" is being archived.\"", ";", "}", "case", "EXAM_ARCHIVE_FINISHED", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "EXAM_ARCHIVE_FINISHED_TITLE", ";", "text", "=", "\"The exam \\\"\"", "+", "exam", ".", "getTitle", "(", ")", "+", "\"\\\" has been archived.\"", ";", "if", "(", "!", "archiveErrors", ".", "isEmpty", "(", ")", ")", "{", "text", "+=", "\" Some exercises couldn't be included in the archive:<br/><br/>\"", "+", "String", ".", "join", "(", "\"<br/><br/>\"", ",", "archiveErrors", ")", ";", "}", "}", "case", "EXAM_ARCHIVE_FAILED", "->", "{", "title", "=", "NotificationTitleTypeConstants", ".", "EXAM_ARCHIVE_FAILED_TITLE", ";", "text", "=", "\"The was a problem archiving exam \\\"\"", "+", "exam", ".", "getTitle", "(", ")", "+", "\"\\\": <br/><br/>\"", "+", "String", ".", "join", "(", "\"<br/><br/>\"", ",", "archiveErrors", ")", ";", "}", "default", "->", "throw", "new", "UnsupportedOperationException", "(", "\"Unsupported NotificationType: \"", "+", "notificationType", ")", ";", "}", "GroupNotification", "notification", "=", "new", "GroupNotification", "(", "exam", ".", "getCourse", "(", ")", ",", "title", ",", "text", ",", "author", ",", "groupNotificationType", ")", ";", "notification", ".", "setTarget", "(", "notification", ".", "getCourseTarget", "(", "exam", ".", "getCourse", "(", ")", ",", "\"examArchiveUpdated\"", ")", ")", ";", "return", "notification", ";", "}" ]
Creates an instance of GroupNotification based on the passed parameters.
[ "Creates", "an", "instance", "of", "GroupNotification", "based", "on", "the", "passed", "parameters", "." ]
[]
[ { "param": "exam", "type": "Exam" }, { "param": "author", "type": "User" }, { "param": "groupNotificationType", "type": "GroupNotificationType" }, { "param": "notificationType", "type": "NotificationType" }, { "param": "archiveErrors", "type": "List<String>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exam", "type": "Exam", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "author", "type": "User", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "groupNotificationType", "type": "GroupNotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationType", "type": "NotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "archiveErrors", "type": "List<String>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 760, 3756, 4386, 752, 4386, 12, 424, 301, 19707, 16, 2177, 2869, 16, 3756, 4386, 559, 1041, 4386, 559, 16, 8050, 559, 3851, 559, 16, 203, 5411, 987, 32, 780, 34, 5052, 4229, 13, 288, 203, 3639, 514, 2077, 16, 977, 31, 203, 3639, 1620, 261, 9927, 559, 13, 288, 203, 5411, 648, 5675, 2192, 67, 10586, 5354, 67, 20943, 6404, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 2294, 2192, 67, 10586, 5354, 67, 20943, 6404, 67, 14123, 31, 203, 7734, 977, 273, 315, 1986, 19707, 11843, 397, 19707, 18, 588, 4247, 1435, 397, 7023, 353, 3832, 23276, 1199, 31, 203, 5411, 289, 203, 5411, 648, 5675, 2192, 67, 10586, 5354, 67, 23259, 2056, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 2294, 2192, 67, 10586, 5354, 67, 23259, 2056, 67, 14123, 31, 203, 7734, 977, 273, 315, 1986, 19707, 11843, 397, 19707, 18, 588, 4247, 1435, 397, 7023, 711, 2118, 23276, 1199, 31, 203, 203, 7734, 309, 16051, 10686, 4229, 18, 291, 1921, 10756, 288, 203, 10792, 977, 1011, 315, 10548, 431, 12610, 6141, 17991, 1404, 506, 5849, 316, 326, 5052, 22292, 2848, 19, 4438, 2848, 26293, 397, 514, 18, 5701, 2932, 32, 2848, 19, 4438, 2848, 26293, 16, 5052, 4229, 1769, 203, 7734, 289, 203, 5411, 289, 203, 5411, 648, 5675, 2192, 67, 10586, 5354, 67, 11965, 317, 288, 203, 7734, 2077, 273, 8050, 4247, 559, 2918, 18, 2294, 2192, 67, 10586, 5354, 67, 11965, 67, 14123, 31, 203, 7734, 977, 273, 315, 1986, 1703, 279, 6199, 6637, 9288, 19707, 11843, 397, 19707, 18, 588, 4247, 1435, 397, 1548, 6877, 411, 2848, 19, 4438, 2848, 26293, 397, 514, 18, 5701, 2932, 32, 2848, 19, 4438, 2848, 26293, 16, 5052, 4229, 1769, 203, 5411, 289, 203, 5411, 805, 317, 604, 394, 13172, 2932, 8544, 8050, 559, 30, 315, 397, 3851, 559, 1769, 203, 3639, 289, 203, 203, 3639, 3756, 4386, 3851, 273, 394, 3756, 4386, 12, 338, 301, 18, 588, 39, 3117, 9334, 2077, 16, 977, 16, 2869, 16, 1041, 4386, 559, 1769, 203, 3639, 3851, 18, 542, 2326, 12, 9927, 18, 588, 39, 3117, 2326, 12, 338, 301, 18, 588, 39, 3117, 9334, 315, 338, 301, 7465, 7381, 7923, 1769, 203, 3639, 327, 3851, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 10210, 392, 791, 434, 3756, 4386, 2511, 603, 326, 2275, 1472, 18, 203, 377, 380, 203, 377, 380, 632, 891, 19707, 7734, 326, 19707, 3832, 23276, 203, 377, 380, 632, 891, 2869, 7734, 434, 326, 3851, 203, 377, 380, 632, 891, 1041, 4386, 559, 729, 1041, 618, 326, 3851, 1410, 1018, 203, 377, 380, 632, 891, 3851, 559, 1377, 618, 434, 326, 3851, 716, 1410, 506, 2522, 203, 377, 380, 632, 891, 5052, 4229, 540, 279, 666, 434, 1334, 716, 7841, 4982, 6637, 9288, 203, 377, 380, 632, 2463, 392, 791, 434, 3756, 4386, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
9ecb098d9bd932ae356f34bb1527204d68004c9d
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/StatisticsService.java
[ "MIT" ]
Java
createSpanMap
null
private Map<SpanType, Integer> createSpanMap() { Map<SpanType, Integer> spanMap = new HashMap<>(); spanMap.put(SpanType.DAY, 24); spanMap.put(SpanType.WEEK, 7); spanMap.put(SpanType.QUARTER, 12); spanMap.put(SpanType.YEAR, 12); return spanMap; }
/** * A map to manage the spanTypes and the corresponding array length of the result */
A map to manage the spanTypes and the corresponding array length of the result
[ "A", "map", "to", "manage", "the", "spanTypes", "and", "the", "corresponding", "array", "length", "of", "the", "result" ]
private Map<SpanType, Integer> createSpanMap() { Map<SpanType, Integer> spanMap = new HashMap<>(); spanMap.put(SpanType.DAY, 24); spanMap.put(SpanType.WEEK, 7); spanMap.put(SpanType.QUARTER, 12); spanMap.put(SpanType.YEAR, 12); return spanMap; }
[ "private", "Map", "<", "SpanType", ",", "Integer", ">", "createSpanMap", "(", ")", "{", "Map", "<", "SpanType", ",", "Integer", ">", "spanMap", "=", "new", "HashMap", "<", ">", "(", ")", ";", "spanMap", ".", "put", "(", "SpanType", ".", "DAY", ",", "24", ")", ";", "spanMap", ".", "put", "(", "SpanType", ".", "WEEK", ",", "7", ")", ";", "spanMap", ".", "put", "(", "SpanType", ".", "QUARTER", ",", "12", ")", ";", "spanMap", ".", "put", "(", "SpanType", ".", "YEAR", ",", "12", ")", ";", "return", "spanMap", ";", "}" ]
A map to manage the spanTypes and the corresponding array length of the result
[ "A", "map", "to", "manage", "the", "spanTypes", "and", "the", "corresponding", "array", "length", "of", "the", "result" ]
[]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 1635, 32, 6952, 559, 16, 2144, 34, 752, 6952, 863, 1435, 288, 203, 3639, 1635, 32, 6952, 559, 16, 2144, 34, 4548, 863, 273, 394, 4317, 29667, 5621, 203, 3639, 4548, 863, 18, 458, 12, 6952, 559, 18, 10339, 16, 4248, 1769, 203, 3639, 4548, 863, 18, 458, 12, 6952, 559, 18, 20274, 16, 2371, 1769, 203, 3639, 4548, 863, 18, 458, 12, 6952, 559, 18, 3500, 985, 2560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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 432, 852, 358, 10680, 326, 4548, 2016, 471, 326, 4656, 526, 769, 434, 326, 563, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
9ecb098d9bd932ae356f34bb1527204d68004c9d
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/StatisticsService.java
[ "MIT" ]
Java
sortAfterReleaseDate
null
private void sortAfterReleaseDate(List<CourseStatisticsAverageScore> exercises) { exercises.sort((exerciseA, exerciseB) -> { var releaseDateA = exerciseA.getReleaseDate(); var releaseDateB = exerciseB.getReleaseDate(); if (releaseDateA == null) { // If A has no release date, sort B first return 1; } else if (releaseDateB == null) { // If B has no release date, sort A first return -1; } else if (releaseDateA.isEqual(releaseDateB)) { return 0; } else { // Sort the one with the earlier release date first return releaseDateA.isBefore(releaseDateB) ? -1 : 1; } }); }
/** * Sorting averageScores for release dates * @param exercises the exercises which we want to sort */
Sorting averageScores for release dates @param exercises the exercises which we want to sort
[ "Sorting", "averageScores", "for", "release", "dates", "@param", "exercises", "the", "exercises", "which", "we", "want", "to", "sort" ]
private void sortAfterReleaseDate(List<CourseStatisticsAverageScore> exercises) { exercises.sort((exerciseA, exerciseB) -> { var releaseDateA = exerciseA.getReleaseDate(); var releaseDateB = exerciseB.getReleaseDate(); if (releaseDateA == null) { return 1; } else if (releaseDateB == null) { return -1; } else if (releaseDateA.isEqual(releaseDateB)) { return 0; } else { return releaseDateA.isBefore(releaseDateB) ? -1 : 1; } }); }
[ "private", "void", "sortAfterReleaseDate", "(", "List", "<", "CourseStatisticsAverageScore", ">", "exercises", ")", "{", "exercises", ".", "sort", "(", "(", "exerciseA", ",", "exerciseB", ")", "->", "{", "var", "releaseDateA", "=", "exerciseA", ".", "getReleaseDate", "(", ")", ";", "var", "releaseDateB", "=", "exerciseB", ".", "getReleaseDate", "(", ")", ";", "if", "(", "releaseDateA", "==", "null", ")", "{", "return", "1", ";", "}", "else", "if", "(", "releaseDateB", "==", "null", ")", "{", "return", "-", "1", ";", "}", "else", "if", "(", "releaseDateA", ".", "isEqual", "(", "releaseDateB", ")", ")", "{", "return", "0", ";", "}", "else", "{", "return", "releaseDateA", ".", "isBefore", "(", "releaseDateB", ")", "?", "-", "1", ":", "1", ";", "}", "}", ")", ";", "}" ]
Sorting averageScores for release dates @param exercises the exercises which we want to sort
[ "Sorting", "averageScores", "for", "release", "dates", "@param", "exercises", "the", "exercises", "which", "we", "want", "to", "sort" ]
[ "// If A has no release date, sort B first", "// If B has no release date, sort A first", "// Sort the one with the earlier release date first" ]
[ { "param": "exercises", "type": "List<CourseStatisticsAverageScore>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exercises", "type": "List<CourseStatisticsAverageScore>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 1524, 4436, 7391, 1626, 12, 682, 32, 39, 3117, 8569, 17115, 7295, 34, 431, 12610, 6141, 13, 288, 203, 3639, 431, 12610, 6141, 18, 3804, 12443, 8913, 30708, 37, 16, 24165, 38, 13, 317, 288, 203, 5411, 569, 3992, 1626, 37, 273, 24165, 37, 18, 588, 7391, 1626, 5621, 203, 5411, 569, 3992, 1626, 38, 273, 24165, 38, 18, 588, 7391, 1626, 5621, 203, 5411, 309, 261, 9340, 1626, 37, 422, 446, 13, 288, 203, 7734, 368, 971, 432, 711, 1158, 3992, 1509, 16, 1524, 605, 1122, 203, 7734, 327, 404, 31, 203, 5411, 289, 203, 5411, 469, 309, 261, 9340, 1626, 38, 422, 446, 13, 288, 203, 7734, 368, 971, 605, 711, 1158, 3992, 1509, 16, 1524, 432, 1122, 203, 7734, 327, 300, 21, 31, 203, 5411, 289, 203, 5411, 469, 309, 261, 9340, 1626, 37, 18, 291, 5812, 12, 9340, 1626, 38, 3719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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 5928, 310, 8164, 20037, 364, 3992, 7811, 203, 377, 380, 632, 891, 431, 12610, 6141, 326, 431, 12610, 6141, 1492, 732, 2545, 358, 1524, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
63d74981f67ed07c18502e06abf00692e2b03de2
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseSimulationService.java
[ "MIT" ]
Java
createProgrammingExerciseWithoutVersionControlAndContinuousIntegrationAvailable
ProgrammingExercise
@Transactional // ok because we create many objects in a rather complex way and need a rollback in case of exceptions public ProgrammingExercise createProgrammingExerciseWithoutVersionControlAndContinuousIntegrationAvailable(ProgrammingExercise programmingExercise) { programmingExercise.generateAndSetProjectKey(); programmingExerciseService.initParticipations(programmingExercise); setURLsAndBuildPlanIDsForNewExerciseWithoutVersionControlAndContinuousIntegrationAvailable(programmingExercise); programmingExerciseService.connectBaseParticipationsToExerciseAndSave(programmingExercise); programmingExercise = programmingExerciseRepository.save(programmingExercise); // The creation of the webhooks must occur after the initial push, because the participation is // not yet saved in the database, so we cannot save the submission accordingly (see ProgrammingSubmissionService.notifyPush) instanceMessageSendService.sendProgrammingExerciseSchedule(programmingExercise.getId()); instanceMessageSendService.sendExerciseReleaseNotificationSchedule(programmingExercise.getId()); return programmingExercise; }
/** * Setups the context of a new programming exercise. * @param programmingExercise the exercise which should be stored in the database * @return returns the modified and stored programming exercise * This functionality is only for testing purposes (noVersionControlAndContinuousIntegrationAvailable) */
Setups the context of a new programming exercise. @param programmingExercise the exercise which should be stored in the database @return returns the modified and stored programming exercise This functionality is only for testing purposes (noVersionControlAndContinuousIntegrationAvailable)
[ "Setups", "the", "context", "of", "a", "new", "programming", "exercise", ".", "@param", "programmingExercise", "the", "exercise", "which", "should", "be", "stored", "in", "the", "database", "@return", "returns", "the", "modified", "and", "stored", "programming", "exercise", "This", "functionality", "is", "only", "for", "testing", "purposes", "(", "noVersionControlAndContinuousIntegrationAvailable", ")" ]
@Transactional public ProgrammingExercise createProgrammingExerciseWithoutVersionControlAndContinuousIntegrationAvailable(ProgrammingExercise programmingExercise) { programmingExercise.generateAndSetProjectKey(); programmingExerciseService.initParticipations(programmingExercise); setURLsAndBuildPlanIDsForNewExerciseWithoutVersionControlAndContinuousIntegrationAvailable(programmingExercise); programmingExerciseService.connectBaseParticipationsToExerciseAndSave(programmingExercise); programmingExercise = programmingExerciseRepository.save(programmingExercise); instanceMessageSendService.sendProgrammingExerciseSchedule(programmingExercise.getId()); instanceMessageSendService.sendExerciseReleaseNotificationSchedule(programmingExercise.getId()); return programmingExercise; }
[ "@", "Transactional", "public", "ProgrammingExercise", "createProgrammingExerciseWithoutVersionControlAndContinuousIntegrationAvailable", "(", "ProgrammingExercise", "programmingExercise", ")", "{", "programmingExercise", ".", "generateAndSetProjectKey", "(", ")", ";", "programmingExerciseService", ".", "initParticipations", "(", "programmingExercise", ")", ";", "setURLsAndBuildPlanIDsForNewExerciseWithoutVersionControlAndContinuousIntegrationAvailable", "(", "programmingExercise", ")", ";", "programmingExerciseService", ".", "connectBaseParticipationsToExerciseAndSave", "(", "programmingExercise", ")", ";", "programmingExercise", "=", "programmingExerciseRepository", ".", "save", "(", "programmingExercise", ")", ";", "instanceMessageSendService", ".", "sendProgrammingExerciseSchedule", "(", "programmingExercise", ".", "getId", "(", ")", ")", ";", "instanceMessageSendService", ".", "sendExerciseReleaseNotificationSchedule", "(", "programmingExercise", ".", "getId", "(", ")", ")", ";", "return", "programmingExercise", ";", "}" ]
Setups the context of a new programming exercise.
[ "Setups", "the", "context", "of", "a", "new", "programming", "exercise", "." ]
[ "// ok because we create many objects in a rather complex way and need a rollback in case of exceptions", "// The creation of the webhooks must occur after the initial push, because the participation is", "// not yet saved in the database, so we cannot save the submission accordingly (see ProgrammingSubmissionService.notifyPush)" ]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 3342, 287, 368, 1529, 2724, 732, 752, 4906, 2184, 316, 279, 9178, 7233, 4031, 471, 1608, 279, 8006, 316, 648, 434, 4798, 203, 565, 1071, 13586, 11987, 424, 20603, 752, 9459, 11987, 424, 20603, 8073, 1444, 3367, 1876, 26509, 15372, 5268, 12, 9459, 11987, 424, 20603, 5402, 11987, 424, 20603, 13, 288, 203, 3639, 5402, 11987, 424, 20603, 18, 7163, 13152, 4109, 653, 5621, 203, 203, 3639, 5402, 11987, 424, 20603, 1179, 18, 2738, 1988, 24629, 1012, 12, 12890, 11987, 424, 20603, 1769, 203, 3639, 444, 15749, 1876, 3116, 5365, 5103, 1290, 1908, 424, 20603, 8073, 1444, 3367, 1876, 26509, 15372, 5268, 12, 12890, 11987, 424, 20603, 1769, 203, 203, 3639, 5402, 11987, 424, 20603, 1179, 18, 3612, 2171, 1988, 24629, 1012, 774, 424, 20603, 1876, 4755, 12, 12890, 11987, 424, 20603, 1769, 203, 3639, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 5688, 12, 12890, 11987, 424, 20603, 1769, 203, 203, 3639, 368, 1021, 6710, 434, 326, 30045, 1297, 3334, 1839, 326, 2172, 1817, 16, 2724, 326, 30891, 367, 353, 203, 3639, 368, 486, 4671, 5198, 316, 326, 2063, 16, 1427, 732, 2780, 1923, 326, 8515, 15905, 261, 5946, 13586, 11987, 17865, 1179, 18, 12336, 7621, 13, 203, 3639, 791, 1079, 3826, 1179, 18, 4661, 9459, 11987, 424, 20603, 6061, 12, 12890, 11987, 424, 20603, 18, 26321, 10663, 203, 3639, 791, 1079, 3826, 1179, 18, 4661, 424, 20603, 7391, 4386, 6061, 12, 12890, 11987, 424, 20603, 18, 26321, 10663, 203, 203, 3639, 327, 5402, 11987, 424, 20603, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 10939, 87, 326, 819, 434, 279, 394, 5402, 11987, 24165, 18, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 326, 24165, 1492, 1410, 506, 4041, 316, 326, 2063, 203, 377, 380, 632, 2463, 1135, 326, 4358, 471, 4041, 5402, 11987, 24165, 203, 377, 380, 1220, 14176, 353, 1338, 364, 7769, 13694, 261, 2135, 1444, 3367, 1876, 26509, 15372, 5268, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
a49f1138b91c27defb1a31490c76c5954db9950a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/ProgrammingExercise.java
[ "MIT" ]
Java
findAppropriateSubmissionByResults
Submission
@Nullable @Override public Submission findAppropriateSubmissionByResults(Set<Submission> submissions) { return submissions.stream().filter(submission -> { Result result = submission.getLatestResult(); if (result != null) { return checkForRatedAndAssessedResult(result); } return this.getDueDate() == null || submission.getType().equals(SubmissionType.INSTRUCTOR) || submission.getType().equals(SubmissionType.TEST) || submission.getSubmissionDate().isBefore(this.getDueDate()); }).max(Comparator.comparing(Submission::getSubmissionDate)).orElse(null); }
/** * Get the latest (potentially) graded submission for a programming exercise. * Programming submissions work differently in this regard as a submission without a result does not mean it is not rated/assessed, but that e.g. the CI system failed to deliver the build results. * * @param submissions Submissions for the given student. * @return the latest graded submission. */
Get the latest (potentially) graded submission for a programming exercise. Programming submissions work differently in this regard as a submission without a result does not mean it is not rated/assessed, but that e.g. the CI system failed to deliver the build results. @param submissions Submissions for the given student. @return the latest graded submission.
[ "Get", "the", "latest", "(", "potentially", ")", "graded", "submission", "for", "a", "programming", "exercise", ".", "Programming", "submissions", "work", "differently", "in", "this", "regard", "as", "a", "submission", "without", "a", "result", "does", "not", "mean", "it", "is", "not", "rated", "/", "assessed", "but", "that", "e", ".", "g", ".", "the", "CI", "system", "failed", "to", "deliver", "the", "build", "results", ".", "@param", "submissions", "Submissions", "for", "the", "given", "student", ".", "@return", "the", "latest", "graded", "submission", "." ]
@Nullable @Override public Submission findAppropriateSubmissionByResults(Set<Submission> submissions) { return submissions.stream().filter(submission -> { Result result = submission.getLatestResult(); if (result != null) { return checkForRatedAndAssessedResult(result); } return this.getDueDate() == null || submission.getType().equals(SubmissionType.INSTRUCTOR) || submission.getType().equals(SubmissionType.TEST) || submission.getSubmissionDate().isBefore(this.getDueDate()); }).max(Comparator.comparing(Submission::getSubmissionDate)).orElse(null); }
[ "@", "Nullable", "@", "Override", "public", "Submission", "findAppropriateSubmissionByResults", "(", "Set", "<", "Submission", ">", "submissions", ")", "{", "return", "submissions", ".", "stream", "(", ")", ".", "filter", "(", "submission", "->", "{", "Result", "result", "=", "submission", ".", "getLatestResult", "(", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "checkForRatedAndAssessedResult", "(", "result", ")", ";", "}", "return", "this", ".", "getDueDate", "(", ")", "==", "null", "||", "submission", ".", "getType", "(", ")", ".", "equals", "(", "SubmissionType", ".", "INSTRUCTOR", ")", "||", "submission", ".", "getType", "(", ")", ".", "equals", "(", "SubmissionType", ".", "TEST", ")", "||", "submission", ".", "getSubmissionDate", "(", ")", ".", "isBefore", "(", "this", ".", "getDueDate", "(", ")", ")", ";", "}", ")", ".", "max", "(", "Comparator", ".", "comparing", "(", "Submission", "::", "getSubmissionDate", ")", ")", ".", "orElse", "(", "null", ")", ";", "}" ]
Get the latest (potentially) graded submission for a programming exercise.
[ "Get", "the", "latest", "(", "potentially", ")", "graded", "submission", "for", "a", "programming", "exercise", "." ]
[]
[ { "param": "submissions", "type": "Set<Submission>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "submissions", "type": "Set<Submission>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 13349, 203, 565, 632, 6618, 203, 565, 1071, 2592, 3951, 1104, 1294, 5986, 566, 340, 17865, 858, 3447, 12, 694, 32, 17865, 34, 22071, 13, 288, 203, 3639, 327, 22071, 18, 3256, 7675, 2188, 12, 12684, 317, 288, 203, 5411, 3438, 563, 273, 8515, 18, 588, 18650, 1253, 5621, 203, 5411, 309, 261, 2088, 480, 446, 13, 288, 203, 7734, 327, 13855, 54, 690, 1876, 2610, 281, 730, 1253, 12, 2088, 1769, 203, 5411, 289, 203, 5411, 327, 333, 18, 588, 30023, 1626, 1435, 422, 446, 747, 8515, 18, 588, 559, 7675, 14963, 12, 17865, 559, 18, 706, 13915, 916, 13, 747, 8515, 18, 588, 559, 7675, 14963, 12, 17865, 559, 18, 16961, 13, 203, 10792, 747, 8515, 18, 588, 17865, 1626, 7675, 291, 4649, 12, 2211, 18, 588, 30023, 1626, 10663, 203, 3639, 289, 2934, 1896, 12, 5559, 18, 832, 12583, 12, 17865, 2866, 588, 17865, 1626, 13, 2934, 280, 12427, 12, 2011, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 968, 326, 4891, 261, 13130, 11220, 13, 3087, 785, 8515, 364, 279, 5402, 11987, 24165, 18, 203, 377, 380, 13586, 11987, 22071, 1440, 23621, 316, 333, 12283, 487, 279, 8515, 2887, 279, 563, 1552, 486, 3722, 518, 353, 486, 436, 690, 19, 428, 281, 730, 16, 1496, 716, 425, 18, 75, 18, 326, 17166, 2619, 2535, 358, 11795, 326, 1361, 1686, 18, 203, 377, 380, 203, 377, 380, 632, 891, 22071, 2592, 7300, 364, 326, 864, 18110, 18, 203, 377, 380, 632, 2463, 326, 4891, 3087, 785, 8515, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
a49f1138b91c27defb1a31490c76c5954db9950a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/ProgrammingExercise.java
[ "MIT" ]
Java
areManualResultsAllowed
null
public boolean areManualResultsAllowed() { // Only allow manual results for programming exercises if option was enabled and due dates have passed; final var relevantDueDate = getBuildAndTestStudentSubmissionsAfterDueDate() != null ? getBuildAndTestStudentSubmissionsAfterDueDate() : getDueDate(); return (getAssessmentType() == AssessmentType.SEMI_AUTOMATIC || getAllowComplaintsForAutomaticAssessments()) && (relevantDueDate == null || relevantDueDate.isBefore(ZonedDateTime.now())); }
/** * Check if manual results are allowed for the exercise * @return true if manual results are allowed, false otherwise */
Check if manual results are allowed for the exercise @return true if manual results are allowed, false otherwise
[ "Check", "if", "manual", "results", "are", "allowed", "for", "the", "exercise", "@return", "true", "if", "manual", "results", "are", "allowed", "false", "otherwise" ]
public boolean areManualResultsAllowed() { final var relevantDueDate = getBuildAndTestStudentSubmissionsAfterDueDate() != null ? getBuildAndTestStudentSubmissionsAfterDueDate() : getDueDate(); return (getAssessmentType() == AssessmentType.SEMI_AUTOMATIC || getAllowComplaintsForAutomaticAssessments()) && (relevantDueDate == null || relevantDueDate.isBefore(ZonedDateTime.now())); }
[ "public", "boolean", "areManualResultsAllowed", "(", ")", "{", "final", "var", "relevantDueDate", "=", "getBuildAndTestStudentSubmissionsAfterDueDate", "(", ")", "!=", "null", "?", "getBuildAndTestStudentSubmissionsAfterDueDate", "(", ")", ":", "getDueDate", "(", ")", ";", "return", "(", "getAssessmentType", "(", ")", "==", "AssessmentType", ".", "SEMI_AUTOMATIC", "||", "getAllowComplaintsForAutomaticAssessments", "(", ")", ")", "&&", "(", "relevantDueDate", "==", "null", "||", "relevantDueDate", ".", "isBefore", "(", "ZonedDateTime", ".", "now", "(", ")", ")", ")", ";", "}" ]
Check if manual results are allowed for the exercise @return true if manual results are allowed, false otherwise
[ "Check", "if", "manual", "results", "are", "allowed", "for", "the", "exercise", "@return", "true", "if", "manual", "results", "are", "allowed", "false", "otherwise" ]
[ "// Only allow manual results for programming exercises if option was enabled and due dates have passed;" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 1250, 854, 25139, 3447, 5042, 1435, 288, 203, 3639, 368, 5098, 1699, 11297, 1686, 364, 5402, 11987, 431, 12610, 6141, 309, 1456, 1703, 3696, 471, 6541, 7811, 1240, 2275, 31, 203, 3639, 727, 569, 9368, 30023, 1626, 273, 21122, 1876, 4709, 19943, 319, 1676, 7300, 4436, 30023, 1626, 1435, 480, 446, 692, 21122, 1876, 4709, 19943, 319, 1676, 7300, 4436, 30023, 1626, 1435, 294, 2343, 344, 1626, 5621, 203, 3639, 327, 261, 588, 15209, 559, 1435, 422, 25241, 559, 18, 1090, 7492, 67, 37, 1693, 1872, 11781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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2073, 309, 11297, 1686, 854, 2935, 364, 326, 24165, 203, 377, 380, 632, 2463, 638, 309, 11297, 1686, 854, 2935, 16, 629, 3541, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
a49f1138b91c27defb1a31490c76c5954db9950a
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/ProgrammingExercise.java
[ "MIT" ]
Java
checksAndSetsIfProgrammingExerciseIsLocalSimulation
null
public void checksAndSetsIfProgrammingExerciseIsLocalSimulation() { if (getTestRepositoryUrl().contains("artemislocalhost")) { setIsLocalSimulation(true); } }
/** * Sets the transient attribute "isLocalSimulation" if the exercises is a programming exercise * and the testRepositoryUrl contains the String "artemislocalhost" which is the indicator that the programming exercise has * no connection to a version control and continuous integration server * */
Sets the transient attribute "isLocalSimulation" if the exercises is a programming exercise and the testRepositoryUrl contains the String "artemislocalhost" which is the indicator that the programming exercise has no connection to a version control and continuous integration server
[ "Sets", "the", "transient", "attribute", "\"", "isLocalSimulation", "\"", "if", "the", "exercises", "is", "a", "programming", "exercise", "and", "the", "testRepositoryUrl", "contains", "the", "String", "\"", "artemislocalhost", "\"", "which", "is", "the", "indicator", "that", "the", "programming", "exercise", "has", "no", "connection", "to", "a", "version", "control", "and", "continuous", "integration", "server" ]
public void checksAndSetsIfProgrammingExerciseIsLocalSimulation() { if (getTestRepositoryUrl().contains("artemislocalhost")) { setIsLocalSimulation(true); } }
[ "public", "void", "checksAndSetsIfProgrammingExerciseIsLocalSimulation", "(", ")", "{", "if", "(", "getTestRepositoryUrl", "(", ")", ".", "contains", "(", "\"artemislocalhost\"", ")", ")", "{", "setIsLocalSimulation", "(", "true", ")", ";", "}", "}" ]
Sets the transient attribute "isLocalSimulation" if the exercises is a programming exercise and the testRepositoryUrl contains the String "artemislocalhost" which is the indicator that the programming exercise has no connection to a version control and continuous integration server
[ "Sets", "the", "transient", "attribute", "\"", "isLocalSimulation", "\"", "if", "the", "exercises", "is", "a", "programming", "exercise", "and", "the", "testRepositoryUrl", "contains", "the", "String", "\"", "artemislocalhost", "\"", "which", "is", "the", "indicator", "that", "the", "programming", "exercise", "has", "no", "connection", "to", "a", "version", "control", "and", "continuous", "integration", "server" ]
[]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 918, 4271, 1876, 2785, 2047, 9459, 11987, 424, 20603, 2520, 2042, 18419, 1435, 288, 203, 3639, 309, 261, 588, 4709, 3305, 1489, 7675, 12298, 2932, 485, 351, 291, 13014, 6, 3719, 288, 203, 5411, 15269, 2042, 18419, 12, 3767, 1769, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 11511, 326, 12315, 1566, 315, 291, 2042, 18419, 6, 309, 326, 431, 12610, 6141, 353, 279, 5402, 11987, 24165, 203, 377, 380, 471, 326, 1842, 3305, 1489, 1914, 326, 514, 315, 485, 351, 291, 13014, 6, 1492, 353, 326, 10664, 716, 326, 5402, 11987, 24165, 711, 203, 377, 380, 1158, 1459, 358, 279, 1177, 3325, 471, 17235, 12040, 1438, 203, 377, 380, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
processNewProgrammingExerciseResult
null
public Optional<Result> processNewProgrammingExerciseResult(@NotNull ProgrammingExerciseParticipation participation, @NotNull Object requestBody) { log.debug("Received new build result (NEW) for participation {}", participation.getId()); Result newResult; try { newResult = continuousIntegrationService.get().onBuildCompleted(participation, requestBody); // NOTE: the result is not saved yet, but is connected to the submission, the submission is not completely saved yet } catch (ContinuousIntegrationException ex) { log.error("Result for participation " + participation.getId() + " could not be created", ex); return Optional.empty(); } if (newResult != null) { ProgrammingExercise programmingExercise = participation.getProgrammingExercise(); boolean isSolutionParticipation = participation instanceof SolutionProgrammingExerciseParticipation; boolean isTemplateParticipation = participation instanceof TemplateProgrammingExerciseParticipation; // Find out which test cases were executed and calculate the score according to their status and weight. // This needs to be done as some test cases might not have been executed. // When the result is from a solution participation, extract the feedback items (= test cases) and store them in our database. if (isSolutionParticipation) { extractTestCasesFromResult(programmingExercise, newResult); } newResult = calculateScoreForResult(newResult, programmingExercise, !isSolutionParticipation && !isTemplateParticipation); // Note: This programming submission might already have multiple results, however they do not contain the assessor or the feedback var programmingSubmission = (ProgrammingSubmission) newResult.getSubmission(); // If the solution participation was updated, also trigger the template participation build. if (isSolutionParticipation) { // This method will return without triggering the build if the submission is not of type TEST. triggerTemplateBuildIfTestCasesChanged(programmingExercise.getId(), programmingSubmission); } if (!isSolutionParticipation && !isTemplateParticipation && programmingSubmission.getLatestResult() != null && programmingSubmission.getLatestResult().isManual()) { // Note: in this case, we do not want to save the newResult, but we only want to update the latest semi-automatic one Result updatedLatestSemiAutomaticResult = updateLatestSemiAutomaticResultWithNewAutomaticFeedback(programmingSubmission.getLatestResult().getId(), newResult, programmingExercise); // Adding back dropped submission updatedLatestSemiAutomaticResult.setSubmission(programmingSubmission); programmingSubmissionRepository.save(programmingSubmission); resultRepository.save(updatedLatestSemiAutomaticResult); return Optional.of(updatedLatestSemiAutomaticResult); } // Finally save the new result once and make sure the order column between submission and result is maintained newResult.setSubmission(null); // workaround to avoid org.hibernate.HibernateException: null index column for collection: // de.tum.in.www1.artemis.domain.Submission.results newResult = resultRepository.save(newResult); newResult.setSubmission(programmingSubmission); programmingSubmission.addResult(newResult); programmingSubmissionRepository.save(programmingSubmission); } return Optional.ofNullable(newResult); }
/** * Use the given requestBody to extract the relevant information from it. Fetch and attach the result's feedback items to it. For programming exercises the test cases are * extracted from the feedbacks & the result is updated with the information from the test cases. * * @param participation the participation for which the build was finished * @param requestBody RequestBody containing the build result and its feedback items * @return result after compilation */
Use the given requestBody to extract the relevant information from it. Fetch and attach the result's feedback items to it. For programming exercises the test cases are extracted from the feedbacks & the result is updated with the information from the test cases. @param participation the participation for which the build was finished @param requestBody RequestBody containing the build result and its feedback items @return result after compilation
[ "Use", "the", "given", "requestBody", "to", "extract", "the", "relevant", "information", "from", "it", ".", "Fetch", "and", "attach", "the", "result", "'", "s", "feedback", "items", "to", "it", ".", "For", "programming", "exercises", "the", "test", "cases", "are", "extracted", "from", "the", "feedbacks", "&", "the", "result", "is", "updated", "with", "the", "information", "from", "the", "test", "cases", ".", "@param", "participation", "the", "participation", "for", "which", "the", "build", "was", "finished", "@param", "requestBody", "RequestBody", "containing", "the", "build", "result", "and", "its", "feedback", "items", "@return", "result", "after", "compilation" ]
public Optional<Result> processNewProgrammingExerciseResult(@NotNull ProgrammingExerciseParticipation participation, @NotNull Object requestBody) { log.debug("Received new build result (NEW) for participation {}", participation.getId()); Result newResult; try { newResult = continuousIntegrationService.get().onBuildCompleted(participation, requestBody); } catch (ContinuousIntegrationException ex) { log.error("Result for participation " + participation.getId() + " could not be created", ex); return Optional.empty(); } if (newResult != null) { ProgrammingExercise programmingExercise = participation.getProgrammingExercise(); boolean isSolutionParticipation = participation instanceof SolutionProgrammingExerciseParticipation; boolean isTemplateParticipation = participation instanceof TemplateProgrammingExerciseParticipation; if (isSolutionParticipation) { extractTestCasesFromResult(programmingExercise, newResult); } newResult = calculateScoreForResult(newResult, programmingExercise, !isSolutionParticipation && !isTemplateParticipation); var programmingSubmission = (ProgrammingSubmission) newResult.getSubmission(); if (isSolutionParticipation) { triggerTemplateBuildIfTestCasesChanged(programmingExercise.getId(), programmingSubmission); } if (!isSolutionParticipation && !isTemplateParticipation && programmingSubmission.getLatestResult() != null && programmingSubmission.getLatestResult().isManual()) { Result updatedLatestSemiAutomaticResult = updateLatestSemiAutomaticResultWithNewAutomaticFeedback(programmingSubmission.getLatestResult().getId(), newResult, programmingExercise); updatedLatestSemiAutomaticResult.setSubmission(programmingSubmission); programmingSubmissionRepository.save(programmingSubmission); resultRepository.save(updatedLatestSemiAutomaticResult); return Optional.of(updatedLatestSemiAutomaticResult); } newResult.setSubmission(null); newResult = resultRepository.save(newResult); newResult.setSubmission(programmingSubmission); programmingSubmission.addResult(newResult); programmingSubmissionRepository.save(programmingSubmission); } return Optional.ofNullable(newResult); }
[ "public", "Optional", "<", "Result", ">", "processNewProgrammingExerciseResult", "(", "@", "NotNull", "ProgrammingExerciseParticipation", "participation", ",", "@", "NotNull", "Object", "requestBody", ")", "{", "log", ".", "debug", "(", "\"Received new build result (NEW) for participation {}\"", ",", "participation", ".", "getId", "(", ")", ")", ";", "Result", "newResult", ";", "try", "{", "newResult", "=", "continuousIntegrationService", ".", "get", "(", ")", ".", "onBuildCompleted", "(", "participation", ",", "requestBody", ")", ";", "}", "catch", "(", "ContinuousIntegrationException", "ex", ")", "{", "log", ".", "error", "(", "\"Result for participation \"", "+", "participation", ".", "getId", "(", ")", "+", "\" could not be created\"", ",", "ex", ")", ";", "return", "Optional", ".", "empty", "(", ")", ";", "}", "if", "(", "newResult", "!=", "null", ")", "{", "ProgrammingExercise", "programmingExercise", "=", "participation", ".", "getProgrammingExercise", "(", ")", ";", "boolean", "isSolutionParticipation", "=", "participation", "instanceof", "SolutionProgrammingExerciseParticipation", ";", "boolean", "isTemplateParticipation", "=", "participation", "instanceof", "TemplateProgrammingExerciseParticipation", ";", "if", "(", "isSolutionParticipation", ")", "{", "extractTestCasesFromResult", "(", "programmingExercise", ",", "newResult", ")", ";", "}", "newResult", "=", "calculateScoreForResult", "(", "newResult", ",", "programmingExercise", ",", "!", "isSolutionParticipation", "&&", "!", "isTemplateParticipation", ")", ";", "var", "programmingSubmission", "=", "(", "ProgrammingSubmission", ")", "newResult", ".", "getSubmission", "(", ")", ";", "if", "(", "isSolutionParticipation", ")", "{", "triggerTemplateBuildIfTestCasesChanged", "(", "programmingExercise", ".", "getId", "(", ")", ",", "programmingSubmission", ")", ";", "}", "if", "(", "!", "isSolutionParticipation", "&&", "!", "isTemplateParticipation", "&&", "programmingSubmission", ".", "getLatestResult", "(", ")", "!=", "null", "&&", "programmingSubmission", ".", "getLatestResult", "(", ")", ".", "isManual", "(", ")", ")", "{", "Result", "updatedLatestSemiAutomaticResult", "=", "updateLatestSemiAutomaticResultWithNewAutomaticFeedback", "(", "programmingSubmission", ".", "getLatestResult", "(", ")", ".", "getId", "(", ")", ",", "newResult", ",", "programmingExercise", ")", ";", "updatedLatestSemiAutomaticResult", ".", "setSubmission", "(", "programmingSubmission", ")", ";", "programmingSubmissionRepository", ".", "save", "(", "programmingSubmission", ")", ";", "resultRepository", ".", "save", "(", "updatedLatestSemiAutomaticResult", ")", ";", "return", "Optional", ".", "of", "(", "updatedLatestSemiAutomaticResult", ")", ";", "}", "newResult", ".", "setSubmission", "(", "null", ")", ";", "newResult", "=", "resultRepository", ".", "save", "(", "newResult", ")", ";", "newResult", ".", "setSubmission", "(", "programmingSubmission", ")", ";", "programmingSubmission", ".", "addResult", "(", "newResult", ")", ";", "programmingSubmissionRepository", ".", "save", "(", "programmingSubmission", ")", ";", "}", "return", "Optional", ".", "ofNullable", "(", "newResult", ")", ";", "}" ]
Use the given requestBody to extract the relevant information from it.
[ "Use", "the", "given", "requestBody", "to", "extract", "the", "relevant", "information", "from", "it", "." ]
[ "// NOTE: the result is not saved yet, but is connected to the submission, the submission is not completely saved yet", "// Find out which test cases were executed and calculate the score according to their status and weight.", "// This needs to be done as some test cases might not have been executed.", "// When the result is from a solution participation, extract the feedback items (= test cases) and store them in our database.", "// Note: This programming submission might already have multiple results, however they do not contain the assessor or the feedback", "// If the solution participation was updated, also trigger the template participation build.", "// This method will return without triggering the build if the submission is not of type TEST.", "// Note: in this case, we do not want to save the newResult, but we only want to update the latest semi-automatic one", "// Adding back dropped submission", "// Finally save the new result once and make sure the order column between submission and result is maintained", "// workaround to avoid org.hibernate.HibernateException: null index column for collection:", "// de.tum.in.www1.artemis.domain.Submission.results" ]
[ { "param": "participation", "type": "ProgrammingExerciseParticipation" }, { "param": "requestBody", "type": "Object" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "participation", "type": "ProgrammingExerciseParticipation", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "requestBody", "type": "Object", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 4055, 32, 1253, 34, 1207, 1908, 9459, 11987, 424, 20603, 1253, 26964, 5962, 13586, 11987, 424, 20603, 1988, 24629, 367, 30891, 367, 16, 632, 5962, 1033, 20740, 13, 288, 203, 3639, 613, 18, 4148, 2932, 8872, 394, 1361, 563, 261, 12917, 13, 364, 30891, 367, 3728, 16, 30891, 367, 18, 26321, 10663, 203, 203, 3639, 3438, 394, 1253, 31, 203, 3639, 775, 288, 203, 5411, 394, 1253, 273, 17235, 15372, 1179, 18, 588, 7675, 265, 3116, 9556, 12, 2680, 24629, 367, 16, 20740, 1769, 203, 5411, 368, 5219, 30, 326, 563, 353, 486, 5198, 4671, 16, 1496, 353, 5840, 358, 326, 8515, 16, 326, 8515, 353, 486, 14416, 5198, 4671, 203, 3639, 289, 203, 3639, 1044, 261, 26509, 15372, 503, 431, 13, 288, 203, 5411, 613, 18, 1636, 2932, 1253, 364, 30891, 367, 315, 397, 30891, 367, 18, 26321, 1435, 397, 315, 3377, 486, 506, 2522, 3113, 431, 1769, 203, 5411, 327, 4055, 18, 5531, 5621, 203, 3639, 289, 203, 203, 3639, 309, 261, 2704, 1253, 480, 446, 13, 288, 203, 5411, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 273, 30891, 367, 18, 588, 9459, 11987, 424, 20603, 5621, 203, 5411, 1250, 11604, 5889, 1988, 24629, 367, 273, 30891, 367, 1276, 29172, 9459, 11987, 424, 20603, 1988, 24629, 367, 31, 203, 5411, 1250, 353, 2283, 1988, 24629, 367, 273, 30891, 367, 1276, 5035, 9459, 11987, 424, 20603, 1988, 24629, 367, 31, 203, 5411, 368, 4163, 596, 1492, 1842, 6088, 4591, 7120, 471, 4604, 326, 4462, 4888, 358, 3675, 1267, 471, 3119, 18, 203, 5411, 368, 1220, 4260, 358, 506, 2731, 487, 2690, 1842, 6088, 4825, 486, 1240, 2118, 7120, 18, 203, 5411, 368, 5203, 326, 563, 353, 628, 279, 6959, 30891, 367, 16, 2608, 326, 10762, 1516, 261, 33, 1842, 6088, 13, 471, 1707, 2182, 316, 3134, 2063, 18, 203, 5411, 309, 261, 291, 16135, 1988, 24629, 367, 13, 288, 203, 7734, 2608, 4709, 30744, 1265, 1253, 12, 12890, 11987, 424, 20603, 16, 394, 1253, 1769, 203, 5411, 289, 203, 5411, 394, 1253, 273, 4604, 7295, 1290, 1253, 12, 2704, 1253, 16, 5402, 11987, 424, 20603, 16, 401, 291, 16135, 1988, 24629, 367, 597, 401, 291, 2283, 1988, 24629, 367, 1769, 203, 203, 5411, 368, 3609, 30, 1220, 5402, 11987, 8515, 4825, 1818, 1240, 3229, 1686, 16, 14025, 2898, 741, 486, 912, 326, 1551, 403, 280, 578, 326, 10762, 203, 5411, 569, 5402, 11987, 17865, 273, 261, 9459, 11987, 17865, 13, 394, 1253, 18, 588, 17865, 5621, 203, 203, 5411, 368, 971, 326, 6959, 30891, 367, 1703, 3526, 16, 2546, 3080, 326, 1542, 30891, 367, 1361, 18, 203, 5411, 309, 261, 291, 16135, 1988, 24629, 367, 13, 288, 203, 7734, 368, 1220, 707, 903, 327, 2887, 27411, 326, 1361, 309, 326, 8515, 353, 486, 434, 618, 22130, 18, 203, 7734, 3080, 2283, 3116, 2047, 4709, 30744, 5033, 12, 12890, 11987, 424, 20603, 18, 26321, 9334, 5402, 11987, 17865, 1769, 203, 5411, 289, 203, 203, 5411, 309, 16051, 291, 16135, 1988, 24629, 367, 597, 401, 291, 2283, 1988, 24629, 367, 597, 5402, 11987, 17865, 18, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 2672, 326, 864, 20740, 358, 2608, 326, 9368, 1779, 628, 518, 18, 8065, 471, 3306, 326, 563, 1807, 10762, 1516, 358, 518, 18, 2457, 5402, 11987, 431, 12610, 6141, 326, 1842, 6088, 854, 203, 377, 380, 9438, 628, 326, 10762, 87, 473, 326, 563, 353, 3526, 598, 326, 1779, 628, 326, 1842, 6088, 18, 203, 377, 380, 203, 377, 380, 632, 891, 30891, 367, 326, 30891, 367, 364, 1492, 326, 1361, 1703, 6708, 203, 377, 380, 632, 891, 20740, 282, 1567, 2250, 4191, 326, 1361, 563, 471, 2097, 10762, 1516, 203, 377, 380, 632, 2463, 563, 1839, 8916, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
updateLatestSemiAutomaticResultWithNewAutomaticFeedback
Result
private Result updateLatestSemiAutomaticResultWithNewAutomaticFeedback(long lastSemiAutomaticResultId, Result newAutomaticResult, ProgrammingExercise programmingExercise) { // Note: refetch the semi automatic result with feedback and assessor var latestSemiAutomaticResult = resultRepository.findByIdWithEagerFeedbacksAndAssessor(lastSemiAutomaticResultId).get(); // this makes it the most recent result, but optionally keeps the draft state of an unfinished manual result latestSemiAutomaticResult.setCompletionDate(latestSemiAutomaticResult.getCompletionDate() != null ? newAutomaticResult.getCompletionDate() : null); // remove old automatic feedback latestSemiAutomaticResult.getFeedbacks().removeIf(feedback -> feedback != null && feedback.getType() == FeedbackType.AUTOMATIC); // copy all feedback from the automatic result List<Feedback> copiedFeedbacks = newAutomaticResult.getFeedbacks().stream().map(Feedback::copyFeedback).collect(Collectors.toList()); latestSemiAutomaticResult = resultService.addFeedbackToResult(latestSemiAutomaticResult, copiedFeedbacks, false); String resultString = updateManualResultString(newAutomaticResult.getResultString(), latestSemiAutomaticResult, programmingExercise); latestSemiAutomaticResult.setResultString(resultString); return resultRepository.save(latestSemiAutomaticResult); }
/** * Updates an existing semi-automatic result with automatic feedback from another result. * * Note: for the second correction it is important that we do not create additional semi automatic results * * @param lastSemiAutomaticResultId The latest manual result for the same submission (which must exist in the database) * @param newAutomaticResult The new automatic result * @param programmingExercise The programming exercise * @return The updated semi-automatic result */
Updates an existing semi-automatic result with automatic feedback from another result. Note: for the second correction it is important that we do not create additional semi automatic results @param lastSemiAutomaticResultId The latest manual result for the same submission (which must exist in the database) @param newAutomaticResult The new automatic result @param programmingExercise The programming exercise @return The updated semi-automatic result
[ "Updates", "an", "existing", "semi", "-", "automatic", "result", "with", "automatic", "feedback", "from", "another", "result", ".", "Note", ":", "for", "the", "second", "correction", "it", "is", "important", "that", "we", "do", "not", "create", "additional", "semi", "automatic", "results", "@param", "lastSemiAutomaticResultId", "The", "latest", "manual", "result", "for", "the", "same", "submission", "(", "which", "must", "exist", "in", "the", "database", ")", "@param", "newAutomaticResult", "The", "new", "automatic", "result", "@param", "programmingExercise", "The", "programming", "exercise", "@return", "The", "updated", "semi", "-", "automatic", "result" ]
private Result updateLatestSemiAutomaticResultWithNewAutomaticFeedback(long lastSemiAutomaticResultId, Result newAutomaticResult, ProgrammingExercise programmingExercise) { var latestSemiAutomaticResult = resultRepository.findByIdWithEagerFeedbacksAndAssessor(lastSemiAutomaticResultId).get(); latestSemiAutomaticResult.setCompletionDate(latestSemiAutomaticResult.getCompletionDate() != null ? newAutomaticResult.getCompletionDate() : null); latestSemiAutomaticResult.getFeedbacks().removeIf(feedback -> feedback != null && feedback.getType() == FeedbackType.AUTOMATIC); List<Feedback> copiedFeedbacks = newAutomaticResult.getFeedbacks().stream().map(Feedback::copyFeedback).collect(Collectors.toList()); latestSemiAutomaticResult = resultService.addFeedbackToResult(latestSemiAutomaticResult, copiedFeedbacks, false); String resultString = updateManualResultString(newAutomaticResult.getResultString(), latestSemiAutomaticResult, programmingExercise); latestSemiAutomaticResult.setResultString(resultString); return resultRepository.save(latestSemiAutomaticResult); }
[ "private", "Result", "updateLatestSemiAutomaticResultWithNewAutomaticFeedback", "(", "long", "lastSemiAutomaticResultId", ",", "Result", "newAutomaticResult", ",", "ProgrammingExercise", "programmingExercise", ")", "{", "var", "latestSemiAutomaticResult", "=", "resultRepository", ".", "findByIdWithEagerFeedbacksAndAssessor", "(", "lastSemiAutomaticResultId", ")", ".", "get", "(", ")", ";", "latestSemiAutomaticResult", ".", "setCompletionDate", "(", "latestSemiAutomaticResult", ".", "getCompletionDate", "(", ")", "!=", "null", "?", "newAutomaticResult", ".", "getCompletionDate", "(", ")", ":", "null", ")", ";", "latestSemiAutomaticResult", ".", "getFeedbacks", "(", ")", ".", "removeIf", "(", "feedback", "->", "feedback", "!=", "null", "&&", "feedback", ".", "getType", "(", ")", "==", "FeedbackType", ".", "AUTOMATIC", ")", ";", "List", "<", "Feedback", ">", "copiedFeedbacks", "=", "newAutomaticResult", ".", "getFeedbacks", "(", ")", ".", "stream", "(", ")", ".", "map", "(", "Feedback", "::", "copyFeedback", ")", ".", "collect", "(", "Collectors", ".", "toList", "(", ")", ")", ";", "latestSemiAutomaticResult", "=", "resultService", ".", "addFeedbackToResult", "(", "latestSemiAutomaticResult", ",", "copiedFeedbacks", ",", "false", ")", ";", "String", "resultString", "=", "updateManualResultString", "(", "newAutomaticResult", ".", "getResultString", "(", ")", ",", "latestSemiAutomaticResult", ",", "programmingExercise", ")", ";", "latestSemiAutomaticResult", ".", "setResultString", "(", "resultString", ")", ";", "return", "resultRepository", ".", "save", "(", "latestSemiAutomaticResult", ")", ";", "}" ]
Updates an existing semi-automatic result with automatic feedback from another result.
[ "Updates", "an", "existing", "semi", "-", "automatic", "result", "with", "automatic", "feedback", "from", "another", "result", "." ]
[ "// Note: refetch the semi automatic result with feedback and assessor", "// this makes it the most recent result, but optionally keeps the draft state of an unfinished manual result", "// remove old automatic feedback", "// copy all feedback from the automatic result" ]
[ { "param": "lastSemiAutomaticResultId", "type": "long" }, { "param": "newAutomaticResult", "type": "Result" }, { "param": "programmingExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "lastSemiAutomaticResultId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "newAutomaticResult", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 3438, 1089, 18650, 13185, 77, 7150, 4941, 1253, 1190, 1908, 7150, 4941, 15888, 12, 5748, 1142, 13185, 77, 7150, 4941, 1253, 548, 16, 3438, 394, 7150, 4941, 1253, 16, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 13, 288, 203, 3639, 368, 3609, 30, 1278, 1593, 326, 23161, 5859, 563, 598, 10762, 471, 1551, 403, 280, 203, 3639, 569, 4891, 13185, 77, 7150, 4941, 1253, 273, 563, 3305, 18, 4720, 5132, 1190, 41, 6817, 15888, 87, 1876, 2610, 403, 280, 12, 2722, 13185, 77, 7150, 4941, 1253, 548, 2934, 588, 5621, 203, 3639, 368, 333, 7297, 518, 326, 4486, 8399, 563, 16, 1496, 8771, 20948, 326, 12246, 919, 434, 392, 640, 13527, 11297, 563, 203, 3639, 4891, 13185, 77, 7150, 4941, 1253, 18, 542, 11238, 1626, 12, 13550, 13185, 77, 7150, 4941, 1253, 18, 588, 11238, 1626, 1435, 480, 446, 692, 394, 7150, 4941, 1253, 18, 588, 11238, 1626, 1435, 294, 446, 1769, 203, 203, 3639, 368, 1206, 1592, 5859, 10762, 203, 3639, 4891, 13185, 77, 7150, 4941, 1253, 18, 588, 15888, 87, 7675, 4479, 2047, 12, 12571, 317, 10762, 480, 446, 597, 10762, 18, 588, 559, 1435, 422, 14013, 823, 559, 18, 37, 1693, 1872, 11781, 1769, 203, 203, 3639, 368, 1610, 777, 10762, 628, 326, 5859, 563, 203, 3639, 987, 32, 15888, 34, 9268, 15888, 87, 273, 394, 7150, 4941, 1253, 18, 588, 15888, 87, 7675, 3256, 7675, 1458, 12, 15888, 2866, 3530, 15888, 2934, 14676, 12, 10808, 1383, 18, 869, 682, 10663, 203, 3639, 4891, 13185, 77, 7150, 4941, 1253, 273, 563, 1179, 18, 1289, 15888, 774, 1253, 12, 13550, 13185, 77, 7150, 4941, 1253, 16, 9268, 15888, 87, 16, 629, 1769, 203, 203, 3639, 514, 563, 780, 273, 1089, 25139, 1253, 780, 12, 2704, 7150, 4941, 1253, 18, 588, 1253, 780, 9334, 4891, 13185, 77, 7150, 4941, 1253, 16, 5402, 11987, 424, 20603, 1769, 203, 3639, 4891, 13185, 77, 7150, 4941, 1253, 18, 542, 1253, 780, 12, 2088, 780, 1769, 203, 203, 3639, 327, 563, 3305, 18, 5688, 12, 13550, 13185, 77, 7150, 4941, 1253, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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802, 716, 732, 741, 486, 752, 3312, 23161, 5859, 1686, 203, 377, 380, 203, 377, 380, 632, 891, 1142, 13185, 77, 7150, 4941, 1253, 548, 1021, 4891, 11297, 563, 364, 326, 1967, 8515, 261, 12784, 1297, 1005, 316, 326, 2063, 13, 203, 377, 380, 632, 891, 394, 7150, 4941, 1253, 1021, 394, 5859, 563, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 1021, 5402, 11987, 24165, 203, 377, 380, 632, 2463, 1021, 3526, 23161, 17, 5854, 4941, 563, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
triggerTemplateBuildIfTestCasesChanged
null
private void triggerTemplateBuildIfTestCasesChanged(long programmingExerciseId, ProgrammingSubmission submission) { // We only trigger the template build when the test repository was changed. // If the submission is from type TEST but already has a result, this build was not triggered by a test repository change if (!submission.belongsToTestRepository() || (submission.belongsToTestRepository() && submission.getResults() != null && !submission.getResults().isEmpty())) { return; } try { programmingSubmissionService.triggerTemplateBuildAndNotifyUser(programmingExerciseId, submission.getCommitHash(), SubmissionType.TEST); } catch (EntityNotFoundException ex) { // If for some reason the programming exercise does not have a template participation, we can only log and abort. log.error( "Could not trigger the build of the template repository for the programming exercise id {} because no template participation could be found for the given exercise", programmingExerciseId); } }
/** * Trigger the build of the template repository, if the submission of the provided result is of type TEST. * Will use the commitHash of the submission for triggering the template build. * * If the submission of the provided result is not of type TEST, the method will return without triggering the build. * * @param programmingExerciseId ProgrammingExercise id that belongs to the result. * @param submission ProgrammingSubmission */
Trigger the build of the template repository, if the submission of the provided result is of type TEST. Will use the commitHash of the submission for triggering the template build. If the submission of the provided result is not of type TEST, the method will return without triggering the build. @param programmingExerciseId ProgrammingExercise id that belongs to the result.
[ "Trigger", "the", "build", "of", "the", "template", "repository", "if", "the", "submission", "of", "the", "provided", "result", "is", "of", "type", "TEST", ".", "Will", "use", "the", "commitHash", "of", "the", "submission", "for", "triggering", "the", "template", "build", ".", "If", "the", "submission", "of", "the", "provided", "result", "is", "not", "of", "type", "TEST", "the", "method", "will", "return", "without", "triggering", "the", "build", ".", "@param", "programmingExerciseId", "ProgrammingExercise", "id", "that", "belongs", "to", "the", "result", "." ]
private void triggerTemplateBuildIfTestCasesChanged(long programmingExerciseId, ProgrammingSubmission submission) { if (!submission.belongsToTestRepository() || (submission.belongsToTestRepository() && submission.getResults() != null && !submission.getResults().isEmpty())) { return; } try { programmingSubmissionService.triggerTemplateBuildAndNotifyUser(programmingExerciseId, submission.getCommitHash(), SubmissionType.TEST); } catch (EntityNotFoundException ex) { log.error( "Could not trigger the build of the template repository for the programming exercise id {} because no template participation could be found for the given exercise", programmingExerciseId); } }
[ "private", "void", "triggerTemplateBuildIfTestCasesChanged", "(", "long", "programmingExerciseId", ",", "ProgrammingSubmission", "submission", ")", "{", "if", "(", "!", "submission", ".", "belongsToTestRepository", "(", ")", "||", "(", "submission", ".", "belongsToTestRepository", "(", ")", "&&", "submission", ".", "getResults", "(", ")", "!=", "null", "&&", "!", "submission", ".", "getResults", "(", ")", ".", "isEmpty", "(", ")", ")", ")", "{", "return", ";", "}", "try", "{", "programmingSubmissionService", ".", "triggerTemplateBuildAndNotifyUser", "(", "programmingExerciseId", ",", "submission", ".", "getCommitHash", "(", ")", ",", "SubmissionType", ".", "TEST", ")", ";", "}", "catch", "(", "EntityNotFoundException", "ex", ")", "{", "log", ".", "error", "(", "\"Could not trigger the build of the template repository for the programming exercise id {} because no template participation could be found for the given exercise\"", ",", "programmingExerciseId", ")", ";", "}", "}" ]
Trigger the build of the template repository, if the submission of the provided result is of type TEST.
[ "Trigger", "the", "build", "of", "the", "template", "repository", "if", "the", "submission", "of", "the", "provided", "result", "is", "of", "type", "TEST", "." ]
[ "// We only trigger the template build when the test repository was changed.", "// If the submission is from type TEST but already has a result, this build was not triggered by a test repository change", "// If for some reason the programming exercise does not have a template participation, we can only log and abort." ]
[ { "param": "programmingExerciseId", "type": "long" }, { "param": "submission", "type": "ProgrammingSubmission" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "submission", "type": "ProgrammingSubmission", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 3080, 2283, 3116, 2047, 4709, 30744, 5033, 12, 5748, 5402, 11987, 424, 20603, 548, 16, 13586, 11987, 17865, 8515, 13, 288, 203, 3639, 368, 1660, 1338, 3080, 326, 1542, 1361, 1347, 326, 1842, 3352, 1703, 3550, 18, 203, 3639, 368, 971, 326, 8515, 353, 628, 618, 22130, 1496, 1818, 711, 279, 563, 16, 333, 1361, 1703, 486, 10861, 635, 279, 1842, 3352, 2549, 203, 3639, 309, 16051, 12684, 18, 13285, 27192, 4709, 3305, 1435, 747, 261, 12684, 18, 13285, 27192, 4709, 3305, 1435, 597, 8515, 18, 588, 3447, 1435, 480, 446, 597, 401, 12684, 18, 588, 3447, 7675, 291, 1921, 1435, 3719, 288, 203, 5411, 327, 31, 203, 3639, 289, 203, 3639, 775, 288, 203, 5411, 5402, 11987, 17865, 1179, 18, 10668, 2283, 3116, 1876, 9168, 1299, 12, 12890, 11987, 424, 20603, 548, 16, 8515, 18, 588, 5580, 2310, 9334, 2592, 3951, 559, 18, 16961, 1769, 203, 3639, 289, 203, 3639, 1044, 261, 1943, 3990, 431, 13, 288, 203, 5411, 368, 971, 364, 2690, 3971, 326, 5402, 11987, 24165, 1552, 486, 1240, 279, 1542, 30891, 367, 16, 732, 848, 1338, 613, 471, 6263, 18, 203, 5411, 613, 18, 1636, 12, 203, 10792, 315, 4445, 486, 3080, 326, 1361, 434, 326, 1542, 3352, 364, 326, 5402, 11987, 24165, 612, 2618, 2724, 1158, 1542, 30891, 367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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 11321, 326, 1361, 434, 326, 1542, 3352, 16, 309, 326, 8515, 434, 326, 2112, 563, 353, 434, 618, 22130, 18, 203, 377, 380, 9980, 999, 326, 3294, 2310, 434, 326, 8515, 364, 27411, 326, 1542, 1361, 18, 203, 377, 380, 203, 377, 380, 971, 326, 8515, 434, 326, 2112, 563, 353, 486, 434, 618, 22130, 16, 326, 707, 903, 327, 2887, 27411, 326, 1361, 18, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 548, 13586, 11987, 424, 20603, 612, 716, 11081, 358, 326, 563, 18, 203, 377, 380, 632, 891, 8515, 5411, 13586, 11987, 17865, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
extractTestCasesFromResult
null
private void extractTestCasesFromResult(ProgrammingExercise exercise, Result result) { boolean haveTestCasesChanged = testCaseService.generateTestCasesFromFeedbacks(result.getFeedbacks(), exercise); if (haveTestCasesChanged) { // Notify the client about the updated testCases Set<ProgrammingExerciseTestCase> testCases = testCaseService.findByExerciseId(exercise.getId()); messagingTemplate.convertAndSend("/topic/programming-exercise/" + exercise.getId() + "/test-cases", testCases); } }
/** * Generates test cases from the given result's feedbacks & notifies the subscribing users about the test cases if they have changed. Has the side effect of sending a message * through the websocket! * * @param exercise the programming exercise for which the test cases should be extracted from the new result * @param result from which to extract the test cases. */
Generates test cases from the given result's feedbacks & notifies the subscribing users about the test cases if they have changed. Has the side effect of sending a message through the websocket! @param exercise the programming exercise for which the test cases should be extracted from the new result @param result from which to extract the test cases.
[ "Generates", "test", "cases", "from", "the", "given", "result", "'", "s", "feedbacks", "&", "notifies", "the", "subscribing", "users", "about", "the", "test", "cases", "if", "they", "have", "changed", ".", "Has", "the", "side", "effect", "of", "sending", "a", "message", "through", "the", "websocket!", "@param", "exercise", "the", "programming", "exercise", "for", "which", "the", "test", "cases", "should", "be", "extracted", "from", "the", "new", "result", "@param", "result", "from", "which", "to", "extract", "the", "test", "cases", "." ]
private void extractTestCasesFromResult(ProgrammingExercise exercise, Result result) { boolean haveTestCasesChanged = testCaseService.generateTestCasesFromFeedbacks(result.getFeedbacks(), exercise); if (haveTestCasesChanged) { Set<ProgrammingExerciseTestCase> testCases = testCaseService.findByExerciseId(exercise.getId()); messagingTemplate.convertAndSend("/topic/programming-exercise/" + exercise.getId() + "/test-cases", testCases); } }
[ "private", "void", "extractTestCasesFromResult", "(", "ProgrammingExercise", "exercise", ",", "Result", "result", ")", "{", "boolean", "haveTestCasesChanged", "=", "testCaseService", ".", "generateTestCasesFromFeedbacks", "(", "result", ".", "getFeedbacks", "(", ")", ",", "exercise", ")", ";", "if", "(", "haveTestCasesChanged", ")", "{", "Set", "<", "ProgrammingExerciseTestCase", ">", "testCases", "=", "testCaseService", ".", "findByExerciseId", "(", "exercise", ".", "getId", "(", ")", ")", ";", "messagingTemplate", ".", "convertAndSend", "(", "\"/topic/programming-exercise/\"", "+", "exercise", ".", "getId", "(", ")", "+", "\"/test-cases\"", ",", "testCases", ")", ";", "}", "}" ]
Generates test cases from the given result's feedbacks & notifies the subscribing users about the test cases if they have changed.
[ "Generates", "test", "cases", "from", "the", "given", "result", "'", "s", "feedbacks", "&", "notifies", "the", "subscribing", "users", "about", "the", "test", "cases", "if", "they", "have", "changed", "." ]
[ "// Notify the client about the updated testCases" ]
[ { "param": "exercise", "type": "ProgrammingExercise" }, { "param": "result", "type": "Result" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 2608, 4709, 30744, 1265, 1253, 12, 9459, 11987, 424, 20603, 24165, 16, 3438, 563, 13, 288, 203, 3639, 1250, 1240, 4709, 30744, 5033, 273, 1842, 2449, 1179, 18, 7163, 4709, 30744, 1265, 15888, 87, 12, 2088, 18, 588, 15888, 87, 9334, 24165, 1769, 203, 3639, 309, 261, 21516, 4709, 30744, 5033, 13, 288, 203, 5411, 368, 10918, 326, 1004, 2973, 326, 3526, 1842, 30744, 203, 5411, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 1842, 30744, 273, 1842, 2449, 1179, 18, 4720, 858, 424, 20603, 548, 12, 8913, 30708, 18, 26321, 10663, 203, 5411, 17301, 2283, 18, 6283, 1876, 3826, 2932, 19, 10476, 19, 12890, 11987, 17, 8913, 30708, 4898, 397, 24165, 18, 26321, 1435, 397, 2206, 3813, 17, 22186, 3113, 1842, 30744, 1769, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 31902, 1842, 6088, 628, 326, 864, 563, 1807, 10762, 87, 473, 19527, 326, 10189, 310, 3677, 2973, 326, 1842, 6088, 309, 2898, 1240, 3550, 18, 4393, 326, 4889, 5426, 434, 5431, 279, 883, 203, 377, 380, 3059, 326, 11537, 5, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 326, 5402, 11987, 24165, 364, 1492, 326, 1842, 6088, 1410, 506, 9438, 628, 326, 394, 563, 203, 377, 380, 632, 891, 563, 282, 628, 1492, 358, 2608, 326, 1842, 6088, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
calculateScoreForResult
Result
public Result calculateScoreForResult(Result result, ProgrammingExercise exercise, boolean isStudentParticipation) { Set<ProgrammingExerciseTestCase> testCases = testCaseService.findActiveByExerciseId(exercise.getId()); Set<ProgrammingExerciseTestCase> testCasesForCurrentDate = testCases; // We don't filter the test cases for the solution/template participation's results as they are used as indicators for the instructor! if (isStudentParticipation) { testCasesForCurrentDate = filterTestCasesForCurrentDate(exercise, testCases); } return calculateScoreForResult(testCases, testCasesForCurrentDate, result, exercise); }
/** * Updates an incoming result with the information of the exercises test cases. This update includes: * - Checking which test cases were not executed as this is not part of the bamboo build (not all test cases are executed in an exercise with sequential test runs) * - Checking the due date and the visibility. * - Recalculating the score based on the successful test cases weight vs the total weight of all test cases. * * If there are no test cases stored in the database for the given exercise (i.e. we have a legacy exercise) or the weight has not been changed, then the result will not change * * @param result to modify with new score, result string & added feedbacks (not executed tests) * @param exercise the result belongs to. * @param isStudentParticipation boolean flag indicating weather the participation of the result is not a solution/template participation. * @return Result with updated feedbacks, score and result string. */
Updates an incoming result with the information of the exercises test cases. This update includes: - Checking which test cases were not executed as this is not part of the bamboo build (not all test cases are executed in an exercise with sequential test runs) - Checking the due date and the visibility. - Recalculating the score based on the successful test cases weight vs the total weight of all test cases. If there are no test cases stored in the database for the given exercise or the weight has not been changed, then the result will not change @param result to modify with new score, result string & added feedbacks (not executed tests) @param exercise the result belongs to. @param isStudentParticipation boolean flag indicating weather the participation of the result is not a solution/template participation. @return Result with updated feedbacks, score and result string.
[ "Updates", "an", "incoming", "result", "with", "the", "information", "of", "the", "exercises", "test", "cases", ".", "This", "update", "includes", ":", "-", "Checking", "which", "test", "cases", "were", "not", "executed", "as", "this", "is", "not", "part", "of", "the", "bamboo", "build", "(", "not", "all", "test", "cases", "are", "executed", "in", "an", "exercise", "with", "sequential", "test", "runs", ")", "-", "Checking", "the", "due", "date", "and", "the", "visibility", ".", "-", "Recalculating", "the", "score", "based", "on", "the", "successful", "test", "cases", "weight", "vs", "the", "total", "weight", "of", "all", "test", "cases", ".", "If", "there", "are", "no", "test", "cases", "stored", "in", "the", "database", "for", "the", "given", "exercise", "or", "the", "weight", "has", "not", "been", "changed", "then", "the", "result", "will", "not", "change", "@param", "result", "to", "modify", "with", "new", "score", "result", "string", "&", "added", "feedbacks", "(", "not", "executed", "tests", ")", "@param", "exercise", "the", "result", "belongs", "to", ".", "@param", "isStudentParticipation", "boolean", "flag", "indicating", "weather", "the", "participation", "of", "the", "result", "is", "not", "a", "solution", "/", "template", "participation", ".", "@return", "Result", "with", "updated", "feedbacks", "score", "and", "result", "string", "." ]
public Result calculateScoreForResult(Result result, ProgrammingExercise exercise, boolean isStudentParticipation) { Set<ProgrammingExerciseTestCase> testCases = testCaseService.findActiveByExerciseId(exercise.getId()); Set<ProgrammingExerciseTestCase> testCasesForCurrentDate = testCases; if (isStudentParticipation) { testCasesForCurrentDate = filterTestCasesForCurrentDate(exercise, testCases); } return calculateScoreForResult(testCases, testCasesForCurrentDate, result, exercise); }
[ "public", "Result", "calculateScoreForResult", "(", "Result", "result", ",", "ProgrammingExercise", "exercise", ",", "boolean", "isStudentParticipation", ")", "{", "Set", "<", "ProgrammingExerciseTestCase", ">", "testCases", "=", "testCaseService", ".", "findActiveByExerciseId", "(", "exercise", ".", "getId", "(", ")", ")", ";", "Set", "<", "ProgrammingExerciseTestCase", ">", "testCasesForCurrentDate", "=", "testCases", ";", "if", "(", "isStudentParticipation", ")", "{", "testCasesForCurrentDate", "=", "filterTestCasesForCurrentDate", "(", "exercise", ",", "testCases", ")", ";", "}", "return", "calculateScoreForResult", "(", "testCases", ",", "testCasesForCurrentDate", ",", "result", ",", "exercise", ")", ";", "}" ]
Updates an incoming result with the information of the exercises test cases.
[ "Updates", "an", "incoming", "result", "with", "the", "information", "of", "the", "exercises", "test", "cases", "." ]
[ "// We don't filter the test cases for the solution/template participation's results as they are used as indicators for the instructor!" ]
[ { "param": "result", "type": "Result" }, { "param": "exercise", "type": "ProgrammingExercise" }, { "param": "isStudentParticipation", "type": "boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "exercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "isStudentParticipation", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 3438, 4604, 7295, 1290, 1253, 12, 1253, 563, 16, 13586, 11987, 424, 20603, 24165, 16, 1250, 353, 19943, 319, 1988, 24629, 367, 13, 288, 203, 3639, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 1842, 30744, 273, 1842, 2449, 1179, 18, 4720, 3896, 858, 424, 20603, 548, 12, 8913, 30708, 18, 26321, 10663, 203, 3639, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 1842, 30744, 1290, 3935, 1626, 273, 1842, 30744, 31, 203, 3639, 368, 1660, 2727, 1404, 1034, 326, 1842, 6088, 364, 326, 6959, 19, 3202, 30891, 367, 1807, 1686, 487, 2898, 854, 1399, 487, 27121, 364, 326, 316, 2732, 5, 203, 3639, 309, 261, 291, 19943, 319, 1988, 24629, 367, 13, 288, 203, 5411, 1842, 30744, 1290, 3935, 1626, 273, 1034, 4709, 30744, 1290, 3935, 1626, 12, 8913, 30708, 16, 1842, 30744, 1769, 203, 3639, 289, 203, 3639, 327, 4604, 7295, 1290, 1253, 12, 3813, 30744, 16, 1842, 30744, 1290, 3935, 1626, 16, 563, 16, 24165, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 15419, 392, 6935, 563, 598, 326, 1779, 434, 326, 431, 12610, 6141, 1842, 6088, 18, 1220, 1089, 6104, 30, 203, 377, 380, 300, 24471, 1492, 1842, 6088, 4591, 486, 7120, 487, 333, 353, 486, 1087, 434, 326, 11400, 1075, 83, 1361, 261, 902, 777, 1842, 6088, 854, 7120, 316, 392, 24165, 598, 21210, 1842, 7597, 13, 203, 377, 380, 300, 24471, 326, 6541, 1509, 471, 326, 9478, 18, 203, 377, 380, 300, 868, 12780, 1776, 326, 4462, 2511, 603, 326, 6873, 1842, 6088, 3119, 6195, 326, 2078, 3119, 434, 777, 1842, 6088, 18, 203, 377, 380, 203, 377, 380, 971, 1915, 854, 1158, 1842, 6088, 4041, 316, 326, 2063, 364, 326, 864, 24165, 261, 77, 18, 73, 18, 732, 1240, 279, 8866, 2 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
updateAllResults
null
public List<Result> updateAllResults(ProgrammingExercise exercise) { Set<ProgrammingExerciseTestCase> testCases = testCaseService.findActiveByExerciseId(exercise.getId()); ArrayList<Result> updatedResults = new ArrayList<>(); templateProgrammingExerciseParticipationRepository.findWithEagerResultsAndFeedbacksAndSubmissionsByProgrammingExerciseId(exercise.getId()) .flatMap(p -> Optional.ofNullable(p.findLatestLegalResult())).ifPresent(result -> { calculateScoreForResult(testCases, testCases, result, exercise); updatedResults.add(result); }); solutionProgrammingExerciseParticipationRepository.findWithEagerResultsAndFeedbacksAndSubmissionsByProgrammingExerciseId(exercise.getId()) .flatMap(p -> Optional.ofNullable(p.findLatestLegalResult())).ifPresent(result -> { calculateScoreForResult(testCases, testCases, result, exercise); updatedResults.add(result); }); // filter the test cases for the student results if necessary Set<ProgrammingExerciseTestCase> testCasesForCurrentDate = filterTestCasesForCurrentDate(exercise, testCases); // We only update the latest automatic results here, later manual assessments are not affected List<StudentParticipation> participations = studentParticipationRepository.findByExerciseIdWithLatestAutomaticResultAndFeedbacks(exercise.getId()); for (StudentParticipation studentParticipation : participations) { Result result = studentParticipation.findLatestLegalResult(); if (result != null) { calculateScoreForResult(testCases, testCasesForCurrentDate, result, exercise); updatedResults.add(result); } } // Update also manual results List<StudentParticipation> participationsWithManualResult = studentParticipationRepository.findByExerciseIdWithManualResultAndFeedbacks(exercise.getId()); for (StudentParticipation studentParticipation : participationsWithManualResult) { Result result = studentParticipation.findLatestLegalResult(); if (result != null) { calculateScoreForResult(testCases, testCasesForCurrentDate, result, exercise); updatedResults.add(result); } } return updatedResults; }
/** * Updates <b>all</b> latest automatic results of the given exercise with the information of the exercises test cases. This update includes: * - Checking which test cases were not executed as this is not part of the bamboo build (not all test cases are executed in an exercise with sequential test runs) * - Checking the due date and the visibility. * - Recalculating the score based based on the successful test cases weight vs the total weight of all test cases. * * If there are no test cases stored in the database for the given exercise (i.e. we have a legacy exercise) or the weight has not been changed, then the result will not change * * @param exercise the exercise whose results should be updated * @return the results of the exercise that have been updated */
Updates all latest automatic results of the given exercise with the information of the exercises test cases. This update includes: - Checking which test cases were not executed as this is not part of the bamboo build (not all test cases are executed in an exercise with sequential test runs) - Checking the due date and the visibility. - Recalculating the score based based on the successful test cases weight vs the total weight of all test cases. If there are no test cases stored in the database for the given exercise or the weight has not been changed, then the result will not change @param exercise the exercise whose results should be updated @return the results of the exercise that have been updated
[ "Updates", "all", "latest", "automatic", "results", "of", "the", "given", "exercise", "with", "the", "information", "of", "the", "exercises", "test", "cases", ".", "This", "update", "includes", ":", "-", "Checking", "which", "test", "cases", "were", "not", "executed", "as", "this", "is", "not", "part", "of", "the", "bamboo", "build", "(", "not", "all", "test", "cases", "are", "executed", "in", "an", "exercise", "with", "sequential", "test", "runs", ")", "-", "Checking", "the", "due", "date", "and", "the", "visibility", ".", "-", "Recalculating", "the", "score", "based", "based", "on", "the", "successful", "test", "cases", "weight", "vs", "the", "total", "weight", "of", "all", "test", "cases", ".", "If", "there", "are", "no", "test", "cases", "stored", "in", "the", "database", "for", "the", "given", "exercise", "or", "the", "weight", "has", "not", "been", "changed", "then", "the", "result", "will", "not", "change", "@param", "exercise", "the", "exercise", "whose", "results", "should", "be", "updated", "@return", "the", "results", "of", "the", "exercise", "that", "have", "been", "updated" ]
public List<Result> updateAllResults(ProgrammingExercise exercise) { Set<ProgrammingExerciseTestCase> testCases = testCaseService.findActiveByExerciseId(exercise.getId()); ArrayList<Result> updatedResults = new ArrayList<>(); templateProgrammingExerciseParticipationRepository.findWithEagerResultsAndFeedbacksAndSubmissionsByProgrammingExerciseId(exercise.getId()) .flatMap(p -> Optional.ofNullable(p.findLatestLegalResult())).ifPresent(result -> { calculateScoreForResult(testCases, testCases, result, exercise); updatedResults.add(result); }); solutionProgrammingExerciseParticipationRepository.findWithEagerResultsAndFeedbacksAndSubmissionsByProgrammingExerciseId(exercise.getId()) .flatMap(p -> Optional.ofNullable(p.findLatestLegalResult())).ifPresent(result -> { calculateScoreForResult(testCases, testCases, result, exercise); updatedResults.add(result); }); Set<ProgrammingExerciseTestCase> testCasesForCurrentDate = filterTestCasesForCurrentDate(exercise, testCases); List<StudentParticipation> participations = studentParticipationRepository.findByExerciseIdWithLatestAutomaticResultAndFeedbacks(exercise.getId()); for (StudentParticipation studentParticipation : participations) { Result result = studentParticipation.findLatestLegalResult(); if (result != null) { calculateScoreForResult(testCases, testCasesForCurrentDate, result, exercise); updatedResults.add(result); } } List<StudentParticipation> participationsWithManualResult = studentParticipationRepository.findByExerciseIdWithManualResultAndFeedbacks(exercise.getId()); for (StudentParticipation studentParticipation : participationsWithManualResult) { Result result = studentParticipation.findLatestLegalResult(); if (result != null) { calculateScoreForResult(testCases, testCasesForCurrentDate, result, exercise); updatedResults.add(result); } } return updatedResults; }
[ "public", "List", "<", "Result", ">", "updateAllResults", "(", "ProgrammingExercise", "exercise", ")", "{", "Set", "<", "ProgrammingExerciseTestCase", ">", "testCases", "=", "testCaseService", ".", "findActiveByExerciseId", "(", "exercise", ".", "getId", "(", ")", ")", ";", "ArrayList", "<", "Result", ">", "updatedResults", "=", "new", "ArrayList", "<", ">", "(", ")", ";", "templateProgrammingExerciseParticipationRepository", ".", "findWithEagerResultsAndFeedbacksAndSubmissionsByProgrammingExerciseId", "(", "exercise", ".", "getId", "(", ")", ")", ".", "flatMap", "(", "p", "->", "Optional", ".", "ofNullable", "(", "p", ".", "findLatestLegalResult", "(", ")", ")", ")", ".", "ifPresent", "(", "result", "->", "{", "calculateScoreForResult", "(", "testCases", ",", "testCases", ",", "result", ",", "exercise", ")", ";", "updatedResults", ".", "add", "(", "result", ")", ";", "}", ")", ";", "solutionProgrammingExerciseParticipationRepository", ".", "findWithEagerResultsAndFeedbacksAndSubmissionsByProgrammingExerciseId", "(", "exercise", ".", "getId", "(", ")", ")", ".", "flatMap", "(", "p", "->", "Optional", ".", "ofNullable", "(", "p", ".", "findLatestLegalResult", "(", ")", ")", ")", ".", "ifPresent", "(", "result", "->", "{", "calculateScoreForResult", "(", "testCases", ",", "testCases", ",", "result", ",", "exercise", ")", ";", "updatedResults", ".", "add", "(", "result", ")", ";", "}", ")", ";", "Set", "<", "ProgrammingExerciseTestCase", ">", "testCasesForCurrentDate", "=", "filterTestCasesForCurrentDate", "(", "exercise", ",", "testCases", ")", ";", "List", "<", "StudentParticipation", ">", "participations", "=", "studentParticipationRepository", ".", "findByExerciseIdWithLatestAutomaticResultAndFeedbacks", "(", "exercise", ".", "getId", "(", ")", ")", ";", "for", "(", "StudentParticipation", "studentParticipation", ":", "participations", ")", "{", "Result", "result", "=", "studentParticipation", ".", "findLatestLegalResult", "(", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "calculateScoreForResult", "(", "testCases", ",", "testCasesForCurrentDate", ",", "result", ",", "exercise", ")", ";", "updatedResults", ".", "add", "(", "result", ")", ";", "}", "}", "List", "<", "StudentParticipation", ">", "participationsWithManualResult", "=", "studentParticipationRepository", ".", "findByExerciseIdWithManualResultAndFeedbacks", "(", "exercise", ".", "getId", "(", ")", ")", ";", "for", "(", "StudentParticipation", "studentParticipation", ":", "participationsWithManualResult", ")", "{", "Result", "result", "=", "studentParticipation", ".", "findLatestLegalResult", "(", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "calculateScoreForResult", "(", "testCases", ",", "testCasesForCurrentDate", ",", "result", ",", "exercise", ")", ";", "updatedResults", ".", "add", "(", "result", ")", ";", "}", "}", "return", "updatedResults", ";", "}" ]
Updates <b>all</b> latest automatic results of the given exercise with the information of the exercises test cases.
[ "Updates", "<b", ">", "all<", "/", "b", ">", "latest", "automatic", "results", "of", "the", "given", "exercise", "with", "the", "information", "of", "the", "exercises", "test", "cases", "." ]
[ "// filter the test cases for the student results if necessary", "// We only update the latest automatic results here, later manual assessments are not affected", "// Update also manual results" ]
[ { "param": "exercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 987, 32, 1253, 34, 1089, 1595, 3447, 12, 9459, 11987, 424, 20603, 24165, 13, 288, 203, 3639, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 1842, 30744, 273, 1842, 2449, 1179, 18, 4720, 3896, 858, 424, 20603, 548, 12, 8913, 30708, 18, 26321, 10663, 203, 203, 3639, 2407, 32, 1253, 34, 3526, 3447, 273, 394, 2407, 29667, 5621, 203, 203, 3639, 1542, 9459, 11987, 424, 20603, 1988, 24629, 367, 3305, 18, 4720, 1190, 41, 6817, 3447, 1876, 15888, 87, 1876, 1676, 7300, 858, 9459, 11987, 424, 20603, 548, 12, 8913, 30708, 18, 26321, 10756, 203, 7734, 263, 15401, 863, 12, 84, 317, 4055, 18, 792, 13349, 12, 84, 18, 4720, 18650, 30697, 1253, 10756, 2934, 430, 6351, 12, 2088, 317, 288, 203, 10792, 4604, 7295, 1290, 1253, 12, 3813, 30744, 16, 1842, 30744, 16, 563, 16, 24165, 1769, 203, 10792, 3526, 3447, 18, 1289, 12, 2088, 1769, 203, 7734, 15549, 203, 3639, 6959, 9459, 11987, 424, 20603, 1988, 24629, 367, 3305, 18, 4720, 1190, 41, 6817, 3447, 1876, 15888, 87, 1876, 1676, 7300, 858, 9459, 11987, 424, 20603, 548, 12, 8913, 30708, 18, 26321, 10756, 203, 7734, 263, 15401, 863, 12, 84, 317, 4055, 18, 792, 13349, 12, 84, 18, 4720, 18650, 30697, 1253, 10756, 2934, 430, 6351, 12, 2088, 317, 288, 203, 10792, 4604, 7295, 1290, 1253, 12, 3813, 30744, 16, 1842, 30744, 16, 563, 16, 24165, 1769, 203, 10792, 3526, 3447, 18, 1289, 12, 2088, 1769, 203, 7734, 15549, 203, 203, 3639, 368, 1034, 326, 1842, 6088, 364, 326, 18110, 1686, 309, 4573, 203, 3639, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 1842, 30744, 1290, 3935, 1626, 273, 1034, 4709, 30744, 1290, 3935, 1626, 12, 8913, 30708, 16, 1842, 30744, 1769, 203, 3639, 368, 1660, 1338, 1089, 326, 4891, 5859, 1686, 2674, 16, 5137, 11297, 1551, 403, 1346, 854, 486, 9844, 203, 3639, 987, 32, 19943, 319, 1988, 24629, 367, 34, 30891, 1012, 273, 18110, 1988, 24629, 367, 3305, 18, 4720, 858, 424, 20603, 548, 1190, 18650, 7150, 4941, 1253, 1876, 15888, 87, 12, 8913, 30708, 18, 26321, 10663, 203, 203, 3639, 364, 261, 19943, 319, 1988, 24629, 367, 18110, 1988, 24629, 367, 294, 30891, 1012, 13, 288, 203, 5411, 3438, 563, 273, 18110, 1988, 24629, 367, 18, 4720, 18650, 30697, 1253, 5621, 203, 5411, 309, 261, 2088, 480, 446, 13, 288, 203, 7734, 4604, 7295, 1290, 1253, 12, 3813, 30744, 16, 1842, 30744, 1290, 3935, 1626, 16, 563, 16, 24165, 1769, 203, 7734, 3526, 3447, 18, 1289, 12, 2088, 1769, 203, 5411, 289, 203, 3639, 289, 203, 203, 3639, 368, 2315, 2546, 11297, 1686, 203, 3639, 987, 32, 19943, 319, 1988, 24629, 367, 34, 30891, 1012, 1190, 25139, 1253, 273, 18110, 1988, 24629, 367, 3305, 18, 4720, 858, 424, 20603, 548, 1190, 25139, 1253, 1876, 15888, 87, 12, 8913, 30708, 18, 26321, 10663, 203, 3639, 364, 261, 19943, 319, 1988, 24629, 367, 18110, 1988, 24629, 367, 294, 30891, 1012, 1190, 25139, 1253, 13, 288, 203, 5411, 3438, 563, 273, 18110, 1988, 24629, 367, 18, 4720, 18650, 30697, 1253, 5621, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 15419, 411, 70, 34, 454, 1757, 70, 34, 4891, 5859, 1686, 434, 326, 864, 24165, 598, 326, 1779, 434, 326, 431, 12610, 6141, 1842, 6088, 18, 1220, 1089, 6104, 30, 203, 377, 380, 300, 24471, 1492, 1842, 6088, 4591, 486, 7120, 487, 333, 353, 486, 1087, 434, 326, 11400, 1075, 83, 1361, 261, 902, 777, 1842, 6088, 854, 7120, 316, 392, 24165, 598, 21210, 1842, 7597, 13, 203, 377, 380, 300, 24471, 326, 6541, 1509, 471, 326, 9478, 18, 203, 377, 380, 300, 868, 12780, 1776, 326, 4462, 2511, 2511, 603, 326, 6873, 1842, 6088, 3119, 6195, 326, 2078, 3119, 434, 777, 1842, 6088, 18, 203, 377, 380, 203, 377, 380, 971, 1915, 854, 1158, 1842, 6088, 4041, 316, 326, 2063, 364, 2 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
retainAutomaticFeedbacksWithTestCase
null
private void retainAutomaticFeedbacksWithTestCase(Result result, final Set<ProgrammingExerciseTestCase> testCases) { // Remove automatic feedbacks not associated with test cases result.getFeedbacks().removeIf(feedback -> feedback.getType() == FeedbackType.AUTOMATIC && !feedback.isStaticCodeAnalysisFeedback() && testCases.stream().noneMatch(test -> test.getTestName().equalsIgnoreCase(feedback.getText()))); // If there are no feedbacks left after filtering those not valid, also setHasFeedback to false. if (result.getFeedbacks().stream().noneMatch(feedback -> Boolean.FALSE.equals(feedback.isPositive()) || feedback.getType() != null && (feedback.getType().equals(FeedbackType.MANUAL) || feedback.getType().equals(FeedbackType.MANUAL_UNREFERENCED)))) { result.setHasFeedback(false); } }
/** * Only keeps automatic feedbacks that also are associated with a test case. * * Does not remove static code analysis feedback. * * @param result of the build run. * @param testCases of the programming exercise. */
Only keeps automatic feedbacks that also are associated with a test case. Does not remove static code analysis feedback. @param result of the build run. @param testCases of the programming exercise.
[ "Only", "keeps", "automatic", "feedbacks", "that", "also", "are", "associated", "with", "a", "test", "case", ".", "Does", "not", "remove", "static", "code", "analysis", "feedback", ".", "@param", "result", "of", "the", "build", "run", ".", "@param", "testCases", "of", "the", "programming", "exercise", "." ]
private void retainAutomaticFeedbacksWithTestCase(Result result, final Set<ProgrammingExerciseTestCase> testCases) { result.getFeedbacks().removeIf(feedback -> feedback.getType() == FeedbackType.AUTOMATIC && !feedback.isStaticCodeAnalysisFeedback() && testCases.stream().noneMatch(test -> test.getTestName().equalsIgnoreCase(feedback.getText()))); if (result.getFeedbacks().stream().noneMatch(feedback -> Boolean.FALSE.equals(feedback.isPositive()) || feedback.getType() != null && (feedback.getType().equals(FeedbackType.MANUAL) || feedback.getType().equals(FeedbackType.MANUAL_UNREFERENCED)))) { result.setHasFeedback(false); } }
[ "private", "void", "retainAutomaticFeedbacksWithTestCase", "(", "Result", "result", ",", "final", "Set", "<", "ProgrammingExerciseTestCase", ">", "testCases", ")", "{", "result", ".", "getFeedbacks", "(", ")", ".", "removeIf", "(", "feedback", "->", "feedback", ".", "getType", "(", ")", "==", "FeedbackType", ".", "AUTOMATIC", "&&", "!", "feedback", ".", "isStaticCodeAnalysisFeedback", "(", ")", "&&", "testCases", ".", "stream", "(", ")", ".", "noneMatch", "(", "test", "->", "test", ".", "getTestName", "(", ")", ".", "equalsIgnoreCase", "(", "feedback", ".", "getText", "(", ")", ")", ")", ")", ";", "if", "(", "result", ".", "getFeedbacks", "(", ")", ".", "stream", "(", ")", ".", "noneMatch", "(", "feedback", "->", "Boolean", ".", "FALSE", ".", "equals", "(", "feedback", ".", "isPositive", "(", ")", ")", "||", "feedback", ".", "getType", "(", ")", "!=", "null", "&&", "(", "feedback", ".", "getType", "(", ")", ".", "equals", "(", "FeedbackType", ".", "MANUAL", ")", "||", "feedback", ".", "getType", "(", ")", ".", "equals", "(", "FeedbackType", ".", "MANUAL_UNREFERENCED", ")", ")", ")", ")", "{", "result", ".", "setHasFeedback", "(", "false", ")", ";", "}", "}" ]
Only keeps automatic feedbacks that also are associated with a test case.
[ "Only", "keeps", "automatic", "feedbacks", "that", "also", "are", "associated", "with", "a", "test", "case", "." ]
[ "// Remove automatic feedbacks not associated with test cases", "// If there are no feedbacks left after filtering those not valid, also setHasFeedback to false." ]
[ { "param": "result", "type": "Result" }, { "param": "testCases", "type": "Set<ProgrammingExerciseTestCase>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "testCases", "type": "Set<ProgrammingExerciseTestCase>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 15096, 7150, 4941, 15888, 87, 1190, 4709, 2449, 12, 1253, 563, 16, 727, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 1842, 30744, 13, 288, 203, 3639, 368, 3581, 5859, 10762, 87, 486, 3627, 598, 1842, 6088, 203, 3639, 563, 18, 588, 15888, 87, 7675, 4479, 2047, 12, 12571, 317, 10762, 18, 588, 559, 1435, 422, 14013, 823, 559, 18, 37, 1693, 1872, 11781, 597, 401, 12571, 18, 291, 5788, 1085, 9418, 15888, 1435, 203, 7734, 597, 1842, 30744, 18, 3256, 7675, 6102, 2060, 12, 3813, 317, 1842, 18, 588, 4709, 461, 7675, 14963, 5556, 12, 12571, 18, 588, 1528, 1435, 3719, 1769, 203, 203, 3639, 368, 971, 1915, 854, 1158, 10762, 87, 2002, 1839, 11346, 5348, 486, 923, 16, 2546, 444, 5582, 15888, 358, 629, 18, 203, 3639, 309, 261, 2088, 18, 588, 15888, 87, 7675, 3256, 7675, 6102, 2060, 12, 12571, 317, 3411, 18, 21053, 18, 14963, 12, 12571, 18, 291, 14900, 10756, 203, 7734, 747, 10762, 18, 588, 559, 1435, 480, 446, 597, 261, 12571, 18, 588, 559, 7675, 14963, 12, 15888, 559, 18, 9560, 14235, 13, 747, 10762, 18, 588, 559, 7675, 14963, 12, 15888, 559, 18, 9560, 14235, 67, 2124, 14617, 40, 3719, 3719, 288, 203, 5411, 563, 18, 542, 5582, 15888, 12, 5743, 1769, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 5098, 20948, 5859, 10762, 87, 716, 2546, 854, 3627, 598, 279, 1842, 648, 18, 203, 377, 380, 203, 377, 380, 9637, 486, 1206, 760, 981, 6285, 10762, 18, 203, 377, 380, 203, 377, 380, 632, 891, 563, 434, 326, 1361, 1086, 18, 203, 377, 380, 632, 891, 1842, 30744, 434, 326, 5402, 11987, 24165, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
createFeedbackForDuplicateTests
null
private boolean createFeedbackForDuplicateTests(Result result, ProgrammingExercise programmingExercise) { Set<String> uniqueFeedbackNames = new HashSet<>(); // Find duplicate test cases from feedback which is automatic feedback Set<String> duplicateFeedbackNames = result.getFeedbacks().stream() .filter(feedback -> !feedback.isStaticCodeAnalysisFeedback() && FeedbackType.AUTOMATIC.equals(feedback.getType())).map(Feedback::getText) // Set.add() returns false if the lowerCase element was already in the set, this is how we find all duplicates .filter(feedbackName -> !uniqueFeedbackNames.add(feedbackName.toLowerCase())).collect(Collectors.toSet()); if (!duplicateFeedbackNames.isEmpty()) { String duplicateDetailText = "This is a duplicate test case. Please review all your test cases and verify that your test cases have unique names!"; List<Feedback> feedbacksForDuplicateTestCases = duplicateFeedbackNames.stream() .map(feedbackName -> new Feedback().type(FeedbackType.AUTOMATIC).text(feedbackName + " - Duplicate Test Case!").detailText(duplicateDetailText).positive(false)) .collect(Collectors.toList()); result.addFeedbacks(feedbacksForDuplicateTestCases); // Enables to view the result details in case all test cases are positive result.setHasFeedback(true); String notificationText = TEST_CASES_DUPLICATE_NOTIFICATION + String.join(", ", duplicateFeedbackNames); groupNotificationService.notifyEditorAndInstructorGroupAboutDuplicateTestCasesForExercise(programmingExercise, notificationText); return true; } return false; }
/** * Check which feedback entries have the same name and therefore indicate multiple testcases with the same name. * These duplicate testcases are added as a feedback element to the result. * The instructor and tutors are notified via a group notification. * * @param result of the build run. * @param programmingExercise the current programming exercise. */
Check which feedback entries have the same name and therefore indicate multiple testcases with the same name. These duplicate testcases are added as a feedback element to the result. The instructor and tutors are notified via a group notification. @param result of the build run. @param programmingExercise the current programming exercise.
[ "Check", "which", "feedback", "entries", "have", "the", "same", "name", "and", "therefore", "indicate", "multiple", "testcases", "with", "the", "same", "name", ".", "These", "duplicate", "testcases", "are", "added", "as", "a", "feedback", "element", "to", "the", "result", ".", "The", "instructor", "and", "tutors", "are", "notified", "via", "a", "group", "notification", ".", "@param", "result", "of", "the", "build", "run", ".", "@param", "programmingExercise", "the", "current", "programming", "exercise", "." ]
private boolean createFeedbackForDuplicateTests(Result result, ProgrammingExercise programmingExercise) { Set<String> uniqueFeedbackNames = new HashSet<>(); Set<String> duplicateFeedbackNames = result.getFeedbacks().stream() .filter(feedback -> !feedback.isStaticCodeAnalysisFeedback() && FeedbackType.AUTOMATIC.equals(feedback.getType())).map(Feedback::getText) .filter(feedbackName -> !uniqueFeedbackNames.add(feedbackName.toLowerCase())).collect(Collectors.toSet()); if (!duplicateFeedbackNames.isEmpty()) { String duplicateDetailText = "This is a duplicate test case. Please review all your test cases and verify that your test cases have unique names!"; List<Feedback> feedbacksForDuplicateTestCases = duplicateFeedbackNames.stream() .map(feedbackName -> new Feedback().type(FeedbackType.AUTOMATIC).text(feedbackName + " - Duplicate Test Case!").detailText(duplicateDetailText).positive(false)) .collect(Collectors.toList()); result.addFeedbacks(feedbacksForDuplicateTestCases); result.setHasFeedback(true); String notificationText = TEST_CASES_DUPLICATE_NOTIFICATION + String.join(", ", duplicateFeedbackNames); groupNotificationService.notifyEditorAndInstructorGroupAboutDuplicateTestCasesForExercise(programmingExercise, notificationText); return true; } return false; }
[ "private", "boolean", "createFeedbackForDuplicateTests", "(", "Result", "result", ",", "ProgrammingExercise", "programmingExercise", ")", "{", "Set", "<", "String", ">", "uniqueFeedbackNames", "=", "new", "HashSet", "<", ">", "(", ")", ";", "Set", "<", "String", ">", "duplicateFeedbackNames", "=", "result", ".", "getFeedbacks", "(", ")", ".", "stream", "(", ")", ".", "filter", "(", "feedback", "->", "!", "feedback", ".", "isStaticCodeAnalysisFeedback", "(", ")", "&&", "FeedbackType", ".", "AUTOMATIC", ".", "equals", "(", "feedback", ".", "getType", "(", ")", ")", ")", ".", "map", "(", "Feedback", "::", "getText", ")", ".", "filter", "(", "feedbackName", "->", "!", "uniqueFeedbackNames", ".", "add", "(", "feedbackName", ".", "toLowerCase", "(", ")", ")", ")", ".", "collect", "(", "Collectors", ".", "toSet", "(", ")", ")", ";", "if", "(", "!", "duplicateFeedbackNames", ".", "isEmpty", "(", ")", ")", "{", "String", "duplicateDetailText", "=", "\"This is a duplicate test case. Please review all your test cases and verify that your test cases have unique names!\"", ";", "List", "<", "Feedback", ">", "feedbacksForDuplicateTestCases", "=", "duplicateFeedbackNames", ".", "stream", "(", ")", ".", "map", "(", "feedbackName", "->", "new", "Feedback", "(", ")", ".", "type", "(", "FeedbackType", ".", "AUTOMATIC", ")", ".", "text", "(", "feedbackName", "+", "\" - Duplicate Test Case!\"", ")", ".", "detailText", "(", "duplicateDetailText", ")", ".", "positive", "(", "false", ")", ")", ".", "collect", "(", "Collectors", ".", "toList", "(", ")", ")", ";", "result", ".", "addFeedbacks", "(", "feedbacksForDuplicateTestCases", ")", ";", "result", ".", "setHasFeedback", "(", "true", ")", ";", "String", "notificationText", "=", "TEST_CASES_DUPLICATE_NOTIFICATION", "+", "String", ".", "join", "(", "\", \"", ",", "duplicateFeedbackNames", ")", ";", "groupNotificationService", ".", "notifyEditorAndInstructorGroupAboutDuplicateTestCasesForExercise", "(", "programmingExercise", ",", "notificationText", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Check which feedback entries have the same name and therefore indicate multiple testcases with the same name.
[ "Check", "which", "feedback", "entries", "have", "the", "same", "name", "and", "therefore", "indicate", "multiple", "testcases", "with", "the", "same", "name", "." ]
[ "// Find duplicate test cases from feedback which is automatic feedback", "// Set.add() returns false if the lowerCase element was already in the set, this is how we find all duplicates", "// Enables to view the result details in case all test cases are positive" ]
[ { "param": "result", "type": "Result" }, { "param": "programmingExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 1250, 752, 15888, 1290, 11826, 14650, 12, 1253, 563, 16, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 13, 288, 203, 3639, 1000, 32, 780, 34, 3089, 15888, 1557, 273, 394, 6847, 29667, 5621, 203, 3639, 368, 4163, 6751, 1842, 6088, 628, 10762, 1492, 353, 5859, 10762, 203, 3639, 1000, 32, 780, 34, 6751, 15888, 1557, 273, 563, 18, 588, 15888, 87, 7675, 3256, 1435, 203, 7734, 263, 2188, 12, 12571, 317, 401, 12571, 18, 291, 5788, 1085, 9418, 15888, 1435, 597, 14013, 823, 559, 18, 37, 1693, 1872, 11781, 18, 14963, 12, 12571, 18, 588, 559, 10756, 2934, 1458, 12, 15888, 2866, 588, 1528, 13, 203, 7734, 368, 1000, 18, 1289, 1435, 1135, 629, 309, 326, 29454, 930, 1703, 1818, 316, 326, 444, 16, 333, 353, 3661, 732, 1104, 777, 11211, 203, 7734, 263, 2188, 12, 12571, 461, 317, 401, 6270, 15888, 1557, 18, 1289, 12, 12571, 461, 18, 869, 5630, 10756, 2934, 14676, 12, 10808, 1383, 18, 869, 694, 10663, 203, 203, 3639, 309, 16051, 17342, 15888, 1557, 18, 291, 1921, 10756, 288, 203, 5411, 514, 6751, 6109, 1528, 273, 315, 2503, 353, 279, 6751, 1842, 648, 18, 7801, 10725, 777, 3433, 1842, 6088, 471, 3929, 716, 3433, 1842, 6088, 1240, 3089, 1257, 4442, 31, 203, 5411, 987, 32, 15888, 34, 10762, 28388, 11826, 4709, 30744, 273, 6751, 15888, 1557, 18, 3256, 1435, 203, 10792, 263, 1458, 12, 12571, 461, 317, 394, 14013, 823, 7675, 723, 12, 15888, 559, 18, 37, 1693, 1872, 11781, 2934, 955, 12, 12571, 461, 397, 315, 300, 19072, 7766, 12605, 4442, 2934, 8992, 1528, 12, 17342, 6109, 1528, 2934, 21094, 12, 5743, 3719, 203, 10792, 263, 14676, 12, 10808, 1383, 18, 869, 682, 10663, 203, 5411, 563, 18, 1289, 15888, 87, 12, 12571, 28388, 11826, 4709, 30744, 1769, 203, 5411, 368, 1374, 1538, 358, 1476, 326, 563, 3189, 316, 648, 777, 1842, 6088, 854, 6895, 203, 5411, 563, 18, 542, 5582, 15888, 12, 3767, 1769, 203, 5411, 514, 3851, 1528, 273, 22130, 67, 13415, 55, 67, 30387, 26042, 67, 4400, 14865, 397, 514, 18, 5701, 2932, 16, 3104, 6751, 15888, 1557, 1769, 203, 5411, 1041, 4386, 1179, 18, 12336, 6946, 1876, 382, 2732, 1114, 24813, 11826, 4709, 30744, 1290, 424, 20603, 12, 12890, 11987, 424, 20603, 16, 3851, 1528, 1769, 203, 5411, 327, 638, 31, 203, 3639, 289, 203, 3639, 327, 629, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2073, 1492, 10762, 3222, 1240, 326, 1967, 508, 471, 13526, 10768, 3229, 1842, 22186, 598, 326, 1967, 508, 18, 203, 377, 380, 8646, 6751, 1842, 22186, 854, 3096, 487, 279, 10762, 930, 358, 326, 563, 18, 203, 377, 380, 1021, 316, 2732, 471, 268, 13595, 854, 18791, 3970, 279, 1041, 3851, 18, 203, 377, 380, 203, 377, 380, 632, 891, 563, 2868, 434, 326, 1361, 1086, 18, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 326, 783, 5402, 11987, 24165, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
updateScore
null
private void updateScore(Result result, Set<ProgrammingExerciseTestCase> successfulTestCases, Set<ProgrammingExerciseTestCase> allTests, List<Feedback> staticCodeAnalysisFeedback, ProgrammingExercise programmingExercise, boolean hasDuplicateTestCases) { if (hasDuplicateTestCases || successfulTestCases.isEmpty()) { result.setScore(0D); } else { double weightSum = allTests.stream().filter(testCase -> !testCase.isInvisible()).mapToDouble(ProgrammingExerciseTestCase::getWeight).sum(); // Checks if weightSum == 0. We can't use == operator since we are comparing doubles if (Precision.equals(weightSum, 0, 1E-8)) { result.setScore(0D); return; } // calculate the achieved points from the passed test cases double successfulTestPoints = successfulTestCases.stream().mapToDouble(test -> { double testWeight = test.getWeight() * test.getBonusMultiplier(); double testPoints = testWeight / weightSum * programmingExercise.getMaxPoints(); double testPointsWithBonus = testPoints + test.getBonusPoints(); // Update credits of related feedback // We need to compare testcases via lowercase, because the testcaseRepository is case-insensitive result.getFeedbacks().stream().filter(fb -> fb.getType() == FeedbackType.AUTOMATIC && fb.getText().equalsIgnoreCase(test.getTestName())).findFirst() .ifPresent(feedback -> feedback.setCredits(testPointsWithBonus)); return testPointsWithBonus; }).sum(); /* * The points are capped by the maximum achievable points. The cap is applied before the static code analysis penalty is subtracted as otherwise the penalty won't have * any effect in some cases. For example with maxPoints=20, successfulTestPoints=30 and penalty=10, a student would still receive the full 20 points, if the points are * not capped before the penalty is subtracted. With the implemented order in place successfulTestPoints will be capped to 20 points first, then the penalty is * subtracted resulting in 10 points. */ double maxPoints = programmingExercise.getMaxPoints() + Optional.ofNullable(programmingExercise.getBonusPoints()).orElse(0.0); if (successfulTestPoints > maxPoints) { successfulTestPoints = maxPoints; } if (Double.isNaN(successfulTestPoints)) { successfulTestPoints = 0.0; } // if static code analysis is enabled, reduce the points by the calculated penalty if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && Optional.ofNullable(programmingExercise.getMaxStaticCodeAnalysisPenalty()).orElse(1) > 0) { successfulTestPoints -= calculateStaticCodeAnalysisPenalty(staticCodeAnalysisFeedback, programmingExercise); if (successfulTestPoints < 0) { successfulTestPoints = 0; } } // The score is calculated as a percentage of the maximum points double score = successfulTestPoints / programmingExercise.getMaxPoints() * 100.0; result.setScore(score); } result.getFeedbacks().forEach(feedback -> { if (feedback.getCredits() == null) { feedback.setCredits(0D); } }); }
/** * Update the score given the positive tests score divided by all tests' score. * Takes weight, bonus multiplier and absolute bonus points into account. * All tests in this case does not include ones with visibility=never. * * @param result of the build run. * @param successfulTestCases test cases with positive feedback. * @param allTests of a given programming exercise. * @param staticCodeAnalysisFeedback of a given programming exercise. * @param programmingExercise the given programming exercise. * @param hasDuplicateTestCases indicates duplicate test cases. */
Update the score given the positive tests score divided by all tests' score. Takes weight, bonus multiplier and absolute bonus points into account. All tests in this case does not include ones with visibility=never. @param result of the build run. @param successfulTestCases test cases with positive feedback. @param allTests of a given programming exercise. @param staticCodeAnalysisFeedback of a given programming exercise. @param programmingExercise the given programming exercise. @param hasDuplicateTestCases indicates duplicate test cases.
[ "Update", "the", "score", "given", "the", "positive", "tests", "score", "divided", "by", "all", "tests", "'", "score", ".", "Takes", "weight", "bonus", "multiplier", "and", "absolute", "bonus", "points", "into", "account", ".", "All", "tests", "in", "this", "case", "does", "not", "include", "ones", "with", "visibility", "=", "never", ".", "@param", "result", "of", "the", "build", "run", ".", "@param", "successfulTestCases", "test", "cases", "with", "positive", "feedback", ".", "@param", "allTests", "of", "a", "given", "programming", "exercise", ".", "@param", "staticCodeAnalysisFeedback", "of", "a", "given", "programming", "exercise", ".", "@param", "programmingExercise", "the", "given", "programming", "exercise", ".", "@param", "hasDuplicateTestCases", "indicates", "duplicate", "test", "cases", "." ]
private void updateScore(Result result, Set<ProgrammingExerciseTestCase> successfulTestCases, Set<ProgrammingExerciseTestCase> allTests, List<Feedback> staticCodeAnalysisFeedback, ProgrammingExercise programmingExercise, boolean hasDuplicateTestCases) { if (hasDuplicateTestCases || successfulTestCases.isEmpty()) { result.setScore(0D); } else { double weightSum = allTests.stream().filter(testCase -> !testCase.isInvisible()).mapToDouble(ProgrammingExerciseTestCase::getWeight).sum(); if (Precision.equals(weightSum, 0, 1E-8)) { result.setScore(0D); return; } double successfulTestPoints = successfulTestCases.stream().mapToDouble(test -> { double testWeight = test.getWeight() * test.getBonusMultiplier(); double testPoints = testWeight / weightSum * programmingExercise.getMaxPoints(); double testPointsWithBonus = testPoints + test.getBonusPoints(); result.getFeedbacks().stream().filter(fb -> fb.getType() == FeedbackType.AUTOMATIC && fb.getText().equalsIgnoreCase(test.getTestName())).findFirst() .ifPresent(feedback -> feedback.setCredits(testPointsWithBonus)); return testPointsWithBonus; }).sum(); /* * The points are capped by the maximum achievable points. The cap is applied before the static code analysis penalty is subtracted as otherwise the penalty won't have * any effect in some cases. For example with maxPoints=20, successfulTestPoints=30 and penalty=10, a student would still receive the full 20 points, if the points are * not capped before the penalty is subtracted. With the implemented order in place successfulTestPoints will be capped to 20 points first, then the penalty is * subtracted resulting in 10 points. */ double maxPoints = programmingExercise.getMaxPoints() + Optional.ofNullable(programmingExercise.getBonusPoints()).orElse(0.0); if (successfulTestPoints > maxPoints) { successfulTestPoints = maxPoints; } if (Double.isNaN(successfulTestPoints)) { successfulTestPoints = 0.0; } if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && Optional.ofNullable(programmingExercise.getMaxStaticCodeAnalysisPenalty()).orElse(1) > 0) { successfulTestPoints -= calculateStaticCodeAnalysisPenalty(staticCodeAnalysisFeedback, programmingExercise); if (successfulTestPoints < 0) { successfulTestPoints = 0; } } double score = successfulTestPoints / programmingExercise.getMaxPoints() * 100.0; result.setScore(score); } result.getFeedbacks().forEach(feedback -> { if (feedback.getCredits() == null) { feedback.setCredits(0D); } }); }
[ "private", "void", "updateScore", "(", "Result", "result", ",", "Set", "<", "ProgrammingExerciseTestCase", ">", "successfulTestCases", ",", "Set", "<", "ProgrammingExerciseTestCase", ">", "allTests", ",", "List", "<", "Feedback", ">", "staticCodeAnalysisFeedback", ",", "ProgrammingExercise", "programmingExercise", ",", "boolean", "hasDuplicateTestCases", ")", "{", "if", "(", "hasDuplicateTestCases", "||", "successfulTestCases", ".", "isEmpty", "(", ")", ")", "{", "result", ".", "setScore", "(", "0D", ")", ";", "}", "else", "{", "double", "weightSum", "=", "allTests", ".", "stream", "(", ")", ".", "filter", "(", "testCase", "->", "!", "testCase", ".", "isInvisible", "(", ")", ")", ".", "mapToDouble", "(", "ProgrammingExerciseTestCase", "::", "getWeight", ")", ".", "sum", "(", ")", ";", "if", "(", "Precision", ".", "equals", "(", "weightSum", ",", "0", ",", "1E-8", ")", ")", "{", "result", ".", "setScore", "(", "0D", ")", ";", "return", ";", "}", "double", "successfulTestPoints", "=", "successfulTestCases", ".", "stream", "(", ")", ".", "mapToDouble", "(", "test", "->", "{", "double", "testWeight", "=", "test", ".", "getWeight", "(", ")", "*", "test", ".", "getBonusMultiplier", "(", ")", ";", "double", "testPoints", "=", "testWeight", "/", "weightSum", "*", "programmingExercise", ".", "getMaxPoints", "(", ")", ";", "double", "testPointsWithBonus", "=", "testPoints", "+", "test", ".", "getBonusPoints", "(", ")", ";", "result", ".", "getFeedbacks", "(", ")", ".", "stream", "(", ")", ".", "filter", "(", "fb", "->", "fb", ".", "getType", "(", ")", "==", "FeedbackType", ".", "AUTOMATIC", "&&", "fb", ".", "getText", "(", ")", ".", "equalsIgnoreCase", "(", "test", ".", "getTestName", "(", ")", ")", ")", ".", "findFirst", "(", ")", ".", "ifPresent", "(", "feedback", "->", "feedback", ".", "setCredits", "(", "testPointsWithBonus", ")", ")", ";", "return", "testPointsWithBonus", ";", "}", ")", ".", "sum", "(", ")", ";", "/*\n * The points are capped by the maximum achievable points. The cap is applied before the static code analysis penalty is subtracted as otherwise the penalty won't have\n * any effect in some cases. For example with maxPoints=20, successfulTestPoints=30 and penalty=10, a student would still receive the full 20 points, if the points are\n * not capped before the penalty is subtracted. With the implemented order in place successfulTestPoints will be capped to 20 points first, then the penalty is\n * subtracted resulting in 10 points.\n */", "double", "maxPoints", "=", "programmingExercise", ".", "getMaxPoints", "(", ")", "+", "Optional", ".", "ofNullable", "(", "programmingExercise", ".", "getBonusPoints", "(", ")", ")", ".", "orElse", "(", "0.0", ")", ";", "if", "(", "successfulTestPoints", ">", "maxPoints", ")", "{", "successfulTestPoints", "=", "maxPoints", ";", "}", "if", "(", "Double", ".", "isNaN", "(", "successfulTestPoints", ")", ")", "{", "successfulTestPoints", "=", "0.0", ";", "}", "if", "(", "Boolean", ".", "TRUE", ".", "equals", "(", "programmingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", ")", "&&", "Optional", ".", "ofNullable", "(", "programmingExercise", ".", "getMaxStaticCodeAnalysisPenalty", "(", ")", ")", ".", "orElse", "(", "1", ")", ">", "0", ")", "{", "successfulTestPoints", "-=", "calculateStaticCodeAnalysisPenalty", "(", "staticCodeAnalysisFeedback", ",", "programmingExercise", ")", ";", "if", "(", "successfulTestPoints", "<", "0", ")", "{", "successfulTestPoints", "=", "0", ";", "}", "}", "double", "score", "=", "successfulTestPoints", "/", "programmingExercise", ".", "getMaxPoints", "(", ")", "*", "100.0", ";", "result", ".", "setScore", "(", "score", ")", ";", "}", "result", ".", "getFeedbacks", "(", ")", ".", "forEach", "(", "feedback", "->", "{", "if", "(", "feedback", ".", "getCredits", "(", ")", "==", "null", ")", "{", "feedback", ".", "setCredits", "(", "0D", ")", ";", "}", "}", ")", ";", "}" ]
Update the score given the positive tests score divided by all tests' score.
[ "Update", "the", "score", "given", "the", "positive", "tests", "score", "divided", "by", "all", "tests", "'", "score", "." ]
[ "// Checks if weightSum == 0. We can't use == operator since we are comparing doubles", "// calculate the achieved points from the passed test cases", "// Update credits of related feedback", "// We need to compare testcases via lowercase, because the testcaseRepository is case-insensitive", "// if static code analysis is enabled, reduce the points by the calculated penalty", "// The score is calculated as a percentage of the maximum points" ]
[ { "param": "result", "type": "Result" }, { "param": "successfulTestCases", "type": "Set<ProgrammingExerciseTestCase>" }, { "param": "allTests", "type": "Set<ProgrammingExerciseTestCase>" }, { "param": "staticCodeAnalysisFeedback", "type": "List<Feedback>" }, { "param": "programmingExercise", "type": "ProgrammingExercise" }, { "param": "hasDuplicateTestCases", "type": "boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "successfulTestCases", "type": "Set<ProgrammingExerciseTestCase>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "allTests", "type": "Set<ProgrammingExerciseTestCase>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "staticCodeAnalysisFeedback", "type": "List<Feedback>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "hasDuplicateTestCases", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 1089, 7295, 12, 1253, 563, 16, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 6873, 4709, 30744, 16, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 777, 14650, 16, 203, 5411, 987, 32, 15888, 34, 760, 1085, 9418, 15888, 16, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 16, 1250, 711, 11826, 4709, 30744, 13, 288, 203, 203, 3639, 309, 261, 5332, 11826, 4709, 30744, 747, 6873, 4709, 30744, 18, 291, 1921, 10756, 288, 203, 5411, 563, 18, 542, 7295, 12, 20, 40, 1769, 203, 3639, 289, 203, 3639, 469, 288, 203, 5411, 1645, 3119, 3495, 273, 777, 14650, 18, 3256, 7675, 2188, 12, 3813, 2449, 317, 401, 3813, 2449, 18, 291, 382, 8613, 1435, 2934, 1458, 774, 5265, 12, 9459, 11987, 424, 20603, 4709, 2449, 2866, 588, 6544, 2934, 1364, 5621, 203, 5411, 368, 13074, 309, 3119, 3495, 422, 374, 18, 1660, 848, 1404, 999, 422, 3726, 3241, 732, 854, 17553, 31446, 203, 5411, 309, 261, 15410, 18, 14963, 12, 4865, 3495, 16, 374, 16, 404, 41, 17, 28, 3719, 288, 203, 7734, 563, 18, 542, 7295, 12, 20, 40, 1769, 203, 7734, 327, 31, 203, 5411, 289, 203, 203, 5411, 368, 4604, 326, 20186, 2155, 3143, 628, 326, 2275, 1842, 6088, 203, 5411, 1645, 6873, 4709, 5636, 273, 6873, 4709, 30744, 18, 3256, 7675, 1458, 774, 5265, 12, 3813, 317, 288, 203, 7734, 1645, 1842, 6544, 273, 1842, 18, 588, 6544, 1435, 380, 1842, 18, 588, 38, 22889, 23365, 5621, 203, 7734, 1645, 1842, 5636, 273, 1842, 6544, 342, 3119, 3495, 380, 5402, 11987, 424, 20603, 18, 588, 2747, 5636, 5621, 203, 7734, 1645, 1842, 5636, 1190, 38, 22889, 273, 1842, 5636, 397, 1842, 18, 588, 38, 22889, 5636, 5621, 203, 7734, 368, 2315, 6197, 1282, 434, 3746, 10762, 203, 7734, 368, 1660, 1608, 358, 3400, 1842, 22186, 3970, 12400, 16, 2724, 326, 1842, 3593, 3305, 353, 648, 17, 31940, 203, 7734, 563, 18, 588, 15888, 87, 7675, 3256, 7675, 2188, 12, 19192, 317, 12754, 18, 588, 559, 1435, 422, 14013, 823, 559, 18, 37, 1693, 1872, 11781, 597, 12754, 18, 588, 1528, 7675, 14963, 5556, 12, 3813, 18, 588, 4709, 461, 10756, 2934, 4720, 3759, 1435, 203, 13491, 263, 430, 6351, 12, 12571, 317, 10762, 18, 542, 24201, 1282, 12, 3813, 5636, 1190, 38, 22889, 10019, 203, 7734, 327, 1842, 5636, 1190, 38, 22889, 31, 203, 5411, 289, 2934, 1364, 5621, 203, 203, 5411, 1748, 203, 2398, 380, 1021, 3143, 854, 3523, 1845, 635, 326, 4207, 20186, 16845, 3143, 18, 1021, 3523, 353, 6754, 1865, 326, 760, 981, 6285, 23862, 353, 10418, 329, 487, 3541, 326, 23862, 8462, 1404, 1240, 203, 2398, 380, 1281, 5426, 316, 2690, 6088, 18, 2457, 3454, 598, 943, 5636, 33, 3462, 16, 6873, 4709, 5636, 33, 5082, 471, 23862, 33, 2163, 16, 279, 18110, 4102, 4859, 6798, 326, 1983, 4200, 3143, 16, 309, 326, 3143, 854, 203, 2398, 380, 486, 3523, 1845, 1865, 326, 23862, 353, 10418, 329, 18, 3423, 326, 8249, 1353, 316, 3166, 6873, 4709, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 2315, 326, 4462, 864, 326, 6895, 7434, 4462, 26057, 635, 777, 7434, 11, 4462, 18, 203, 377, 380, 23004, 3119, 16, 324, 22889, 15027, 471, 4967, 324, 22889, 3143, 1368, 2236, 18, 203, 377, 380, 4826, 7434, 316, 333, 648, 1552, 486, 2341, 5945, 598, 9478, 33, 4644, 502, 18, 203, 377, 380, 203, 377, 380, 632, 891, 563, 5397, 434, 326, 1361, 1086, 18, 203, 377, 380, 632, 891, 6873, 4709, 30744, 3639, 1842, 6088, 598, 6895, 10762, 18, 203, 377, 380, 632, 891, 777, 14650, 10402, 434, 279, 864, 5402, 11987, 24165, 18, 203, 377, 380, 632, 891, 760, 1085, 9418, 15888, 434, 279, 864, 5402, 11987, 24165, 18, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 3639, 326, 2 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
calculateStaticCodeAnalysisPenalty
null
private double calculateStaticCodeAnalysisPenalty(List<Feedback> staticCodeAnalysisFeedback, ProgrammingExercise programmingExercise) { double codeAnalysisPenaltyPoints = 0; var feedbackByCategory = staticCodeAnalysisFeedback.stream().collect(Collectors.groupingBy(Feedback::getStaticCodeAnalysisCategory)); for (var category : staticCodeAnalysisService.findByExerciseId(programmingExercise.getId())) { if (!category.getState().equals(CategoryState.GRADED)) { continue; } // get all feedback in this category List<Feedback> categoryFeedback = feedbackByCategory.getOrDefault(category.getName(), List.of()); // calculate the sum of all per-feedback penalties double categoryPenaltyPoints = categoryFeedback.size() * category.getPenalty(); // cap at the maximum allowed penalty for this category if (category.getMaxPenalty() != null && categoryPenaltyPoints > category.getMaxPenalty()) { categoryPenaltyPoints = category.getMaxPenalty(); } // update credits of feedbacks in category if (!categoryFeedback.isEmpty()) { double perFeedbackPenalty = categoryPenaltyPoints / categoryFeedback.size(); categoryFeedback.forEach(feedback -> feedback.setCredits(-perFeedbackPenalty)); } codeAnalysisPenaltyPoints += categoryPenaltyPoints; } /* * Cap at the maximum allowed penalty for this exercise (maxStaticCodeAnalysisPenalty is in percent) The max penalty is applied to the maxScore. If no max penalty was * supplied, the value defaults to 100 percent. If for example maxScore is 6, maxBonus is 4 and the penalty is 50 percent, then a student can only loose 3 (0.5 * maxScore) * points due to static code analysis issues. */ final var maxExercisePenaltyPoints = (double) Optional.ofNullable(programmingExercise.getMaxStaticCodeAnalysisPenalty()).orElse(100) / 100.0 * programmingExercise.getMaxPoints(); if (codeAnalysisPenaltyPoints > maxExercisePenaltyPoints) { codeAnalysisPenaltyPoints = maxExercisePenaltyPoints; } return codeAnalysisPenaltyPoints; }
/** * Calculates the total penalty over all static code analysis issues * @param staticCodeAnalysisFeedback The list of static code analysis feedback * @param programmingExercise The current exercise * @return The sum of all penalties, capped at the maximum allowed penalty */
Calculates the total penalty over all static code analysis issues @param staticCodeAnalysisFeedback The list of static code analysis feedback @param programmingExercise The current exercise @return The sum of all penalties, capped at the maximum allowed penalty
[ "Calculates", "the", "total", "penalty", "over", "all", "static", "code", "analysis", "issues", "@param", "staticCodeAnalysisFeedback", "The", "list", "of", "static", "code", "analysis", "feedback", "@param", "programmingExercise", "The", "current", "exercise", "@return", "The", "sum", "of", "all", "penalties", "capped", "at", "the", "maximum", "allowed", "penalty" ]
private double calculateStaticCodeAnalysisPenalty(List<Feedback> staticCodeAnalysisFeedback, ProgrammingExercise programmingExercise) { double codeAnalysisPenaltyPoints = 0; var feedbackByCategory = staticCodeAnalysisFeedback.stream().collect(Collectors.groupingBy(Feedback::getStaticCodeAnalysisCategory)); for (var category : staticCodeAnalysisService.findByExerciseId(programmingExercise.getId())) { if (!category.getState().equals(CategoryState.GRADED)) { continue; } List<Feedback> categoryFeedback = feedbackByCategory.getOrDefault(category.getName(), List.of()); double categoryPenaltyPoints = categoryFeedback.size() * category.getPenalty(); if (category.getMaxPenalty() != null && categoryPenaltyPoints > category.getMaxPenalty()) { categoryPenaltyPoints = category.getMaxPenalty(); } if (!categoryFeedback.isEmpty()) { double perFeedbackPenalty = categoryPenaltyPoints / categoryFeedback.size(); categoryFeedback.forEach(feedback -> feedback.setCredits(-perFeedbackPenalty)); } codeAnalysisPenaltyPoints += categoryPenaltyPoints; } /* * Cap at the maximum allowed penalty for this exercise (maxStaticCodeAnalysisPenalty is in percent) The max penalty is applied to the maxScore. If no max penalty was * supplied, the value defaults to 100 percent. If for example maxScore is 6, maxBonus is 4 and the penalty is 50 percent, then a student can only loose 3 (0.5 * maxScore) * points due to static code analysis issues. */ final var maxExercisePenaltyPoints = (double) Optional.ofNullable(programmingExercise.getMaxStaticCodeAnalysisPenalty()).orElse(100) / 100.0 * programmingExercise.getMaxPoints(); if (codeAnalysisPenaltyPoints > maxExercisePenaltyPoints) { codeAnalysisPenaltyPoints = maxExercisePenaltyPoints; } return codeAnalysisPenaltyPoints; }
[ "private", "double", "calculateStaticCodeAnalysisPenalty", "(", "List", "<", "Feedback", ">", "staticCodeAnalysisFeedback", ",", "ProgrammingExercise", "programmingExercise", ")", "{", "double", "codeAnalysisPenaltyPoints", "=", "0", ";", "var", "feedbackByCategory", "=", "staticCodeAnalysisFeedback", ".", "stream", "(", ")", ".", "collect", "(", "Collectors", ".", "groupingBy", "(", "Feedback", "::", "getStaticCodeAnalysisCategory", ")", ")", ";", "for", "(", "var", "category", ":", "staticCodeAnalysisService", ".", "findByExerciseId", "(", "programmingExercise", ".", "getId", "(", ")", ")", ")", "{", "if", "(", "!", "category", ".", "getState", "(", ")", ".", "equals", "(", "CategoryState", ".", "GRADED", ")", ")", "{", "continue", ";", "}", "List", "<", "Feedback", ">", "categoryFeedback", "=", "feedbackByCategory", ".", "getOrDefault", "(", "category", ".", "getName", "(", ")", ",", "List", ".", "of", "(", ")", ")", ";", "double", "categoryPenaltyPoints", "=", "categoryFeedback", ".", "size", "(", ")", "*", "category", ".", "getPenalty", "(", ")", ";", "if", "(", "category", ".", "getMaxPenalty", "(", ")", "!=", "null", "&&", "categoryPenaltyPoints", ">", "category", ".", "getMaxPenalty", "(", ")", ")", "{", "categoryPenaltyPoints", "=", "category", ".", "getMaxPenalty", "(", ")", ";", "}", "if", "(", "!", "categoryFeedback", ".", "isEmpty", "(", ")", ")", "{", "double", "perFeedbackPenalty", "=", "categoryPenaltyPoints", "/", "categoryFeedback", ".", "size", "(", ")", ";", "categoryFeedback", ".", "forEach", "(", "feedback", "->", "feedback", ".", "setCredits", "(", "-", "perFeedbackPenalty", ")", ")", ";", "}", "codeAnalysisPenaltyPoints", "+=", "categoryPenaltyPoints", ";", "}", "/*\n * Cap at the maximum allowed penalty for this exercise (maxStaticCodeAnalysisPenalty is in percent) The max penalty is applied to the maxScore. If no max penalty was\n * supplied, the value defaults to 100 percent. If for example maxScore is 6, maxBonus is 4 and the penalty is 50 percent, then a student can only loose 3 (0.5 * maxScore)\n * points due to static code analysis issues.\n */", "final", "var", "maxExercisePenaltyPoints", "=", "(", "double", ")", "Optional", ".", "ofNullable", "(", "programmingExercise", ".", "getMaxStaticCodeAnalysisPenalty", "(", ")", ")", ".", "orElse", "(", "100", ")", "/", "100.0", "*", "programmingExercise", ".", "getMaxPoints", "(", ")", ";", "if", "(", "codeAnalysisPenaltyPoints", ">", "maxExercisePenaltyPoints", ")", "{", "codeAnalysisPenaltyPoints", "=", "maxExercisePenaltyPoints", ";", "}", "return", "codeAnalysisPenaltyPoints", ";", "}" ]
Calculates the total penalty over all static code analysis issues @param staticCodeAnalysisFeedback The list of static code analysis feedback @param programmingExercise The current exercise @return The sum of all penalties, capped at the maximum allowed penalty
[ "Calculates", "the", "total", "penalty", "over", "all", "static", "code", "analysis", "issues", "@param", "staticCodeAnalysisFeedback", "The", "list", "of", "static", "code", "analysis", "feedback", "@param", "programmingExercise", "The", "current", "exercise", "@return", "The", "sum", "of", "all", "penalties", "capped", "at", "the", "maximum", "allowed", "penalty" ]
[ "// get all feedback in this category", "// calculate the sum of all per-feedback penalties", "// cap at the maximum allowed penalty for this category", "// update credits of feedbacks in category" ]
[ { "param": "staticCodeAnalysisFeedback", "type": "List<Feedback>" }, { "param": "programmingExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "staticCodeAnalysisFeedback", "type": "List<Feedback>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 1645, 4604, 5788, 1085, 9418, 24251, 15006, 12, 682, 32, 15888, 34, 760, 1085, 9418, 15888, 16, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 13, 288, 203, 3639, 1645, 981, 9418, 24251, 15006, 5636, 273, 374, 31, 203, 203, 3639, 569, 10762, 858, 4457, 273, 760, 1085, 9418, 15888, 18, 3256, 7675, 14676, 12, 10808, 1383, 18, 25592, 858, 12, 15888, 2866, 588, 5788, 1085, 9418, 4457, 10019, 203, 203, 3639, 364, 261, 1401, 3150, 294, 760, 1085, 9418, 1179, 18, 4720, 858, 424, 20603, 548, 12, 12890, 11987, 424, 20603, 18, 26321, 1435, 3719, 288, 203, 203, 5411, 309, 16051, 4743, 18, 588, 1119, 7675, 14963, 12, 4457, 1119, 18, 24554, 7660, 3719, 288, 203, 7734, 1324, 31, 203, 5411, 289, 203, 203, 5411, 368, 336, 777, 10762, 316, 333, 3150, 203, 5411, 987, 32, 15888, 34, 3150, 15888, 273, 10762, 858, 4457, 18, 588, 25186, 12, 4743, 18, 17994, 9334, 987, 18, 792, 10663, 203, 203, 5411, 368, 4604, 326, 2142, 434, 777, 1534, 17, 12571, 14264, 2390, 606, 203, 5411, 1645, 3150, 24251, 15006, 5636, 273, 3150, 15888, 18, 1467, 1435, 380, 3150, 18, 588, 24251, 15006, 5621, 203, 203, 5411, 368, 3523, 622, 326, 4207, 2935, 23862, 364, 333, 3150, 203, 5411, 309, 261, 4743, 18, 588, 2747, 24251, 15006, 1435, 480, 446, 597, 3150, 24251, 15006, 5636, 405, 3150, 18, 588, 2747, 24251, 15006, 10756, 288, 203, 7734, 3150, 24251, 15006, 5636, 273, 3150, 18, 588, 2747, 24251, 15006, 5621, 203, 5411, 289, 203, 203, 5411, 368, 1089, 6197, 1282, 434, 10762, 87, 316, 3150, 203, 5411, 309, 16051, 4743, 15888, 18, 291, 1921, 10756, 288, 203, 7734, 1645, 1534, 15888, 24251, 15006, 273, 3150, 24251, 15006, 5636, 342, 3150, 15888, 18, 1467, 5621, 203, 7734, 3150, 15888, 18, 1884, 3442, 12, 12571, 317, 10762, 18, 542, 24201, 1282, 19236, 457, 15888, 24251, 15006, 10019, 203, 5411, 289, 203, 203, 5411, 981, 9418, 24251, 15006, 5636, 1011, 3150, 24251, 15006, 5636, 31, 203, 3639, 289, 203, 203, 3639, 1748, 203, 540, 380, 11200, 622, 326, 4207, 2935, 23862, 364, 333, 24165, 261, 1896, 5788, 1085, 9418, 24251, 15006, 353, 316, 5551, 13, 1021, 943, 23862, 353, 6754, 358, 326, 943, 7295, 18, 971, 1158, 943, 23862, 1703, 203, 540, 380, 4580, 16, 326, 460, 3467, 358, 2130, 5551, 18, 971, 364, 3454, 943, 7295, 353, 1666, 16, 943, 38, 22889, 353, 1059, 471, 326, 23862, 353, 6437, 5551, 16, 1508, 279, 18110, 848, 1338, 28393, 890, 261, 20, 18, 25, 380, 943, 7295, 13, 203, 540, 380, 3143, 6541, 358, 760, 981, 6285, 8296, 18, 203, 540, 1195, 203, 3639, 727, 569, 943, 424, 20603, 24251, 15006, 5636, 273, 261, 9056, 13, 4055, 18, 792, 13349, 12, 12890, 11987, 424, 20603, 18, 588, 2747, 5788, 1085, 9418, 24251, 15006, 1435, 2934, 280, 12427, 12, 6625, 13, 342, 2130, 18, 20, 203, 7734, 380, 5402, 11987, 424, 20603, 18, 588, 2747, 5636, 5621, 203, 3639, 309, 261, 710, 9418, 24251, 15006, 5636, 405, 943, 424, 20603, 24251, 15006, 5636, 13, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 26128, 326, 2078, 23862, 1879, 777, 760, 981, 6285, 8296, 203, 377, 380, 632, 891, 760, 1085, 9418, 15888, 1021, 666, 434, 760, 981, 6285, 10762, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 1021, 783, 24165, 203, 377, 380, 632, 2463, 1021, 2142, 434, 777, 14264, 2390, 606, 16, 3523, 1845, 622, 326, 4207, 2935, 23862, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
updateResultString
null
private void updateResultString(Result result, Set<ProgrammingExerciseTestCase> successfulTestCases, Set<ProgrammingExerciseTestCase> allTests, List<Feedback> scaFeedback, ProgrammingExercise exercise, boolean hasDuplicateTestCases) { if (hasDuplicateTestCases) { result.setResultString("Error: Found duplicated tests!"); } else { // Create a new result string that reflects passed, failed & not executed test cases. String newResultString = successfulTestCases.size() + " of " + allTests.size() + " passed"; // Show number of found quality issues if static code analysis is enabled if (Boolean.TRUE.equals(exercise.isStaticCodeAnalysisEnabled())) { String issueTerm = scaFeedback.size() == 1 ? ", 1 issue" : ", " + scaFeedback.size() + " issues"; newResultString += issueTerm; } if (result.isManual()) { newResultString = updateManualResultString(newResultString, result, exercise); } result.setResultString(newResultString); } }
/** * Update the result's result string given the successful tests vs. all tests (x of y passed). * * @param result of the build run. * @param successfulTestCases test cases with positive feedback. * @param allTests of the given programming exercise. * @param scaFeedback for the result * @param exercise to which this result and the test cases belong * @param hasDuplicateTestCases indicates duplicate test cases */
Update the result's result string given the successful tests vs. all tests (x of y passed). @param result of the build run. @param successfulTestCases test cases with positive feedback. @param allTests of the given programming exercise. @param scaFeedback for the result @param exercise to which this result and the test cases belong @param hasDuplicateTestCases indicates duplicate test cases
[ "Update", "the", "result", "'", "s", "result", "string", "given", "the", "successful", "tests", "vs", ".", "all", "tests", "(", "x", "of", "y", "passed", ")", ".", "@param", "result", "of", "the", "build", "run", ".", "@param", "successfulTestCases", "test", "cases", "with", "positive", "feedback", ".", "@param", "allTests", "of", "the", "given", "programming", "exercise", ".", "@param", "scaFeedback", "for", "the", "result", "@param", "exercise", "to", "which", "this", "result", "and", "the", "test", "cases", "belong", "@param", "hasDuplicateTestCases", "indicates", "duplicate", "test", "cases" ]
private void updateResultString(Result result, Set<ProgrammingExerciseTestCase> successfulTestCases, Set<ProgrammingExerciseTestCase> allTests, List<Feedback> scaFeedback, ProgrammingExercise exercise, boolean hasDuplicateTestCases) { if (hasDuplicateTestCases) { result.setResultString("Error: Found duplicated tests!"); } else { String newResultString = successfulTestCases.size() + " of " + allTests.size() + " passed"; if (Boolean.TRUE.equals(exercise.isStaticCodeAnalysisEnabled())) { String issueTerm = scaFeedback.size() == 1 ? ", 1 issue" : ", " + scaFeedback.size() + " issues"; newResultString += issueTerm; } if (result.isManual()) { newResultString = updateManualResultString(newResultString, result, exercise); } result.setResultString(newResultString); } }
[ "private", "void", "updateResultString", "(", "Result", "result", ",", "Set", "<", "ProgrammingExerciseTestCase", ">", "successfulTestCases", ",", "Set", "<", "ProgrammingExerciseTestCase", ">", "allTests", ",", "List", "<", "Feedback", ">", "scaFeedback", ",", "ProgrammingExercise", "exercise", ",", "boolean", "hasDuplicateTestCases", ")", "{", "if", "(", "hasDuplicateTestCases", ")", "{", "result", ".", "setResultString", "(", "\"Error: Found duplicated tests!\"", ")", ";", "}", "else", "{", "String", "newResultString", "=", "successfulTestCases", ".", "size", "(", ")", "+", "\" of \"", "+", "allTests", ".", "size", "(", ")", "+", "\" passed\"", ";", "if", "(", "Boolean", ".", "TRUE", ".", "equals", "(", "exercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", ")", ")", "{", "String", "issueTerm", "=", "scaFeedback", ".", "size", "(", ")", "==", "1", "?", "\", 1 issue\"", ":", "\", \"", "+", "scaFeedback", ".", "size", "(", ")", "+", "\" issues\"", ";", "newResultString", "+=", "issueTerm", ";", "}", "if", "(", "result", ".", "isManual", "(", ")", ")", "{", "newResultString", "=", "updateManualResultString", "(", "newResultString", ",", "result", ",", "exercise", ")", ";", "}", "result", ".", "setResultString", "(", "newResultString", ")", ";", "}", "}" ]
Update the result's result string given the successful tests vs. all tests (x of y passed).
[ "Update", "the", "result", "'", "s", "result", "string", "given", "the", "successful", "tests", "vs", ".", "all", "tests", "(", "x", "of", "y", "passed", ")", "." ]
[ "// Create a new result string that reflects passed, failed & not executed test cases.", "// Show number of found quality issues if static code analysis is enabled" ]
[ { "param": "result", "type": "Result" }, { "param": "successfulTestCases", "type": "Set<ProgrammingExerciseTestCase>" }, { "param": "allTests", "type": "Set<ProgrammingExerciseTestCase>" }, { "param": "scaFeedback", "type": "List<Feedback>" }, { "param": "exercise", "type": "ProgrammingExercise" }, { "param": "hasDuplicateTestCases", "type": "boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "successfulTestCases", "type": "Set<ProgrammingExerciseTestCase>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "allTests", "type": "Set<ProgrammingExerciseTestCase>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "scaFeedback", "type": "List<Feedback>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "exercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "hasDuplicateTestCases", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 1089, 1253, 780, 12, 1253, 563, 16, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 6873, 4709, 30744, 16, 1000, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 777, 14650, 16, 987, 32, 15888, 34, 888, 69, 15888, 16, 203, 5411, 13586, 11987, 424, 20603, 24165, 16, 1250, 711, 11826, 4709, 30744, 13, 288, 203, 3639, 309, 261, 5332, 11826, 4709, 30744, 13, 288, 203, 5411, 563, 18, 542, 1253, 780, 2932, 668, 30, 10750, 16975, 7434, 4442, 1769, 203, 3639, 289, 203, 3639, 469, 288, 203, 5411, 368, 1788, 279, 394, 563, 533, 716, 3037, 87, 2275, 16, 2535, 473, 486, 7120, 1842, 6088, 18, 203, 5411, 514, 394, 1253, 780, 273, 6873, 4709, 30744, 18, 1467, 1435, 397, 315, 434, 315, 397, 777, 14650, 18, 1467, 1435, 397, 315, 2275, 14432, 203, 203, 5411, 368, 9674, 1300, 434, 1392, 9312, 8296, 309, 760, 981, 6285, 353, 3696, 203, 5411, 309, 261, 5507, 18, 18724, 18, 14963, 12, 8913, 30708, 18, 291, 5788, 1085, 9418, 1526, 1435, 3719, 288, 203, 7734, 514, 5672, 4065, 273, 888, 69, 15888, 18, 1467, 1435, 422, 404, 692, 3104, 404, 5672, 6, 294, 3104, 315, 397, 888, 69, 15888, 18, 1467, 1435, 397, 315, 8296, 14432, 203, 7734, 394, 1253, 780, 1011, 5672, 4065, 31, 203, 5411, 289, 203, 5411, 309, 261, 2088, 18, 291, 25139, 10756, 288, 203, 7734, 394, 1253, 780, 273, 1089, 25139, 1253, 780, 12, 2704, 1253, 780, 16, 563, 16, 24165, 1769, 203, 5411, 289, 203, 5411, 563, 18, 542, 1253, 780, 12, 2704, 1253, 780, 1769, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2315, 326, 563, 1807, 563, 533, 864, 326, 6873, 7434, 6195, 18, 777, 7434, 261, 92, 434, 677, 2275, 2934, 203, 377, 380, 203, 377, 380, 632, 891, 563, 7734, 434, 326, 1361, 1086, 18, 203, 377, 380, 632, 891, 6873, 4709, 30744, 282, 1842, 6088, 598, 6895, 10762, 18, 203, 377, 380, 632, 891, 777, 14650, 2868, 434, 326, 864, 5402, 11987, 24165, 18, 203, 377, 380, 632, 891, 888, 69, 15888, 6647, 364, 326, 563, 203, 377, 380, 632, 891, 24165, 2868, 358, 1492, 333, 563, 471, 326, 1842, 6088, 10957, 203, 377, 380, 632, 891, 711, 11826, 4709, 30744, 8527, 6751, 1842, 6088, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
updateManualResultString
String
private String updateManualResultString(String resultString, Result result, ProgrammingExercise exercise) { // Calculate different scores for totalScore calculation and add points and maxScore to result string double maxScore = exercise.getMaxPoints(); double points = programmingAssessmentService.calculateTotalScore(result); result.setScore(points, maxScore); return resultString + ", " + result.createResultString(points, maxScore); }
/** * Update the result string of a manual result with the achieved points. * @param resultString The automatic part of the result string * @param result The result to add the result string * @param exercise The programming exercise * @return The updated result string */
Update the result string of a manual result with the achieved points. @param resultString The automatic part of the result string @param result The result to add the result string @param exercise The programming exercise @return The updated result string
[ "Update", "the", "result", "string", "of", "a", "manual", "result", "with", "the", "achieved", "points", ".", "@param", "resultString", "The", "automatic", "part", "of", "the", "result", "string", "@param", "result", "The", "result", "to", "add", "the", "result", "string", "@param", "exercise", "The", "programming", "exercise", "@return", "The", "updated", "result", "string" ]
private String updateManualResultString(String resultString, Result result, ProgrammingExercise exercise) { double maxScore = exercise.getMaxPoints(); double points = programmingAssessmentService.calculateTotalScore(result); result.setScore(points, maxScore); return resultString + ", " + result.createResultString(points, maxScore); }
[ "private", "String", "updateManualResultString", "(", "String", "resultString", ",", "Result", "result", ",", "ProgrammingExercise", "exercise", ")", "{", "double", "maxScore", "=", "exercise", ".", "getMaxPoints", "(", ")", ";", "double", "points", "=", "programmingAssessmentService", ".", "calculateTotalScore", "(", "result", ")", ";", "result", ".", "setScore", "(", "points", ",", "maxScore", ")", ";", "return", "resultString", "+", "\", \"", "+", "result", ".", "createResultString", "(", "points", ",", "maxScore", ")", ";", "}" ]
Update the result string of a manual result with the achieved points.
[ "Update", "the", "result", "string", "of", "a", "manual", "result", "with", "the", "achieved", "points", "." ]
[ "// Calculate different scores for totalScore calculation and add points and maxScore to result string" ]
[ { "param": "resultString", "type": "String" }, { "param": "result", "type": "Result" }, { "param": "exercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "resultString", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "exercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 514, 1089, 25139, 1253, 780, 12, 780, 563, 780, 16, 3438, 563, 16, 13586, 11987, 424, 20603, 24165, 13, 288, 203, 3639, 368, 9029, 3775, 8474, 364, 2078, 7295, 11096, 471, 527, 3143, 471, 943, 7295, 358, 563, 533, 203, 3639, 1645, 943, 7295, 273, 24165, 18, 588, 2747,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, 563, 358, 527, 326, 563, 533, 203, 377, 380, 632, 891, 24165, 1021, 5402, 11987, 24165, 203, 377, 380, 632, 2463, 1021, 3526, 563, 533, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
removeAllTestCaseFeedbackAndSetScoreToZero
null
private void removeAllTestCaseFeedbackAndSetScoreToZero(Result result, List<Feedback> staticCodeAnalysisFeedback) { result.setFeedbacks(staticCodeAnalysisFeedback); result.hasFeedback(staticCodeAnalysisFeedback.size() > 0); result.setScore(0D); }
/** * Remove all test case feedback information from a result and treat it as if it has a score of 0. * @param result Result containing all feedback * @param staticCodeAnalysisFeedback Static code analysis feedback to keep */
Remove all test case feedback information from a result and treat it as if it has a score of 0. @param result Result containing all feedback @param staticCodeAnalysisFeedback Static code analysis feedback to keep
[ "Remove", "all", "test", "case", "feedback", "information", "from", "a", "result", "and", "treat", "it", "as", "if", "it", "has", "a", "score", "of", "0", ".", "@param", "result", "Result", "containing", "all", "feedback", "@param", "staticCodeAnalysisFeedback", "Static", "code", "analysis", "feedback", "to", "keep" ]
private void removeAllTestCaseFeedbackAndSetScoreToZero(Result result, List<Feedback> staticCodeAnalysisFeedback) { result.setFeedbacks(staticCodeAnalysisFeedback); result.hasFeedback(staticCodeAnalysisFeedback.size() > 0); result.setScore(0D); }
[ "private", "void", "removeAllTestCaseFeedbackAndSetScoreToZero", "(", "Result", "result", ",", "List", "<", "Feedback", ">", "staticCodeAnalysisFeedback", ")", "{", "result", ".", "setFeedbacks", "(", "staticCodeAnalysisFeedback", ")", ";", "result", ".", "hasFeedback", "(", "staticCodeAnalysisFeedback", ".", "size", "(", ")", ">", "0", ")", ";", "result", ".", "setScore", "(", "0D", ")", ";", "}" ]
Remove all test case feedback information from a result and treat it as if it has a score of 0.
[ "Remove", "all", "test", "case", "feedback", "information", "from", "a", "result", "and", "treat", "it", "as", "if", "it", "has", "a", "score", "of", "0", "." ]
[]
[ { "param": "result", "type": "Result" }, { "param": "staticCodeAnalysisFeedback", "type": "List<Feedback>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "staticCodeAnalysisFeedback", "type": "List<Feedback>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 12787, 4709, 2449, 15888, 13152, 7295, 774, 7170, 12, 1253, 563, 16, 987, 32, 15888, 34, 760, 1085, 9418, 15888, 13, 288, 203, 3639, 563, 18, 542, 15888, 87, 12, 3845, 1085, 9418, 15888, 1769, 203, 3639, 563, 18, 5332, 15888, 12, 3845, 1085, 9418, 15888, 18, 1467, 1435, 405, 374, 1769, 203, 3639, 563, 18, 542, 7295, 12, 20, 40, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 3581, 777, 1842, 648, 10762, 1779, 628, 279, 563, 471, 10116, 518, 487, 309, 518, 711, 279, 4462, 434, 374, 18, 203, 377, 380, 632, 891, 563, 3438, 4191, 777, 10762, 203, 377, 380, 632, 891, 760, 1085, 9418, 15888, 10901, 981, 6285, 10762, 358, 3455, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
isSuccessful
null
private Predicate<ProgrammingExerciseTestCase> isSuccessful(Result result) { // We need to compare testcases via lowercase, because the testcaseRepository is case-insensitive return testCase -> result.getFeedbacks().stream() .anyMatch(feedback -> feedback.getText() != null && feedback.getText().equalsIgnoreCase(testCase.getTestName()) && Boolean.TRUE.equals(feedback.isPositive())); }
/** * Check if the provided test was found in the result's feedbacks with positive = true. * @param result of the build run. * @return true if there is a positive feedback for a given test. */
Check if the provided test was found in the result's feedbacks with positive = true. @param result of the build run. @return true if there is a positive feedback for a given test.
[ "Check", "if", "the", "provided", "test", "was", "found", "in", "the", "result", "'", "s", "feedbacks", "with", "positive", "=", "true", ".", "@param", "result", "of", "the", "build", "run", ".", "@return", "true", "if", "there", "is", "a", "positive", "feedback", "for", "a", "given", "test", "." ]
private Predicate<ProgrammingExerciseTestCase> isSuccessful(Result result) { return testCase -> result.getFeedbacks().stream() .anyMatch(feedback -> feedback.getText() != null && feedback.getText().equalsIgnoreCase(testCase.getTestName()) && Boolean.TRUE.equals(feedback.isPositive())); }
[ "private", "Predicate", "<", "ProgrammingExerciseTestCase", ">", "isSuccessful", "(", "Result", "result", ")", "{", "return", "testCase", "->", "result", ".", "getFeedbacks", "(", ")", ".", "stream", "(", ")", ".", "anyMatch", "(", "feedback", "->", "feedback", ".", "getText", "(", ")", "!=", "null", "&&", "feedback", ".", "getText", "(", ")", ".", "equalsIgnoreCase", "(", "testCase", ".", "getTestName", "(", ")", ")", "&&", "Boolean", ".", "TRUE", ".", "equals", "(", "feedback", ".", "isPositive", "(", ")", ")", ")", ";", "}" ]
Check if the provided test was found in the result's feedbacks with positive = true.
[ "Check", "if", "the", "provided", "test", "was", "found", "in", "the", "result", "'", "s", "feedbacks", "with", "positive", "=", "true", "." ]
[ "// We need to compare testcases via lowercase, because the testcaseRepository is case-insensitive" ]
[ { "param": "result", "type": "Result" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 10202, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 25250, 12, 1253, 563, 13, 288, 203, 3639, 368, 1660, 1608, 358, 3400, 1842, 22186, 3970, 12400, 16, 2724, 326, 1842, 3593, 3305, 353, 648, 17, 31940, 203, 3639, 327, 1842, 2449, 317, 563, 18, 588, 15888, 87, 7675, 3256, 1435, 203, 7734, 263, 2273, 2060, 12, 12571, 317, 10762, 18, 588, 1528, 1435, 480, 446, 597, 10762, 18, 588, 1528, 7675, 14963, 5556, 12, 3813, 2449, 18, 588, 4709, 461, 10756, 597, 3411, 18, 18724, 18, 14963, 12, 12571, 18, 291, 14900, 1435, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2073, 309, 326, 2112, 1842, 1703, 1392, 316, 326, 563, 1807, 10762, 87, 598, 6895, 273, 638, 18, 203, 377, 380, 632, 891, 563, 434, 326, 1361, 1086, 18, 203, 377, 380, 632, 2463, 638, 309, 1915, 353, 279, 6895, 10762, 364, 279, 864, 1842, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
wasNotExecuted
null
private Predicate<ProgrammingExerciseTestCase> wasNotExecuted(Result result) { // We need to compare testcases via lowercase, because the testcaseRepository is case-insensitive return testCase -> result.getFeedbacks().stream() .noneMatch(feedback -> feedback.getType() == FeedbackType.AUTOMATIC && feedback.getText().equalsIgnoreCase(testCase.getTestName())); }
/** * Check if the provided test was not found in the result's feedbacks. * @param result of the build run. * @return true if there is no feedback for a given test. */
Check if the provided test was not found in the result's feedbacks. @param result of the build run. @return true if there is no feedback for a given test.
[ "Check", "if", "the", "provided", "test", "was", "not", "found", "in", "the", "result", "'", "s", "feedbacks", ".", "@param", "result", "of", "the", "build", "run", ".", "@return", "true", "if", "there", "is", "no", "feedback", "for", "a", "given", "test", "." ]
private Predicate<ProgrammingExerciseTestCase> wasNotExecuted(Result result) { return testCase -> result.getFeedbacks().stream() .noneMatch(feedback -> feedback.getType() == FeedbackType.AUTOMATIC && feedback.getText().equalsIgnoreCase(testCase.getTestName())); }
[ "private", "Predicate", "<", "ProgrammingExerciseTestCase", ">", "wasNotExecuted", "(", "Result", "result", ")", "{", "return", "testCase", "->", "result", ".", "getFeedbacks", "(", ")", ".", "stream", "(", ")", ".", "noneMatch", "(", "feedback", "->", "feedback", ".", "getType", "(", ")", "==", "FeedbackType", ".", "AUTOMATIC", "&&", "feedback", ".", "getText", "(", ")", ".", "equalsIgnoreCase", "(", "testCase", ".", "getTestName", "(", ")", ")", ")", ";", "}" ]
Check if the provided test was not found in the result's feedbacks.
[ "Check", "if", "the", "provided", "test", "was", "not", "found", "in", "the", "result", "'", "s", "feedbacks", "." ]
[ "// We need to compare testcases via lowercase, because the testcaseRepository is case-insensitive" ]
[ { "param": "result", "type": "Result" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "result", "type": "Result", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 10202, 32, 9459, 11987, 424, 20603, 4709, 2449, 34, 1703, 1248, 23839, 12, 1253, 563, 13, 288, 203, 3639, 368, 1660, 1608, 358, 3400, 1842, 22186, 3970, 12400, 16, 2724, 326, 1842, 3593, 3305, 353, 648, 17, 31940, 203, 3639, 327, 1842, 2449, 317, 563, 18, 588, 15888, 87, 7675, 3256, 1435, 203, 7734, 263, 6102, 2060, 12, 12571, 317, 10762, 18, 588, 559, 1435, 422, 14013, 823, 559, 18, 37, 1693, 1872, 11781, 597, 10762, 18, 588, 1528, 7675, 14963, 5556, 12, 3813, 2449, 18, 588, 4709, 461, 1435, 10019, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2073, 309, 326, 2112, 1842, 1703, 486, 1392, 316, 326, 563, 1807, 10762, 87, 18, 203, 377, 380, 632, 891, 563, 434, 326, 1361, 1086, 18, 203, 377, 380, 632, 2463, 638, 309, 1915, 353, 1158, 10762, 364, 279, 864, 1842, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
generateGradingStatistics
ProgrammingExerciseGradingStatisticsDTO
public ProgrammingExerciseGradingStatisticsDTO generateGradingStatistics(Long exerciseId) { var statistics = new ProgrammingExerciseGradingStatisticsDTO(); var results = resultRepository.findLatestAutomaticResultsWithEagerFeedbacksForExercise(exerciseId); statistics.setNumParticipations(results.size()); var testCases = testCaseService.findByExerciseId(exerciseId); var categories = staticCodeAnalysisService.findByExerciseId(exerciseId); // number of passed and failed tests per test case var testCaseStatsMap = new HashMap<String, ProgrammingExerciseGradingStatisticsDTO.TestCaseStats>(); // number of students per amount of detected issues per category var categoryIssuesStudentsMap = new HashMap<String, Map<Integer, Integer>>(); // init for each test case for (var testCase : testCases) { testCaseStatsMap.put(testCase.getTestName(), new ProgrammingExerciseGradingStatisticsDTO.TestCaseStats(0, 0)); } // init for each category for (var category : categories) { categoryIssuesStudentsMap.put(category.getName(), new HashMap<>()); } for (var result : results) { // number of detected issues per category for this result var categoryIssuesMap = new HashMap<String, Integer>(); for (var feedback : result.getFeedbacks()) { // analyse the feedback and add to the statistics addFeedbackToStatistics(feedback, categoryIssuesMap, testCaseStatsMap); } // merge the student specific issue map with the overall students issue map mergeCategoryIssuesMaps(categoryIssuesStudentsMap, categoryIssuesMap); } statistics.setTestCaseStatsMap(testCaseStatsMap); statistics.setCategoryIssuesMap(categoryIssuesStudentsMap); return statistics; }
/** * Calculates the statistics for the grading page. * @param exerciseId The current exercise * @return The statistics object */
Calculates the statistics for the grading page. @param exerciseId The current exercise @return The statistics object
[ "Calculates", "the", "statistics", "for", "the", "grading", "page", ".", "@param", "exerciseId", "The", "current", "exercise", "@return", "The", "statistics", "object" ]
public ProgrammingExerciseGradingStatisticsDTO generateGradingStatistics(Long exerciseId) { var statistics = new ProgrammingExerciseGradingStatisticsDTO(); var results = resultRepository.findLatestAutomaticResultsWithEagerFeedbacksForExercise(exerciseId); statistics.setNumParticipations(results.size()); var testCases = testCaseService.findByExerciseId(exerciseId); var categories = staticCodeAnalysisService.findByExerciseId(exerciseId); var testCaseStatsMap = new HashMap<String, ProgrammingExerciseGradingStatisticsDTO.TestCaseStats>(); var categoryIssuesStudentsMap = new HashMap<String, Map<Integer, Integer>>(); for (var testCase : testCases) { testCaseStatsMap.put(testCase.getTestName(), new ProgrammingExerciseGradingStatisticsDTO.TestCaseStats(0, 0)); } for (var category : categories) { categoryIssuesStudentsMap.put(category.getName(), new HashMap<>()); } for (var result : results) { var categoryIssuesMap = new HashMap<String, Integer>(); for (var feedback : result.getFeedbacks()) { addFeedbackToStatistics(feedback, categoryIssuesMap, testCaseStatsMap); } mergeCategoryIssuesMaps(categoryIssuesStudentsMap, categoryIssuesMap); } statistics.setTestCaseStatsMap(testCaseStatsMap); statistics.setCategoryIssuesMap(categoryIssuesStudentsMap); return statistics; }
[ "public", "ProgrammingExerciseGradingStatisticsDTO", "generateGradingStatistics", "(", "Long", "exerciseId", ")", "{", "var", "statistics", "=", "new", "ProgrammingExerciseGradingStatisticsDTO", "(", ")", ";", "var", "results", "=", "resultRepository", ".", "findLatestAutomaticResultsWithEagerFeedbacksForExercise", "(", "exerciseId", ")", ";", "statistics", ".", "setNumParticipations", "(", "results", ".", "size", "(", ")", ")", ";", "var", "testCases", "=", "testCaseService", ".", "findByExerciseId", "(", "exerciseId", ")", ";", "var", "categories", "=", "staticCodeAnalysisService", ".", "findByExerciseId", "(", "exerciseId", ")", ";", "var", "testCaseStatsMap", "=", "new", "HashMap", "<", "String", ",", "ProgrammingExerciseGradingStatisticsDTO", ".", "TestCaseStats", ">", "(", ")", ";", "var", "categoryIssuesStudentsMap", "=", "new", "HashMap", "<", "String", ",", "Map", "<", "Integer", ",", "Integer", ">", ">", "(", ")", ";", "for", "(", "var", "testCase", ":", "testCases", ")", "{", "testCaseStatsMap", ".", "put", "(", "testCase", ".", "getTestName", "(", ")", ",", "new", "ProgrammingExerciseGradingStatisticsDTO", ".", "TestCaseStats", "(", "0", ",", "0", ")", ")", ";", "}", "for", "(", "var", "category", ":", "categories", ")", "{", "categoryIssuesStudentsMap", ".", "put", "(", "category", ".", "getName", "(", ")", ",", "new", "HashMap", "<", ">", "(", ")", ")", ";", "}", "for", "(", "var", "result", ":", "results", ")", "{", "var", "categoryIssuesMap", "=", "new", "HashMap", "<", "String", ",", "Integer", ">", "(", ")", ";", "for", "(", "var", "feedback", ":", "result", ".", "getFeedbacks", "(", ")", ")", "{", "addFeedbackToStatistics", "(", "feedback", ",", "categoryIssuesMap", ",", "testCaseStatsMap", ")", ";", "}", "mergeCategoryIssuesMaps", "(", "categoryIssuesStudentsMap", ",", "categoryIssuesMap", ")", ";", "}", "statistics", ".", "setTestCaseStatsMap", "(", "testCaseStatsMap", ")", ";", "statistics", ".", "setCategoryIssuesMap", "(", "categoryIssuesStudentsMap", ")", ";", "return", "statistics", ";", "}" ]
Calculates the statistics for the grading page.
[ "Calculates", "the", "statistics", "for", "the", "grading", "page", "." ]
[ "// number of passed and failed tests per test case", "// number of students per amount of detected issues per category", "// init for each test case", "// init for each category", "// number of detected issues per category for this result", "// analyse the feedback and add to the statistics", "// merge the student specific issue map with the overall students issue map" ]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 13586, 11987, 424, 20603, 30420, 310, 8569, 19792, 2103, 30420, 310, 8569, 12, 3708, 24165, 548, 13, 288, 203, 3639, 569, 7691, 273, 394, 13586, 11987, 424, 20603, 30420, 310, 8569, 19792, 5621, 203, 203, 3639, 569, 1686, 273, 563, 3305, 18, 4720, 18650, 7150, 4941, 3447, 1190, 41, 6817, 15888, 28388, 424, 20603, 12, 8913, 30708, 548, 1769, 203, 203, 3639, 7691, 18, 542, 2578, 1988, 24629, 1012, 12, 4717, 18, 1467, 10663, 203, 203, 3639, 569, 1842, 30744, 273, 1842, 2449, 1179, 18, 4720, 858, 424, 20603, 548, 12, 8913, 30708, 548, 1769, 203, 3639, 569, 6477, 273, 760, 1085, 9418, 1179, 18, 4720, 858, 424, 20603, 548, 12, 8913, 30708, 548, 1769, 203, 203, 3639, 368, 1300, 434, 2275, 471, 2535, 7434, 1534, 1842, 648, 203, 3639, 569, 1842, 2449, 4195, 863, 273, 394, 4317, 32, 780, 16, 13586, 11987, 424, 20603, 30420, 310, 8569, 19792, 18, 4709, 2449, 4195, 34, 5621, 203, 203, 3639, 368, 1300, 434, 10068, 4877, 1534, 3844, 434, 8316, 8296, 1534, 3150, 203, 3639, 569, 3150, 17316, 19943, 4877, 863, 273, 394, 4317, 32, 780, 16, 1635, 32, 4522, 16, 2144, 9778, 5621, 203, 203, 3639, 368, 1208, 364, 1517, 1842, 648, 203, 3639, 364, 261, 1401, 1842, 2449, 294, 1842, 30744, 13, 288, 203, 5411, 1842, 2449, 4195, 863, 18, 458, 12, 3813, 2449, 18, 588, 4709, 461, 9334, 394, 13586, 11987, 424, 20603, 30420, 310, 8569, 19792, 18, 4709, 2449, 4195, 12, 20, 16, 374, 10019, 203, 3639, 289, 203, 203, 3639, 368, 1208, 364, 1517, 3150, 203, 3639, 364, 261, 1401, 3150, 294, 6477, 13, 288, 203, 5411, 3150, 17316, 19943, 4877, 863, 18, 458, 12, 4743, 18, 17994, 9334, 394, 4317, 29667, 10663, 203, 3639, 289, 203, 203, 3639, 364, 261, 1401, 563, 294, 1686, 13, 288, 203, 203, 5411, 368, 1300, 434, 8316, 8296, 1534, 3150, 364, 333, 563, 203, 5411, 569, 3150, 17316, 863, 273, 394, 4317, 32, 780, 16, 2144, 34, 5621, 203, 203, 5411, 364, 261, 1401, 10762, 294, 563, 18, 588, 15888, 87, 10756, 288, 203, 7734, 368, 31087, 326, 10762, 471, 527, 358, 326, 7691, 203, 7734, 527, 15888, 774, 8569, 12, 12571, 16, 3150, 17316, 863, 16, 1842, 2449, 4195, 863, 1769, 203, 5411, 289, 203, 203, 5411, 368, 2691, 326, 18110, 2923, 5672, 852, 598, 326, 13914, 10068, 4877, 5672, 852, 203, 5411, 2691, 4457, 17316, 8903, 12, 4743, 17316, 19943, 4877, 863, 16, 3150, 17316, 863, 1769, 203, 3639, 289, 203, 203, 3639, 7691, 18, 542, 4709, 2449, 4195, 863, 12, 3813, 2449, 4195, 863, 1769, 203, 3639, 7691, 18, 542, 4457, 17316, 863, 12, 4743, 17316, 19943, 4877, 863, 1769, 203, 203, 3639, 327, 7691, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
mergeCategoryIssuesMaps
null
private void mergeCategoryIssuesMaps(Map<String, Map<Integer, Integer>> categoryIssuesStudentsMap, Map<String, Integer> categoryIssuesMap) { for (var entry : categoryIssuesMap.entrySet()) { // key: category, value: number of issues if (categoryIssuesStudentsMap.containsKey(entry.getKey())) { var issuesStudentsMap = categoryIssuesStudentsMap.get(entry.getKey()); // add 1 to the number of students for the category & issues if (issuesStudentsMap.containsKey(entry.getValue())) { issuesStudentsMap.merge(entry.getValue(), 1, Integer::sum); } else { issuesStudentsMap.put(entry.getValue(), 1); } } else { // create a new issues map for this category var issuesStudentsMap = new HashMap<Integer, Integer>(); issuesStudentsMap.put(entry.getValue(), 1); categoryIssuesStudentsMap.put(entry.getKey(), issuesStudentsMap); } } }
/** * Merge the result issues map with the overall issues map * @param categoryIssuesStudentsMap The overall issues map for all students * @param categoryIssuesMap The issues map for one students */
Merge the result issues map with the overall issues map @param categoryIssuesStudentsMap The overall issues map for all students @param categoryIssuesMap The issues map for one students
[ "Merge", "the", "result", "issues", "map", "with", "the", "overall", "issues", "map", "@param", "categoryIssuesStudentsMap", "The", "overall", "issues", "map", "for", "all", "students", "@param", "categoryIssuesMap", "The", "issues", "map", "for", "one", "students" ]
private void mergeCategoryIssuesMaps(Map<String, Map<Integer, Integer>> categoryIssuesStudentsMap, Map<String, Integer> categoryIssuesMap) { for (var entry : categoryIssuesMap.entrySet()) { if (categoryIssuesStudentsMap.containsKey(entry.getKey())) { var issuesStudentsMap = categoryIssuesStudentsMap.get(entry.getKey()); if (issuesStudentsMap.containsKey(entry.getValue())) { issuesStudentsMap.merge(entry.getValue(), 1, Integer::sum); } else { issuesStudentsMap.put(entry.getValue(), 1); } } else { var issuesStudentsMap = new HashMap<Integer, Integer>(); issuesStudentsMap.put(entry.getValue(), 1); categoryIssuesStudentsMap.put(entry.getKey(), issuesStudentsMap); } } }
[ "private", "void", "mergeCategoryIssuesMaps", "(", "Map", "<", "String", ",", "Map", "<", "Integer", ",", "Integer", ">", ">", "categoryIssuesStudentsMap", ",", "Map", "<", "String", ",", "Integer", ">", "categoryIssuesMap", ")", "{", "for", "(", "var", "entry", ":", "categoryIssuesMap", ".", "entrySet", "(", ")", ")", "{", "if", "(", "categoryIssuesStudentsMap", ".", "containsKey", "(", "entry", ".", "getKey", "(", ")", ")", ")", "{", "var", "issuesStudentsMap", "=", "categoryIssuesStudentsMap", ".", "get", "(", "entry", ".", "getKey", "(", ")", ")", ";", "if", "(", "issuesStudentsMap", ".", "containsKey", "(", "entry", ".", "getValue", "(", ")", ")", ")", "{", "issuesStudentsMap", ".", "merge", "(", "entry", ".", "getValue", "(", ")", ",", "1", ",", "Integer", "::", "sum", ")", ";", "}", "else", "{", "issuesStudentsMap", ".", "put", "(", "entry", ".", "getValue", "(", ")", ",", "1", ")", ";", "}", "}", "else", "{", "var", "issuesStudentsMap", "=", "new", "HashMap", "<", "Integer", ",", "Integer", ">", "(", ")", ";", "issuesStudentsMap", ".", "put", "(", "entry", ".", "getValue", "(", ")", ",", "1", ")", ";", "categoryIssuesStudentsMap", ".", "put", "(", "entry", ".", "getKey", "(", ")", ",", "issuesStudentsMap", ")", ";", "}", "}", "}" ]
Merge the result issues map with the overall issues map @param categoryIssuesStudentsMap The overall issues map for all students @param categoryIssuesMap The issues map for one students
[ "Merge", "the", "result", "issues", "map", "with", "the", "overall", "issues", "map", "@param", "categoryIssuesStudentsMap", "The", "overall", "issues", "map", "for", "all", "students", "@param", "categoryIssuesMap", "The", "issues", "map", "for", "one", "students" ]
[ "// key: category, value: number of issues", "// add 1 to the number of students for the category & issues", "// create a new issues map for this category" ]
[ { "param": "categoryIssuesStudentsMap", "type": "Map<String, Map<Integer, Integer>>" }, { "param": "categoryIssuesMap", "type": "Map<String, Integer>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "categoryIssuesStudentsMap", "type": "Map<String, Map<Integer, Integer>>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "categoryIssuesMap", "type": "Map<String, Integer>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 2691, 4457, 17316, 8903, 12, 863, 32, 780, 16, 1635, 32, 4522, 16, 2144, 9778, 3150, 17316, 19943, 4877, 863, 16, 1635, 32, 780, 16, 2144, 34, 3150, 17316, 863, 13, 288, 203, 3639, 364, 261, 1401, 1241, 294, 3150, 17316, 863, 18, 4099, 694, 10756, 288, 203, 5411, 368, 498, 30, 3150, 16, 460, 30, 1300, 434, 8296, 203, 203, 5411, 309, 261, 4743, 17316, 19943, 4877, 863, 18, 12298, 653, 12, 4099, 18, 588, 653, 1435, 3719, 288, 203, 7734, 569, 8296, 19943, 4877, 863, 273, 3150, 17316, 19943, 4877, 863, 18, 588, 12, 4099, 18, 588, 653, 10663, 203, 7734, 368, 527, 404, 358, 326, 1300, 434, 10068, 4877, 364, 326, 3150, 473, 8296, 203, 7734, 309, 261, 9618, 19943, 4877, 863, 18, 12298, 653, 12, 4099, 18, 24805, 1435, 3719, 288, 203, 10792, 8296, 19943, 4877, 863, 18, 2702, 12, 4099, 18, 24805, 9334, 404, 16, 2144, 2866, 1364, 1769, 203, 7734, 289, 203, 7734, 469, 288, 203, 10792, 8296, 19943, 4877, 863, 18, 458, 12, 4099, 18, 24805, 9334, 404, 1769, 203, 7734, 289, 203, 5411, 289, 203, 5411, 469, 288, 203, 7734, 368, 752, 279, 394, 8296, 852, 364, 333, 3150, 203, 7734, 569, 8296, 19943, 4877, 863, 273, 394, 4317, 32, 4522, 16, 2144, 34, 5621, 203, 7734, 8296, 19943, 4877, 863, 18, 458, 12, 4099, 18, 24805, 9334, 404, 1769, 203, 7734, 3150, 17316, 19943, 4877, 863, 18, 458, 12, 4099, 18, 588, 653, 9334, 8296, 19943, 4877, 863, 1769, 203, 5411, 289, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 8964, 326, 563, 8296, 852, 598, 326, 13914, 8296, 852, 203, 377, 380, 632, 891, 3150, 17316, 19943, 4877, 863, 1021, 13914, 8296, 852, 364, 777, 10068, 4877, 203, 377, 380, 632, 891, 3150, 17316, 863, 1021, 8296, 852, 364, 1245, 10068, 4877, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
78f9eb09e9e442c89b5ef6f1804b151532e3b8f4
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseGradingService.java
[ "MIT" ]
Java
addFeedbackToStatistics
null
private void addFeedbackToStatistics(Feedback feedback, Map<String, Integer> categoryIssuesMap, Map<String, ProgrammingExerciseGradingStatisticsDTO.TestCaseStats> testCaseStatsMap) { if (feedback.isStaticCodeAnalysisFeedback()) { // sca feedback var categoryName = feedback.getText().substring(Feedback.STATIC_CODE_ANALYSIS_FEEDBACK_IDENTIFIER.length()); if ("".equals(categoryName)) { return; // this feedback belongs to no category } // add 1 to the issues for this category if (categoryIssuesMap.containsKey(categoryName)) { categoryIssuesMap.merge(categoryName, 1, Integer::sum); } else { categoryIssuesMap.put(categoryName, 1); } } else if (feedback.getType().equals(FeedbackType.AUTOMATIC)) { // test case feedback var testName = feedback.getText(); // add 1 to the passed or failed amount for this test case // dependant on the positive flag of the feedback if (testCaseStatsMap.containsKey(testName)) { if (Boolean.TRUE.equals(feedback.isPositive())) { testCaseStatsMap.get(testName).increaseNumPassed(); } else { testCaseStatsMap.get(testName).increaseNumFailed(); } } else { testCaseStatsMap.put(testName, new ProgrammingExerciseGradingStatisticsDTO.TestCaseStats(feedback.isPositive() ? 1 : 0, feedback.isPositive() ? 0 : 1)); } } }
/** * Analyses the feedback and updates the statistics maps * @param feedback The given feedback object * @param categoryIssuesMap The issues map for sca statistics * @param testCaseStatsMap The map for test case statistics */
Analyses the feedback and updates the statistics maps @param feedback The given feedback object @param categoryIssuesMap The issues map for sca statistics @param testCaseStatsMap The map for test case statistics
[ "Analyses", "the", "feedback", "and", "updates", "the", "statistics", "maps", "@param", "feedback", "The", "given", "feedback", "object", "@param", "categoryIssuesMap", "The", "issues", "map", "for", "sca", "statistics", "@param", "testCaseStatsMap", "The", "map", "for", "test", "case", "statistics" ]
private void addFeedbackToStatistics(Feedback feedback, Map<String, Integer> categoryIssuesMap, Map<String, ProgrammingExerciseGradingStatisticsDTO.TestCaseStats> testCaseStatsMap) { if (feedback.isStaticCodeAnalysisFeedback()) { var categoryName = feedback.getText().substring(Feedback.STATIC_CODE_ANALYSIS_FEEDBACK_IDENTIFIER.length()); if ("".equals(categoryName)) { return; } if (categoryIssuesMap.containsKey(categoryName)) { categoryIssuesMap.merge(categoryName, 1, Integer::sum); } else { categoryIssuesMap.put(categoryName, 1); } } else if (feedback.getType().equals(FeedbackType.AUTOMATIC)) { var testName = feedback.getText(); if (testCaseStatsMap.containsKey(testName)) { if (Boolean.TRUE.equals(feedback.isPositive())) { testCaseStatsMap.get(testName).increaseNumPassed(); } else { testCaseStatsMap.get(testName).increaseNumFailed(); } } else { testCaseStatsMap.put(testName, new ProgrammingExerciseGradingStatisticsDTO.TestCaseStats(feedback.isPositive() ? 1 : 0, feedback.isPositive() ? 0 : 1)); } } }
[ "private", "void", "addFeedbackToStatistics", "(", "Feedback", "feedback", ",", "Map", "<", "String", ",", "Integer", ">", "categoryIssuesMap", ",", "Map", "<", "String", ",", "ProgrammingExerciseGradingStatisticsDTO", ".", "TestCaseStats", ">", "testCaseStatsMap", ")", "{", "if", "(", "feedback", ".", "isStaticCodeAnalysisFeedback", "(", ")", ")", "{", "var", "categoryName", "=", "feedback", ".", "getText", "(", ")", ".", "substring", "(", "Feedback", ".", "STATIC_CODE_ANALYSIS_FEEDBACK_IDENTIFIER", ".", "length", "(", ")", ")", ";", "if", "(", "\"\"", ".", "equals", "(", "categoryName", ")", ")", "{", "return", ";", "}", "if", "(", "categoryIssuesMap", ".", "containsKey", "(", "categoryName", ")", ")", "{", "categoryIssuesMap", ".", "merge", "(", "categoryName", ",", "1", ",", "Integer", "::", "sum", ")", ";", "}", "else", "{", "categoryIssuesMap", ".", "put", "(", "categoryName", ",", "1", ")", ";", "}", "}", "else", "if", "(", "feedback", ".", "getType", "(", ")", ".", "equals", "(", "FeedbackType", ".", "AUTOMATIC", ")", ")", "{", "var", "testName", "=", "feedback", ".", "getText", "(", ")", ";", "if", "(", "testCaseStatsMap", ".", "containsKey", "(", "testName", ")", ")", "{", "if", "(", "Boolean", ".", "TRUE", ".", "equals", "(", "feedback", ".", "isPositive", "(", ")", ")", ")", "{", "testCaseStatsMap", ".", "get", "(", "testName", ")", ".", "increaseNumPassed", "(", ")", ";", "}", "else", "{", "testCaseStatsMap", ".", "get", "(", "testName", ")", ".", "increaseNumFailed", "(", ")", ";", "}", "}", "else", "{", "testCaseStatsMap", ".", "put", "(", "testName", ",", "new", "ProgrammingExerciseGradingStatisticsDTO", ".", "TestCaseStats", "(", "feedback", ".", "isPositive", "(", ")", "?", "1", ":", "0", ",", "feedback", ".", "isPositive", "(", ")", "?", "0", ":", "1", ")", ")", ";", "}", "}", "}" ]
Analyses the feedback and updates the statistics maps @param feedback The given feedback object @param categoryIssuesMap The issues map for sca statistics @param testCaseStatsMap The map for test case statistics
[ "Analyses", "the", "feedback", "and", "updates", "the", "statistics", "maps", "@param", "feedback", "The", "given", "feedback", "object", "@param", "categoryIssuesMap", "The", "issues", "map", "for", "sca", "statistics", "@param", "testCaseStatsMap", "The", "map", "for", "test", "case", "statistics" ]
[ "// sca feedback", "// this feedback belongs to no category", "// add 1 to the issues for this category", "// test case feedback", "// add 1 to the passed or failed amount for this test case", "// dependant on the positive flag of the feedback" ]
[ { "param": "feedback", "type": "Feedback" }, { "param": "categoryIssuesMap", "type": "Map<String, Integer>" }, { "param": "testCaseStatsMap", "type": "Map<String, ProgrammingExerciseGradingStatisticsDTO.TestCaseStats>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "feedback", "type": "Feedback", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "categoryIssuesMap", "type": "Map<String, Integer>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "testCaseStatsMap", "type": "Map<String, ProgrammingExerciseGradingStatisticsDTO.TestCaseStats>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 527, 15888, 774, 8569, 12, 15888, 10762, 16, 1635, 32, 780, 16, 2144, 34, 3150, 17316, 863, 16, 203, 5411, 1635, 32, 780, 16, 13586, 11987, 424, 20603, 30420, 310, 8569, 19792, 18, 4709, 2449, 4195, 34, 1842, 2449, 4195, 863, 13, 288, 203, 3639, 309, 261, 12571, 18, 291, 5788, 1085, 9418, 15888, 10756, 288, 203, 5411, 368, 888, 69, 10762, 203, 5411, 569, 3150, 461, 273, 10762, 18, 588, 1528, 7675, 28023, 12, 15888, 18, 22741, 67, 5572, 67, 1258, 19448, 15664, 67, 29195, 8720, 67, 16606, 18, 2469, 10663, 203, 5411, 309, 261, 3660, 18, 14963, 12, 4743, 461, 3719, 288, 203, 7734, 327, 31, 368, 333, 10762, 11081, 358, 1158, 3150, 203, 5411, 289, 203, 203, 5411, 368, 527, 404, 358, 326, 8296, 364, 333, 3150, 203, 5411, 309, 261, 4743, 17316, 863, 18, 12298, 653, 12, 4743, 461, 3719, 288, 203, 7734, 3150, 17316, 863, 18, 2702, 12, 4743, 461, 16, 404, 16, 2144, 2866, 1364, 1769, 203, 5411, 289, 203, 5411, 469, 288, 203, 7734, 3150, 17316, 863, 18, 458, 12, 4743, 461, 16, 404, 1769, 203, 5411, 289, 203, 203, 3639, 289, 203, 3639, 469, 309, 261, 12571, 18, 588, 559, 7675, 14963, 12, 15888, 559, 18, 37, 1693, 1872, 11781, 3719, 288, 203, 5411, 368, 1842, 648, 10762, 203, 5411, 569, 1842, 461, 273, 10762, 18, 588, 1528, 5621, 203, 203, 5411, 368, 527, 404, 358, 326, 2275, 578, 2535, 3844, 364, 333, 1842, 648, 203, 5411, 368, 2447, 970, 603, 326, 6895, 2982, 434, 326, 10762, 203, 5411, 309, 261, 3813, 2449, 4195, 863, 18, 12298, 653, 12, 3813, 461, 3719, 288, 203, 7734, 309, 261, 5507, 18, 18724, 18, 14963, 12, 12571, 18, 291, 14900, 1435, 3719, 288, 203, 10792, 1842, 2449, 4195, 863, 18, 588, 12, 3813, 461, 2934, 267, 11908, 2578, 22530, 5621, 203, 7734, 289, 203, 7734, 469, 288, 203, 10792, 1842, 2449, 4195, 863, 18, 588, 12, 3813, 461, 2934, 267, 11908, 2578, 2925, 5621, 203, 7734, 289, 203, 5411, 289, 203, 5411, 469, 288, 203, 7734, 1842, 2449, 4195, 863, 18, 458, 12, 3813, 461, 16, 394, 13586, 11987, 424, 20603, 30420, 310, 8569, 19792, 18, 4709, 2449, 4195, 12, 12571, 18, 291, 14900, 1435, 692, 404, 294, 374, 16, 10762, 18, 291, 14900, 1435, 692, 374, 294, 404, 10019, 203, 5411, 289, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 1922, 23723, 326, 10762, 471, 4533, 326, 7691, 7565, 203, 377, 380, 632, 891, 10762, 1021, 864, 10762, 733, 203, 377, 380, 632, 891, 3150, 17316, 863, 1021, 8296, 852, 364, 888, 69, 7691, 203, 377, 380, 632, 891, 1842, 2449, 4195, 863, 1021, 852, 364, 1842, 648, 7691, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
ff76ed18be905846e9f6cfd8a2d082572d28895f
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java
[ "MIT" ]
Java
scheduleNotificationForExercise
null
private void scheduleNotificationForExercise(Exercise exercise) { try { if (!SecurityUtils.isAuthenticated()) { SecurityUtils.setAuthorizationObject(); } scheduleService.scheduleTask(exercise, ExerciseLifecycle.RELEASE, () -> { groupNotificationService.notifyStudentAndTutorGroupAboutStartedExercise(exercise); }); log.debug("Scheduled notify about started exercise after due date for exercise '{}' (#{}) for {}.", exercise.getTitle(), exercise.getId(), exercise.getReleaseDate()); } catch (Exception exception) { log.error("Failed to schedule notification for exercise " + exercise.getId(), exception); } }
/** * The place where the actual tasks/methods are called/scheduled that should be run at the exercise release time * @param exercise which will be announced by a notifications at release date */
The place where the actual tasks/methods are called/scheduled that should be run at the exercise release time @param exercise which will be announced by a notifications at release date
[ "The", "place", "where", "the", "actual", "tasks", "/", "methods", "are", "called", "/", "scheduled", "that", "should", "be", "run", "at", "the", "exercise", "release", "time", "@param", "exercise", "which", "will", "be", "announced", "by", "a", "notifications", "at", "release", "date" ]
private void scheduleNotificationForExercise(Exercise exercise) { try { if (!SecurityUtils.isAuthenticated()) { SecurityUtils.setAuthorizationObject(); } scheduleService.scheduleTask(exercise, ExerciseLifecycle.RELEASE, () -> { groupNotificationService.notifyStudentAndTutorGroupAboutStartedExercise(exercise); }); log.debug("Scheduled notify about started exercise after due date for exercise '{}' (#{}) for {}.", exercise.getTitle(), exercise.getId(), exercise.getReleaseDate()); } catch (Exception exception) { log.error("Failed to schedule notification for exercise " + exercise.getId(), exception); } }
[ "private", "void", "scheduleNotificationForExercise", "(", "Exercise", "exercise", ")", "{", "try", "{", "if", "(", "!", "SecurityUtils", ".", "isAuthenticated", "(", ")", ")", "{", "SecurityUtils", ".", "setAuthorizationObject", "(", ")", ";", "}", "scheduleService", ".", "scheduleTask", "(", "exercise", ",", "ExerciseLifecycle", ".", "RELEASE", ",", "(", ")", "->", "{", "groupNotificationService", ".", "notifyStudentAndTutorGroupAboutStartedExercise", "(", "exercise", ")", ";", "}", ")", ";", "log", ".", "debug", "(", "\"Scheduled notify about started exercise after due date for exercise '{}' (#{}) for {}.\"", ",", "exercise", ".", "getTitle", "(", ")", ",", "exercise", ".", "getId", "(", ")", ",", "exercise", ".", "getReleaseDate", "(", ")", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "log", ".", "error", "(", "\"Failed to schedule notification for exercise \"", "+", "exercise", ".", "getId", "(", ")", ",", "exception", ")", ";", "}", "}" ]
The place where the actual tasks/methods are called/scheduled that should be run at the exercise release time @param exercise which will be announced by a notifications at release date
[ "The", "place", "where", "the", "actual", "tasks", "/", "methods", "are", "called", "/", "scheduled", "that", "should", "be", "run", "at", "the", "exercise", "release", "time", "@param", "exercise", "which", "will", "be", "announced", "by", "a", "notifications", "at", "release", "date" ]
[]
[ { "param": "exercise", "type": "Exercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exercise", "type": "Exercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 4788, 4386, 1290, 424, 20603, 12, 424, 20603, 24165, 13, 288, 203, 3639, 775, 288, 203, 5411, 309, 16051, 4368, 1989, 18, 291, 15606, 10756, 288, 203, 7734, 6036, 1989, 18, 542, 6063, 921, 5621, 203, 5411, 289, 203, 5411, 4788, 1179, 18, 10676, 2174, 12, 8913, 30708, 16, 1312, 20603, 9977, 18, 30762, 16, 1832, 317, 288, 203, 7734, 1041, 4386, 1179, 18, 12336, 19943, 319, 1876, 56, 3408, 1114, 24813, 9217, 424, 20603, 12, 8913, 30708, 1769, 203, 5411, 15549, 203, 5411, 613, 18, 4148, 2932, 10660, 5066, 2973, 5746, 24165, 1839, 6541, 1509, 364, 24165, 7485, 23885, 2916, 13, 364, 20178, 16, 24165, 18, 588, 4247, 9334, 24165, 18, 26321, 9334, 24165, 18, 588, 7391, 1626, 10663, 203, 3639, 289, 203, 3639, 1044, 261, 503, 1520, 13, 288, 203, 5411, 613, 18, 1636, 2932, 2925, 358, 4788, 3851, 364, 24165, 315, 397, 24165, 18, 26321, 9334, 1520, 1769, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 1021, 3166, 1625, 326, 3214, 4592, 19, 5163, 854, 2566, 19, 23307, 716, 1410, 506, 1086, 622, 326, 24165, 3992, 813, 203, 377, 380, 632, 891, 24165, 1492, 903, 506, 8226, 27373, 635, 279, 9208, 622, 3992, 1509, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
8bfc48638e4761f568a67705185a5541ad8f31c1
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/NotificationSettingsService.java
[ "MIT" ]
Java
findDeactivatedNotificationTypes
null
public Set<NotificationType> findDeactivatedNotificationTypes(Set<NotificationSetting> notificationSettings) { Map<NotificationType, Boolean> notificationSettingWithActivationStatusMap = convertNotificationSettingsToNotificationTypesWithActivationStatus(notificationSettings); Set<NotificationType> deactivatedNotificationTypes = new HashSet<>(); notificationSettingWithActivationStatusMap.forEach((notificationType, isActivated) -> { if (!isActivated) { deactivatedNotificationTypes.add(notificationType); } }); return deactivatedNotificationTypes; }
/** * Finds the deactivated NotificationTypes based on the user's NotificationSettings * @param notificationSettings which should be mapped to their respective NotificationTypes and filtered by activation status * @return a set of NotificationTypes which are deactivated by the current user's notification settings */
Finds the deactivated NotificationTypes based on the user's NotificationSettings @param notificationSettings which should be mapped to their respective NotificationTypes and filtered by activation status @return a set of NotificationTypes which are deactivated by the current user's notification settings
[ "Finds", "the", "deactivated", "NotificationTypes", "based", "on", "the", "user", "'", "s", "NotificationSettings", "@param", "notificationSettings", "which", "should", "be", "mapped", "to", "their", "respective", "NotificationTypes", "and", "filtered", "by", "activation", "status", "@return", "a", "set", "of", "NotificationTypes", "which", "are", "deactivated", "by", "the", "current", "user", "'", "s", "notification", "settings" ]
public Set<NotificationType> findDeactivatedNotificationTypes(Set<NotificationSetting> notificationSettings) { Map<NotificationType, Boolean> notificationSettingWithActivationStatusMap = convertNotificationSettingsToNotificationTypesWithActivationStatus(notificationSettings); Set<NotificationType> deactivatedNotificationTypes = new HashSet<>(); notificationSettingWithActivationStatusMap.forEach((notificationType, isActivated) -> { if (!isActivated) { deactivatedNotificationTypes.add(notificationType); } }); return deactivatedNotificationTypes; }
[ "public", "Set", "<", "NotificationType", ">", "findDeactivatedNotificationTypes", "(", "Set", "<", "NotificationSetting", ">", "notificationSettings", ")", "{", "Map", "<", "NotificationType", ",", "Boolean", ">", "notificationSettingWithActivationStatusMap", "=", "convertNotificationSettingsToNotificationTypesWithActivationStatus", "(", "notificationSettings", ")", ";", "Set", "<", "NotificationType", ">", "deactivatedNotificationTypes", "=", "new", "HashSet", "<", ">", "(", ")", ";", "notificationSettingWithActivationStatusMap", ".", "forEach", "(", "(", "notificationType", ",", "isActivated", ")", "->", "{", "if", "(", "!", "isActivated", ")", "{", "deactivatedNotificationTypes", ".", "add", "(", "notificationType", ")", ";", "}", "}", ")", ";", "return", "deactivatedNotificationTypes", ";", "}" ]
Finds the deactivated NotificationTypes based on the user's NotificationSettings @param notificationSettings which should be mapped to their respective NotificationTypes and filtered by activation status @return a set of NotificationTypes which are deactivated by the current user's notification settings
[ "Finds", "the", "deactivated", "NotificationTypes", "based", "on", "the", "user", "'", "s", "NotificationSettings", "@param", "notificationSettings", "which", "should", "be", "mapped", "to", "their", "respective", "NotificationTypes", "and", "filtered", "by", "activation", "status", "@return", "a", "set", "of", "NotificationTypes", "which", "are", "deactivated", "by", "the", "current", "user", "'", "s", "notification", "settings" ]
[]
[ { "param": "notificationSettings", "type": "Set<NotificationSetting>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "notificationSettings", "type": "Set<NotificationSetting>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 1000, 32, 4386, 559, 34, 1104, 758, 18836, 4386, 2016, 12, 694, 32, 4386, 5568, 34, 3851, 2628, 13, 288, 203, 3639, 1635, 32, 4386, 559, 16, 3411, 34, 3851, 5568, 1190, 14857, 1482, 863, 273, 1765, 4386, 2628, 774, 4386, 2016, 1190, 14857, 1482, 12, 9927, 2628, 1769, 203, 3639, 1000, 32, 4386, 559, 34, 443, 18836, 4386, 2016, 273, 394, 6847, 29667, 5621, 203, 3639, 3851, 5568, 1190, 14857, 1482, 863, 18, 1884, 3442, 12443, 9927, 559, 16, 353, 28724, 13, 317, 288, 203, 5411, 309, 16051, 291, 28724, 13, 288, 203, 7734, 443, 18836, 4386, 2016, 18, 1289, 12, 9927, 559, 1769, 203, 5411, 289, 203, 3639, 15549, 203, 3639, 327, 443, 18836, 4386, 2016, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4163, 87, 326, 443, 18836, 8050, 2016, 2511, 603, 326, 729, 1807, 8050, 2628, 203, 377, 380, 632, 891, 3851, 2628, 1492, 1410, 506, 5525, 358, 3675, 17613, 8050, 2016, 471, 5105, 635, 10027, 1267, 203, 377, 380, 632, 2463, 279, 444, 434, 8050, 2016, 1492, 854, 443, 18836, 635, 326, 783, 729, 1807, 3851, 1947, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
8bfc48638e4761f568a67705185a5541ad8f31c1
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/NotificationSettingsService.java
[ "MIT" ]
Java
convertNotificationSettingsToNotificationTypesWithActivationStatus
null
private Map<NotificationType, Boolean> convertNotificationSettingsToNotificationTypesWithActivationStatus(Set<NotificationSetting> notificationSettings) { Map<NotificationType, Boolean> resultingMap = new HashMap<>(); for (NotificationSetting setting : notificationSettings) { NotificationType[] tmpNotificationTypes = NOTIFICATION_SETTING_ID_TO_NOTIFICATION_TYPES_MAP.getOrDefault(setting.getSettingId(), new NotificationType[0]); for (NotificationType type : tmpNotificationTypes) { resultingMap.put(type, setting.isWebapp()); } } return resultingMap; }
/** * Converts the provided NotificationSetting to a map of corresponding NotificationTypes and activation status. * @param notificationSettings which will be mapped to their respective NotificationTypes with respect to their activation status * @return a map with key of NotificationType and value Boolean indicating which types are (de)activated by the user's notification settings */
Converts the provided NotificationSetting to a map of corresponding NotificationTypes and activation status. @param notificationSettings which will be mapped to their respective NotificationTypes with respect to their activation status @return a map with key of NotificationType and value Boolean indicating which types are (de)activated by the user's notification settings
[ "Converts", "the", "provided", "NotificationSetting", "to", "a", "map", "of", "corresponding", "NotificationTypes", "and", "activation", "status", ".", "@param", "notificationSettings", "which", "will", "be", "mapped", "to", "their", "respective", "NotificationTypes", "with", "respect", "to", "their", "activation", "status", "@return", "a", "map", "with", "key", "of", "NotificationType", "and", "value", "Boolean", "indicating", "which", "types", "are", "(", "de", ")", "activated", "by", "the", "user", "'", "s", "notification", "settings" ]
private Map<NotificationType, Boolean> convertNotificationSettingsToNotificationTypesWithActivationStatus(Set<NotificationSetting> notificationSettings) { Map<NotificationType, Boolean> resultingMap = new HashMap<>(); for (NotificationSetting setting : notificationSettings) { NotificationType[] tmpNotificationTypes = NOTIFICATION_SETTING_ID_TO_NOTIFICATION_TYPES_MAP.getOrDefault(setting.getSettingId(), new NotificationType[0]); for (NotificationType type : tmpNotificationTypes) { resultingMap.put(type, setting.isWebapp()); } } return resultingMap; }
[ "private", "Map", "<", "NotificationType", ",", "Boolean", ">", "convertNotificationSettingsToNotificationTypesWithActivationStatus", "(", "Set", "<", "NotificationSetting", ">", "notificationSettings", ")", "{", "Map", "<", "NotificationType", ",", "Boolean", ">", "resultingMap", "=", "new", "HashMap", "<", ">", "(", ")", ";", "for", "(", "NotificationSetting", "setting", ":", "notificationSettings", ")", "{", "NotificationType", "[", "]", "tmpNotificationTypes", "=", "NOTIFICATION_SETTING_ID_TO_NOTIFICATION_TYPES_MAP", ".", "getOrDefault", "(", "setting", ".", "getSettingId", "(", ")", ",", "new", "NotificationType", "[", "0", "]", ")", ";", "for", "(", "NotificationType", "type", ":", "tmpNotificationTypes", ")", "{", "resultingMap", ".", "put", "(", "type", ",", "setting", ".", "isWebapp", "(", ")", ")", ";", "}", "}", "return", "resultingMap", ";", "}" ]
Converts the provided NotificationSetting to a map of corresponding NotificationTypes and activation status.
[ "Converts", "the", "provided", "NotificationSetting", "to", "a", "map", "of", "corresponding", "NotificationTypes", "and", "activation", "status", "." ]
[]
[ { "param": "notificationSettings", "type": "Set<NotificationSetting>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "notificationSettings", "type": "Set<NotificationSetting>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 1635, 32, 4386, 559, 16, 3411, 34, 1765, 4386, 2628, 774, 4386, 2016, 1190, 14857, 1482, 12, 694, 32, 4386, 5568, 34, 3851, 2628, 13, 288, 203, 3639, 1635, 32, 4386, 559, 16, 3411, 34, 8156, 863, 273, 394, 4317, 29667, 5621, 203, 3639, 364, 261, 4386, 5568, 3637, 294, 3851, 2628, 13, 288, 203, 5411, 8050, 559, 8526, 1853, 4386, 2016, 273, 4269, 14865, 67, 1090, 12239, 67, 734, 67, 4296, 67, 4400, 14865, 67, 10564, 67, 8352, 18, 588, 25186, 12, 8920, 18, 588, 5568, 548, 9334, 394, 8050, 559, 63, 20, 19226, 203, 5411, 364, 261, 4386, 559, 618, 294, 1853, 4386, 2016, 13, 288, 203, 7734, 8156, 863, 18, 458, 12, 723, 16, 3637, 18, 291, 4079, 2910, 10663, 203, 5411, 289, 203, 3639, 289, 203, 3639, 327, 8156, 863, 31, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 20377, 326, 2112, 8050, 5568, 358, 279, 852, 434, 4656, 8050, 2016, 471, 10027, 1267, 18, 203, 377, 380, 632, 891, 3851, 2628, 1492, 903, 506, 5525, 358, 3675, 17613, 8050, 2016, 598, 8762, 358, 3675, 10027, 1267, 203, 377, 380, 632, 2463, 279, 852, 598, 498, 434, 8050, 559, 471, 460, 3411, 11193, 1492, 1953, 854, 261, 323, 13, 18836, 635, 326, 729, 1807, 3851, 1947, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
b8ffeb54ac8a0f338bf1dd06786c4b1a81b78968
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/AuxiliaryRepositoryService.java
[ "MIT" ]
Java
validateAndAddAuxiliaryRepositoriesOfProgrammingExercise
null
public void validateAndAddAuxiliaryRepositoriesOfProgrammingExercise(ProgrammingExercise programmingExercise, List<AuxiliaryRepository> newAuxiliaryRepositories) { List<AuxiliaryRepository> auxiliaryRepositories = new ArrayList<>(Objects .requireNonNullElse(programmingExercise.getAuxiliaryRepositories(), new ArrayList<AuxiliaryRepository>()).stream().filter(repo -> repo.getId() != null).toList()); for (AuxiliaryRepository repo : newAuxiliaryRepositories) { validateAuxiliaryRepository(repo, auxiliaryRepositories, true); auxiliaryRepositories.add(repo); } programmingExercise.setAuxiliaryRepositories(new ArrayList<>()); auxiliaryRepositories.forEach(programmingExercise::addAuxiliaryRepository); }
/** * Validates and adds all new Auxiliary Repositories that are added to the given exercise * @param programmingExercise The programming exercise where the auxiliary repositories are added * @param newAuxiliaryRepositories The newly added auxiliary repositories */
Validates and adds all new Auxiliary Repositories that are added to the given exercise @param programmingExercise The programming exercise where the auxiliary repositories are added @param newAuxiliaryRepositories The newly added auxiliary repositories
[ "Validates", "and", "adds", "all", "new", "Auxiliary", "Repositories", "that", "are", "added", "to", "the", "given", "exercise", "@param", "programmingExercise", "The", "programming", "exercise", "where", "the", "auxiliary", "repositories", "are", "added", "@param", "newAuxiliaryRepositories", "The", "newly", "added", "auxiliary", "repositories" ]
public void validateAndAddAuxiliaryRepositoriesOfProgrammingExercise(ProgrammingExercise programmingExercise, List<AuxiliaryRepository> newAuxiliaryRepositories) { List<AuxiliaryRepository> auxiliaryRepositories = new ArrayList<>(Objects .requireNonNullElse(programmingExercise.getAuxiliaryRepositories(), new ArrayList<AuxiliaryRepository>()).stream().filter(repo -> repo.getId() != null).toList()); for (AuxiliaryRepository repo : newAuxiliaryRepositories) { validateAuxiliaryRepository(repo, auxiliaryRepositories, true); auxiliaryRepositories.add(repo); } programmingExercise.setAuxiliaryRepositories(new ArrayList<>()); auxiliaryRepositories.forEach(programmingExercise::addAuxiliaryRepository); }
[ "public", "void", "validateAndAddAuxiliaryRepositoriesOfProgrammingExercise", "(", "ProgrammingExercise", "programmingExercise", ",", "List", "<", "AuxiliaryRepository", ">", "newAuxiliaryRepositories", ")", "{", "List", "<", "AuxiliaryRepository", ">", "auxiliaryRepositories", "=", "new", "ArrayList", "<", ">", "(", "Objects", ".", "requireNonNullElse", "(", "programmingExercise", ".", "getAuxiliaryRepositories", "(", ")", ",", "new", "ArrayList", "<", "AuxiliaryRepository", ">", "(", ")", ")", ".", "stream", "(", ")", ".", "filter", "(", "repo", "->", "repo", ".", "getId", "(", ")", "!=", "null", ")", ".", "toList", "(", ")", ")", ";", "for", "(", "AuxiliaryRepository", "repo", ":", "newAuxiliaryRepositories", ")", "{", "validateAuxiliaryRepository", "(", "repo", ",", "auxiliaryRepositories", ",", "true", ")", ";", "auxiliaryRepositories", ".", "add", "(", "repo", ")", ";", "}", "programmingExercise", ".", "setAuxiliaryRepositories", "(", "new", "ArrayList", "<", ">", "(", ")", ")", ";", "auxiliaryRepositories", ".", "forEach", "(", "programmingExercise", "::", "addAuxiliaryRepository", ")", ";", "}" ]
Validates and adds all new Auxiliary Repositories that are added to the given exercise @param programmingExercise The programming exercise where the auxiliary repositories are added @param newAuxiliaryRepositories The newly added auxiliary repositories
[ "Validates", "and", "adds", "all", "new", "Auxiliary", "Repositories", "that", "are", "added", "to", "the", "given", "exercise", "@param", "programmingExercise", "The", "programming", "exercise", "where", "the", "auxiliary", "repositories", "are", "added", "@param", "newAuxiliaryRepositories", "The", "newly", "added", "auxiliary", "repositories" ]
[]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" }, { "param": "newAuxiliaryRepositories", "type": "List<AuxiliaryRepository>" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "newAuxiliaryRepositories", "type": "List<AuxiliaryRepository>", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 918, 1954, 1876, 986, 21981, 20606, 18429, 951, 9459, 11987, 424, 20603, 12, 9459, 11987, 424, 20603, 5402, 11987, 424, 20603, 16, 987, 32, 21981, 20606, 3305, 34, 394, 21981, 20606, 18429, 13, 288, 203, 3639, 987, 32, 21981, 20606, 3305, 34, 9397, 20606, 18429, 273, 394, 2407, 29667, 12, 4710, 203, 7734, 263, 6528, 8921, 12427, 12, 12890, 11987, 424, 20603, 18, 588, 21981, 20606, 18429, 9334, 394, 2407, 32, 21981, 20606, 3305, 34, 1435, 2934, 3256, 7675, 2188, 12, 7422, 317, 3538, 18, 26321, 1435, 480, 446, 2934, 869, 682, 10663, 203, 3639, 364, 261, 21981, 20606, 3305, 3538, 294, 394, 21981, 20606, 18429, 13, 288, 203, 5411, 1954, 21981, 20606, 3305, 12, 7422, 16, 9397, 20606, 18429, 16, 638, 1769, 203, 5411, 9397, 20606, 18429, 18, 1289, 12, 7422, 1769, 203, 3639, 289, 203, 3639, 5402, 11987, 424, 20603, 18, 542, 21981, 20606, 18429, 12, 2704, 2407, 29667, 10663, 203, 3639, 9397, 20606, 18429, 18, 1884, 3442, 12, 12890, 11987, 424, 20603, 2866, 1289, 21981, 20606, 3305, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2364, 815, 471, 4831, 777, 394, 432, 2616, 20606, 30111, 716, 854, 3096, 358, 326, 864, 24165, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 1021, 5402, 11987, 24165, 1625, 326, 9397, 20606, 14531, 854, 3096, 203, 377, 380, 632, 891, 394, 21981, 20606, 18429, 1021, 10894, 3096, 9397, 20606, 14531, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
b8ffeb54ac8a0f338bf1dd06786c4b1a81b78968
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/service/programming/AuxiliaryRepositoryService.java
[ "MIT" ]
Java
handleAuxiliaryRepositoriesWhenUpdatingExercises
null
public void handleAuxiliaryRepositoriesWhenUpdatingExercises(ProgrammingExercise programmingExercise, ProgrammingExercise updatedExercise) { // Get all new (ID is still null) and changed (some string value is changed) auxiliary repositories List<AuxiliaryRepository> newOrEditedAuxiliaryRepositories = new ArrayList<>(updatedExercise.getAuxiliaryRepositories().stream().filter(repo -> { if (repo.getId() == null) { return true; } AuxiliaryRepository auxiliaryRepositoryBeforeUpdate = auxiliaryRepositoryRepository.findById(repo.getId()) .orElseThrow(() -> new IllegalStateException("Edited an existing repository that is not in the data base!")); return !repo.containsEqualStringValues(auxiliaryRepositoryBeforeUpdate); }).toList()); validateAndUpdateExistingAuxiliaryRepositoriesOfProgrammingExercise(programmingExercise, newOrEditedAuxiliaryRepositories, updatedExercise); List<AuxiliaryRepository> removedAuxiliaryRepositories = programmingExercise.getAuxiliaryRepositories().stream() .filter(repo -> updatedExercise.getAuxiliaryRepositories().stream().noneMatch(updatedRepo -> repo.getId().equals(updatedRepo.getId()))).toList(); auxiliaryRepositoryRepository.deleteAll(removedAuxiliaryRepositories); }
/** * Handles an update of a programming exercises where some of the auxiliary repositories are added, changed or deleted * @param programmingExercise The programming exercise before the update * @param updatedExercise The programming exercise after the update */
Handles an update of a programming exercises where some of the auxiliary repositories are added, changed or deleted @param programmingExercise The programming exercise before the update @param updatedExercise The programming exercise after the update
[ "Handles", "an", "update", "of", "a", "programming", "exercises", "where", "some", "of", "the", "auxiliary", "repositories", "are", "added", "changed", "or", "deleted", "@param", "programmingExercise", "The", "programming", "exercise", "before", "the", "update", "@param", "updatedExercise", "The", "programming", "exercise", "after", "the", "update" ]
public void handleAuxiliaryRepositoriesWhenUpdatingExercises(ProgrammingExercise programmingExercise, ProgrammingExercise updatedExercise) { List<AuxiliaryRepository> newOrEditedAuxiliaryRepositories = new ArrayList<>(updatedExercise.getAuxiliaryRepositories().stream().filter(repo -> { if (repo.getId() == null) { return true; } AuxiliaryRepository auxiliaryRepositoryBeforeUpdate = auxiliaryRepositoryRepository.findById(repo.getId()) .orElseThrow(() -> new IllegalStateException("Edited an existing repository that is not in the data base!")); return !repo.containsEqualStringValues(auxiliaryRepositoryBeforeUpdate); }).toList()); validateAndUpdateExistingAuxiliaryRepositoriesOfProgrammingExercise(programmingExercise, newOrEditedAuxiliaryRepositories, updatedExercise); List<AuxiliaryRepository> removedAuxiliaryRepositories = programmingExercise.getAuxiliaryRepositories().stream() .filter(repo -> updatedExercise.getAuxiliaryRepositories().stream().noneMatch(updatedRepo -> repo.getId().equals(updatedRepo.getId()))).toList(); auxiliaryRepositoryRepository.deleteAll(removedAuxiliaryRepositories); }
[ "public", "void", "handleAuxiliaryRepositoriesWhenUpdatingExercises", "(", "ProgrammingExercise", "programmingExercise", ",", "ProgrammingExercise", "updatedExercise", ")", "{", "List", "<", "AuxiliaryRepository", ">", "newOrEditedAuxiliaryRepositories", "=", "new", "ArrayList", "<", ">", "(", "updatedExercise", ".", "getAuxiliaryRepositories", "(", ")", ".", "stream", "(", ")", ".", "filter", "(", "repo", "->", "{", "if", "(", "repo", ".", "getId", "(", ")", "==", "null", ")", "{", "return", "true", ";", "}", "AuxiliaryRepository", "auxiliaryRepositoryBeforeUpdate", "=", "auxiliaryRepositoryRepository", ".", "findById", "(", "repo", ".", "getId", "(", ")", ")", ".", "orElseThrow", "(", "(", ")", "->", "new", "IllegalStateException", "(", "\"Edited an existing repository that is not in the data base!\"", ")", ")", ";", "return", "!", "repo", ".", "containsEqualStringValues", "(", "auxiliaryRepositoryBeforeUpdate", ")", ";", "}", ")", ".", "toList", "(", ")", ")", ";", "validateAndUpdateExistingAuxiliaryRepositoriesOfProgrammingExercise", "(", "programmingExercise", ",", "newOrEditedAuxiliaryRepositories", ",", "updatedExercise", ")", ";", "List", "<", "AuxiliaryRepository", ">", "removedAuxiliaryRepositories", "=", "programmingExercise", ".", "getAuxiliaryRepositories", "(", ")", ".", "stream", "(", ")", ".", "filter", "(", "repo", "->", "updatedExercise", ".", "getAuxiliaryRepositories", "(", ")", ".", "stream", "(", ")", ".", "noneMatch", "(", "updatedRepo", "->", "repo", ".", "getId", "(", ")", ".", "equals", "(", "updatedRepo", ".", "getId", "(", ")", ")", ")", ")", ".", "toList", "(", ")", ";", "auxiliaryRepositoryRepository", ".", "deleteAll", "(", "removedAuxiliaryRepositories", ")", ";", "}" ]
Handles an update of a programming exercises where some of the auxiliary repositories are added, changed or deleted @param programmingExercise The programming exercise before the update @param updatedExercise The programming exercise after the update
[ "Handles", "an", "update", "of", "a", "programming", "exercises", "where", "some", "of", "the", "auxiliary", "repositories", "are", "added", "changed", "or", "deleted", "@param", "programmingExercise", "The", "programming", "exercise", "before", "the", "update", "@param", "updatedExercise", "The", "programming", "exercise", "after", "the", "update" ]
[ "// Get all new (ID is still null) and changed (some string value is changed) auxiliary repositories" ]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" }, { "param": "updatedExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "updatedExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 918, 1640, 21981, 20606, 18429, 9434, 17858, 424, 12610, 6141, 12, 9459, 11987, 424, 20603, 5402, 11987, 424, 20603, 16, 13586, 11987, 424, 20603, 3526, 424, 20603, 13, 288, 203, 3639, 368, 968, 777, 394, 261, 734, 353, 4859, 446, 13, 471, 3550, 261, 19068, 533, 460, 353, 3550, 13, 9397, 20606, 14531, 203, 3639, 987, 32, 21981, 20606, 3305, 34, 394, 1162, 4666, 329, 21981, 20606, 18429, 273, 394, 2407, 29667, 12, 7007, 424, 20603, 18, 588, 21981, 20606, 18429, 7675, 3256, 7675, 2188, 12, 7422, 317, 288, 203, 5411, 309, 261, 7422, 18, 26321, 1435, 422, 446, 13, 288, 203, 7734, 327, 638, 31, 203, 5411, 289, 203, 5411, 432, 2616, 20606, 3305, 9397, 20606, 3305, 4649, 1891, 273, 9397, 20606, 3305, 3305, 18, 4720, 5132, 12, 7422, 18, 26321, 10756, 203, 10792, 263, 280, 12427, 8282, 12, 1435, 317, 394, 5477, 2932, 4666, 329, 392, 2062, 3352, 716, 353, 486, 316, 326, 501, 1026, 4442, 10019, 203, 5411, 327, 401, 7422, 18, 12298, 5812, 780, 1972, 12, 18196, 20606, 3305, 4649, 1891, 1769, 203, 3639, 289, 2934, 869, 682, 10663, 203, 3639, 1954, 1876, 1891, 9895, 21981, 20606, 18429, 951, 9459, 11987, 424, 20603, 12, 12890, 11987, 424, 20603, 16, 394, 1162, 4666, 329, 21981, 20606, 18429, 16, 3526, 424, 20603, 1769, 203, 203, 3639, 987, 32, 21981, 20606, 3305, 34, 3723, 21981, 20606, 18429, 273, 5402, 11987, 424, 20603, 18, 588, 21981, 20606, 18429, 7675, 3256, 1435, 203, 7734, 263, 2188, 12, 7422, 317, 3526, 424, 20603, 18, 588, 21981, 20606, 18429, 7675, 3256, 7675, 6102, 2060, 12, 7007, 8791, 317, 3538, 18, 26321, 7675, 14963, 12, 7007, 8791, 18, 26321, 1435, 3719, 2934, 869, 682, 5621, 203, 203, 3639, 9397, 20606, 3305, 3305, 18, 3733, 1595, 12, 14923, 21981, 20606, 18429, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 27020, 392, 1089, 434, 279, 5402, 11987, 431, 12610, 6141, 1625, 2690, 434, 326, 9397, 20606, 14531, 854, 3096, 16, 3550, 578, 4282, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 1021, 5402, 11987, 24165, 1865, 326, 1089, 203, 377, 380, 632, 891, 3526, 424, 20603, 1021, 5402, 11987, 24165, 1839, 326, 1089, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
6fe1f092f4fd0290b1faad5d0c70d8f220bbe0d3
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/NotificationSettingsResource.java
[ "MIT" ]
Java
saveNotificationSettingsForCurrentUser
null
@PutMapping("notification-settings") @PreAuthorize("hasRole('USER')") public ResponseEntity<NotificationSetting[]> saveNotificationSettingsForCurrentUser(@NotNull @RequestBody NotificationSetting[] notificationSettings) { if (notificationSettings.length == 0) { return badRequest("notificationSettings", "400", "Can not save non existing Notification Settings"); } User currentUser = userRepository.getUserWithGroupsAndAuthorities(); log.debug("REST request to save NotificationSettings : {} for current user {}", notificationSettings, currentUser); notificationSettingsService.setCurrentUser(notificationSettings, currentUser); List<NotificationSetting> resultAsList = notificationSettingRepository.saveAll(Arrays.stream(notificationSettings).toList()); if (resultAsList.isEmpty()) { return badRequest("notificationSettings", "500", "Error occurred during saving of Notification Settings"); } NotificationSetting[] resultAsArray = resultAsList.toArray(new NotificationSetting[0]); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, "notificationSetting", "test")).body(resultAsArray); }
/** * PUT notification-settings : Save NotificationSettings for current user * * Saves the provided NotificationSettings to the server. * @param notificationSettings which should be saved to the notificationSetting database. * * @return the NotificationSettings that just got saved for the current user as array * 200 for a successful execution, 400 if the user provided empty settings to save, 500 if the save call returns empty settings */
PUT notification-settings : Save NotificationSettings for current user Saves the provided NotificationSettings to the server. @param notificationSettings which should be saved to the notificationSetting database. @return the NotificationSettings that just got saved for the current user as array 200 for a successful execution, 400 if the user provided empty settings to save, 500 if the save call returns empty settings
[ "PUT", "notification", "-", "settings", ":", "Save", "NotificationSettings", "for", "current", "user", "Saves", "the", "provided", "NotificationSettings", "to", "the", "server", ".", "@param", "notificationSettings", "which", "should", "be", "saved", "to", "the", "notificationSetting", "database", ".", "@return", "the", "NotificationSettings", "that", "just", "got", "saved", "for", "the", "current", "user", "as", "array", "200", "for", "a", "successful", "execution", "400", "if", "the", "user", "provided", "empty", "settings", "to", "save", "500", "if", "the", "save", "call", "returns", "empty", "settings" ]
@PutMapping("notification-settings") @PreAuthorize("hasRole('USER')") public ResponseEntity<NotificationSetting[]> saveNotificationSettingsForCurrentUser(@NotNull @RequestBody NotificationSetting[] notificationSettings) { if (notificationSettings.length == 0) { return badRequest("notificationSettings", "400", "Can not save non existing Notification Settings"); } User currentUser = userRepository.getUserWithGroupsAndAuthorities(); log.debug("REST request to save NotificationSettings : {} for current user {}", notificationSettings, currentUser); notificationSettingsService.setCurrentUser(notificationSettings, currentUser); List<NotificationSetting> resultAsList = notificationSettingRepository.saveAll(Arrays.stream(notificationSettings).toList()); if (resultAsList.isEmpty()) { return badRequest("notificationSettings", "500", "Error occurred during saving of Notification Settings"); } NotificationSetting[] resultAsArray = resultAsList.toArray(new NotificationSetting[0]); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, "notificationSetting", "test")).body(resultAsArray); }
[ "@", "PutMapping", "(", "\"notification-settings\"", ")", "@", "PreAuthorize", "(", "\"hasRole('USER')\"", ")", "public", "ResponseEntity", "<", "NotificationSetting", "[", "]", ">", "saveNotificationSettingsForCurrentUser", "(", "@", "NotNull", "@", "RequestBody", "NotificationSetting", "[", "]", "notificationSettings", ")", "{", "if", "(", "notificationSettings", ".", "length", "==", "0", ")", "{", "return", "badRequest", "(", "\"notificationSettings\"", ",", "\"400\"", ",", "\"Can not save non existing Notification Settings\"", ")", ";", "}", "User", "currentUser", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "log", ".", "debug", "(", "\"REST request to save NotificationSettings : {} for current user {}\"", ",", "notificationSettings", ",", "currentUser", ")", ";", "notificationSettingsService", ".", "setCurrentUser", "(", "notificationSettings", ",", "currentUser", ")", ";", "List", "<", "NotificationSetting", ">", "resultAsList", "=", "notificationSettingRepository", ".", "saveAll", "(", "Arrays", ".", "stream", "(", "notificationSettings", ")", ".", "toList", "(", ")", ")", ";", "if", "(", "resultAsList", ".", "isEmpty", "(", ")", ")", "{", "return", "badRequest", "(", "\"notificationSettings\"", ",", "\"500\"", ",", "\"Error occurred during saving of Notification Settings\"", ")", ";", "}", "NotificationSetting", "[", "]", "resultAsArray", "=", "resultAsList", ".", "toArray", "(", "new", "NotificationSetting", "[", "0", "]", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityUpdateAlert", "(", "applicationName", ",", "true", ",", "\"notificationSetting\"", ",", "\"test\"", ")", ")", ".", "body", "(", "resultAsArray", ")", ";", "}" ]
PUT notification-settings : Save NotificationSettings for current user Saves the provided NotificationSettings to the server.
[ "PUT", "notification", "-", "settings", ":", "Save", "NotificationSettings", "for", "current", "user", "Saves", "the", "provided", "NotificationSettings", "to", "the", "server", "." ]
[]
[ { "param": "notificationSettings", "type": "NotificationSetting[]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "notificationSettings", "type": "NotificationSetting[]", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 2932, 9927, 17, 4272, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 4714, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 4386, 5568, 8526, 34, 1923, 4386, 2628, 1290, 3935, 1299, 26964, 5962, 632, 28843, 8050, 5568, 8526, 3851, 2628, 13, 288, 203, 3639, 309, 261, 9927, 2628, 18, 2469, 422, 374, 13, 288, 203, 5411, 327, 5570, 691, 2932, 9927, 2628, 3113, 315, 16010, 3113, 315, 2568, 486, 1923, 1661, 2062, 8050, 8709, 8863, 203, 3639, 289, 203, 3639, 2177, 13970, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 1923, 8050, 2628, 294, 2618, 364, 783, 729, 3728, 16, 3851, 2628, 16, 13970, 1769, 203, 3639, 3851, 2628, 1179, 18, 542, 3935, 1299, 12, 9927, 2628, 16, 13970, 1769, 203, 3639, 987, 32, 4386, 5568, 34, 563, 1463, 682, 273, 3851, 5568, 3305, 18, 5688, 1595, 12, 12726, 18, 3256, 12, 9927, 2628, 2934, 869, 682, 10663, 203, 3639, 309, 261, 2088, 1463, 682, 18, 291, 1921, 10756, 288, 203, 5411, 327, 5570, 691, 2932, 9927, 2628, 3113, 315, 12483, 3113, 315, 668, 7841, 4982, 12392, 434, 8050, 8709, 8863, 203, 3639, 289, 203, 3639, 8050, 5568, 8526, 563, 19196, 273, 563, 1463, 682, 18, 31447, 12, 2704, 8050, 5568, 63, 20, 19226, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 2485, 12, 1864, 1304, 18, 2640, 1943, 1891, 13298, 12, 3685, 461, 16, 638, 16, 315, 9927, 5568, 3113, 315, 3813, 7923, 2934, 3432, 12, 2088, 19196, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 11443, 3851, 17, 4272, 294, 7074, 8050, 2628, 364, 783, 729, 203, 377, 380, 203, 377, 380, 348, 6606, 326, 2112, 8050, 2628, 358, 326, 1438, 18, 203, 377, 380, 632, 891, 3851, 2628, 1492, 1410, 506, 5198, 358, 326, 3851, 5568, 2063, 18, 203, 377, 380, 203, 377, 380, 632, 2463, 326, 8050, 2628, 716, 2537, 2363, 5198, 364, 326, 783, 729, 487, 526, 203, 377, 380, 4044, 364, 279, 6873, 4588, 16, 7409, 309, 326, 729, 2112, 1008, 1947, 358, 1923, 16, 6604, 309, 326, 1923, 745, 1135, 1008, 1947, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
checkProgrammingExerciseForError
null
private void checkProgrammingExerciseForError(ProgrammingExercise exercise) { if (!continuousIntegrationService.get().checkIfBuildPlanExists(exercise.getProjectKey(), exercise.getTemplateBuildPlanId())) { throw new BadRequestAlertException("The Template Build Plan ID seems to be invalid.", "Exercise", ErrorKeys.INVALID_TEMPLATE_BUILD_PLAN_ID); } if (exercise.getVcsTemplateRepositoryUrl() == null || !versionControlService.get().repositoryUrlIsValid(exercise.getVcsTemplateRepositoryUrl())) { throw new BadRequestAlertException("The Template Repository URL seems to be invalid.", "Exercise", ErrorKeys.INVALID_TEMPLATE_REPOSITORY_URL); } if (exercise.getSolutionBuildPlanId() != null && !continuousIntegrationService.get().checkIfBuildPlanExists(exercise.getProjectKey(), exercise.getSolutionBuildPlanId())) { throw new BadRequestAlertException("The Solution Build Plan ID seems to be invalid.", "Exercise", ErrorKeys.INVALID_SOLUTION_BUILD_PLAN_ID); } var solutionRepositoryUrl = exercise.getVcsSolutionRepositoryUrl(); if (solutionRepositoryUrl != null && !versionControlService.get().repositoryUrlIsValid(solutionRepositoryUrl)) { throw new BadRequestAlertException("The Solution Repository URL seems to be invalid.", "Exercise", ErrorKeys.INVALID_SOLUTION_REPOSITORY_URL); } }
/** * @param exercise the exercise object we want to check for errors */
@param exercise the exercise object we want to check for errors
[ "@param", "exercise", "the", "exercise", "object", "we", "want", "to", "check", "for", "errors" ]
private void checkProgrammingExerciseForError(ProgrammingExercise exercise) { if (!continuousIntegrationService.get().checkIfBuildPlanExists(exercise.getProjectKey(), exercise.getTemplateBuildPlanId())) { throw new BadRequestAlertException("The Template Build Plan ID seems to be invalid.", "Exercise", ErrorKeys.INVALID_TEMPLATE_BUILD_PLAN_ID); } if (exercise.getVcsTemplateRepositoryUrl() == null || !versionControlService.get().repositoryUrlIsValid(exercise.getVcsTemplateRepositoryUrl())) { throw new BadRequestAlertException("The Template Repository URL seems to be invalid.", "Exercise", ErrorKeys.INVALID_TEMPLATE_REPOSITORY_URL); } if (exercise.getSolutionBuildPlanId() != null && !continuousIntegrationService.get().checkIfBuildPlanExists(exercise.getProjectKey(), exercise.getSolutionBuildPlanId())) { throw new BadRequestAlertException("The Solution Build Plan ID seems to be invalid.", "Exercise", ErrorKeys.INVALID_SOLUTION_BUILD_PLAN_ID); } var solutionRepositoryUrl = exercise.getVcsSolutionRepositoryUrl(); if (solutionRepositoryUrl != null && !versionControlService.get().repositoryUrlIsValid(solutionRepositoryUrl)) { throw new BadRequestAlertException("The Solution Repository URL seems to be invalid.", "Exercise", ErrorKeys.INVALID_SOLUTION_REPOSITORY_URL); } }
[ "private", "void", "checkProgrammingExerciseForError", "(", "ProgrammingExercise", "exercise", ")", "{", "if", "(", "!", "continuousIntegrationService", ".", "get", "(", ")", ".", "checkIfBuildPlanExists", "(", "exercise", ".", "getProjectKey", "(", ")", ",", "exercise", ".", "getTemplateBuildPlanId", "(", ")", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The Template Build Plan ID seems to be invalid.\"", ",", "\"Exercise\"", ",", "ErrorKeys", ".", "INVALID_TEMPLATE_BUILD_PLAN_ID", ")", ";", "}", "if", "(", "exercise", ".", "getVcsTemplateRepositoryUrl", "(", ")", "==", "null", "||", "!", "versionControlService", ".", "get", "(", ")", ".", "repositoryUrlIsValid", "(", "exercise", ".", "getVcsTemplateRepositoryUrl", "(", ")", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The Template Repository URL seems to be invalid.\"", ",", "\"Exercise\"", ",", "ErrorKeys", ".", "INVALID_TEMPLATE_REPOSITORY_URL", ")", ";", "}", "if", "(", "exercise", ".", "getSolutionBuildPlanId", "(", ")", "!=", "null", "&&", "!", "continuousIntegrationService", ".", "get", "(", ")", ".", "checkIfBuildPlanExists", "(", "exercise", ".", "getProjectKey", "(", ")", ",", "exercise", ".", "getSolutionBuildPlanId", "(", ")", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The Solution Build Plan ID seems to be invalid.\"", ",", "\"Exercise\"", ",", "ErrorKeys", ".", "INVALID_SOLUTION_BUILD_PLAN_ID", ")", ";", "}", "var", "solutionRepositoryUrl", "=", "exercise", ".", "getVcsSolutionRepositoryUrl", "(", ")", ";", "if", "(", "solutionRepositoryUrl", "!=", "null", "&&", "!", "versionControlService", ".", "get", "(", ")", ".", "repositoryUrlIsValid", "(", "solutionRepositoryUrl", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The Solution Repository URL seems to be invalid.\"", ",", "\"Exercise\"", ",", "ErrorKeys", ".", "INVALID_SOLUTION_REPOSITORY_URL", ")", ";", "}", "}" ]
@param exercise the exercise object we want to check for errors
[ "@param", "exercise", "the", "exercise", "object", "we", "want", "to", "check", "for", "errors" ]
[]
[ { "param": "exercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 866, 9459, 11987, 424, 20603, 1290, 668, 12, 9459, 11987, 424, 20603, 24165, 13, 288, 203, 3639, 309, 16051, 31056, 15372, 1179, 18, 588, 7675, 1893, 2047, 3116, 5365, 4002, 12, 8913, 30708, 18, 588, 4109, 653, 9334, 24165, 18, 588, 2283, 3116, 5365, 548, 1435, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 5035, 3998, 12540, 1599, 12001, 358, 506, 2057, 1199, 16, 315, 424, 20603, 3113, 1068, 2396, 18, 9347, 67, 12205, 67, 20215, 67, 6253, 1258, 67, 734, 1769, 203, 3639, 289, 203, 3639, 309, 261, 8913, 30708, 18, 588, 58, 2143, 2283, 3305, 1489, 1435, 422, 446, 747, 401, 1589, 3367, 1179, 18, 588, 7675, 9071, 1489, 20536, 12, 8913, 30708, 18, 588, 58, 2143, 2283, 3305, 1489, 1435, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 5035, 6281, 1976, 12001, 358, 506, 2057, 1199, 16, 315, 424, 20603, 3113, 1068, 2396, 18, 9347, 67, 12205, 67, 862, 30986, 67, 1785, 1769, 203, 3639, 289, 203, 3639, 309, 261, 8913, 30708, 18, 588, 16135, 3116, 5365, 548, 1435, 480, 446, 597, 401, 31056, 15372, 1179, 18, 588, 7675, 1893, 2047, 3116, 5365, 4002, 12, 8913, 30708, 18, 588, 4109, 653, 9334, 24165, 18, 588, 16135, 3116, 5365, 548, 1435, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 29172, 3998, 12540, 1599, 12001, 358, 506, 2057, 1199, 16, 315, 424, 20603, 3113, 1068, 2396, 18, 9347, 67, 19815, 13269, 67, 20215, 67, 6253, 1258, 67, 734, 1769, 203, 3639, 289, 203, 3639, 569, 6959, 3305, 1489, 273, 24165, 18, 588, 58, 2143, 16135, 3305, 1489, 5621, 203, 3639, 309, 261, 13385, 3305, 1489, 480, 446, 597, 401, 1589, 3367, 1179, 18, 588, 7675, 9071, 1489, 20536, 12, 13385, 3305, 1489, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 29172, 6281, 1976, 12001, 358, 506, 2057, 1199, 16, 315, 424, 20603, 3113, 1068, 2396, 18, 9347, 67, 19815, 13269, 67, 862, 30986, 67, 1785, 1769, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 632, 891, 24165, 326, 24165, 733, 732, 2545, 358, 866, 364, 1334, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
validateCourseAndExerciseShortName
null
private void validateCourseAndExerciseShortName(ProgrammingExercise programmingExercise, Course course) { // Check if exercise shortname is set if (programmingExercise.getShortName() == null || programmingExercise.getShortName().length() < 3) { throw new BadRequestAlertException("The shortname of the programming exercise is not set or too short", "Exercise", "programmingExerciseShortnameInvalid"); } // Check if course shortname is set if (course.getShortName() == null || course.getShortName().length() < 3) { throw new BadRequestAlertException("The shortname of the course is not set or too short", "Exercise", "courseShortnameInvalid"); } // Check if exercise shortname matches regex Matcher shortNameMatcher = SHORT_NAME_PATTERN.matcher(programmingExercise.getShortName()); if (!shortNameMatcher.matches()) { throw new BadRequestAlertException("The shortname is invalid", "Exercise", "shortnameInvalid"); } // NOTE: we have to cover two cases here: exercises directly stored in the course and exercises indirectly stored in the course (exercise -> exerciseGroup -> exam -> // course) long numberOfProgrammingExercisesWithSameShortName = programmingExerciseRepository.countByShortNameAndCourse(programmingExercise.getShortName(), course) + programmingExerciseRepository.countByShortNameAndExerciseGroupExamCourse(programmingExercise.getShortName(), course); if (numberOfProgrammingExercisesWithSameShortName > 0) { throw new BadRequestAlertException("A programming exercise with the same short name already exists. Please choose a different short name.", "Exercise", "shortnameAlreadyExists"); } }
/** * Validates the course and programming exercise short name. * 1. Check presence and length of exercise short name * 2. Check presence and length of course short name * 3. Find forbidden patterns in exercise short name * 4. Check that the short name doesn't already exist withing course or exam exercises * * @param programmingExercise Programming exercise to be validated * @param course Course of the programming exercise */
Validates the course and programming exercise short name. 1. Check presence and length of exercise short name 2. Check presence and length of course short name 3. Find forbidden patterns in exercise short name 4. Check that the short name doesn't already exist withing course or exam exercises @param programmingExercise Programming exercise to be validated @param course Course of the programming exercise
[ "Validates", "the", "course", "and", "programming", "exercise", "short", "name", ".", "1", ".", "Check", "presence", "and", "length", "of", "exercise", "short", "name", "2", ".", "Check", "presence", "and", "length", "of", "course", "short", "name", "3", ".", "Find", "forbidden", "patterns", "in", "exercise", "short", "name", "4", ".", "Check", "that", "the", "short", "name", "doesn", "'", "t", "already", "exist", "withing", "course", "or", "exam", "exercises", "@param", "programmingExercise", "Programming", "exercise", "to", "be", "validated", "@param", "course", "Course", "of", "the", "programming", "exercise" ]
private void validateCourseAndExerciseShortName(ProgrammingExercise programmingExercise, Course course) { if (programmingExercise.getShortName() == null || programmingExercise.getShortName().length() < 3) { throw new BadRequestAlertException("The shortname of the programming exercise is not set or too short", "Exercise", "programmingExerciseShortnameInvalid"); } if (course.getShortName() == null || course.getShortName().length() < 3) { throw new BadRequestAlertException("The shortname of the course is not set or too short", "Exercise", "courseShortnameInvalid"); } Matcher shortNameMatcher = SHORT_NAME_PATTERN.matcher(programmingExercise.getShortName()); if (!shortNameMatcher.matches()) { throw new BadRequestAlertException("The shortname is invalid", "Exercise", "shortnameInvalid"); } long numberOfProgrammingExercisesWithSameShortName = programmingExerciseRepository.countByShortNameAndCourse(programmingExercise.getShortName(), course) + programmingExerciseRepository.countByShortNameAndExerciseGroupExamCourse(programmingExercise.getShortName(), course); if (numberOfProgrammingExercisesWithSameShortName > 0) { throw new BadRequestAlertException("A programming exercise with the same short name already exists. Please choose a different short name.", "Exercise", "shortnameAlreadyExists"); } }
[ "private", "void", "validateCourseAndExerciseShortName", "(", "ProgrammingExercise", "programmingExercise", ",", "Course", "course", ")", "{", "if", "(", "programmingExercise", ".", "getShortName", "(", ")", "==", "null", "||", "programmingExercise", ".", "getShortName", "(", ")", ".", "length", "(", ")", "<", "3", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The shortname of the programming exercise is not set or too short\"", ",", "\"Exercise\"", ",", "\"programmingExerciseShortnameInvalid\"", ")", ";", "}", "if", "(", "course", ".", "getShortName", "(", ")", "==", "null", "||", "course", ".", "getShortName", "(", ")", ".", "length", "(", ")", "<", "3", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The shortname of the course is not set or too short\"", ",", "\"Exercise\"", ",", "\"courseShortnameInvalid\"", ")", ";", "}", "Matcher", "shortNameMatcher", "=", "SHORT_NAME_PATTERN", ".", "matcher", "(", "programmingExercise", ".", "getShortName", "(", ")", ")", ";", "if", "(", "!", "shortNameMatcher", ".", "matches", "(", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The shortname is invalid\"", ",", "\"Exercise\"", ",", "\"shortnameInvalid\"", ")", ";", "}", "long", "numberOfProgrammingExercisesWithSameShortName", "=", "programmingExerciseRepository", ".", "countByShortNameAndCourse", "(", "programmingExercise", ".", "getShortName", "(", ")", ",", "course", ")", "+", "programmingExerciseRepository", ".", "countByShortNameAndExerciseGroupExamCourse", "(", "programmingExercise", ".", "getShortName", "(", ")", ",", "course", ")", ";", "if", "(", "numberOfProgrammingExercisesWithSameShortName", ">", "0", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"A programming exercise with the same short name already exists. Please choose a different short name.\"", ",", "\"Exercise\"", ",", "\"shortnameAlreadyExists\"", ")", ";", "}", "}" ]
Validates the course and programming exercise short name.
[ "Validates", "the", "course", "and", "programming", "exercise", "short", "name", "." ]
[ "// Check if exercise shortname is set", "// Check if course shortname is set", "// Check if exercise shortname matches regex", "// NOTE: we have to cover two cases here: exercises directly stored in the course and exercises indirectly stored in the course (exercise -> exerciseGroup -> exam ->", "// course)" ]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" }, { "param": "course", "type": "Course" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "course", "type": "Course", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 1954, 39, 3117, 1876, 424, 20603, 29983, 12, 9459, 11987, 424, 20603, 5402, 11987, 424, 20603, 16, 385, 3117, 4362, 13, 288, 203, 3639, 368, 2073, 309, 24165, 23879, 353, 444, 203, 3639, 309, 261, 12890, 11987, 424, 20603, 18, 588, 29983, 1435, 422, 446, 747, 5402, 11987, 424, 20603, 18, 588, 29983, 7675, 2469, 1435, 411, 890, 13, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 23879, 434, 326, 5402, 11987, 24165, 353, 486, 444, 578, 4885, 3025, 3113, 315, 424, 20603, 3113, 315, 12890, 11987, 424, 20603, 4897, 529, 1941, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 309, 4362, 23879, 353, 444, 203, 3639, 309, 261, 5566, 18, 588, 29983, 1435, 422, 446, 747, 4362, 18, 588, 29983, 7675, 2469, 1435, 411, 890, 13, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 23879, 434, 326, 4362, 353, 486, 444, 578, 4885, 3025, 3113, 315, 424, 20603, 3113, 315, 5566, 4897, 529, 1941, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 309, 24165, 23879, 1885, 3936, 203, 3639, 9757, 19276, 6286, 273, 20079, 67, 1985, 67, 10831, 18, 22761, 12, 12890, 11987, 424, 20603, 18, 588, 29983, 10663, 203, 3639, 309, 16051, 6620, 461, 6286, 18, 8436, 10756, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 23879, 353, 2057, 3113, 315, 424, 20603, 3113, 315, 28650, 1941, 8863, 203, 3639, 289, 203, 203, 3639, 368, 5219, 30, 732, 1240, 358, 5590, 2795, 6088, 2674, 30, 431, 12610, 6141, 5122, 4041, 316, 326, 4362, 471, 431, 12610, 6141, 16807, 715, 4041, 316, 326, 4362, 261, 8913, 30708, 317, 24165, 1114, 317, 19707, 317, 203, 3639, 368, 4362, 13, 203, 3639, 1525, 7922, 9459, 11987, 424, 12610, 6141, 1190, 8650, 29983, 273, 5402, 11987, 424, 20603, 3305, 18, 1883, 858, 29983, 1876, 39, 3117, 12, 12890, 11987, 424, 20603, 18, 588, 29983, 9334, 4362, 13, 203, 7734, 397, 5402, 11987, 424, 20603, 3305, 18, 1883, 858, 29983, 1876, 424, 20603, 1114, 424, 301, 39, 3117, 12, 12890, 11987, 424, 20603, 18, 588, 29983, 9334, 4362, 1769, 203, 3639, 309, 261, 2696, 951, 9459, 11987, 424, 12610, 6141, 1190, 8650, 29983, 405, 374, 13, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 37, 5402, 11987, 24165, 598, 326, 1967, 3025, 508, 1818, 1704, 18, 7801, 9876, 279, 3775, 3025, 508, 1199, 16, 315, 424, 20603, 3113, 203, 10792, 315, 28650, 16686, 8863, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2364, 815, 326, 4362, 471, 5402, 11987, 24165, 3025, 508, 18, 203, 377, 380, 404, 18, 2073, 9805, 471, 769, 434, 24165, 3025, 508, 203, 377, 380, 576, 18, 2073, 9805, 471, 769, 434, 4362, 3025, 508, 203, 377, 380, 890, 18, 4163, 17987, 6884, 316, 24165, 3025, 508, 203, 377, 380, 1059, 18, 2073, 716, 326, 3025, 508, 3302, 1404, 1818, 1005, 598, 310, 4362, 578, 19707, 431, 12610, 6141, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 13586, 11987, 24165, 358, 506, 10266, 203, 377, 380, 632, 891, 4362, 2868, 385, 3117, 434, 326, 5402, 11987, 24165, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
validateTitle
null
private void validateTitle(ProgrammingExercise programmingExercise, Course course) { // Check if exercise title is set if (programmingExercise.getTitle() == null || programmingExercise.getTitle().length() < 3) { throw new BadRequestAlertException("The title of the programming exercise is too short", "Exercise", "programmingExerciseTitleInvalid"); } // Check if the exercise title matches regex Matcher titleMatcher = TITLE_NAME_PATTERN.matcher(programmingExercise.getTitle()); if (!titleMatcher.matches()) { throw new BadRequestAlertException("The title is invalid", "Exercise", "titleInvalid"); } // Check that the exercise title is unique among all programming exercises in the course, otherwise the corresponding project in the VCS system cannot be generated long numberOfProgrammingExercisesWithSameTitle = programmingExerciseRepository.countByTitleAndCourse(programmingExercise.getTitle(), course) + programmingExerciseRepository.countByTitleAndExerciseGroupExamCourse(programmingExercise.getTitle(), course); if (numberOfProgrammingExercisesWithSameTitle > 0) { throw new BadRequestAlertException("A programming exercise with the same title already exists. Please choose a different title.", "Exercise", "titleAlreadyExists"); } }
/** * Validate the programming exercise title. * 1. Check presence and length of exercise title * 2. Find forbidden patterns in exercise title * * @param programmingExercise Programming exercise to be validated * @param course Course of the programming exercise */
Validate the programming exercise title. 1. Check presence and length of exercise title 2. Find forbidden patterns in exercise title @param programmingExercise Programming exercise to be validated @param course Course of the programming exercise
[ "Validate", "the", "programming", "exercise", "title", ".", "1", ".", "Check", "presence", "and", "length", "of", "exercise", "title", "2", ".", "Find", "forbidden", "patterns", "in", "exercise", "title", "@param", "programmingExercise", "Programming", "exercise", "to", "be", "validated", "@param", "course", "Course", "of", "the", "programming", "exercise" ]
private void validateTitle(ProgrammingExercise programmingExercise, Course course) { if (programmingExercise.getTitle() == null || programmingExercise.getTitle().length() < 3) { throw new BadRequestAlertException("The title of the programming exercise is too short", "Exercise", "programmingExerciseTitleInvalid"); } Matcher titleMatcher = TITLE_NAME_PATTERN.matcher(programmingExercise.getTitle()); if (!titleMatcher.matches()) { throw new BadRequestAlertException("The title is invalid", "Exercise", "titleInvalid"); } long numberOfProgrammingExercisesWithSameTitle = programmingExerciseRepository.countByTitleAndCourse(programmingExercise.getTitle(), course) + programmingExerciseRepository.countByTitleAndExerciseGroupExamCourse(programmingExercise.getTitle(), course); if (numberOfProgrammingExercisesWithSameTitle > 0) { throw new BadRequestAlertException("A programming exercise with the same title already exists. Please choose a different title.", "Exercise", "titleAlreadyExists"); } }
[ "private", "void", "validateTitle", "(", "ProgrammingExercise", "programmingExercise", ",", "Course", "course", ")", "{", "if", "(", "programmingExercise", ".", "getTitle", "(", ")", "==", "null", "||", "programmingExercise", ".", "getTitle", "(", ")", ".", "length", "(", ")", "<", "3", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The title of the programming exercise is too short\"", ",", "\"Exercise\"", ",", "\"programmingExerciseTitleInvalid\"", ")", ";", "}", "Matcher", "titleMatcher", "=", "TITLE_NAME_PATTERN", ".", "matcher", "(", "programmingExercise", ".", "getTitle", "(", ")", ")", ";", "if", "(", "!", "titleMatcher", ".", "matches", "(", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The title is invalid\"", ",", "\"Exercise\"", ",", "\"titleInvalid\"", ")", ";", "}", "long", "numberOfProgrammingExercisesWithSameTitle", "=", "programmingExerciseRepository", ".", "countByTitleAndCourse", "(", "programmingExercise", ".", "getTitle", "(", ")", ",", "course", ")", "+", "programmingExerciseRepository", ".", "countByTitleAndExerciseGroupExamCourse", "(", "programmingExercise", ".", "getTitle", "(", ")", ",", "course", ")", ";", "if", "(", "numberOfProgrammingExercisesWithSameTitle", ">", "0", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"A programming exercise with the same title already exists. Please choose a different title.\"", ",", "\"Exercise\"", ",", "\"titleAlreadyExists\"", ")", ";", "}", "}" ]
Validate the programming exercise title.
[ "Validate", "the", "programming", "exercise", "title", "." ]
[ "// Check if exercise title is set", "// Check if the exercise title matches regex", "// Check that the exercise title is unique among all programming exercises in the course, otherwise the corresponding project in the VCS system cannot be generated" ]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" }, { "param": "course", "type": "Course" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "course", "type": "Course", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 1954, 4247, 12, 9459, 11987, 424, 20603, 5402, 11987, 424, 20603, 16, 385, 3117, 4362, 13, 288, 203, 3639, 368, 2073, 309, 24165, 2077, 353, 444, 203, 3639, 309, 261, 12890, 11987, 424, 20603, 18, 588, 4247, 1435, 422, 446, 747, 5402, 11987, 424, 20603, 18, 588, 4247, 7675, 2469, 1435, 411, 890, 13, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 2077, 434, 326, 5402, 11987, 24165, 353, 4885, 3025, 3113, 315, 424, 20603, 3113, 315, 12890, 11987, 424, 20603, 4247, 1941, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 309, 326, 24165, 2077, 1885, 3936, 203, 3639, 9757, 2077, 6286, 273, 29406, 67, 1985, 67, 10831, 18, 22761, 12, 12890, 11987, 424, 20603, 18, 588, 4247, 10663, 203, 3639, 309, 16051, 2649, 6286, 18, 8436, 10756, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 2077, 353, 2057, 3113, 315, 424, 20603, 3113, 315, 2649, 1941, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 716, 326, 24165, 2077, 353, 3089, 17200, 777, 5402, 11987, 431, 12610, 6141, 316, 326, 4362, 16, 3541, 326, 4656, 1984, 316, 326, 776, 4596, 2619, 2780, 506, 4374, 203, 3639, 1525, 7922, 9459, 11987, 424, 12610, 6141, 1190, 8650, 4247, 273, 5402, 11987, 424, 20603, 3305, 18, 1883, 858, 4247, 1876, 39, 3117, 12, 12890, 11987, 424, 20603, 18, 588, 4247, 9334, 4362, 13, 203, 7734, 397, 5402, 11987, 424, 20603, 3305, 18, 1883, 858, 4247, 1876, 424, 20603, 1114, 424, 301, 39, 3117, 12, 12890, 11987, 424, 20603, 18, 588, 4247, 9334, 4362, 1769, 203, 3639, 309, 261, 2696, 951, 9459, 11987, 424, 12610, 6141, 1190, 8650, 4247, 405, 374, 13, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 37, 5402, 11987, 24165, 598, 326, 1967, 2077, 1818, 1704, 18, 7801, 9876, 279, 3775, 2077, 1199, 16, 315, 424, 20603, 3113, 315, 2649, 16686, 8863, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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987, 24165, 2077, 18, 203, 377, 380, 404, 18, 2073, 9805, 471, 769, 434, 24165, 2077, 203, 377, 380, 576, 18, 4163, 17987, 6884, 316, 24165, 2077, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 13586, 11987, 24165, 358, 506, 10266, 203, 377, 380, 632, 891, 4362, 2868, 385, 3117, 434, 326, 5402, 11987, 24165, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
validateProgrammingSettings
null
private void validateProgrammingSettings(ProgrammingExercise programmingExercise) { // Check if a participation mode was selected if (!Boolean.TRUE.equals(programmingExercise.isAllowOnlineEditor()) && !Boolean.TRUE.equals(programmingExercise.isAllowOfflineIde())) { throw new BadRequestAlertException("You need to allow at least one participation mode, the online editor or the offline IDE", "Exercise", "noParticipationModeAllowed"); } // Check if Xcode has no online code editor enabled if (ProjectType.XCODE.equals(programmingExercise.getProjectType()) && Boolean.TRUE.equals(programmingExercise.isAllowOnlineEditor())) { throw new BadRequestAlertException("The online editor is not allowed for Xcode programming exercises", "Exercise", "noParticipationModeAllowed"); } // Check if programming language is set if (programmingExercise.getProgrammingLanguage() == null) { throw new BadRequestAlertException("No programming language was specified", "Exercise", "programmingLanguageNotSet"); } }
/** * Validates general programming exercise settings * 1. Validates the programming language * * @param programmingExercise exercise to validate */
Validates general programming exercise settings 1. Validates the programming language @param programmingExercise exercise to validate
[ "Validates", "general", "programming", "exercise", "settings", "1", ".", "Validates", "the", "programming", "language", "@param", "programmingExercise", "exercise", "to", "validate" ]
private void validateProgrammingSettings(ProgrammingExercise programmingExercise) { if (!Boolean.TRUE.equals(programmingExercise.isAllowOnlineEditor()) && !Boolean.TRUE.equals(programmingExercise.isAllowOfflineIde())) { throw new BadRequestAlertException("You need to allow at least one participation mode, the online editor or the offline IDE", "Exercise", "noParticipationModeAllowed"); } if (ProjectType.XCODE.equals(programmingExercise.getProjectType()) && Boolean.TRUE.equals(programmingExercise.isAllowOnlineEditor())) { throw new BadRequestAlertException("The online editor is not allowed for Xcode programming exercises", "Exercise", "noParticipationModeAllowed"); } if (programmingExercise.getProgrammingLanguage() == null) { throw new BadRequestAlertException("No programming language was specified", "Exercise", "programmingLanguageNotSet"); } }
[ "private", "void", "validateProgrammingSettings", "(", "ProgrammingExercise", "programmingExercise", ")", "{", "if", "(", "!", "Boolean", ".", "TRUE", ".", "equals", "(", "programmingExercise", ".", "isAllowOnlineEditor", "(", ")", ")", "&&", "!", "Boolean", ".", "TRUE", ".", "equals", "(", "programmingExercise", ".", "isAllowOfflineIde", "(", ")", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"You need to allow at least one participation mode, the online editor or the offline IDE\"", ",", "\"Exercise\"", ",", "\"noParticipationModeAllowed\"", ")", ";", "}", "if", "(", "ProjectType", ".", "XCODE", ".", "equals", "(", "programmingExercise", ".", "getProjectType", "(", ")", ")", "&&", "Boolean", ".", "TRUE", ".", "equals", "(", "programmingExercise", ".", "isAllowOnlineEditor", "(", ")", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The online editor is not allowed for Xcode programming exercises\"", ",", "\"Exercise\"", ",", "\"noParticipationModeAllowed\"", ")", ";", "}", "if", "(", "programmingExercise", ".", "getProgrammingLanguage", "(", ")", "==", "null", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"No programming language was specified\"", ",", "\"Exercise\"", ",", "\"programmingLanguageNotSet\"", ")", ";", "}", "}" ]
Validates general programming exercise settings 1.
[ "Validates", "general", "programming", "exercise", "settings", "1", "." ]
[ "// Check if a participation mode was selected", "// Check if Xcode has no online code editor enabled", "// Check if programming language is set" ]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 1954, 9459, 11987, 2628, 12, 9459, 11987, 424, 20603, 5402, 11987, 424, 20603, 13, 288, 203, 203, 3639, 368, 2073, 309, 279, 30891, 367, 1965, 1703, 3170, 203, 3639, 309, 16051, 5507, 18, 18724, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 291, 7009, 16860, 6946, 10756, 597, 401, 5507, 18, 18724, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 291, 7009, 23106, 45, 323, 1435, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 6225, 1608, 358, 1699, 622, 4520, 1245, 30891, 367, 1965, 16, 326, 12365, 4858, 578, 326, 13493, 1599, 41, 3113, 315, 424, 20603, 3113, 315, 2135, 1988, 24629, 367, 2309, 5042, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 309, 1139, 710, 711, 1158, 12365, 981, 4858, 3696, 203, 3639, 309, 261, 4109, 559, 18, 60, 5572, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 588, 4109, 559, 10756, 597, 3411, 18, 18724, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 291, 7009, 16860, 6946, 1435, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 12365, 4858, 353, 486, 2935, 364, 1139, 710, 5402, 11987, 431, 12610, 6141, 3113, 315, 424, 20603, 3113, 315, 2135, 1988, 24629, 367, 2309, 5042, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 309, 5402, 11987, 2653, 353, 444, 203, 3639, 309, 261, 12890, 11987, 424, 20603, 18, 588, 9459, 11987, 3779, 1435, 422, 446, 13, 288, 203, 5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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 2364, 815, 7470, 5402, 11987, 24165, 1947, 203, 377, 380, 404, 18, 2364, 815, 326, 5402, 11987, 2653, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 24165, 358, 1954, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
validateStaticCodeAnalysisSettings
null
private void validateStaticCodeAnalysisSettings(ProgrammingExercise programmingExercise) { ProgrammingLanguageFeature programmingLanguageFeature = programmingLanguageFeatureService.getProgrammingLanguageFeatures(programmingExercise.getProgrammingLanguage()); // Check if the static code analysis flag was set if (programmingExercise.isStaticCodeAnalysisEnabled() == null) { throw new BadRequestAlertException("The static code analysis flag must be set to true or false", "Exercise", "staticCodeAnalysisFlagNotSet"); } // Check that programming exercise doesn't have sequential test runs and static code analysis enabled if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && programmingExercise.hasSequentialTestRuns()) { throw new BadRequestAlertException("The static code analysis with sequential test runs is not supported at the moment", "Exercise", "staticCodeAnalysisAndSequential"); } // Check if the programming language supports static code analysis if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && !programmingLanguageFeature.isStaticCodeAnalysis()) { throw new BadRequestAlertException("The static code analysis is not supported for this programming language", "Exercise", "staticCodeAnalysisNotSupportedForLanguage"); } // Check that Xcode has no SCA enabled if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && ProjectType.XCODE.equals(programmingExercise.getProjectType())) { throw new BadRequestAlertException("The static code analysis is not supported for Xcode programming exercises", "Exercise", "staticCodeAnalysisNotSupportedForLanguage"); } // Static code analysis max penalty must only be set if static code analysis is enabled if (Boolean.FALSE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && programmingExercise.getMaxStaticCodeAnalysisPenalty() != null) { throw new BadRequestAlertException("Max static code analysis penalty must only be set if static code analysis is enabled", "Exercise", "staticCodeAnalysisDisabledButPenaltySet"); } // Static code analysis max penalty must be positive if (programmingExercise.getMaxStaticCodeAnalysisPenalty() != null && programmingExercise.getMaxStaticCodeAnalysisPenalty() < 0) { throw new BadRequestAlertException("You need to allow at least one participation mode, the online editor or the offline IDE", "Exercise", "noParticipationModeAllowed"); } }
/** * Validates static code analysis settings * 1. The flag staticCodeAnalysisEnabled must not be null * 2. Static code analysis and sequential test runs can't be active at the same time * 3. Static code analysis can only be enabled for supported programming languages * 4. Static code analysis max penalty must only be set if static code analysis is enabled * 5. Static code analysis max penalty must be positive * * @param programmingExercise exercise to validate */
Validates static code analysis settings 1. The flag staticCodeAnalysisEnabled must not be null 2. Static code analysis and sequential test runs can't be active at the same time 3. Static code analysis can only be enabled for supported programming languages 4. Static code analysis max penalty must only be set if static code analysis is enabled 5. Static code analysis max penalty must be positive @param programmingExercise exercise to validate
[ "Validates", "static", "code", "analysis", "settings", "1", ".", "The", "flag", "staticCodeAnalysisEnabled", "must", "not", "be", "null", "2", ".", "Static", "code", "analysis", "and", "sequential", "test", "runs", "can", "'", "t", "be", "active", "at", "the", "same", "time", "3", ".", "Static", "code", "analysis", "can", "only", "be", "enabled", "for", "supported", "programming", "languages", "4", ".", "Static", "code", "analysis", "max", "penalty", "must", "only", "be", "set", "if", "static", "code", "analysis", "is", "enabled", "5", ".", "Static", "code", "analysis", "max", "penalty", "must", "be", "positive", "@param", "programmingExercise", "exercise", "to", "validate" ]
private void validateStaticCodeAnalysisSettings(ProgrammingExercise programmingExercise) { ProgrammingLanguageFeature programmingLanguageFeature = programmingLanguageFeatureService.getProgrammingLanguageFeatures(programmingExercise.getProgrammingLanguage()); if (programmingExercise.isStaticCodeAnalysisEnabled() == null) { throw new BadRequestAlertException("The static code analysis flag must be set to true or false", "Exercise", "staticCodeAnalysisFlagNotSet"); } if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && programmingExercise.hasSequentialTestRuns()) { throw new BadRequestAlertException("The static code analysis with sequential test runs is not supported at the moment", "Exercise", "staticCodeAnalysisAndSequential"); } if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && !programmingLanguageFeature.isStaticCodeAnalysis()) { throw new BadRequestAlertException("The static code analysis is not supported for this programming language", "Exercise", "staticCodeAnalysisNotSupportedForLanguage"); } if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && ProjectType.XCODE.equals(programmingExercise.getProjectType())) { throw new BadRequestAlertException("The static code analysis is not supported for Xcode programming exercises", "Exercise", "staticCodeAnalysisNotSupportedForLanguage"); } if (Boolean.FALSE.equals(programmingExercise.isStaticCodeAnalysisEnabled()) && programmingExercise.getMaxStaticCodeAnalysisPenalty() != null) { throw new BadRequestAlertException("Max static code analysis penalty must only be set if static code analysis is enabled", "Exercise", "staticCodeAnalysisDisabledButPenaltySet"); } if (programmingExercise.getMaxStaticCodeAnalysisPenalty() != null && programmingExercise.getMaxStaticCodeAnalysisPenalty() < 0) { throw new BadRequestAlertException("You need to allow at least one participation mode, the online editor or the offline IDE", "Exercise", "noParticipationModeAllowed"); } }
[ "private", "void", "validateStaticCodeAnalysisSettings", "(", "ProgrammingExercise", "programmingExercise", ")", "{", "ProgrammingLanguageFeature", "programmingLanguageFeature", "=", "programmingLanguageFeatureService", ".", "getProgrammingLanguageFeatures", "(", "programmingExercise", ".", "getProgrammingLanguage", "(", ")", ")", ";", "if", "(", "programmingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", "==", "null", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The static code analysis flag must be set to true or false\"", ",", "\"Exercise\"", ",", "\"staticCodeAnalysisFlagNotSet\"", ")", ";", "}", "if", "(", "Boolean", ".", "TRUE", ".", "equals", "(", "programmingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", ")", "&&", "programmingExercise", ".", "hasSequentialTestRuns", "(", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The static code analysis with sequential test runs is not supported at the moment\"", ",", "\"Exercise\"", ",", "\"staticCodeAnalysisAndSequential\"", ")", ";", "}", "if", "(", "Boolean", ".", "TRUE", ".", "equals", "(", "programmingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", ")", "&&", "!", "programmingLanguageFeature", ".", "isStaticCodeAnalysis", "(", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The static code analysis is not supported for this programming language\"", ",", "\"Exercise\"", ",", "\"staticCodeAnalysisNotSupportedForLanguage\"", ")", ";", "}", "if", "(", "Boolean", ".", "TRUE", ".", "equals", "(", "programmingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", ")", "&&", "ProjectType", ".", "XCODE", ".", "equals", "(", "programmingExercise", ".", "getProjectType", "(", ")", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The static code analysis is not supported for Xcode programming exercises\"", ",", "\"Exercise\"", ",", "\"staticCodeAnalysisNotSupportedForLanguage\"", ")", ";", "}", "if", "(", "Boolean", ".", "FALSE", ".", "equals", "(", "programmingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", ")", "&&", "programmingExercise", ".", "getMaxStaticCodeAnalysisPenalty", "(", ")", "!=", "null", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"Max static code analysis penalty must only be set if static code analysis is enabled\"", ",", "\"Exercise\"", ",", "\"staticCodeAnalysisDisabledButPenaltySet\"", ")", ";", "}", "if", "(", "programmingExercise", ".", "getMaxStaticCodeAnalysisPenalty", "(", ")", "!=", "null", "&&", "programmingExercise", ".", "getMaxStaticCodeAnalysisPenalty", "(", ")", "<", "0", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"You need to allow at least one participation mode, the online editor or the offline IDE\"", ",", "\"Exercise\"", ",", "\"noParticipationModeAllowed\"", ")", ";", "}", "}" ]
Validates static code analysis settings 1.
[ "Validates", "static", "code", "analysis", "settings", "1", "." ]
[ "// Check if the static code analysis flag was set", "// Check that programming exercise doesn't have sequential test runs and static code analysis enabled", "// Check if the programming language supports static code analysis", "// Check that Xcode has no SCA enabled", "// Static code analysis max penalty must only be set if static code analysis is enabled", "// Static code analysis max penalty must be positive" ]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 3238, 918, 1954, 5788, 1085, 9418, 2628, 12, 9459, 11987, 424, 20603, 5402, 11987, 424, 20603, 13, 288, 203, 3639, 13586, 11987, 3779, 4595, 5402, 11987, 3779, 4595, 273, 5402, 11987, 3779, 4595, 1179, 18, 588, 9459, 11987, 3779, 8696, 12, 12890, 11987, 424, 20603, 18, 588, 9459, 11987, 3779, 10663, 203, 203, 3639, 368, 2073, 309, 326, 760, 981, 6285, 2982, 1703, 444, 203, 3639, 309, 261, 12890, 11987, 424, 20603, 18, 291, 5788, 1085, 9418, 1526, 1435, 422, 446, 13, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 760, 981, 6285, 2982, 1297, 506, 444, 358, 638, 578, 629, 3113, 315, 424, 20603, 3113, 315, 3845, 1085, 9418, 4678, 1248, 694, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 716, 5402, 11987, 24165, 3302, 1404, 1240, 21210, 1842, 7597, 471, 760, 981, 6285, 3696, 203, 3639, 309, 261, 5507, 18, 18724, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 291, 5788, 1085, 9418, 1526, 10756, 597, 5402, 11987, 424, 20603, 18, 5332, 28241, 4709, 9361, 10756, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 760, 981, 6285, 598, 21210, 1842, 7597, 353, 486, 3260, 622, 326, 10382, 3113, 315, 424, 20603, 3113, 315, 3845, 1085, 9418, 1876, 28241, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 309, 326, 5402, 11987, 2653, 6146, 760, 981, 6285, 203, 3639, 309, 261, 5507, 18, 18724, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 291, 5788, 1085, 9418, 1526, 10756, 597, 401, 12890, 11987, 3779, 4595, 18, 291, 5788, 1085, 9418, 10756, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 760, 981, 6285, 353, 486, 3260, 364, 333, 5402, 11987, 2653, 3113, 315, 424, 20603, 3113, 315, 3845, 1085, 9418, 16106, 1290, 3779, 8863, 203, 3639, 289, 203, 203, 3639, 368, 2073, 716, 1139, 710, 711, 1158, 348, 3587, 3696, 203, 3639, 309, 261, 5507, 18, 18724, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 291, 5788, 1085, 9418, 1526, 10756, 597, 5420, 559, 18, 60, 5572, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 588, 4109, 559, 1435, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 760, 981, 6285, 353, 486, 3260, 364, 1139, 710, 5402, 11987, 431, 12610, 6141, 3113, 315, 424, 20603, 3113, 203, 10792, 315, 3845, 1085, 9418, 16106, 1290, 3779, 8863, 203, 3639, 289, 203, 203, 3639, 368, 10901, 981, 6285, 943, 23862, 1297, 1338, 506, 444, 309, 760, 981, 6285, 353, 3696, 203, 3639, 309, 261, 5507, 18, 21053, 18, 14963, 12, 12890, 11987, 424, 20603, 18, 291, 5788, 1085, 9418, 1526, 10756, 597, 5402, 11987, 424, 20603, 18, 588, 2747, 5788, 1085, 9418, 24251, 15006, 1435, 480, 446, 13, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 2747, 760, 981, 6285, 23862, 1297, 1338, 506, 444, 309, 760, 981, 6285, 353, 3696, 3113, 315, 424, 20603, 3113, 203, 10792, 315, 3845, 1085, 9418, 8853, 31167, 24251, 15006, 694, 8863, 203, 3639, 289, 203, 203, 3639, 368, 10901, 981, 6285, 943, 23862, 1297, 506, 6895, 203, 3639, 309, 261, 12890, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 2364, 815, 760, 981, 6285, 1947, 203, 377, 380, 404, 18, 1021, 2982, 760, 1085, 9418, 1526, 1297, 486, 506, 446, 203, 377, 380, 576, 18, 10901, 981, 6285, 471, 21210, 1842, 7597, 848, 1404, 506, 2695, 622, 326, 1967, 813, 203, 377, 380, 890, 18, 10901, 981, 6285, 848, 1338, 506, 3696, 364, 3260, 5402, 11987, 8191, 203, 377, 380, 1059, 18, 10901, 981, 6285, 943, 23862, 1297, 1338, 506, 444, 309, 760, 981, 6285, 353, 3696, 203, 377, 380, 1381, 18, 10901, 981, 6285, 943, 23862, 1297, 506, 6895, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 24165, 358, 1954, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
createProgrammingExercise
null
@PostMapping(Endpoints.SETUP) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> createProgrammingExercise(@RequestBody ProgrammingExercise programmingExercise) { log.debug("REST request to setup ProgrammingExercise : {}", programmingExercise); if (programmingExercise.getId() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "A new programmingExercise cannot already have an ID", "idexists")).body(null); } // Valid exercises have set either a course or an exerciseGroup programmingExercise.checkCourseAndExerciseGroupExclusivity(ENTITY_NAME); Course course = courseService.retrieveCourseOverExerciseGroupOrCourseId(programmingExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, null); exerciseService.validateGeneralSettings(programmingExercise); validateProgrammingSettings(programmingExercise); auxiliaryRepositoryService.validateAndAddAuxiliaryRepositoriesOfProgrammingExercise(programmingExercise, programmingExercise.getAuxiliaryRepositories()); ProgrammingLanguageFeature programmingLanguageFeature = programmingLanguageFeatureService.getProgrammingLanguageFeatures(programmingExercise.getProgrammingLanguage()); // Check if package name is set if (programmingLanguageFeature.isPackageNameRequired()) { if (programmingExercise.getPackageName() == null) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "The package name is invalid", "packagenameInvalid")).body(null); } // Check if package name matches regex Matcher packageNameMatcher; if (programmingExercise.getProgrammingLanguage() == ProgrammingLanguage.SWIFT) { packageNameMatcher = packageNamePatternForSwift.matcher(programmingExercise.getPackageName()); } else { packageNameMatcher = packageNamePattern.matcher(programmingExercise.getPackageName()); } if (!packageNameMatcher.matches()) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "The package name is invalid", "packagenameInvalid")).body(null); } } // Check if project type is selected if (programmingLanguageFeature.getProjectTypes().size() > 0) { if (programmingExercise.getProjectType() == null) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "The project type is not set", "projectTypeNotSet")).body(null); } if (!programmingLanguageFeature.getProjectTypes().contains(programmingExercise.getProjectType())) { return ResponseEntity.badRequest() .headers(HeaderUtil.createAlert(applicationName, "The project type is not supported for this programming language", "projectTypeNotSupported")).body(null); } } else { if (programmingExercise.getProjectType() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "The project type is set but not supported", "projectTypeSet")).body(null); } } // Check if checkout solution repository is enabled if (programmingExercise.getCheckoutSolutionRepository() && !programmingLanguageFeature.isCheckoutSolutionRepositoryAllowed()) { return ResponseEntity.badRequest() .headers(HeaderUtil.createAlert(applicationName, "Checking out the solution repository is not supported for this language", "checkoutSolutionNotSupported")) .body(null); } validateCourseSettings(programmingExercise, course); validateStaticCodeAnalysisSettings(programmingExercise); programmingExercise.generateAndSetProjectKey(); Optional<ResponseEntity<ProgrammingExercise>> projectExistsError = checkIfProjectExists(programmingExercise); if (projectExistsError.isPresent()) { return projectExistsError.get(); } try { // Setup all repositories etc ProgrammingExercise newProgrammingExercise = programmingExerciseService.createProgrammingExercise(programmingExercise); // Create default static code analysis categories if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled())) { staticCodeAnalysisService.createDefaultCategories(newProgrammingExercise); } return ResponseEntity.created(new URI("/api/programming-exercises" + newProgrammingExercise.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, newProgrammingExercise.getTitle())).body(newProgrammingExercise); } catch (IOException | URISyntaxException | InterruptedException | GitAPIException | ContinuousIntegrationException e) { log.error("Error while setting up programming exercise", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .headers(HeaderUtil.createAlert(applicationName, "An error occurred while setting up the exercise: " + e.getMessage(), "errorProgrammingExercise")).body(null); } }
/** * POST /programming-exercises/setup : Setup a new programmingExercise (with all needed repositories etc.) * * @param programmingExercise the programmingExercise to setup * @return the ResponseEntity with status 201 (Created) and with body the new programmingExercise, or with status 400 (Bad Request) if the parameters are invalid */
POST /programming-exercises/setup : Setup a new programmingExercise (with all needed repositories etc.) @param programmingExercise the programmingExercise to setup @return the ResponseEntity with status 201 (Created) and with body the new programmingExercise, or with status 400 (Bad Request) if the parameters are invalid
[ "POST", "/", "programming", "-", "exercises", "/", "setup", ":", "Setup", "a", "new", "programmingExercise", "(", "with", "all", "needed", "repositories", "etc", ".", ")", "@param", "programmingExercise", "the", "programmingExercise", "to", "setup", "@return", "the", "ResponseEntity", "with", "status", "201", "(", "Created", ")", "and", "with", "body", "the", "new", "programmingExercise", "or", "with", "status", "400", "(", "Bad", "Request", ")", "if", "the", "parameters", "are", "invalid" ]
@PostMapping(Endpoints.SETUP) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> createProgrammingExercise(@RequestBody ProgrammingExercise programmingExercise) { log.debug("REST request to setup ProgrammingExercise : {}", programmingExercise); if (programmingExercise.getId() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "A new programmingExercise cannot already have an ID", "idexists")).body(null); } programmingExercise.checkCourseAndExerciseGroupExclusivity(ENTITY_NAME); Course course = courseService.retrieveCourseOverExerciseGroupOrCourseId(programmingExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, null); exerciseService.validateGeneralSettings(programmingExercise); validateProgrammingSettings(programmingExercise); auxiliaryRepositoryService.validateAndAddAuxiliaryRepositoriesOfProgrammingExercise(programmingExercise, programmingExercise.getAuxiliaryRepositories()); ProgrammingLanguageFeature programmingLanguageFeature = programmingLanguageFeatureService.getProgrammingLanguageFeatures(programmingExercise.getProgrammingLanguage()); if (programmingLanguageFeature.isPackageNameRequired()) { if (programmingExercise.getPackageName() == null) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "The package name is invalid", "packagenameInvalid")).body(null); } Matcher packageNameMatcher; if (programmingExercise.getProgrammingLanguage() == ProgrammingLanguage.SWIFT) { packageNameMatcher = packageNamePatternForSwift.matcher(programmingExercise.getPackageName()); } else { packageNameMatcher = packageNamePattern.matcher(programmingExercise.getPackageName()); } if (!packageNameMatcher.matches()) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "The package name is invalid", "packagenameInvalid")).body(null); } } if (programmingLanguageFeature.getProjectTypes().size() > 0) { if (programmingExercise.getProjectType() == null) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "The project type is not set", "projectTypeNotSet")).body(null); } if (!programmingLanguageFeature.getProjectTypes().contains(programmingExercise.getProjectType())) { return ResponseEntity.badRequest() .headers(HeaderUtil.createAlert(applicationName, "The project type is not supported for this programming language", "projectTypeNotSupported")).body(null); } } else { if (programmingExercise.getProjectType() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "The project type is set but not supported", "projectTypeSet")).body(null); } } if (programmingExercise.getCheckoutSolutionRepository() && !programmingLanguageFeature.isCheckoutSolutionRepositoryAllowed()) { return ResponseEntity.badRequest() .headers(HeaderUtil.createAlert(applicationName, "Checking out the solution repository is not supported for this language", "checkoutSolutionNotSupported")) .body(null); } validateCourseSettings(programmingExercise, course); validateStaticCodeAnalysisSettings(programmingExercise); programmingExercise.generateAndSetProjectKey(); Optional<ResponseEntity<ProgrammingExercise>> projectExistsError = checkIfProjectExists(programmingExercise); if (projectExistsError.isPresent()) { return projectExistsError.get(); } try { ProgrammingExercise newProgrammingExercise = programmingExerciseService.createProgrammingExercise(programmingExercise); if (Boolean.TRUE.equals(programmingExercise.isStaticCodeAnalysisEnabled())) { staticCodeAnalysisService.createDefaultCategories(newProgrammingExercise); } return ResponseEntity.created(new URI("/api/programming-exercises" + newProgrammingExercise.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, newProgrammingExercise.getTitle())).body(newProgrammingExercise); } catch (IOException | URISyntaxException | InterruptedException | GitAPIException | ContinuousIntegrationException e) { log.error("Error while setting up programming exercise", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .headers(HeaderUtil.createAlert(applicationName, "An error occurred while setting up the exercise: " + e.getMessage(), "errorProgrammingExercise")).body(null); } }
[ "@", "PostMapping", "(", "Endpoints", ".", "SETUP", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "ProgrammingExercise", ">", "createProgrammingExercise", "(", "@", "RequestBody", "ProgrammingExercise", "programmingExercise", ")", "{", "log", ".", "debug", "(", "\"REST request to setup ProgrammingExercise : {}\"", ",", "programmingExercise", ")", ";", "if", "(", "programmingExercise", ".", "getId", "(", ")", "!=", "null", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"A new programmingExercise cannot already have an ID\"", ",", "\"idexists\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "programmingExercise", ".", "checkCourseAndExerciseGroupExclusivity", "(", "ENTITY_NAME", ")", ";", "Course", "course", "=", "courseService", ".", "retrieveCourseOverExerciseGroupOrCourseId", "(", "programmingExercise", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleInCourseElseThrow", "(", "Role", ".", "EDITOR", ",", "course", ",", "null", ")", ";", "exerciseService", ".", "validateGeneralSettings", "(", "programmingExercise", ")", ";", "validateProgrammingSettings", "(", "programmingExercise", ")", ";", "auxiliaryRepositoryService", ".", "validateAndAddAuxiliaryRepositoriesOfProgrammingExercise", "(", "programmingExercise", ",", "programmingExercise", ".", "getAuxiliaryRepositories", "(", ")", ")", ";", "ProgrammingLanguageFeature", "programmingLanguageFeature", "=", "programmingLanguageFeatureService", ".", "getProgrammingLanguageFeatures", "(", "programmingExercise", ".", "getProgrammingLanguage", "(", ")", ")", ";", "if", "(", "programmingLanguageFeature", ".", "isPackageNameRequired", "(", ")", ")", "{", "if", "(", "programmingExercise", ".", "getPackageName", "(", ")", "==", "null", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"The package name is invalid\"", ",", "\"packagenameInvalid\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "Matcher", "packageNameMatcher", ";", "if", "(", "programmingExercise", ".", "getProgrammingLanguage", "(", ")", "==", "ProgrammingLanguage", ".", "SWIFT", ")", "{", "packageNameMatcher", "=", "packageNamePatternForSwift", ".", "matcher", "(", "programmingExercise", ".", "getPackageName", "(", ")", ")", ";", "}", "else", "{", "packageNameMatcher", "=", "packageNamePattern", ".", "matcher", "(", "programmingExercise", ".", "getPackageName", "(", ")", ")", ";", "}", "if", "(", "!", "packageNameMatcher", ".", "matches", "(", ")", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"The package name is invalid\"", ",", "\"packagenameInvalid\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "}", "if", "(", "programmingLanguageFeature", ".", "getProjectTypes", "(", ")", ".", "size", "(", ")", ">", "0", ")", "{", "if", "(", "programmingExercise", ".", "getProjectType", "(", ")", "==", "null", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"The project type is not set\"", ",", "\"projectTypeNotSet\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "if", "(", "!", "programmingLanguageFeature", ".", "getProjectTypes", "(", ")", ".", "contains", "(", "programmingExercise", ".", "getProjectType", "(", ")", ")", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"The project type is not supported for this programming language\"", ",", "\"projectTypeNotSupported\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "}", "else", "{", "if", "(", "programmingExercise", ".", "getProjectType", "(", ")", "!=", "null", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"The project type is set but not supported\"", ",", "\"projectTypeSet\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "}", "if", "(", "programmingExercise", ".", "getCheckoutSolutionRepository", "(", ")", "&&", "!", "programmingLanguageFeature", ".", "isCheckoutSolutionRepositoryAllowed", "(", ")", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"Checking out the solution repository is not supported for this language\"", ",", "\"checkoutSolutionNotSupported\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "validateCourseSettings", "(", "programmingExercise", ",", "course", ")", ";", "validateStaticCodeAnalysisSettings", "(", "programmingExercise", ")", ";", "programmingExercise", ".", "generateAndSetProjectKey", "(", ")", ";", "Optional", "<", "ResponseEntity", "<", "ProgrammingExercise", ">", ">", "projectExistsError", "=", "checkIfProjectExists", "(", "programmingExercise", ")", ";", "if", "(", "projectExistsError", ".", "isPresent", "(", ")", ")", "{", "return", "projectExistsError", ".", "get", "(", ")", ";", "}", "try", "{", "ProgrammingExercise", "newProgrammingExercise", "=", "programmingExerciseService", ".", "createProgrammingExercise", "(", "programmingExercise", ")", ";", "if", "(", "Boolean", ".", "TRUE", ".", "equals", "(", "programmingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", ")", ")", "{", "staticCodeAnalysisService", ".", "createDefaultCategories", "(", "newProgrammingExercise", ")", ";", "}", "return", "ResponseEntity", ".", "created", "(", "new", "URI", "(", "\"/api/programming-exercises\"", "+", "newProgrammingExercise", ".", "getId", "(", ")", ")", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityCreationAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "newProgrammingExercise", ".", "getTitle", "(", ")", ")", ")", ".", "body", "(", "newProgrammingExercise", ")", ";", "}", "catch", "(", "IOException", "|", "URISyntaxException", "|", "InterruptedException", "|", "GitAPIException", "|", "ContinuousIntegrationException", "e", ")", "{", "log", ".", "error", "(", "\"Error while setting up programming exercise\"", ",", "e", ")", ";", "return", "ResponseEntity", ".", "status", "(", "HttpStatus", ".", "INTERNAL_SERVER_ERROR", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"An error occurred while setting up the exercise: \"", "+", "e", ".", "getMessage", "(", ")", ",", "\"errorProgrammingExercise\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "}" ]
POST /programming-exercises/setup : Setup a new programmingExercise (with all needed repositories etc.)
[ "POST", "/", "programming", "-", "exercises", "/", "setup", ":", "Setup", "a", "new", "programmingExercise", "(", "with", "all", "needed", "repositories", "etc", ".", ")" ]
[ "// Valid exercises have set either a course or an exerciseGroup", "// Check if package name is set", "// Check if package name matches regex", "// Check if project type is selected", "// Check if checkout solution repository is enabled", "// Setup all repositories etc", "// Create default static code analysis categories" ]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 3349, 3233, 12, 10357, 18, 4043, 3079, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 9459, 11987, 424, 20603, 34, 752, 9459, 11987, 424, 20603, 26964, 28843, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 13, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 3875, 13586, 11987, 424, 20603, 294, 3728, 16, 5402, 11987, 424, 20603, 1769, 203, 3639, 309, 261, 12890, 11987, 424, 20603, 18, 26321, 1435, 480, 446, 13, 288, 203, 5411, 327, 2306, 1943, 18, 8759, 691, 7675, 2485, 12, 1864, 1304, 18, 2640, 13298, 12, 3685, 461, 16, 315, 37, 394, 5402, 11987, 424, 20603, 2780, 1818, 1240, 392, 1599, 3113, 315, 77, 561, 1486, 7923, 2934, 3432, 12, 2011, 1769, 203, 3639, 289, 203, 203, 3639, 368, 2364, 431, 12610, 6141, 1240, 444, 3344, 279, 4362, 578, 392, 24165, 1114, 203, 3639, 5402, 11987, 424, 20603, 18, 1893, 39, 3117, 1876, 424, 20603, 1114, 424, 830, 407, 2818, 12, 11101, 67, 1985, 1769, 203, 3639, 385, 3117, 4362, 273, 4362, 1179, 18, 17466, 39, 3117, 4851, 424, 20603, 1114, 1162, 39, 3117, 548, 12, 12890, 11987, 424, 20603, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 382, 39, 3117, 12427, 8282, 12, 2996, 18, 13208, 16, 4362, 16, 446, 1769, 203, 203, 3639, 24165, 1179, 18, 5662, 12580, 2628, 12, 12890, 11987, 424, 20603, 1769, 203, 3639, 1954, 9459, 11987, 2628, 12, 12890, 11987, 424, 20603, 1769, 203, 3639, 9397, 20606, 3305, 1179, 18, 5662, 1876, 986, 21981, 20606, 18429, 951, 9459, 11987, 424, 20603, 12, 12890, 11987, 424, 20603, 16, 5402, 11987, 424, 20603, 18, 588, 21981, 20606, 18429, 10663, 203, 203, 3639, 13586, 11987, 3779, 4595, 5402, 11987, 3779, 4595, 273, 5402, 11987, 3779, 4595, 1179, 18, 588, 9459, 11987, 3779, 8696, 12, 12890, 11987, 424, 20603, 18, 588, 9459, 11987, 3779, 10663, 203, 203, 3639, 368, 2073, 309, 2181, 508, 353, 444, 203, 3639, 309, 261, 12890, 11987, 3779, 4595, 18, 291, 18308, 3705, 10756, 288, 203, 5411, 309, 261, 12890, 11987, 424, 20603, 18, 588, 18308, 1435, 422, 446, 13, 288, 203, 7734, 327, 2306, 1943, 18, 8759, 691, 7675, 2485, 12, 1864, 1304, 18, 2640, 13298, 12, 3685, 461, 16, 315, 1986, 2181, 508, 353, 2057, 3113, 315, 2920, 346, 1069, 1941, 7923, 2934, 3432, 12, 2011, 1769, 203, 5411, 289, 203, 203, 5411, 368, 2073, 309, 2181, 508, 1885, 3936, 203, 5411, 9757, 9929, 6286, 31, 203, 5411, 309, 261, 12890, 11987, 424, 20603, 18, 588, 9459, 11987, 3779, 1435, 422, 13586, 11987, 3779, 18, 18746, 17925, 13, 288, 203, 7734, 9929, 6286, 273, 9929, 3234, 1290, 6050, 2136, 18, 22761, 12, 12890, 11987, 424, 20603, 18, 588, 18308, 10663, 203, 5411, 289, 203, 5411, 469, 288, 203, 7734, 9929, 6286, 273, 9929, 3234, 18, 22761, 12, 12890, 11987, 424, 20603, 18, 588, 18308, 10663, 203, 5411, 289, 203, 5411, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 5485, 342, 12890, 11987, 17, 8913, 71, 6141, 19, 8401, 294, 10939, 279, 394, 5402, 11987, 424, 20603, 261, 1918, 777, 3577, 14531, 5527, 12998, 203, 377, 380, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 326, 5402, 11987, 424, 20603, 358, 3875, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 3786, 261, 6119, 13, 471, 598, 1417, 326, 394, 5402, 11987, 424, 20603, 16, 578, 598, 1267, 7409, 261, 6434, 1567, 13, 309, 326, 1472, 854, 2057, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
checkIfProjectExists
null
public Optional<ResponseEntity<ProgrammingExercise>> checkIfProjectExists(ProgrammingExercise programmingExercise) { String projectKey = programmingExercise.getProjectKey(); String projectName = programmingExercise.getProjectName(); boolean projectExists = versionControlService.get().checkIfProjectExists(projectKey, projectName); if (projectExists) { return Optional.of(ResponseEntity.badRequest() .headers(HeaderUtil.createAlert(applicationName, "Project already exists on the Version Control Server: " + projectName + ". Please choose a different title and short name!", "vcsProjectExists")) .body(null)); } String errorMessageCI = continuousIntegrationService.get().checkIfProjectExists(projectKey, projectName); if (errorMessageCI != null) { return Optional.of(ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, errorMessageCI, "ciProjectExists")).body(null)); } // means the project does not exist in version control server and does not exist in continuous integration server return Optional.empty(); }
/** * Checks if the project for the given programming exercise already exists in the version control system (VCS) and in the continuous integration system (CIS). * The check is done based on the project key (course short name + exercise short name) and the project name (course short name + exercise title). * This prevents errors then the actual projects will be generated later on. * An error response is returned in case the project does already exist. This will then e.g. stop the generation (or import) of the programming exercise. * * @param programmingExercise a typically new programming exercise for which the corresponding VCS and CIS projects should not yet exist. * @return an error response in case the project already exists or an empty optional in case it does not exist yet (which means the setup can continue as usual) */
Checks if the project for the given programming exercise already exists in the version control system (VCS) and in the continuous integration system (CIS). The check is done based on the project key (course short name + exercise short name) and the project name (course short name + exercise title). This prevents errors then the actual projects will be generated later on. An error response is returned in case the project does already exist. @param programmingExercise a typically new programming exercise for which the corresponding VCS and CIS projects should not yet exist. @return an error response in case the project already exists or an empty optional in case it does not exist yet (which means the setup can continue as usual)
[ "Checks", "if", "the", "project", "for", "the", "given", "programming", "exercise", "already", "exists", "in", "the", "version", "control", "system", "(", "VCS", ")", "and", "in", "the", "continuous", "integration", "system", "(", "CIS", ")", ".", "The", "check", "is", "done", "based", "on", "the", "project", "key", "(", "course", "short", "name", "+", "exercise", "short", "name", ")", "and", "the", "project", "name", "(", "course", "short", "name", "+", "exercise", "title", ")", ".", "This", "prevents", "errors", "then", "the", "actual", "projects", "will", "be", "generated", "later", "on", ".", "An", "error", "response", "is", "returned", "in", "case", "the", "project", "does", "already", "exist", ".", "@param", "programmingExercise", "a", "typically", "new", "programming", "exercise", "for", "which", "the", "corresponding", "VCS", "and", "CIS", "projects", "should", "not", "yet", "exist", ".", "@return", "an", "error", "response", "in", "case", "the", "project", "already", "exists", "or", "an", "empty", "optional", "in", "case", "it", "does", "not", "exist", "yet", "(", "which", "means", "the", "setup", "can", "continue", "as", "usual", ")" ]
public Optional<ResponseEntity<ProgrammingExercise>> checkIfProjectExists(ProgrammingExercise programmingExercise) { String projectKey = programmingExercise.getProjectKey(); String projectName = programmingExercise.getProjectName(); boolean projectExists = versionControlService.get().checkIfProjectExists(projectKey, projectName); if (projectExists) { return Optional.of(ResponseEntity.badRequest() .headers(HeaderUtil.createAlert(applicationName, "Project already exists on the Version Control Server: " + projectName + ". Please choose a different title and short name!", "vcsProjectExists")) .body(null)); } String errorMessageCI = continuousIntegrationService.get().checkIfProjectExists(projectKey, projectName); if (errorMessageCI != null) { return Optional.of(ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, errorMessageCI, "ciProjectExists")).body(null)); } return Optional.empty(); }
[ "public", "Optional", "<", "ResponseEntity", "<", "ProgrammingExercise", ">", ">", "checkIfProjectExists", "(", "ProgrammingExercise", "programmingExercise", ")", "{", "String", "projectKey", "=", "programmingExercise", ".", "getProjectKey", "(", ")", ";", "String", "projectName", "=", "programmingExercise", ".", "getProjectName", "(", ")", ";", "boolean", "projectExists", "=", "versionControlService", ".", "get", "(", ")", ".", "checkIfProjectExists", "(", "projectKey", ",", "projectName", ")", ";", "if", "(", "projectExists", ")", "{", "return", "Optional", ".", "of", "(", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"Project already exists on the Version Control Server: \"", "+", "projectName", "+", "\". Please choose a different title and short name!\"", ",", "\"vcsProjectExists\"", ")", ")", ".", "body", "(", "null", ")", ")", ";", "}", "String", "errorMessageCI", "=", "continuousIntegrationService", ".", "get", "(", ")", ".", "checkIfProjectExists", "(", "projectKey", ",", "projectName", ")", ";", "if", "(", "errorMessageCI", "!=", "null", ")", "{", "return", "Optional", ".", "of", "(", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "errorMessageCI", ",", "\"ciProjectExists\"", ")", ")", ".", "body", "(", "null", ")", ")", ";", "}", "return", "Optional", ".", "empty", "(", ")", ";", "}" ]
Checks if the project for the given programming exercise already exists in the version control system (VCS) and in the continuous integration system (CIS).
[ "Checks", "if", "the", "project", "for", "the", "given", "programming", "exercise", "already", "exists", "in", "the", "version", "control", "system", "(", "VCS", ")", "and", "in", "the", "continuous", "integration", "system", "(", "CIS", ")", "." ]
[ "// means the project does not exist in version control server and does not exist in continuous integration server" ]
[ { "param": "programmingExercise", "type": "ProgrammingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 4055, 32, 1064, 1943, 32, 9459, 11987, 424, 20603, 9778, 19130, 4109, 4002, 12, 9459, 11987, 424, 20603, 5402, 11987, 424, 20603, 13, 288, 203, 3639, 514, 1984, 653, 273, 5402, 11987, 424, 20603, 18, 588, 4109, 653, 5621, 203, 3639, 514, 17234, 273, 5402, 11987, 424, 20603, 18, 588, 4109, 461, 5621, 203, 3639, 1250, 1984, 4002, 273, 1177, 3367, 1179, 18, 588, 7675, 1893, 2047, 4109, 4002, 12, 4406, 653, 16, 17234, 1769, 203, 3639, 309, 261, 4406, 4002, 13, 288, 203, 5411, 327, 4055, 18, 792, 12, 1064, 1943, 18, 8759, 691, 1435, 203, 10792, 263, 2485, 12, 1864, 1304, 18, 2640, 13298, 12, 3685, 461, 16, 203, 18701, 315, 4109, 1818, 1704, 603, 326, 4049, 8888, 3224, 30, 315, 397, 17234, 397, 3552, 7801, 9876, 279, 3775, 2077, 471, 3025, 508, 5, 3113, 315, 18982, 4109, 4002, 6, 3719, 203, 10792, 263, 3432, 12, 2011, 10019, 203, 3639, 289, 203, 203, 3639, 514, 9324, 7266, 273, 17235, 15372, 1179, 18, 588, 7675, 1893, 2047, 4109, 4002, 12, 4406, 653, 16, 17234, 1769, 203, 3639, 309, 261, 1636, 1079, 7266, 480, 446, 13, 288, 203, 5411, 327, 4055, 18, 792, 12, 1064, 1943, 18, 8759, 691, 7675, 2485, 12, 1864, 1304, 18, 2640, 13298, 12, 3685, 461, 16, 9324, 7266, 16, 315, 8450, 4109, 4002, 7923, 2934, 3432, 12, 2011, 10019, 203, 3639, 289, 203, 3639, 368, 4696, 326, 1984, 1552, 486, 1005, 316, 1177, 3325, 1438, 471, 1552, 486, 1005, 316, 17235, 12040, 1438, 203, 3639, 327, 4055, 18, 5531, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 13074, 309, 326, 1984, 364, 326, 864, 5402, 11987, 24165, 1818, 1704, 316, 326, 1177, 3325, 2619, 261, 58, 4596, 13, 471, 316, 326, 17235, 12040, 2619, 261, 39, 5127, 2934, 203, 377, 380, 1021, 866, 353, 2731, 2511, 603, 326, 1984, 498, 261, 5566, 3025, 508, 397, 24165, 3025, 508, 13, 471, 326, 1984, 508, 261, 5566, 3025, 508, 397, 24165, 2077, 2934, 203, 377, 380, 1220, 17793, 1334, 1508, 326, 3214, 10137, 903, 506, 4374, 5137, 603, 18, 203, 377, 380, 1922, 555, 766, 353, 2106, 316, 648, 326, 1984, 1552, 1818, 1005, 18, 1220, 903, 1508, 425, 18, 75, 18, 2132, 326, 9377, 261, 280, 1930, 13, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 203, 377, 380, 2 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
importProgrammingExercise
null
@PostMapping(Endpoints.IMPORT) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> importProgrammingExercise(@PathVariable long sourceExerciseId, @RequestBody ProgrammingExercise newExercise, @RequestParam(defaultValue = "false") boolean recreateBuildPlans, @RequestParam(defaultValue = "false") boolean updateTemplate) { if (sourceExerciseId < 0) { return badRequest(); } // Valid exercises have set either a course or an exerciseGroup newExercise.checkCourseAndExerciseGroupExclusivity(ENTITY_NAME); log.debug("REST request to import programming exercise {} into course {}", sourceExerciseId, newExercise.getCourseViaExerciseGroupOrCourseMember().getId()); exerciseService.validateGeneralSettings(newExercise); validateProgrammingSettings(newExercise); validateStaticCodeAnalysisSettings(newExercise); final var user = userRepository.getUserWithGroupsAndAuthorities(); Course course = courseService.retrieveCourseOverExerciseGroupOrCourseId(newExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, user); // Validate course settings validateCourseSettings(newExercise, course); final var optionalOriginalProgrammingExercise = programmingExerciseRepository .findByIdWithEagerTestCasesStaticCodeAnalysisCategoriesHintsAndTemplateAndSolutionParticipationsAndAuxRepos(sourceExerciseId); if (optionalOriginalProgrammingExercise.isEmpty()) { return notFound(); } final var originalProgrammingExercise = optionalOriginalProgrammingExercise.get(); // The static code analysis flag can only change, if the build plans are recreated and the template is upgraded if (newExercise.isStaticCodeAnalysisEnabled() != originalProgrammingExercise.isStaticCodeAnalysisEnabled() && !(recreateBuildPlans && updateTemplate)) { throw new BadRequestAlertException("Static code analysis can only change, if the recreation of build plans and update of template files is activated", ENTITY_NAME, "staticCodeAnalysisCannotChange"); } // Check if the user has the rights to access the original programming exercise Course originalCourse = courseService.retrieveCourseOverExerciseGroupOrCourseId(originalProgrammingExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, originalCourse, user); newExercise.generateAndSetProjectKey(); Optional<ResponseEntity<ProgrammingExercise>> projectExistsError = checkIfProjectExists(newExercise); if (projectExistsError.isPresent()) { return projectExistsError.get(); } final var importedProgrammingExercise = programmingExerciseImportService.importProgrammingExerciseBasis(originalProgrammingExercise, newExercise); programmingExerciseImportService.importRepositories(originalProgrammingExercise, importedProgrammingExercise); // Update the template files if (updateTemplate) { TemplateUpgradeService upgradeService = templateUpgradePolicy.getUpgradeService(importedProgrammingExercise.getProgrammingLanguage()); upgradeService.upgradeTemplate(importedProgrammingExercise); } HttpHeaders responseHeaders; // Copy or recreate the build plans try { if (recreateBuildPlans) { // Create completely new build plans for the exercise programmingExerciseService.setupBuildPlansForNewExercise(importedProgrammingExercise); } else { // We have removed the automatic build trigger from test to base for new programming exercises. // We also remove this build trigger in the case of an import as the source exercise might still have this trigger. // The importBuildPlans method includes this process programmingExerciseImportService.importBuildPlans(originalProgrammingExercise, importedProgrammingExercise); } responseHeaders = HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, importedProgrammingExercise.getTitle()); } catch (Exception e) { responseHeaders = HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "importExerciseTriggerPlanFail", "Unable to trigger imported build plans"); } programmingExerciseService.scheduleOperations(importedProgrammingExercise.getId()); // Remove unnecessary fields importedProgrammingExercise.setTestCases(null); importedProgrammingExercise.setStaticCodeAnalysisCategories(null); importedProgrammingExercise.setTemplateParticipation(null); importedProgrammingExercise.setSolutionParticipation(null); importedProgrammingExercise.setExerciseHints(null); return ResponseEntity.ok().headers(responseHeaders).body(importedProgrammingExercise); }
/** * POST /programming-exercises/import: Imports an existing programming exercise into an existing course * <p> * This will import the whole exercise, including all base build plans (template, solution) and repositories * (template, solution, test). Referenced entities, s.a. the test cases or the hints will get cloned and assigned * a new id. For a concrete list of what gets copied and what not have a look * at {@link ProgrammingExerciseImportService#importProgrammingExerciseBasis(ProgrammingExercise, ProgrammingExercise)} * * @param sourceExerciseId The ID of the original exercise which should get imported * @param newExercise The new exercise containing values that should get overwritten in the imported exercise, s.a. the title or difficulty * @param recreateBuildPlans Option determining whether the build plans should be copied or re-created from scratch * @param updateTemplate Option determining whether the template files should be updated with the most recent template version * @return The imported exercise (200), a not found error (404) if the template does not exist, or a forbidden error * (403) if the user is not at least an instructor in the target course. * @see ProgrammingExerciseImportService#importProgrammingExerciseBasis(ProgrammingExercise, ProgrammingExercise) * @see ProgrammingExerciseImportService#importBuildPlans(ProgrammingExercise, ProgrammingExercise) * @see ProgrammingExerciseImportService#importRepositories(ProgrammingExercise, ProgrammingExercise) */
POST /programming-exercises/import: Imports an existing programming exercise into an existing course This will import the whole exercise, including all base build plans (template, solution) and repositories (template, solution, test). @param sourceExerciseId The ID of the original exercise which should get imported @param newExercise The new exercise containing values that should get overwritten in the imported exercise, s.a. the title or difficulty @param recreateBuildPlans Option determining whether the build plans should be copied or re-created from scratch @param updateTemplate Option determining whether the template files should be updated with the most recent template version @return The imported exercise (200), a not found error (404) if the template does not exist, or a forbidden error (403) if the user is not at least an instructor in the target course.
[ "POST", "/", "programming", "-", "exercises", "/", "import", ":", "Imports", "an", "existing", "programming", "exercise", "into", "an", "existing", "course", "This", "will", "import", "the", "whole", "exercise", "including", "all", "base", "build", "plans", "(", "template", "solution", ")", "and", "repositories", "(", "template", "solution", "test", ")", ".", "@param", "sourceExerciseId", "The", "ID", "of", "the", "original", "exercise", "which", "should", "get", "imported", "@param", "newExercise", "The", "new", "exercise", "containing", "values", "that", "should", "get", "overwritten", "in", "the", "imported", "exercise", "s", ".", "a", ".", "the", "title", "or", "difficulty", "@param", "recreateBuildPlans", "Option", "determining", "whether", "the", "build", "plans", "should", "be", "copied", "or", "re", "-", "created", "from", "scratch", "@param", "updateTemplate", "Option", "determining", "whether", "the", "template", "files", "should", "be", "updated", "with", "the", "most", "recent", "template", "version", "@return", "The", "imported", "exercise", "(", "200", ")", "a", "not", "found", "error", "(", "404", ")", "if", "the", "template", "does", "not", "exist", "or", "a", "forbidden", "error", "(", "403", ")", "if", "the", "user", "is", "not", "at", "least", "an", "instructor", "in", "the", "target", "course", "." ]
@PostMapping(Endpoints.IMPORT) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> importProgrammingExercise(@PathVariable long sourceExerciseId, @RequestBody ProgrammingExercise newExercise, @RequestParam(defaultValue = "false") boolean recreateBuildPlans, @RequestParam(defaultValue = "false") boolean updateTemplate) { if (sourceExerciseId < 0) { return badRequest(); } newExercise.checkCourseAndExerciseGroupExclusivity(ENTITY_NAME); log.debug("REST request to import programming exercise {} into course {}", sourceExerciseId, newExercise.getCourseViaExerciseGroupOrCourseMember().getId()); exerciseService.validateGeneralSettings(newExercise); validateProgrammingSettings(newExercise); validateStaticCodeAnalysisSettings(newExercise); final var user = userRepository.getUserWithGroupsAndAuthorities(); Course course = courseService.retrieveCourseOverExerciseGroupOrCourseId(newExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, user); validateCourseSettings(newExercise, course); final var optionalOriginalProgrammingExercise = programmingExerciseRepository .findByIdWithEagerTestCasesStaticCodeAnalysisCategoriesHintsAndTemplateAndSolutionParticipationsAndAuxRepos(sourceExerciseId); if (optionalOriginalProgrammingExercise.isEmpty()) { return notFound(); } final var originalProgrammingExercise = optionalOriginalProgrammingExercise.get(); if (newExercise.isStaticCodeAnalysisEnabled() != originalProgrammingExercise.isStaticCodeAnalysisEnabled() && !(recreateBuildPlans && updateTemplate)) { throw new BadRequestAlertException("Static code analysis can only change, if the recreation of build plans and update of template files is activated", ENTITY_NAME, "staticCodeAnalysisCannotChange"); } Course originalCourse = courseService.retrieveCourseOverExerciseGroupOrCourseId(originalProgrammingExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, originalCourse, user); newExercise.generateAndSetProjectKey(); Optional<ResponseEntity<ProgrammingExercise>> projectExistsError = checkIfProjectExists(newExercise); if (projectExistsError.isPresent()) { return projectExistsError.get(); } final var importedProgrammingExercise = programmingExerciseImportService.importProgrammingExerciseBasis(originalProgrammingExercise, newExercise); programmingExerciseImportService.importRepositories(originalProgrammingExercise, importedProgrammingExercise); if (updateTemplate) { TemplateUpgradeService upgradeService = templateUpgradePolicy.getUpgradeService(importedProgrammingExercise.getProgrammingLanguage()); upgradeService.upgradeTemplate(importedProgrammingExercise); } HttpHeaders responseHeaders; try { if (recreateBuildPlans) { programmingExerciseService.setupBuildPlansForNewExercise(importedProgrammingExercise); } else { programmingExerciseImportService.importBuildPlans(originalProgrammingExercise, importedProgrammingExercise); } responseHeaders = HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, importedProgrammingExercise.getTitle()); } catch (Exception e) { responseHeaders = HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "importExerciseTriggerPlanFail", "Unable to trigger imported build plans"); } programmingExerciseService.scheduleOperations(importedProgrammingExercise.getId()); importedProgrammingExercise.setTestCases(null); importedProgrammingExercise.setStaticCodeAnalysisCategories(null); importedProgrammingExercise.setTemplateParticipation(null); importedProgrammingExercise.setSolutionParticipation(null); importedProgrammingExercise.setExerciseHints(null); return ResponseEntity.ok().headers(responseHeaders).body(importedProgrammingExercise); }
[ "@", "PostMapping", "(", "Endpoints", ".", "IMPORT", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "ProgrammingExercise", ">", "importProgrammingExercise", "(", "@", "PathVariable", "long", "sourceExerciseId", ",", "@", "RequestBody", "ProgrammingExercise", "newExercise", ",", "@", "RequestParam", "(", "defaultValue", "=", "\"false\"", ")", "boolean", "recreateBuildPlans", ",", "@", "RequestParam", "(", "defaultValue", "=", "\"false\"", ")", "boolean", "updateTemplate", ")", "{", "if", "(", "sourceExerciseId", "<", "0", ")", "{", "return", "badRequest", "(", ")", ";", "}", "newExercise", ".", "checkCourseAndExerciseGroupExclusivity", "(", "ENTITY_NAME", ")", ";", "log", ".", "debug", "(", "\"REST request to import programming exercise {} into course {}\"", ",", "sourceExerciseId", ",", "newExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ".", "getId", "(", ")", ")", ";", "exerciseService", ".", "validateGeneralSettings", "(", "newExercise", ")", ";", "validateProgrammingSettings", "(", "newExercise", ")", ";", "validateStaticCodeAnalysisSettings", "(", "newExercise", ")", ";", "final", "var", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "Course", "course", "=", "courseService", ".", "retrieveCourseOverExerciseGroupOrCourseId", "(", "newExercise", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleInCourseElseThrow", "(", "Role", ".", "EDITOR", ",", "course", ",", "user", ")", ";", "validateCourseSettings", "(", "newExercise", ",", "course", ")", ";", "final", "var", "optionalOriginalProgrammingExercise", "=", "programmingExerciseRepository", ".", "findByIdWithEagerTestCasesStaticCodeAnalysisCategoriesHintsAndTemplateAndSolutionParticipationsAndAuxRepos", "(", "sourceExerciseId", ")", ";", "if", "(", "optionalOriginalProgrammingExercise", ".", "isEmpty", "(", ")", ")", "{", "return", "notFound", "(", ")", ";", "}", "final", "var", "originalProgrammingExercise", "=", "optionalOriginalProgrammingExercise", ".", "get", "(", ")", ";", "if", "(", "newExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", "!=", "originalProgrammingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", "&&", "!", "(", "recreateBuildPlans", "&&", "updateTemplate", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"Static code analysis can only change, if the recreation of build plans and update of template files is activated\"", ",", "ENTITY_NAME", ",", "\"staticCodeAnalysisCannotChange\"", ")", ";", "}", "Course", "originalCourse", "=", "courseService", ".", "retrieveCourseOverExerciseGroupOrCourseId", "(", "originalProgrammingExercise", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleInCourseElseThrow", "(", "Role", ".", "EDITOR", ",", "originalCourse", ",", "user", ")", ";", "newExercise", ".", "generateAndSetProjectKey", "(", ")", ";", "Optional", "<", "ResponseEntity", "<", "ProgrammingExercise", ">", ">", "projectExistsError", "=", "checkIfProjectExists", "(", "newExercise", ")", ";", "if", "(", "projectExistsError", ".", "isPresent", "(", ")", ")", "{", "return", "projectExistsError", ".", "get", "(", ")", ";", "}", "final", "var", "importedProgrammingExercise", "=", "programmingExerciseImportService", ".", "importProgrammingExerciseBasis", "(", "originalProgrammingExercise", ",", "newExercise", ")", ";", "programmingExerciseImportService", ".", "importRepositories", "(", "originalProgrammingExercise", ",", "importedProgrammingExercise", ")", ";", "if", "(", "updateTemplate", ")", "{", "TemplateUpgradeService", "upgradeService", "=", "templateUpgradePolicy", ".", "getUpgradeService", "(", "importedProgrammingExercise", ".", "getProgrammingLanguage", "(", ")", ")", ";", "upgradeService", ".", "upgradeTemplate", "(", "importedProgrammingExercise", ")", ";", "}", "HttpHeaders", "responseHeaders", ";", "try", "{", "if", "(", "recreateBuildPlans", ")", "{", "programmingExerciseService", ".", "setupBuildPlansForNewExercise", "(", "importedProgrammingExercise", ")", ";", "}", "else", "{", "programmingExerciseImportService", ".", "importBuildPlans", "(", "originalProgrammingExercise", ",", "importedProgrammingExercise", ")", ";", "}", "responseHeaders", "=", "HeaderUtil", ".", "createEntityCreationAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "importedProgrammingExercise", ".", "getTitle", "(", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "responseHeaders", "=", "HeaderUtil", ".", "createFailureAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "\"importExerciseTriggerPlanFail\"", ",", "\"Unable to trigger imported build plans\"", ")", ";", "}", "programmingExerciseService", ".", "scheduleOperations", "(", "importedProgrammingExercise", ".", "getId", "(", ")", ")", ";", "importedProgrammingExercise", ".", "setTestCases", "(", "null", ")", ";", "importedProgrammingExercise", ".", "setStaticCodeAnalysisCategories", "(", "null", ")", ";", "importedProgrammingExercise", ".", "setTemplateParticipation", "(", "null", ")", ";", "importedProgrammingExercise", ".", "setSolutionParticipation", "(", "null", ")", ";", "importedProgrammingExercise", ".", "setExerciseHints", "(", "null", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "responseHeaders", ")", ".", "body", "(", "importedProgrammingExercise", ")", ";", "}" ]
POST /programming-exercises/import: Imports an existing programming exercise into an existing course <p> This will import the whole exercise, including all base build plans (template, solution) and repositories (template, solution, test).
[ "POST", "/", "programming", "-", "exercises", "/", "import", ":", "Imports", "an", "existing", "programming", "exercise", "into", "an", "existing", "course", "<p", ">", "This", "will", "import", "the", "whole", "exercise", "including", "all", "base", "build", "plans", "(", "template", "solution", ")", "and", "repositories", "(", "template", "solution", "test", ")", "." ]
[ "// Valid exercises have set either a course or an exerciseGroup", "// Validate course settings", "// The static code analysis flag can only change, if the build plans are recreated and the template is upgraded", "// Check if the user has the rights to access the original programming exercise", "// Update the template files", "// Copy or recreate the build plans", "// Create completely new build plans for the exercise", "// We have removed the automatic build trigger from test to base for new programming exercises.", "// We also remove this build trigger in the case of an import as the source exercise might still have this trigger.", "// The importBuildPlans method includes this process", "// Remove unnecessary fields" ]
[ { "param": "sourceExerciseId", "type": "long" }, { "param": "newExercise", "type": "ProgrammingExercise" }, { "param": "recreateBuildPlans", "type": "boolean" }, { "param": "updateTemplate", "type": "boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "sourceExerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "newExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "recreateBuildPlans", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "updateTemplate", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 3349, 3233, 12, 10357, 18, 20445, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 9459, 11987, 424, 20603, 34, 1930, 9459, 11987, 424, 20603, 26964, 743, 3092, 1525, 1084, 424, 20603, 548, 16, 632, 28843, 13586, 11987, 424, 20603, 394, 424, 20603, 16, 203, 5411, 632, 691, 786, 12, 27652, 273, 315, 5743, 7923, 1250, 23052, 3116, 22846, 16, 632, 691, 786, 12, 27652, 273, 315, 5743, 7923, 1250, 1089, 2283, 13, 288, 203, 3639, 309, 261, 3168, 424, 20603, 548, 411, 374, 13, 288, 203, 5411, 327, 5570, 691, 5621, 203, 3639, 289, 203, 203, 3639, 368, 2364, 431, 12610, 6141, 1240, 444, 3344, 279, 4362, 578, 392, 24165, 1114, 203, 3639, 394, 424, 20603, 18, 1893, 39, 3117, 1876, 424, 20603, 1114, 424, 830, 407, 2818, 12, 11101, 67, 1985, 1769, 203, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 1930, 5402, 11987, 24165, 2618, 1368, 4362, 3728, 16, 1084, 424, 20603, 548, 16, 394, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 7675, 26321, 10663, 203, 3639, 24165, 1179, 18, 5662, 12580, 2628, 12, 2704, 424, 20603, 1769, 203, 3639, 1954, 9459, 11987, 2628, 12, 2704, 424, 20603, 1769, 203, 3639, 1954, 5788, 1085, 9418, 2628, 12, 2704, 424, 20603, 1769, 203, 203, 3639, 727, 569, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 385, 3117, 4362, 273, 4362, 1179, 18, 17466, 39, 3117, 4851, 424, 20603, 1114, 1162, 39, 3117, 548, 12, 2704, 424, 20603, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 382, 39, 3117, 12427, 8282, 12, 2996, 18, 13208, 16, 4362, 16, 729, 1769, 203, 203, 3639, 368, 3554, 4362, 1947, 203, 3639, 1954, 39, 3117, 2628, 12, 2704, 424, 20603, 16, 4362, 1769, 203, 203, 3639, 727, 569, 3129, 8176, 9459, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 203, 7734, 263, 4720, 5132, 1190, 41, 6817, 4709, 30744, 5788, 1085, 9418, 10487, 13368, 1876, 2283, 1876, 16135, 1988, 24629, 1012, 1876, 21981, 28453, 12, 3168, 424, 20603, 548, 1769, 203, 3639, 309, 261, 10444, 8176, 9459, 11987, 424, 20603, 18, 291, 1921, 10756, 288, 203, 5411, 327, 19372, 5621, 203, 3639, 289, 203, 3639, 727, 569, 2282, 9459, 11987, 424, 20603, 273, 3129, 8176, 9459, 11987, 424, 20603, 18, 588, 5621, 203, 203, 3639, 368, 1021, 760, 981, 6285, 2982, 848, 1338, 2549, 16, 309, 326, 1361, 21440, 854, 283, 4824, 471, 326, 1542, 353, 31049, 203, 3639, 309, 261, 2704, 424, 20603, 18, 291, 5788, 1085, 9418, 1526, 1435, 480, 2282, 9459, 11987, 424, 20603, 18, 291, 5788, 1085, 9418, 1526, 1435, 597, 401, 12, 266, 2640, 3116, 22846, 597, 1089, 2283, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 5788, 981, 6285, 848, 1338, 2549, 16, 309, 326, 283, 17169, 434, 1361, 21440, 471, 1089, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 5485, 342, 12890, 11987, 17, 8913, 71, 6141, 19, 5666, 30, 2221, 4363, 392, 2062, 5402, 11987, 24165, 1368, 392, 2062, 4362, 203, 377, 380, 411, 84, 34, 203, 377, 380, 1220, 903, 1930, 326, 7339, 24165, 16, 6508, 777, 1026, 1361, 21440, 261, 3202, 16, 6959, 13, 471, 14531, 203, 377, 380, 261, 3202, 16, 6959, 16, 1842, 2934, 6268, 72, 5140, 16, 272, 18, 69, 18, 326, 1842, 6088, 578, 326, 13442, 903, 336, 13027, 471, 6958, 203, 377, 380, 279, 394, 612, 18, 2457, 279, 12220, 666, 434, 4121, 5571, 9268, 471, 4121, 486, 1240, 279, 2324, 203, 377, 380, 622, 8901, 1232, 13586, 11987, 424, 20603, 5010, 1179, 7, 5666, 9459, 11987, 424, 20603, 11494, 291, 12, 9459, 2 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
updateProgrammingExercise
null
@PutMapping(Endpoints.PROGRAMMING_EXERCISES) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> updateProgrammingExercise(@RequestBody ProgrammingExercise updatedProgrammingExercise, @RequestParam(value = "notificationText", required = false) String notificationText) { log.debug("REST request to update ProgrammingExercise : {}", updatedProgrammingExercise); if (updatedProgrammingExercise.getId() == null) { return badRequest(); } // Valid exercises have set either a course or an exerciseGroup updatedProgrammingExercise.checkCourseAndExerciseGroupExclusivity(ENTITY_NAME); validateStaticCodeAnalysisSettings(updatedProgrammingExercise); // fetch course from database to make sure client didn't change groups var user = userRepository.getUserWithGroupsAndAuthorities(); Course course = courseService.retrieveCourseOverExerciseGroupOrCourseId(updatedProgrammingExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, user); checkProgrammingExerciseForError(updatedProgrammingExercise); var programmingExerciseBeforeUpdate = programmingExerciseRepository.findByIdWithAuxiliaryRepositoriesElseThrow(updatedProgrammingExercise.getId()); if (!Objects.equals(programmingExerciseBeforeUpdate.getShortName(), updatedProgrammingExercise.getShortName())) { throw new BadRequestAlertException("The programming exercise short name cannot be changed", ENTITY_NAME, "shortNameCannotChange"); } if (programmingExerciseBeforeUpdate.isStaticCodeAnalysisEnabled() != updatedProgrammingExercise.isStaticCodeAnalysisEnabled()) { throw new BadRequestAlertException("Static code analysis enabled flag must not be changed", ENTITY_NAME, "staticCodeAnalysisCannotChange"); } if (!Boolean.TRUE.equals(updatedProgrammingExercise.isAllowOnlineEditor()) && !Boolean.TRUE.equals(updatedProgrammingExercise.isAllowOfflineIde())) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "You need to allow at least one participation mode, the online editor or the offline IDE", "noParticipationModeAllowed")).body(null); } // Forbid changing the course the exercise belongs to. if (!Objects.equals(programmingExerciseBeforeUpdate.getCourseViaExerciseGroupOrCourseMember().getId(), updatedProgrammingExercise.getCourseViaExerciseGroupOrCourseMember().getId())) { return conflict("Exercise course id does not match the stored course id", ENTITY_NAME, "cannotChangeCourseId"); } if (updatedProgrammingExercise.getAuxiliaryRepositories() == null) { // make sure the default value is set properly updatedProgrammingExercise.setAuxiliaryRepositories(new ArrayList<>()); } auxiliaryRepositoryService.handleAuxiliaryRepositoriesWhenUpdatingExercises(programmingExerciseBeforeUpdate, updatedProgrammingExercise); if (updatedProgrammingExercise.getBonusPoints() == null) { // make sure the default value is set properly updatedProgrammingExercise.setBonusPoints(0.0); } // TODO: if isAllowOfflineIde changes, we might want to change access for all existing student participations // false --> true: add access for students to all existing student participations // true --> false: remove access for students from all existing student participations // Forbid conversion between normal course exercise and exam exercise exerciseService.checkForConversionBetweenExamAndCourseExercise(updatedProgrammingExercise, programmingExerciseBeforeUpdate, ENTITY_NAME); // Only save after checking for errors ProgrammingExercise savedProgrammingExercise = programmingExerciseService.updateProgrammingExercise(updatedProgrammingExercise, notificationText); exerciseService.logUpdate(updatedProgrammingExercise, updatedProgrammingExercise.getCourseViaExerciseGroupOrCourseMember(), user); exerciseService.updatePointsInRelatedParticipantScores(programmingExerciseBeforeUpdate, updatedProgrammingExercise); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, updatedProgrammingExercise.getTitle())) .body(savedProgrammingExercise); }
/** * PUT /programming-exercises : Updates an existing updatedProgrammingExercise. * * @param updatedProgrammingExercise the programmingExercise that has been updated on the client * @param notificationText to notify the student group about the update on the programming exercise * @return the ResponseEntity with status 200 (OK) and with body the updated ProgrammingExercise, or with status 400 (Bad Request) if the updated ProgrammingExercise * is not valid, or with status 500 (Internal Server Error) if the updated ProgrammingExercise couldn't be saved to the database */
PUT /programming-exercises : Updates an existing updatedProgrammingExercise. @param updatedProgrammingExercise the programmingExercise that has been updated on the client @param notificationText to notify the student group about the update on the programming exercise @return the ResponseEntity with status 200 (OK) and with body the updated ProgrammingExercise, or with status 400 (Bad Request) if the updated ProgrammingExercise is not valid, or with status 500 (Internal Server Error) if the updated ProgrammingExercise couldn't be saved to the database
[ "PUT", "/", "programming", "-", "exercises", ":", "Updates", "an", "existing", "updatedProgrammingExercise", ".", "@param", "updatedProgrammingExercise", "the", "programmingExercise", "that", "has", "been", "updated", "on", "the", "client", "@param", "notificationText", "to", "notify", "the", "student", "group", "about", "the", "update", "on", "the", "programming", "exercise", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "and", "with", "body", "the", "updated", "ProgrammingExercise", "or", "with", "status", "400", "(", "Bad", "Request", ")", "if", "the", "updated", "ProgrammingExercise", "is", "not", "valid", "or", "with", "status", "500", "(", "Internal", "Server", "Error", ")", "if", "the", "updated", "ProgrammingExercise", "couldn", "'", "t", "be", "saved", "to", "the", "database" ]
@PutMapping(Endpoints.PROGRAMMING_EXERCISES) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> updateProgrammingExercise(@RequestBody ProgrammingExercise updatedProgrammingExercise, @RequestParam(value = "notificationText", required = false) String notificationText) { log.debug("REST request to update ProgrammingExercise : {}", updatedProgrammingExercise); if (updatedProgrammingExercise.getId() == null) { return badRequest(); } updatedProgrammingExercise.checkCourseAndExerciseGroupExclusivity(ENTITY_NAME); validateStaticCodeAnalysisSettings(updatedProgrammingExercise); var user = userRepository.getUserWithGroupsAndAuthorities(); Course course = courseService.retrieveCourseOverExerciseGroupOrCourseId(updatedProgrammingExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, user); checkProgrammingExerciseForError(updatedProgrammingExercise); var programmingExerciseBeforeUpdate = programmingExerciseRepository.findByIdWithAuxiliaryRepositoriesElseThrow(updatedProgrammingExercise.getId()); if (!Objects.equals(programmingExerciseBeforeUpdate.getShortName(), updatedProgrammingExercise.getShortName())) { throw new BadRequestAlertException("The programming exercise short name cannot be changed", ENTITY_NAME, "shortNameCannotChange"); } if (programmingExerciseBeforeUpdate.isStaticCodeAnalysisEnabled() != updatedProgrammingExercise.isStaticCodeAnalysisEnabled()) { throw new BadRequestAlertException("Static code analysis enabled flag must not be changed", ENTITY_NAME, "staticCodeAnalysisCannotChange"); } if (!Boolean.TRUE.equals(updatedProgrammingExercise.isAllowOnlineEditor()) && !Boolean.TRUE.equals(updatedProgrammingExercise.isAllowOfflineIde())) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "You need to allow at least one participation mode, the online editor or the offline IDE", "noParticipationModeAllowed")).body(null); } if (!Objects.equals(programmingExerciseBeforeUpdate.getCourseViaExerciseGroupOrCourseMember().getId(), updatedProgrammingExercise.getCourseViaExerciseGroupOrCourseMember().getId())) { return conflict("Exercise course id does not match the stored course id", ENTITY_NAME, "cannotChangeCourseId"); } if (updatedProgrammingExercise.getAuxiliaryRepositories() == null) { updatedProgrammingExercise.setAuxiliaryRepositories(new ArrayList<>()); } auxiliaryRepositoryService.handleAuxiliaryRepositoriesWhenUpdatingExercises(programmingExerciseBeforeUpdate, updatedProgrammingExercise); if (updatedProgrammingExercise.getBonusPoints() == null) { updatedProgrammingExercise.setBonusPoints(0.0); } exerciseService.checkForConversionBetweenExamAndCourseExercise(updatedProgrammingExercise, programmingExerciseBeforeUpdate, ENTITY_NAME); ProgrammingExercise savedProgrammingExercise = programmingExerciseService.updateProgrammingExercise(updatedProgrammingExercise, notificationText); exerciseService.logUpdate(updatedProgrammingExercise, updatedProgrammingExercise.getCourseViaExerciseGroupOrCourseMember(), user); exerciseService.updatePointsInRelatedParticipantScores(programmingExerciseBeforeUpdate, updatedProgrammingExercise); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, updatedProgrammingExercise.getTitle())) .body(savedProgrammingExercise); }
[ "@", "PutMapping", "(", "Endpoints", ".", "PROGRAMMING_EXERCISES", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "ProgrammingExercise", ">", "updateProgrammingExercise", "(", "@", "RequestBody", "ProgrammingExercise", "updatedProgrammingExercise", ",", "@", "RequestParam", "(", "value", "=", "\"notificationText\"", ",", "required", "=", "false", ")", "String", "notificationText", ")", "{", "log", ".", "debug", "(", "\"REST request to update ProgrammingExercise : {}\"", ",", "updatedProgrammingExercise", ")", ";", "if", "(", "updatedProgrammingExercise", ".", "getId", "(", ")", "==", "null", ")", "{", "return", "badRequest", "(", ")", ";", "}", "updatedProgrammingExercise", ".", "checkCourseAndExerciseGroupExclusivity", "(", "ENTITY_NAME", ")", ";", "validateStaticCodeAnalysisSettings", "(", "updatedProgrammingExercise", ")", ";", "var", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "Course", "course", "=", "courseService", ".", "retrieveCourseOverExerciseGroupOrCourseId", "(", "updatedProgrammingExercise", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleInCourseElseThrow", "(", "Role", ".", "EDITOR", ",", "course", ",", "user", ")", ";", "checkProgrammingExerciseForError", "(", "updatedProgrammingExercise", ")", ";", "var", "programmingExerciseBeforeUpdate", "=", "programmingExerciseRepository", ".", "findByIdWithAuxiliaryRepositoriesElseThrow", "(", "updatedProgrammingExercise", ".", "getId", "(", ")", ")", ";", "if", "(", "!", "Objects", ".", "equals", "(", "programmingExerciseBeforeUpdate", ".", "getShortName", "(", ")", ",", "updatedProgrammingExercise", ".", "getShortName", "(", ")", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"The programming exercise short name cannot be changed\"", ",", "ENTITY_NAME", ",", "\"shortNameCannotChange\"", ")", ";", "}", "if", "(", "programmingExerciseBeforeUpdate", ".", "isStaticCodeAnalysisEnabled", "(", ")", "!=", "updatedProgrammingExercise", ".", "isStaticCodeAnalysisEnabled", "(", ")", ")", "{", "throw", "new", "BadRequestAlertException", "(", "\"Static code analysis enabled flag must not be changed\"", ",", "ENTITY_NAME", ",", "\"staticCodeAnalysisCannotChange\"", ")", ";", "}", "if", "(", "!", "Boolean", ".", "TRUE", ".", "equals", "(", "updatedProgrammingExercise", ".", "isAllowOnlineEditor", "(", ")", ")", "&&", "!", "Boolean", ".", "TRUE", ".", "equals", "(", "updatedProgrammingExercise", ".", "isAllowOfflineIde", "(", ")", ")", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"You need to allow at least one participation mode, the online editor or the offline IDE\"", ",", "\"noParticipationModeAllowed\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "if", "(", "!", "Objects", ".", "equals", "(", "programmingExerciseBeforeUpdate", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ".", "getId", "(", ")", ",", "updatedProgrammingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ".", "getId", "(", ")", ")", ")", "{", "return", "conflict", "(", "\"Exercise course id does not match the stored course id\"", ",", "ENTITY_NAME", ",", "\"cannotChangeCourseId\"", ")", ";", "}", "if", "(", "updatedProgrammingExercise", ".", "getAuxiliaryRepositories", "(", ")", "==", "null", ")", "{", "updatedProgrammingExercise", ".", "setAuxiliaryRepositories", "(", "new", "ArrayList", "<", ">", "(", ")", ")", ";", "}", "auxiliaryRepositoryService", ".", "handleAuxiliaryRepositoriesWhenUpdatingExercises", "(", "programmingExerciseBeforeUpdate", ",", "updatedProgrammingExercise", ")", ";", "if", "(", "updatedProgrammingExercise", ".", "getBonusPoints", "(", ")", "==", "null", ")", "{", "updatedProgrammingExercise", ".", "setBonusPoints", "(", "0.0", ")", ";", "}", "exerciseService", ".", "checkForConversionBetweenExamAndCourseExercise", "(", "updatedProgrammingExercise", ",", "programmingExerciseBeforeUpdate", ",", "ENTITY_NAME", ")", ";", "ProgrammingExercise", "savedProgrammingExercise", "=", "programmingExerciseService", ".", "updateProgrammingExercise", "(", "updatedProgrammingExercise", ",", "notificationText", ")", ";", "exerciseService", ".", "logUpdate", "(", "updatedProgrammingExercise", ",", "updatedProgrammingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ",", "user", ")", ";", "exerciseService", ".", "updatePointsInRelatedParticipantScores", "(", "programmingExerciseBeforeUpdate", ",", "updatedProgrammingExercise", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityUpdateAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "updatedProgrammingExercise", ".", "getTitle", "(", ")", ")", ")", ".", "body", "(", "savedProgrammingExercise", ")", ";", "}" ]
PUT /programming-exercises : Updates an existing updatedProgrammingExercise.
[ "PUT", "/", "programming", "-", "exercises", ":", "Updates", "an", "existing", "updatedProgrammingExercise", "." ]
[ "// Valid exercises have set either a course or an exerciseGroup", "// fetch course from database to make sure client didn't change groups", "// Forbid changing the course the exercise belongs to.", "// make sure the default value is set properly", "// make sure the default value is set properly", "// TODO: if isAllowOfflineIde changes, we might want to change access for all existing student participations", "// false --> true: add access for students to all existing student participations", "// true --> false: remove access for students from all existing student participations", "// Forbid conversion between normal course exercise and exam exercise", "// Only save after checking for errors" ]
[ { "param": "updatedProgrammingExercise", "type": "ProgrammingExercise" }, { "param": "notificationText", "type": "String" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "updatedProgrammingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationText", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 10357, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 9459, 11987, 424, 20603, 34, 1089, 9459, 11987, 424, 20603, 26964, 28843, 13586, 11987, 424, 20603, 3526, 9459, 11987, 424, 20603, 16, 203, 5411, 632, 691, 786, 12, 1132, 273, 315, 9927, 1528, 3113, 1931, 273, 629, 13, 514, 3851, 1528, 13, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 1089, 13586, 11987, 424, 20603, 294, 3728, 16, 3526, 9459, 11987, 424, 20603, 1769, 203, 3639, 309, 261, 7007, 9459, 11987, 424, 20603, 18, 26321, 1435, 422, 446, 13, 288, 203, 5411, 327, 5570, 691, 5621, 203, 3639, 289, 203, 203, 3639, 368, 2364, 431, 12610, 6141, 1240, 444, 3344, 279, 4362, 578, 392, 24165, 1114, 203, 3639, 3526, 9459, 11987, 424, 20603, 18, 1893, 39, 3117, 1876, 424, 20603, 1114, 424, 830, 407, 2818, 12, 11101, 67, 1985, 1769, 203, 3639, 1954, 5788, 1085, 9418, 2628, 12, 7007, 9459, 11987, 424, 20603, 1769, 203, 203, 3639, 368, 2158, 4362, 628, 2063, 358, 1221, 3071, 1004, 10242, 1404, 2549, 3252, 203, 3639, 569, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 385, 3117, 4362, 273, 4362, 1179, 18, 17466, 39, 3117, 4851, 424, 20603, 1114, 1162, 39, 3117, 548, 12, 7007, 9459, 11987, 424, 20603, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 382, 39, 3117, 12427, 8282, 12, 2996, 18, 13208, 16, 4362, 16, 729, 1769, 203, 203, 3639, 866, 9459, 11987, 424, 20603, 1290, 668, 12, 7007, 9459, 11987, 424, 20603, 1769, 203, 203, 3639, 569, 5402, 11987, 424, 20603, 4649, 1891, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 1190, 21981, 20606, 18429, 12427, 8282, 12, 7007, 9459, 11987, 424, 20603, 18, 26321, 10663, 203, 3639, 309, 16051, 4710, 18, 14963, 12, 12890, 11987, 424, 20603, 4649, 1891, 18, 588, 29983, 9334, 3526, 9459, 11987, 424, 20603, 18, 588, 29983, 1435, 3719, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 1986, 5402, 11987, 24165, 3025, 508, 2780, 506, 3550, 3113, 17020, 67, 1985, 16, 315, 6620, 461, 4515, 3043, 8863, 203, 3639, 289, 203, 3639, 309, 261, 12890, 11987, 424, 20603, 4649, 1891, 18, 291, 5788, 1085, 9418, 1526, 1435, 480, 3526, 9459, 11987, 424, 20603, 18, 291, 5788, 1085, 9418, 1526, 10756, 288, 203, 5411, 604, 394, 23223, 13298, 503, 2932, 5788, 981, 6285, 3696, 2982, 1297, 486, 506, 3550, 3113, 17020, 67, 1985, 16, 315, 3845, 1085, 9418, 4515, 3043, 8863, 203, 3639, 289, 203, 3639, 309, 16051, 5507, 18, 18724, 18, 14963, 12, 7007, 9459, 11987, 424, 20603, 18, 291, 7009, 16860, 6946, 10756, 597, 401, 5507, 18, 18724, 18, 14963, 12, 7007, 9459, 11987, 424, 20603, 18, 291, 7009, 23106, 45, 323, 1435, 3719, 288, 203, 5411, 327, 2306, 1943, 18, 8759, 691, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 11443, 342, 12890, 11987, 17, 8913, 71, 6141, 294, 15419, 392, 2062, 3526, 9459, 11987, 424, 20603, 18, 203, 377, 380, 203, 377, 380, 632, 891, 3526, 9459, 11987, 424, 20603, 326, 5402, 11987, 424, 20603, 716, 711, 2118, 3526, 603, 326, 1004, 203, 377, 380, 632, 891, 3851, 1528, 6647, 358, 5066, 326, 18110, 1041, 2973, 326, 1089, 603, 326, 5402, 11987, 24165, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 471, 598, 1417, 326, 3526, 13586, 11987, 424, 20603, 16, 578, 598, 1267, 7409, 261, 6434, 1567, 13, 309, 326, 3526, 13586, 11987, 424, 20603, 203, 377, 380, 353, 486, 923, 16, 578, 598, 1267, 6604, 261, 3061, 3224, 1068, 13, 309, 326, 3526, 2 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
updateProgrammingExerciseTimeline
null
@PutMapping(Endpoints.TIMELINE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> updateProgrammingExerciseTimeline(@RequestBody ProgrammingExercise updatedProgrammingExercise, @RequestParam(value = "notificationText", required = false) String notificationText) { log.debug("REST request to update the timeline of ProgrammingExercise : {}", updatedProgrammingExercise); var existingProgrammingExercise = programmingExerciseRepository.findByIdElseThrow(updatedProgrammingExercise.getId()); var user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, existingProgrammingExercise, user); updatedProgrammingExercise = programmingExerciseService.updateTimeline(updatedProgrammingExercise, notificationText); exerciseService.logUpdate(updatedProgrammingExercise, updatedProgrammingExercise.getCourseViaExerciseGroupOrCourseMember(), user); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, updatedProgrammingExercise.getTitle())) .body(updatedProgrammingExercise); }
/** * PUT /programming-exercises/timeline : Updates the timeline attributes of a given exercise * @param updatedProgrammingExercise containing the changes that have to be saved * @param notificationText an optional text to notify the student group about the update on the programming exercise * @return the ResponseEntity with status 200 (OK) with the updated ProgrammingExercise, or with status 403 (Forbidden) * if the user is not allowed to update the exercise or with 404 (Not Found) if the updated ProgrammingExercise couldn't be found in the database */
PUT /programming-exercises/timeline : Updates the timeline attributes of a given exercise @param updatedProgrammingExercise containing the changes that have to be saved @param notificationText an optional text to notify the student group about the update on the programming exercise @return the ResponseEntity with status 200 (OK) with the updated ProgrammingExercise, or with status 403 (Forbidden) if the user is not allowed to update the exercise or with 404 (Not Found) if the updated ProgrammingExercise couldn't be found in the database
[ "PUT", "/", "programming", "-", "exercises", "/", "timeline", ":", "Updates", "the", "timeline", "attributes", "of", "a", "given", "exercise", "@param", "updatedProgrammingExercise", "containing", "the", "changes", "that", "have", "to", "be", "saved", "@param", "notificationText", "an", "optional", "text", "to", "notify", "the", "student", "group", "about", "the", "update", "on", "the", "programming", "exercise", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "with", "the", "updated", "ProgrammingExercise", "or", "with", "status", "403", "(", "Forbidden", ")", "if", "the", "user", "is", "not", "allowed", "to", "update", "the", "exercise", "or", "with", "404", "(", "Not", "Found", ")", "if", "the", "updated", "ProgrammingExercise", "couldn", "'", "t", "be", "found", "in", "the", "database" ]
@PutMapping(Endpoints.TIMELINE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> updateProgrammingExerciseTimeline(@RequestBody ProgrammingExercise updatedProgrammingExercise, @RequestParam(value = "notificationText", required = false) String notificationText) { log.debug("REST request to update the timeline of ProgrammingExercise : {}", updatedProgrammingExercise); var existingProgrammingExercise = programmingExerciseRepository.findByIdElseThrow(updatedProgrammingExercise.getId()); var user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, existingProgrammingExercise, user); updatedProgrammingExercise = programmingExerciseService.updateTimeline(updatedProgrammingExercise, notificationText); exerciseService.logUpdate(updatedProgrammingExercise, updatedProgrammingExercise.getCourseViaExerciseGroupOrCourseMember(), user); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, updatedProgrammingExercise.getTitle())) .body(updatedProgrammingExercise); }
[ "@", "PutMapping", "(", "Endpoints", ".", "TIMELINE", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "ProgrammingExercise", ">", "updateProgrammingExerciseTimeline", "(", "@", "RequestBody", "ProgrammingExercise", "updatedProgrammingExercise", ",", "@", "RequestParam", "(", "value", "=", "\"notificationText\"", ",", "required", "=", "false", ")", "String", "notificationText", ")", "{", "log", ".", "debug", "(", "\"REST request to update the timeline of ProgrammingExercise : {}\"", ",", "updatedProgrammingExercise", ")", ";", "var", "existingProgrammingExercise", "=", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "updatedProgrammingExercise", ".", "getId", "(", ")", ")", ";", "var", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "EDITOR", ",", "existingProgrammingExercise", ",", "user", ")", ";", "updatedProgrammingExercise", "=", "programmingExerciseService", ".", "updateTimeline", "(", "updatedProgrammingExercise", ",", "notificationText", ")", ";", "exerciseService", ".", "logUpdate", "(", "updatedProgrammingExercise", ",", "updatedProgrammingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ",", "user", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityUpdateAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "updatedProgrammingExercise", ".", "getTitle", "(", ")", ")", ")", ".", "body", "(", "updatedProgrammingExercise", ")", ";", "}" ]
PUT /programming-exercises/timeline : Updates the timeline attributes of a given exercise @param updatedProgrammingExercise containing the changes that have to be saved @param notificationText an optional text to notify the student group about the update on the programming exercise @return the ResponseEntity with status 200 (OK) with the updated ProgrammingExercise, or with status 403 (Forbidden) if the user is not allowed to update the exercise or with 404 (Not Found) if the updated ProgrammingExercise couldn't be found in the database
[ "PUT", "/", "programming", "-", "exercises", "/", "timeline", ":", "Updates", "the", "timeline", "attributes", "of", "a", "given", "exercise", "@param", "updatedProgrammingExercise", "containing", "the", "changes", "that", "have", "to", "be", "saved", "@param", "notificationText", "an", "optional", "text", "to", "notify", "the", "student", "group", "about", "the", "update", "on", "the", "programming", "exercise", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "with", "the", "updated", "ProgrammingExercise", "or", "with", "status", "403", "(", "Forbidden", ")", "if", "the", "user", "is", "not", "allowed", "to", "update", "the", "exercise", "or", "with", "404", "(", "Not", "Found", ")", "if", "the", "updated", "ProgrammingExercise", "couldn", "'", "t", "be", "found", "in", "the", "database" ]
[]
[ { "param": "updatedProgrammingExercise", "type": "ProgrammingExercise" }, { "param": "notificationText", "type": "String" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "updatedProgrammingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationText", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 10357, 18, 4684, 5997, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 9459, 11987, 424, 20603, 34, 1089, 9459, 11987, 424, 20603, 31914, 26964, 28843, 13586, 11987, 424, 20603, 3526, 9459, 11987, 424, 20603, 16, 203, 5411, 632, 691, 786, 12, 1132, 273, 315, 9927, 1528, 3113, 1931, 273, 629, 13, 514, 3851, 1528, 13, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 1089, 326, 18316, 434, 13586, 11987, 424, 20603, 294, 3728, 16, 3526, 9459, 11987, 424, 20603, 1769, 203, 3639, 569, 2062, 9459, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 7007, 9459, 11987, 424, 20603, 18, 26321, 10663, 203, 3639, 569, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 13208, 16, 2062, 9459, 11987, 424, 20603, 16, 729, 1769, 203, 3639, 3526, 9459, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 1179, 18, 2725, 31914, 12, 7007, 9459, 11987, 424, 20603, 16, 3851, 1528, 1769, 203, 3639, 24165, 1179, 18, 1330, 1891, 12, 7007, 9459, 11987, 424, 20603, 16, 3526, 9459, 11987, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 9334, 729, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 2485, 12, 1864, 1304, 18, 2640, 1943, 1891, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 3526, 9459, 11987, 424, 20603, 18, 588, 4247, 1435, 3719, 203, 7734, 263, 3432, 12, 7007, 9459, 11987, 424, 20603, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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1, 26873, 203, 377, 380, 11443, 342, 12890, 11987, 17, 8913, 71, 6141, 19, 26237, 294, 15419, 326, 18316, 1677, 434, 279, 864, 24165, 203, 377, 380, 632, 891, 3526, 9459, 11987, 424, 20603, 4191, 326, 3478, 716, 1240, 358, 506, 5198, 203, 377, 380, 632, 891, 3851, 1528, 392, 3129, 977, 358, 5066, 326, 18110, 1041, 2973, 326, 1089, 603, 326, 5402, 11987, 24165, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 598, 326, 3526, 13586, 11987, 424, 20603, 16, 578, 598, 1267, 14393, 261, 16553, 13, 203, 377, 380, 309, 326, 729, 353, 486, 2935, 358, 1089, 326, 24165, 578, 598, 7709, 261, 1248, 10750, 13, 309, 326, 3526, 13586, 11987, 424, 20603, 17991, 1404, 506, 1392, 316, 326, 2 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
updateProblemStatement
null
@PatchMapping(Endpoints.PROBLEM) @PreAuthorize("hasRole('EDITOR')") public ResponseEntity<ProgrammingExercise> updateProblemStatement(@PathVariable long exerciseId, @RequestBody String updatedProblemStatement, @RequestParam(value = "notificationText", required = false) String notificationText) { log.debug("REST request to update ProgrammingExercise with new problem statement: {}", updatedProblemStatement); var programmingExercise = programmingExerciseRepository.findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById(exerciseId) .orElseThrow(() -> new EntityNotFoundException("Programming Exercise", exerciseId)); var user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, user); var updatedProgrammingExercise = programmingExerciseService.updateProblemStatement(programmingExercise, updatedProblemStatement, notificationText); exerciseService.logUpdate(updatedProgrammingExercise, updatedProgrammingExercise.getCourseViaExerciseGroupOrCourseMember(), user); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, updatedProgrammingExercise.getTitle())) .body(updatedProgrammingExercise); }
/** * PATCH /programming-exercises-problem: Updates the problem statement of the exercise. * * @param exerciseId The ID of the exercise for which to change the problem statement * @param updatedProblemStatement The new problemStatement * @param notificationText to notify the student group about the updated problemStatement on the programming exercise * @return the ResponseEntity with status 200 (OK) and with body the updated problemStatement, with status 404 if the programmingExercise could not be found, or with 403 if the user does not have permissions to access the programming exercise. */
PATCH /programming-exercises-problem: Updates the problem statement of the exercise. @param exerciseId The ID of the exercise for which to change the problem statement @param updatedProblemStatement The new problemStatement @param notificationText to notify the student group about the updated problemStatement on the programming exercise @return the ResponseEntity with status 200 (OK) and with body the updated problemStatement, with status 404 if the programmingExercise could not be found, or with 403 if the user does not have permissions to access the programming exercise.
[ "PATCH", "/", "programming", "-", "exercises", "-", "problem", ":", "Updates", "the", "problem", "statement", "of", "the", "exercise", ".", "@param", "exerciseId", "The", "ID", "of", "the", "exercise", "for", "which", "to", "change", "the", "problem", "statement", "@param", "updatedProblemStatement", "The", "new", "problemStatement", "@param", "notificationText", "to", "notify", "the", "student", "group", "about", "the", "updated", "problemStatement", "on", "the", "programming", "exercise", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "and", "with", "body", "the", "updated", "problemStatement", "with", "status", "404", "if", "the", "programmingExercise", "could", "not", "be", "found", "or", "with", "403", "if", "the", "user", "does", "not", "have", "permissions", "to", "access", "the", "programming", "exercise", "." ]
@PatchMapping(Endpoints.PROBLEM) @PreAuthorize("hasRole('EDITOR')") public ResponseEntity<ProgrammingExercise> updateProblemStatement(@PathVariable long exerciseId, @RequestBody String updatedProblemStatement, @RequestParam(value = "notificationText", required = false) String notificationText) { log.debug("REST request to update ProgrammingExercise with new problem statement: {}", updatedProblemStatement); var programmingExercise = programmingExerciseRepository.findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById(exerciseId) .orElseThrow(() -> new EntityNotFoundException("Programming Exercise", exerciseId)); var user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, user); var updatedProgrammingExercise = programmingExerciseService.updateProblemStatement(programmingExercise, updatedProblemStatement, notificationText); exerciseService.logUpdate(updatedProgrammingExercise, updatedProgrammingExercise.getCourseViaExerciseGroupOrCourseMember(), user); return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, updatedProgrammingExercise.getTitle())) .body(updatedProgrammingExercise); }
[ "@", "PatchMapping", "(", "Endpoints", ".", "PROBLEM", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "public", "ResponseEntity", "<", "ProgrammingExercise", ">", "updateProblemStatement", "(", "@", "PathVariable", "long", "exerciseId", ",", "@", "RequestBody", "String", "updatedProblemStatement", ",", "@", "RequestParam", "(", "value", "=", "\"notificationText\"", ",", "required", "=", "false", ")", "String", "notificationText", ")", "{", "log", ".", "debug", "(", "\"REST request to update ProgrammingExercise with new problem statement: {}\"", ",", "updatedProblemStatement", ")", ";", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesById", "(", "exerciseId", ")", ".", "orElseThrow", "(", "(", ")", "->", "new", "EntityNotFoundException", "(", "\"Programming Exercise\"", ",", "exerciseId", ")", ")", ";", "var", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "EDITOR", ",", "programmingExercise", ",", "user", ")", ";", "var", "updatedProgrammingExercise", "=", "programmingExerciseService", ".", "updateProblemStatement", "(", "programmingExercise", ",", "updatedProblemStatement", ",", "notificationText", ")", ";", "exerciseService", ".", "logUpdate", "(", "updatedProgrammingExercise", ",", "updatedProgrammingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ",", "user", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityUpdateAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "updatedProgrammingExercise", ".", "getTitle", "(", ")", ")", ")", ".", "body", "(", "updatedProgrammingExercise", ")", ";", "}" ]
PATCH /programming-exercises-problem: Updates the problem statement of the exercise.
[ "PATCH", "/", "programming", "-", "exercises", "-", "problem", ":", "Updates", "the", "problem", "statement", "of", "the", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "long" }, { "param": "updatedProblemStatement", "type": "String" }, { "param": "notificationText", "type": "String" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "updatedProblemStatement", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationText", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 7332, 3233, 12, 10357, 18, 3373, 38, 26817, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 9459, 11987, 424, 20603, 34, 1089, 13719, 3406, 26964, 743, 3092, 1525, 24165, 548, 16, 632, 28843, 514, 3526, 13719, 3406, 16, 203, 5411, 632, 691, 786, 12, 1132, 273, 315, 9927, 1528, 3113, 1931, 273, 629, 13, 514, 3851, 1528, 13, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 1089, 13586, 11987, 424, 20603, 598, 394, 6199, 3021, 30, 3728, 16, 3526, 13719, 3406, 1769, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 5132, 12, 8913, 30708, 548, 13, 203, 7734, 263, 280, 12427, 8282, 12, 1435, 317, 394, 3887, 3990, 2932, 9459, 11987, 1312, 20603, 3113, 24165, 548, 10019, 203, 3639, 569, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 13208, 16, 5402, 11987, 424, 20603, 16, 729, 1769, 203, 3639, 569, 3526, 9459, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 1179, 18, 2725, 13719, 3406, 12, 12890, 11987, 424, 20603, 16, 3526, 13719, 3406, 16, 3851, 1528, 1769, 203, 3639, 24165, 1179, 18, 1330, 1891, 12, 7007, 9459, 11987, 424, 20603, 16, 3526, 9459, 11987, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 9334, 729, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 2485, 12, 1864, 1304, 18, 2640, 1943, 1891, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 3526, 9459, 11987, 424, 20603, 18, 588, 4247, 1435, 3719, 203, 7734, 263, 3432, 12, 7007, 9459, 11987, 424, 20603, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 21298, 342, 12890, 11987, 17, 8913, 71, 6141, 17, 18968, 30, 15419, 326, 6199, 3021, 434, 326, 24165, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 2868, 1021, 1599, 434, 326, 24165, 364, 1492, 358, 2549, 326, 6199, 3021, 203, 377, 380, 632, 891, 3526, 13719, 3406, 1021, 394, 6199, 3406, 203, 377, 380, 632, 891, 3851, 1528, 3639, 358, 5066, 326, 18110, 1041, 2973, 326, 3526, 6199, 3406, 603, 326, 5402, 11987, 24165, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 471, 598, 1417, 326, 3526, 6199, 3406, 16, 598, 1267, 7709, 309, 326, 5402, 11987, 424, 20603, 3377, 486, 506, 1392, 16, 578, 598, 14393, 309, 326, 729, 1552, 486, 1240, 2 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
deleteProgrammingExercise
null
@DeleteMapping(Endpoints.PROGRAMMING_EXERCISE) @PreAuthorize("hasRole('INSTRUCTOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Void> deleteProgrammingExercise(@PathVariable long exerciseId, @RequestParam(defaultValue = "false") boolean deleteStudentReposBuildPlans, @RequestParam(defaultValue = "false") boolean deleteBaseReposBuildPlans) { log.info("REST request to delete ProgrammingExercise : {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, programmingExercise, user); exerciseService.logDeletion(programmingExercise, programmingExercise.getCourseViaExerciseGroupOrCourseMember(), user); exerciseService.delete(exerciseId, deleteStudentReposBuildPlans, deleteBaseReposBuildPlans); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, programmingExercise.getTitle())).build(); }
/** * DELETE /programming-exercises/:id : delete the "id" programmingExercise. * * @param exerciseId the id of the programmingExercise to delete * @param deleteStudentReposBuildPlans boolean which states whether the corresponding build plan should be deleted as well * @param deleteBaseReposBuildPlans the ResponseEntity with status 200 (OK) * @return the ResponseEntity with status 200 (OK) when programming exercise has been successfully deleted or with status 404 (Not Found) */
DELETE /programming-exercises/:id : delete the "id" programmingExercise. @param exerciseId the id of the programmingExercise to delete @param deleteStudentReposBuildPlans boolean which states whether the corresponding build plan should be deleted as well @param deleteBaseReposBuildPlans the ResponseEntity with status 200 (OK) @return the ResponseEntity with status 200 (OK) when programming exercise has been successfully deleted or with status 404 (Not Found)
[ "DELETE", "/", "programming", "-", "exercises", "/", ":", "id", ":", "delete", "the", "\"", "id", "\"", "programmingExercise", ".", "@param", "exerciseId", "the", "id", "of", "the", "programmingExercise", "to", "delete", "@param", "deleteStudentReposBuildPlans", "boolean", "which", "states", "whether", "the", "corresponding", "build", "plan", "should", "be", "deleted", "as", "well", "@param", "deleteBaseReposBuildPlans", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "when", "programming", "exercise", "has", "been", "successfully", "deleted", "or", "with", "status", "404", "(", "Not", "Found", ")" ]
@DeleteMapping(Endpoints.PROGRAMMING_EXERCISE) @PreAuthorize("hasRole('INSTRUCTOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Void> deleteProgrammingExercise(@PathVariable long exerciseId, @RequestParam(defaultValue = "false") boolean deleteStudentReposBuildPlans, @RequestParam(defaultValue = "false") boolean deleteBaseReposBuildPlans) { log.info("REST request to delete ProgrammingExercise : {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, programmingExercise, user); exerciseService.logDeletion(programmingExercise, programmingExercise.getCourseViaExerciseGroupOrCourseMember(), user); exerciseService.delete(exerciseId, deleteStudentReposBuildPlans, deleteBaseReposBuildPlans); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, programmingExercise.getTitle())).build(); }
[ "@", "DeleteMapping", "(", "Endpoints", ".", "PROGRAMMING_EXERCISE", ")", "@", "PreAuthorize", "(", "\"hasRole('INSTRUCTOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "Void", ">", "deleteProgrammingExercise", "(", "@", "PathVariable", "long", "exerciseId", ",", "@", "RequestParam", "(", "defaultValue", "=", "\"false\"", ")", "boolean", "deleteStudentReposBuildPlans", ",", "@", "RequestParam", "(", "defaultValue", "=", "\"false\"", ")", "boolean", "deleteBaseReposBuildPlans", ")", "{", "log", ".", "info", "(", "\"REST request to delete ProgrammingExercise : {}\"", ",", "exerciseId", ")", ";", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow", "(", "exerciseId", ")", ";", "User", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "INSTRUCTOR", ",", "programmingExercise", ",", "user", ")", ";", "exerciseService", ".", "logDeletion", "(", "programmingExercise", ",", "programmingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ",", "user", ")", ";", "exerciseService", ".", "delete", "(", "exerciseId", ",", "deleteStudentReposBuildPlans", ",", "deleteBaseReposBuildPlans", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityDeletionAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "programmingExercise", ".", "getTitle", "(", ")", ")", ")", ".", "build", "(", ")", ";", "}" ]
DELETE /programming-exercises/:id : delete the "id" programmingExercise.
[ "DELETE", "/", "programming", "-", "exercises", "/", ":", "id", ":", "delete", "the", "\"", "id", "\"", "programmingExercise", "." ]
[]
[ { "param": "exerciseId", "type": "long" }, { "param": "deleteStudentReposBuildPlans", "type": "boolean" }, { "param": "deleteBaseReposBuildPlans", "type": "boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "deleteStudentReposBuildPlans", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "deleteBaseReposBuildPlans", "type": "boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 2613, 3233, 12, 10357, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 706, 13915, 916, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 1430, 9459, 11987, 424, 20603, 26964, 743, 3092, 1525, 24165, 548, 16, 632, 691, 786, 12, 27652, 273, 315, 5743, 7923, 1250, 1430, 19943, 319, 28453, 3116, 22846, 16, 203, 5411, 632, 691, 786, 12, 27652, 273, 315, 5743, 7923, 1250, 1430, 2171, 28453, 3116, 22846, 13, 288, 203, 3639, 613, 18, 1376, 2932, 12030, 590, 358, 1430, 13586, 11987, 424, 20603, 294, 3728, 16, 24165, 548, 1769, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 2177, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 706, 13915, 916, 16, 5402, 11987, 424, 20603, 16, 729, 1769, 203, 3639, 24165, 1179, 18, 1330, 13064, 12, 12890, 11987, 424, 20603, 16, 5402, 11987, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 9334, 729, 1769, 203, 3639, 24165, 1179, 18, 3733, 12, 8913, 30708, 548, 16, 1430, 19943, 319, 28453, 3116,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 8568, 342, 12890, 11987, 17, 8913, 71, 6141, 16880, 350, 294, 1430, 326, 315, 350, 6, 5402, 11987, 424, 20603, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 10402, 326, 612, 434, 326, 5402, 11987, 424, 20603, 358, 1430, 203, 377, 380, 632, 891, 1430, 19943, 319, 28453, 3116, 22846, 1250, 1492, 5493, 2856, 326, 4656, 1361, 4995, 1410, 506, 4282, 487, 5492, 203, 377, 380, 632, 891, 1430, 2171, 28453, 3116, 22846, 565, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 1347, 5402, 11987, 24165, 711, 2118, 4985, 4282, 578, 598, 1267, 7709, 261, 1248, 10750, 13, 203, 377, 1195, 2, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
combineTemplateRepositoryCommits
null
@PutMapping(value = Endpoints.COMBINE_COMMITS, produces = MediaType.TEXT_PLAIN_VALUE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Void> combineTemplateRepositoryCommits(@PathVariable long exerciseId) { log.debug("REST request to combine the commits of the template repository of ProgrammingExercise with id: {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, null); try { var exerciseRepoURL = programmingExercise.getVcsTemplateRepositoryUrl(); gitService.combineAllCommitsOfRepositoryIntoOne(exerciseRepoURL); return new ResponseEntity<>(HttpStatus.OK); } catch (IllegalStateException | InterruptedException | GitAPIException ex) { return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } }
/** * Combine all commits into one in the template repository of a given exercise. * * @param exerciseId of the exercise * @return the ResponseEntity with status * 200 (OK) if combine has been successfully executed * 403 (Forbidden) if the user is not admin and course instructor or * 500 (Internal Server Error) */
Combine all commits into one in the template repository of a given exercise. @param exerciseId of the exercise @return the ResponseEntity with status 200 (OK) if combine has been successfully executed 403 (Forbidden) if the user is not admin and course instructor or 500 (Internal Server Error)
[ "Combine", "all", "commits", "into", "one", "in", "the", "template", "repository", "of", "a", "given", "exercise", ".", "@param", "exerciseId", "of", "the", "exercise", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "if", "combine", "has", "been", "successfully", "executed", "403", "(", "Forbidden", ")", "if", "the", "user", "is", "not", "admin", "and", "course", "instructor", "or", "500", "(", "Internal", "Server", "Error", ")" ]
@PutMapping(value = Endpoints.COMBINE_COMMITS, produces = MediaType.TEXT_PLAIN_VALUE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Void> combineTemplateRepositoryCommits(@PathVariable long exerciseId) { log.debug("REST request to combine the commits of the template repository of ProgrammingExercise with id: {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, null); try { var exerciseRepoURL = programmingExercise.getVcsTemplateRepositoryUrl(); gitService.combineAllCommitsOfRepositoryIntoOne(exerciseRepoURL); return new ResponseEntity<>(HttpStatus.OK); } catch (IllegalStateException | InterruptedException | GitAPIException ex) { return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } }
[ "@", "PutMapping", "(", "value", "=", "Endpoints", ".", "COMBINE_COMMITS", ",", "produces", "=", "MediaType", ".", "TEXT_PLAIN_VALUE", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "Void", ">", "combineTemplateRepositoryCommits", "(", "@", "PathVariable", "long", "exerciseId", ")", "{", "log", ".", "debug", "(", "\"REST request to combine the commits of the template repository of ProgrammingExercise with id: {}\"", ",", "exerciseId", ")", ";", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "EDITOR", ",", "programmingExercise", ",", "null", ")", ";", "try", "{", "var", "exerciseRepoURL", "=", "programmingExercise", ".", "getVcsTemplateRepositoryUrl", "(", ")", ";", "gitService", ".", "combineAllCommitsOfRepositoryIntoOne", "(", "exerciseRepoURL", ")", ";", "return", "new", "ResponseEntity", "<", ">", "(", "HttpStatus", ".", "OK", ")", ";", "}", "catch", "(", "IllegalStateException", "|", "InterruptedException", "|", "GitAPIException", "ex", ")", "{", "return", "new", "ResponseEntity", "<", ">", "(", "HttpStatus", ".", "INTERNAL_SERVER_ERROR", ")", ";", "}", "}" ]
Combine all commits into one in the template repository of a given exercise.
[ "Combine", "all", "commits", "into", "one", "in", "the", "template", "repository", "of", "a", "given", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 1132, 273, 19258, 18, 4208, 38, 3740, 67, 18658, 55, 16, 15505, 273, 12206, 18, 5151, 67, 26549, 67, 4051, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 8661, 2283, 3305, 23072, 26964, 743, 3092, 1525, 24165, 548, 13, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 8661, 326, 14335, 434, 326, 1542, 3352, 434, 13586, 11987, 424, 20603, 598, 612, 30, 3728, 16, 24165, 548, 1769, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 13208, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 3639, 775, 288, 203, 5411, 569, 24165, 8791, 1785, 273, 5402, 11987, 424, 20603, 18, 588, 58, 2143, 2283, 3305, 1489, 5621, 203, 5411, 5071, 1179, 18, 14082, 1595, 23072, 951, 3305, 5952, 3335, 12, 8913, 30708, 8791, 1785, 1769, 203, 5411, 327, 394, 2306, 1943, 29667, 12, 2940, 1482, 18, 3141, 1769, 203, 3639, 289, 203, 3639, 1044, 261, 12195, 5060, 571, 7558, 571, 6646, 2557, 503, 431, 13, 288, 203, 5411, 327, 394, 2306, 1943, 29667, 12, 2940, 1482, 18, 14005, 67, 4370, 67, 3589, 1769, 203, 3639, 289, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 23949, 777, 14335, 1368, 1245, 316, 326, 1542, 3352, 434, 279, 864, 24165, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 434, 326, 24165, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 203, 377, 380, 4044, 261, 3141, 13, 309, 8661, 711, 2118, 4985, 7120, 203, 377, 380, 14393, 261, 16553, 13, 309, 326, 729, 353, 486, 3981, 471, 4362, 316, 2732, 578, 203, 377, 380, 6604, 261, 3061, 3224, 1068, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
exportInstructorExercise
null
@GetMapping(Endpoints.EXPORT_INSTRUCTOR_EXERCISE) @PreAuthorize("hasRole('INSTRUCTOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> exportInstructorExercise(@PathVariable long exerciseId) throws IOException { var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, programmingExercise, null); long start = System.nanoTime(); var path = programmingExerciseExportService.exportProgrammingExerciseInstructorMaterial(programmingExercise, new ArrayList<>()); if (path == null) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "internalServerError", "There was an error on the server and the zip file could not be created.")).body(null); } var finalZipFile = path.toFile(); InputStreamResource resource = new InputStreamResource(new FileInputStream(finalZipFile)); log.info("Export of the programming exercise {} with title '{}' was successful in {}.", programmingExercise.getId(), programmingExercise.getTitle(), formatDurationFrom(start)); return ResponseEntity.ok().contentLength(finalZipFile.length()).contentType(MediaType.APPLICATION_OCTET_STREAM).header("filename", finalZipFile.getName()).body(resource); }
/** * GET /programming-exercises/:exerciseId/export-instructor-exercise * @param exerciseId The id of the programming exercise * @return ResponseEntity with status * @throws IOException if something during the zip process went wrong */
GET /programming-exercises/:exerciseId/export-instructor-exercise @param exerciseId The id of the programming exercise @return ResponseEntity with status @throws IOException if something during the zip process went wrong
[ "GET", "/", "programming", "-", "exercises", "/", ":", "exerciseId", "/", "export", "-", "instructor", "-", "exercise", "@param", "exerciseId", "The", "id", "of", "the", "programming", "exercise", "@return", "ResponseEntity", "with", "status", "@throws", "IOException", "if", "something", "during", "the", "zip", "process", "went", "wrong" ]
@GetMapping(Endpoints.EXPORT_INSTRUCTOR_EXERCISE) @PreAuthorize("hasRole('INSTRUCTOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> exportInstructorExercise(@PathVariable long exerciseId) throws IOException { var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, programmingExercise, null); long start = System.nanoTime(); var path = programmingExerciseExportService.exportProgrammingExerciseInstructorMaterial(programmingExercise, new ArrayList<>()); if (path == null) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "internalServerError", "There was an error on the server and the zip file could not be created.")).body(null); } var finalZipFile = path.toFile(); InputStreamResource resource = new InputStreamResource(new FileInputStream(finalZipFile)); log.info("Export of the programming exercise {} with title '{}' was successful in {}.", programmingExercise.getId(), programmingExercise.getTitle(), formatDurationFrom(start)); return ResponseEntity.ok().contentLength(finalZipFile.length()).contentType(MediaType.APPLICATION_OCTET_STREAM).header("filename", finalZipFile.getName()).body(resource); }
[ "@", "GetMapping", "(", "Endpoints", ".", "EXPORT_INSTRUCTOR_EXERCISE", ")", "@", "PreAuthorize", "(", "\"hasRole('INSTRUCTOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "Resource", ">", "exportInstructorExercise", "(", "@", "PathVariable", "long", "exerciseId", ")", "throws", "IOException", "{", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "INSTRUCTOR", ",", "programmingExercise", ",", "null", ")", ";", "long", "start", "=", "System", ".", "nanoTime", "(", ")", ";", "var", "path", "=", "programmingExerciseExportService", ".", "exportProgrammingExerciseInstructorMaterial", "(", "programmingExercise", ",", "new", "ArrayList", "<", ">", "(", ")", ")", ";", "if", "(", "path", "==", "null", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createFailureAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "\"internalServerError\"", ",", "\"There was an error on the server and the zip file could not be created.\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "var", "finalZipFile", "=", "path", ".", "toFile", "(", ")", ";", "InputStreamResource", "resource", "=", "new", "InputStreamResource", "(", "new", "FileInputStream", "(", "finalZipFile", ")", ")", ";", "log", ".", "info", "(", "\"Export of the programming exercise {} with title '{}' was successful in {}.\"", ",", "programmingExercise", ".", "getId", "(", ")", ",", "programmingExercise", ".", "getTitle", "(", ")", ",", "formatDurationFrom", "(", "start", ")", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "contentLength", "(", "finalZipFile", ".", "length", "(", ")", ")", ".", "contentType", "(", "MediaType", ".", "APPLICATION_OCTET_STREAM", ")", ".", "header", "(", "\"filename\"", ",", "finalZipFile", ".", "getName", "(", ")", ")", ".", "body", "(", "resource", ")", ";", "}" ]
GET /programming-exercises/:exerciseId/export-instructor-exercise @param exerciseId The id of the programming exercise @return ResponseEntity with status @throws IOException if something during the zip process went wrong
[ "GET", "/", "programming", "-", "exercises", "/", ":", "exerciseId", "/", "export", "-", "instructor", "-", "exercise", "@param", "exerciseId", "The", "id", "of", "the", "programming", "exercise", "@return", "ResponseEntity", "with", "status", "@throws", "IOException", "if", "something", "during", "the", "zip", "process", "went", "wrong" ]
[]
[ { "param": "exerciseId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 967, 3233, 12, 10357, 18, 31275, 67, 706, 13915, 916, 67, 2294, 654, 7266, 1090, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 706, 13915, 916, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 1420, 34, 3359, 382, 2732, 424, 20603, 26964, 743, 3092, 1525, 24165, 548, 13, 1216, 1860, 288, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 706, 13915, 916, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 203, 3639, 1525, 787, 273, 2332, 18, 13569, 83, 950, 5621, 203, 3639, 569, 589, 273, 5402, 11987, 424, 20603, 6144, 1179, 18, 6530, 9459, 11987, 424, 20603, 382, 2732, 11790, 12, 12890, 11987, 424, 20603, 16, 394, 2407, 29667, 10663, 203, 3639, 309, 261, 803, 422, 446, 13, 288, 203, 5411, 327, 2306, 1943, 18, 8759, 691, 7675, 2485, 12, 1864, 1304, 18, 2640, 5247, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 315, 7236, 8777, 3113, 203, 10792, 315, 9828, 1703, 392, 555, 603, 326, 1438, 471, 326, 3144, 585, 3377, 486, 506, 2522, 1199, 13, 2934, 3432, 12, 2011, 1769, 203, 3639, 289, 203, 3639, 569, 727, 29394, 273, 589, 18, 869, 812, 5621, 203, 203, 3639, 5037, 1420, 1058, 273, 394, 5037, 1420, 12, 2704, 11907, 12, 6385, 29394, 10019, 203, 203, 3639, 613, 18, 1376, 2932, 6144, 434, 326, 5402, 11987, 24165, 2618, 598, 2077, 7485, 1703, 6873, 316, 20178, 16, 5402, 11987, 424, 20603, 18, 26321, 9334, 5402, 11987, 424, 20603, 18, 588, 4247, 9334, 203, 7734, 740, 5326, 1265, 12, 1937, 10019, 203, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 1745, 1782, 12, 6385, 29394, 18, 2469, 1435, 2934, 22194, 12, 20870, 18, 25039, 67, 51, 1268, 1584, 67, 13693, 2934, 3374, 2932, 3459, 3113, 727, 29394, 18, 17994, 1435, 2934, 3432, 12, 3146, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4978, 342, 12890, 11987, 17, 8913, 71, 6141, 16880, 8913, 30708, 548, 19, 6530, 17, 267, 2732, 17, 8913, 30708, 203, 377, 380, 632, 891, 24165, 548, 1021, 612, 434, 326, 5402, 11987, 24165, 203, 377, 380, 632, 2463, 2306, 1943, 598, 1267, 203, 377, 380, 632, 15069, 1860, 309, 5943, 4982, 326, 3144, 1207, 16343, 7194, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
exportInstructorRepository
null
@GetMapping(Endpoints.EXPORT_INSTRUCTOR_REPOSITORY) @PreAuthorize("hasRole('TA')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> exportInstructorRepository(@PathVariable long exerciseId, @PathVariable RepositoryType repositoryType) throws IOException { var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.TEACHING_ASSISTANT, programmingExercise, null); long start = System.nanoTime(); Optional<File> zipFile = programmingExerciseExportService.exportInstructorRepositoryForExercise(programmingExercise.getId(), repositoryType, new ArrayList<>()); return returnZipFileForRepositoryExport(zipFile, repositoryType.getName(), programmingExercise, start); }
/** * GET /programming-exercises/:exerciseId/export-instructor-repository/:repositoryType : sends a test, solution or template repository as a zip file * @param exerciseId The id of the programming exercise * @param repositoryType The type of repository to zip and send * @return ResponseEntity with status * @throws IOException if something during the zip process went wrong */
GET /programming-exercises/:exerciseId/export-instructor-repository/:repositoryType : sends a test, solution or template repository as a zip file @param exerciseId The id of the programming exercise @param repositoryType The type of repository to zip and send @return ResponseEntity with status @throws IOException if something during the zip process went wrong
[ "GET", "/", "programming", "-", "exercises", "/", ":", "exerciseId", "/", "export", "-", "instructor", "-", "repository", "/", ":", "repositoryType", ":", "sends", "a", "test", "solution", "or", "template", "repository", "as", "a", "zip", "file", "@param", "exerciseId", "The", "id", "of", "the", "programming", "exercise", "@param", "repositoryType", "The", "type", "of", "repository", "to", "zip", "and", "send", "@return", "ResponseEntity", "with", "status", "@throws", "IOException", "if", "something", "during", "the", "zip", "process", "went", "wrong" ]
@GetMapping(Endpoints.EXPORT_INSTRUCTOR_REPOSITORY) @PreAuthorize("hasRole('TA')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> exportInstructorRepository(@PathVariable long exerciseId, @PathVariable RepositoryType repositoryType) throws IOException { var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.TEACHING_ASSISTANT, programmingExercise, null); long start = System.nanoTime(); Optional<File> zipFile = programmingExerciseExportService.exportInstructorRepositoryForExercise(programmingExercise.getId(), repositoryType, new ArrayList<>()); return returnZipFileForRepositoryExport(zipFile, repositoryType.getName(), programmingExercise, start); }
[ "@", "GetMapping", "(", "Endpoints", ".", "EXPORT_INSTRUCTOR_REPOSITORY", ")", "@", "PreAuthorize", "(", "\"hasRole('TA')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "Resource", ">", "exportInstructorRepository", "(", "@", "PathVariable", "long", "exerciseId", ",", "@", "PathVariable", "RepositoryType", "repositoryType", ")", "throws", "IOException", "{", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "TEACHING_ASSISTANT", ",", "programmingExercise", ",", "null", ")", ";", "long", "start", "=", "System", ".", "nanoTime", "(", ")", ";", "Optional", "<", "File", ">", "zipFile", "=", "programmingExerciseExportService", ".", "exportInstructorRepositoryForExercise", "(", "programmingExercise", ".", "getId", "(", ")", ",", "repositoryType", ",", "new", "ArrayList", "<", ">", "(", ")", ")", ";", "return", "returnZipFileForRepositoryExport", "(", "zipFile", ",", "repositoryType", ".", "getName", "(", ")", ",", "programmingExercise", ",", "start", ")", ";", "}" ]
GET /programming-exercises/:exerciseId/export-instructor-repository/:repositoryType : sends a test, solution or template repository as a zip file @param exerciseId The id of the programming exercise @param repositoryType The type of repository to zip and send @return ResponseEntity with status @throws IOException if something during the zip process went wrong
[ "GET", "/", "programming", "-", "exercises", "/", ":", "exerciseId", "/", "export", "-", "instructor", "-", "repository", "/", ":", "repositoryType", ":", "sends", "a", "test", "solution", "or", "template", "repository", "as", "a", "zip", "file", "@param", "exerciseId", "The", "id", "of", "the", "programming", "exercise", "@param", "repositoryType", "The", "type", "of", "repository", "to", "zip", "and", "send", "@return", "ResponseEntity", "with", "status", "@throws", "IOException", "if", "something", "during", "the", "zip", "process", "went", "wrong" ]
[]
[ { "param": "exerciseId", "type": "long" }, { "param": "repositoryType", "type": "RepositoryType" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repositoryType", "type": "RepositoryType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 967, 3233, 12, 10357, 18, 31275, 67, 706, 13915, 916, 67, 862, 30986, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 9833, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 1420, 34, 3359, 382, 2732, 3305, 26964, 743, 3092, 1525, 24165, 548, 16, 632, 743, 3092, 6281, 559, 3352, 559, 13, 1216, 1860, 288, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 1448, 18133, 1360, 67, 8423, 5511, 6856, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 203, 3639, 1525, 787, 273, 2332, 18, 13569, 83, 950, 5621, 203, 3639, 4055, 32, 812, 34, 19450, 273, 5402, 11987, 424, 20603, 6144, 1179, 18, 6530, 382, 2732, 3305, 1290, 424, 20603, 12, 12890, 11987, 424, 20603, 18, 26321, 9334, 3352, 559, 16, 394, 2407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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4978, 342, 12890, 11987, 17, 8913, 71, 6141, 16880, 8913, 30708, 548, 19, 6530, 17, 267, 2732, 17, 9071, 16880, 9071, 559, 294, 9573, 279, 1842, 16, 6959, 578, 1542, 3352, 487, 279, 3144, 585, 203, 377, 380, 632, 891, 24165, 548, 1021, 612, 434, 326, 5402, 11987, 24165, 203, 377, 380, 632, 891, 3352, 559, 1021, 618, 434, 3352, 358, 3144, 471, 1366, 203, 377, 380, 632, 2463, 2306, 1943, 598, 1267, 203, 377, 380, 632, 15069, 1860, 309, 5943, 4982, 326, 3144, 1207, 16343, 7194, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
exportInstructorAuxiliaryRepository
null
@GetMapping(Endpoints.EXPORT_INSTRUCTOR_AUXILIARY_REPOSITORY) @PreAuthorize("hasRole('TA')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> exportInstructorAuxiliaryRepository(@PathVariable long exerciseId, @PathVariable long repositoryId) throws IOException { var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.TEACHING_ASSISTANT, programmingExercise, null); Optional<AuxiliaryRepository> optionalAuxiliaryRepository = auxiliaryRepositoryRepository.findById(repositoryId); if (optionalAuxiliaryRepository.isEmpty()) { return ResponseEntity.notFound().headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "internalServerError", "There was an error on the server and the URL of the auxiliary couldn't be retrieved.")).build(); } AuxiliaryRepository auxiliaryRepository = optionalAuxiliaryRepository.get(); long start = System.nanoTime(); Optional<File> zipFile = programmingExerciseExportService.exportInstructorAuxiliaryRepositoryForExercise(programmingExercise.getId(), auxiliaryRepository, new ArrayList<>()); return returnZipFileForRepositoryExport(zipFile, auxiliaryRepository.getName(), programmingExercise, start); }
/** * GET /programming-exercises/:exerciseId/export-instructor-auxiliary-repository/:repositoryType : sends an auxiliary repository as a zip file * @param exerciseId The id of the programming exercise * @param repositoryId The id of the auxiliary repository * @return ResponseEntity with status * @throws IOException if something during the zip process went wrong */
GET /programming-exercises/:exerciseId/export-instructor-auxiliary-repository/:repositoryType : sends an auxiliary repository as a zip file @param exerciseId The id of the programming exercise @param repositoryId The id of the auxiliary repository @return ResponseEntity with status @throws IOException if something during the zip process went wrong
[ "GET", "/", "programming", "-", "exercises", "/", ":", "exerciseId", "/", "export", "-", "instructor", "-", "auxiliary", "-", "repository", "/", ":", "repositoryType", ":", "sends", "an", "auxiliary", "repository", "as", "a", "zip", "file", "@param", "exerciseId", "The", "id", "of", "the", "programming", "exercise", "@param", "repositoryId", "The", "id", "of", "the", "auxiliary", "repository", "@return", "ResponseEntity", "with", "status", "@throws", "IOException", "if", "something", "during", "the", "zip", "process", "went", "wrong" ]
@GetMapping(Endpoints.EXPORT_INSTRUCTOR_AUXILIARY_REPOSITORY) @PreAuthorize("hasRole('TA')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> exportInstructorAuxiliaryRepository(@PathVariable long exerciseId, @PathVariable long repositoryId) throws IOException { var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.TEACHING_ASSISTANT, programmingExercise, null); Optional<AuxiliaryRepository> optionalAuxiliaryRepository = auxiliaryRepositoryRepository.findById(repositoryId); if (optionalAuxiliaryRepository.isEmpty()) { return ResponseEntity.notFound().headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "internalServerError", "There was an error on the server and the URL of the auxiliary couldn't be retrieved.")).build(); } AuxiliaryRepository auxiliaryRepository = optionalAuxiliaryRepository.get(); long start = System.nanoTime(); Optional<File> zipFile = programmingExerciseExportService.exportInstructorAuxiliaryRepositoryForExercise(programmingExercise.getId(), auxiliaryRepository, new ArrayList<>()); return returnZipFileForRepositoryExport(zipFile, auxiliaryRepository.getName(), programmingExercise, start); }
[ "@", "GetMapping", "(", "Endpoints", ".", "EXPORT_INSTRUCTOR_AUXILIARY_REPOSITORY", ")", "@", "PreAuthorize", "(", "\"hasRole('TA')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "Resource", ">", "exportInstructorAuxiliaryRepository", "(", "@", "PathVariable", "long", "exerciseId", ",", "@", "PathVariable", "long", "repositoryId", ")", "throws", "IOException", "{", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "TEACHING_ASSISTANT", ",", "programmingExercise", ",", "null", ")", ";", "Optional", "<", "AuxiliaryRepository", ">", "optionalAuxiliaryRepository", "=", "auxiliaryRepositoryRepository", ".", "findById", "(", "repositoryId", ")", ";", "if", "(", "optionalAuxiliaryRepository", ".", "isEmpty", "(", ")", ")", "{", "return", "ResponseEntity", ".", "notFound", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createFailureAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "\"internalServerError\"", ",", "\"There was an error on the server and the URL of the auxiliary couldn't be retrieved.\"", ")", ")", ".", "build", "(", ")", ";", "}", "AuxiliaryRepository", "auxiliaryRepository", "=", "optionalAuxiliaryRepository", ".", "get", "(", ")", ";", "long", "start", "=", "System", ".", "nanoTime", "(", ")", ";", "Optional", "<", "File", ">", "zipFile", "=", "programmingExerciseExportService", ".", "exportInstructorAuxiliaryRepositoryForExercise", "(", "programmingExercise", ".", "getId", "(", ")", ",", "auxiliaryRepository", ",", "new", "ArrayList", "<", ">", "(", ")", ")", ";", "return", "returnZipFileForRepositoryExport", "(", "zipFile", ",", "auxiliaryRepository", ".", "getName", "(", ")", ",", "programmingExercise", ",", "start", ")", ";", "}" ]
GET /programming-exercises/:exerciseId/export-instructor-auxiliary-repository/:repositoryType : sends an auxiliary repository as a zip file @param exerciseId The id of the programming exercise @param repositoryId The id of the auxiliary repository @return ResponseEntity with status @throws IOException if something during the zip process went wrong
[ "GET", "/", "programming", "-", "exercises", "/", ":", "exerciseId", "/", "export", "-", "instructor", "-", "auxiliary", "-", "repository", "/", ":", "repositoryType", ":", "sends", "an", "auxiliary", "repository", "as", "a", "zip", "file", "@param", "exerciseId", "The", "id", "of", "the", "programming", "exercise", "@param", "repositoryId", "The", "id", "of", "the", "auxiliary", "repository", "@return", "ResponseEntity", "with", "status", "@throws", "IOException", "if", "something", "during", "the", "zip", "process", "went", "wrong" ]
[]
[ { "param": "exerciseId", "type": "long" }, { "param": "repositoryId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repositoryId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 967, 3233, 12, 10357, 18, 31275, 67, 706, 13915, 916, 67, 14237, 60, 45, 2053, 6043, 67, 862, 30986, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 9833, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 1420, 34, 3359, 382, 2732, 21981, 20606, 3305, 26964, 743, 3092, 1525, 24165, 548, 16, 632, 743, 3092, 1525, 3352, 548, 13, 1216, 1860, 288, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 1448, 18133, 1360, 67, 8423, 5511, 6856, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 203, 3639, 4055, 32, 21981, 20606, 3305, 34, 3129, 21981, 20606, 3305, 273, 9397, 20606, 3305, 3305, 18, 4720, 5132, 12, 9071, 548, 1769, 203, 203, 3639, 309, 261, 10444, 21981, 20606, 3305, 18, 291, 1921, 10756, 288, 203, 5411, 327, 2306, 1943, 18, 902, 2043, 7675, 2485, 12, 1864, 1304, 18, 2640, 5247, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 315, 7236, 8777, 3113, 203, 10792, 315, 9828, 1703, 392, 555, 603, 326, 1438, 471, 326, 1976, 434, 326, 9397, 20606, 17991, 1404, 506, 10295, 1199, 13, 2934, 3510, 5621, 203, 3639, 289, 203, 203, 3639, 432, 2616, 20606, 3305, 9397, 20606, 3305, 273, 3129, 21981, 20606, 3305, 18, 588, 5621, 203, 203, 3639, 1525, 787, 273, 2332, 18, 13569, 83, 950, 5621, 203, 3639, 4055, 32, 812, 34, 19450, 273, 5402, 11987, 424, 20603, 6144, 1179, 18, 6530, 382, 2732, 21981, 20606, 3305, 1290, 424, 20603, 12, 12890, 11987, 424, 20603, 18, 26321, 9334, 9397, 20606, 3305, 16, 203, 7734, 394, 2407, 29667, 10663, 203, 3639, 327, 327, 29394, 1290, 3305, 6144, 12, 4450, 812, 16, 9397, 20606, 3305, 18, 17994, 9334, 5402, 11987, 424, 20603, 16, 787, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4978, 342, 12890, 11987, 17, 8913, 71, 6141, 16880, 8913, 30708, 548, 19, 6530, 17, 267, 2732, 17, 18196, 20606, 17, 9071, 16880, 9071, 559, 294, 9573, 392, 9397, 20606, 3352, 487, 279, 3144, 585, 203, 377, 380, 632, 891, 24165, 548, 1021, 612, 434, 326, 5402, 11987, 24165, 203, 377, 380, 632, 891, 3352, 548, 1021, 612, 434, 326, 9397, 20606, 3352, 203, 377, 380, 632, 2463, 2306, 1943, 598, 1267, 203, 377, 380, 632, 15069, 1860, 309, 5943, 4982, 326, 3144, 1207, 16343, 7194, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
generateStructureOracleForExercise
null
@PutMapping(value = Endpoints.GENERATE_TESTS, produces = MediaType.TEXT_PLAIN_VALUE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<String> generateStructureOracleForExercise(@PathVariable long exerciseId) { log.debug("REST request to generate the structure oracle for ProgrammingExercise with id: {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, user); if (programmingExercise.getPackageName() == null || programmingExercise.getPackageName().length() < 3) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "This is a linked exercise and generating the structure oracle for this exercise is not possible.", "couldNotGenerateStructureOracle")).body(null); } var solutionRepoURL = programmingExercise.getVcsSolutionRepositoryUrl(); var exerciseRepoURL = programmingExercise.getVcsTemplateRepositoryUrl(); var testRepoURL = programmingExercise.getVcsTestRepositoryUrl(); try { String testsPath = Paths.get("test", programmingExercise.getPackageFolderName()).toString(); // Atm we only have one folder that can have structural tests, but this could change. testsPath = programmingExercise.hasSequentialTestRuns() ? Paths.get("structural", testsPath).toString() : testsPath; boolean didGenerateOracle = programmingExerciseService.generateStructureOracleFile(solutionRepoURL, exerciseRepoURL, testRepoURL, testsPath, user); if (didGenerateOracle) { HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.setContentType(MediaType.TEXT_PLAIN); return new ResponseEntity<>("Successfully generated the structure oracle for the exercise " + programmingExercise.getProjectName(), responseHeaders, HttpStatus.OK); } else { return ResponseEntity.badRequest().headers( HeaderUtil.createAlert(applicationName, "Did not update the oracle because there have not been any changes to it.", "didNotGenerateStructureOracle")) .body(null); } } catch (Exception e) { return ResponseEntity.badRequest() .headers(HeaderUtil.createAlert(applicationName, "An error occurred while generating the structure oracle for the exercise " + programmingExercise.getProjectName() + ": \n" + e.getMessage(), "errorStructureOracleGeneration")) .body(null); } }
/** * PUT /programming-exercises/{exerciseId}/generate-tests : Makes a call to StructureOracleGenerator to generate the structure oracle aka the test.json file * * @param exerciseId The ID of the programming exercise for which the structure oracle should get generated * @return The ResponseEntity with status 201 (Created) or with status 400 (Bad Request) if the parameters are invalid */
PUT /programming-exercises/{exerciseId}/generate-tests : Makes a call to StructureOracleGenerator to generate the structure oracle aka the test.json file @param exerciseId The ID of the programming exercise for which the structure oracle should get generated @return The ResponseEntity with status 201 (Created) or with status 400 (Bad Request) if the parameters are invalid
[ "PUT", "/", "programming", "-", "exercises", "/", "{", "exerciseId", "}", "/", "generate", "-", "tests", ":", "Makes", "a", "call", "to", "StructureOracleGenerator", "to", "generate", "the", "structure", "oracle", "aka", "the", "test", ".", "json", "file", "@param", "exerciseId", "The", "ID", "of", "the", "programming", "exercise", "for", "which", "the", "structure", "oracle", "should", "get", "generated", "@return", "The", "ResponseEntity", "with", "status", "201", "(", "Created", ")", "or", "with", "status", "400", "(", "Bad", "Request", ")", "if", "the", "parameters", "are", "invalid" ]
@PutMapping(value = Endpoints.GENERATE_TESTS, produces = MediaType.TEXT_PLAIN_VALUE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<String> generateStructureOracleForExercise(@PathVariable long exerciseId) { log.debug("REST request to generate the structure oracle for ProgrammingExercise with id: {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, user); if (programmingExercise.getPackageName() == null || programmingExercise.getPackageName().length() < 3) { return ResponseEntity.badRequest().headers(HeaderUtil.createAlert(applicationName, "This is a linked exercise and generating the structure oracle for this exercise is not possible.", "couldNotGenerateStructureOracle")).body(null); } var solutionRepoURL = programmingExercise.getVcsSolutionRepositoryUrl(); var exerciseRepoURL = programmingExercise.getVcsTemplateRepositoryUrl(); var testRepoURL = programmingExercise.getVcsTestRepositoryUrl(); try { String testsPath = Paths.get("test", programmingExercise.getPackageFolderName()).toString(); testsPath = programmingExercise.hasSequentialTestRuns() ? Paths.get("structural", testsPath).toString() : testsPath; boolean didGenerateOracle = programmingExerciseService.generateStructureOracleFile(solutionRepoURL, exerciseRepoURL, testRepoURL, testsPath, user); if (didGenerateOracle) { HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.setContentType(MediaType.TEXT_PLAIN); return new ResponseEntity<>("Successfully generated the structure oracle for the exercise " + programmingExercise.getProjectName(), responseHeaders, HttpStatus.OK); } else { return ResponseEntity.badRequest().headers( HeaderUtil.createAlert(applicationName, "Did not update the oracle because there have not been any changes to it.", "didNotGenerateStructureOracle")) .body(null); } } catch (Exception e) { return ResponseEntity.badRequest() .headers(HeaderUtil.createAlert(applicationName, "An error occurred while generating the structure oracle for the exercise " + programmingExercise.getProjectName() + ": \n" + e.getMessage(), "errorStructureOracleGeneration")) .body(null); } }
[ "@", "PutMapping", "(", "value", "=", "Endpoints", ".", "GENERATE_TESTS", ",", "produces", "=", "MediaType", ".", "TEXT_PLAIN_VALUE", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "String", ">", "generateStructureOracleForExercise", "(", "@", "PathVariable", "long", "exerciseId", ")", "{", "log", ".", "debug", "(", "\"REST request to generate the structure oracle for ProgrammingExercise with id: {}\"", ",", "exerciseId", ")", ";", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow", "(", "exerciseId", ")", ";", "User", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "EDITOR", ",", "programmingExercise", ",", "user", ")", ";", "if", "(", "programmingExercise", ".", "getPackageName", "(", ")", "==", "null", "||", "programmingExercise", ".", "getPackageName", "(", ")", ".", "length", "(", ")", "<", "3", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"This is a linked exercise and generating the structure oracle for this exercise is not possible.\"", ",", "\"couldNotGenerateStructureOracle\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "var", "solutionRepoURL", "=", "programmingExercise", ".", "getVcsSolutionRepositoryUrl", "(", ")", ";", "var", "exerciseRepoURL", "=", "programmingExercise", ".", "getVcsTemplateRepositoryUrl", "(", ")", ";", "var", "testRepoURL", "=", "programmingExercise", ".", "getVcsTestRepositoryUrl", "(", ")", ";", "try", "{", "String", "testsPath", "=", "Paths", ".", "get", "(", "\"test\"", ",", "programmingExercise", ".", "getPackageFolderName", "(", ")", ")", ".", "toString", "(", ")", ";", "testsPath", "=", "programmingExercise", ".", "hasSequentialTestRuns", "(", ")", "?", "Paths", ".", "get", "(", "\"structural\"", ",", "testsPath", ")", ".", "toString", "(", ")", ":", "testsPath", ";", "boolean", "didGenerateOracle", "=", "programmingExerciseService", ".", "generateStructureOracleFile", "(", "solutionRepoURL", ",", "exerciseRepoURL", ",", "testRepoURL", ",", "testsPath", ",", "user", ")", ";", "if", "(", "didGenerateOracle", ")", "{", "HttpHeaders", "responseHeaders", "=", "new", "HttpHeaders", "(", ")", ";", "responseHeaders", ".", "setContentType", "(", "MediaType", ".", "TEXT_PLAIN", ")", ";", "return", "new", "ResponseEntity", "<", ">", "(", "\"Successfully generated the structure oracle for the exercise \"", "+", "programmingExercise", ".", "getProjectName", "(", ")", ",", "responseHeaders", ",", "HttpStatus", ".", "OK", ")", ";", "}", "else", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"Did not update the oracle because there have not been any changes to it.\"", ",", "\"didNotGenerateStructureOracle\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createAlert", "(", "applicationName", ",", "\"An error occurred while generating the structure oracle for the exercise \"", "+", "programmingExercise", ".", "getProjectName", "(", ")", "+", "\": \\n\"", "+", "e", ".", "getMessage", "(", ")", ",", "\"errorStructureOracleGeneration\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "}" ]
PUT /programming-exercises/{exerciseId}/generate-tests : Makes a call to StructureOracleGenerator to generate the structure oracle aka the test.json file @param exerciseId The ID of the programming exercise for which the structure oracle should get generated @return The ResponseEntity with status 201 (Created) or with status 400 (Bad Request) if the parameters are invalid
[ "PUT", "/", "programming", "-", "exercises", "/", "{", "exerciseId", "}", "/", "generate", "-", "tests", ":", "Makes", "a", "call", "to", "StructureOracleGenerator", "to", "generate", "the", "structure", "oracle", "aka", "the", "test", ".", "json", "file", "@param", "exerciseId", "The", "ID", "of", "the", "programming", "exercise", "for", "which", "the", "structure", "oracle", "should", "get", "generated", "@return", "The", "ResponseEntity", "with", "status", "201", "(", "Created", ")", "or", "with", "status", "400", "(", "Bad", "Request", ")", "if", "the", "parameters", "are", "invalid" ]
[ "// Atm we only have one folder that can have structural tests, but this could change." ]
[ { "param": "exerciseId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 1132, 273, 19258, 18, 13990, 1777, 67, 16961, 55, 16, 15505, 273, 12206, 18, 5151, 67, 26549, 67, 4051, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 780, 34, 2103, 6999, 23601, 1290, 424, 20603, 26964, 743, 3092, 1525, 24165, 548, 13, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 2103, 326, 3695, 20865, 364, 13586, 11987, 424, 20603, 598, 612, 30, 3728, 16, 24165, 548, 1769, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 2177, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 13208, 16, 5402, 11987, 424, 20603, 16, 729, 1769, 203, 3639, 309, 261, 12890, 11987, 424, 20603, 18, 588, 18308, 1435, 422, 446, 747, 5402, 11987, 424, 20603, 18, 588, 18308, 7675, 2469, 1435, 411, 890, 13, 288, 203, 5411, 327, 2306, 1943, 18, 8759, 691, 7675, 2485, 12, 1864, 1304, 18, 2640, 13298, 12, 3685, 461, 16, 203, 10792, 315, 2503, 353, 279, 8459, 24165, 471, 12516, 326, 3695, 20865, 364, 333, 24165, 353, 486, 3323, 1199, 16, 315, 15195, 1248, 4625, 6999, 23601, 7923, 2934, 3432, 12, 2011, 1769, 203, 3639, 289, 203, 203, 3639, 569, 6959, 8791, 1785, 273, 5402, 11987, 424, 20603, 18, 588, 58, 2143, 16135, 3305, 1489, 5621, 203, 3639, 569, 24165, 8791, 1785, 273, 5402, 11987, 424, 20603, 18, 588, 58, 2143, 2283, 3305, 1489, 5621, 203, 3639, 569, 1842, 8791, 1785, 273, 5402, 11987, 424, 20603, 18, 588, 58, 2143, 4709, 3305, 1489, 5621, 203, 203, 3639, 775, 288, 203, 5411, 514, 7434, 743, 273, 16643, 18, 588, 2932, 3813, 3113, 5402, 11987, 424, 20603, 18, 588, 2261, 26169, 1435, 2934, 10492, 5621, 203, 5411, 368, 2380, 81, 732, 1338, 1240, 1245, 3009, 716, 848, 1240, 1958, 3766, 7434, 16, 1496, 333, 3377, 2549, 18, 203, 5411, 7434, 743, 273, 5402, 11987, 424, 20603, 18, 5332, 28241, 4709, 9361, 1435, 692, 16643, 18, 588, 2932, 1697, 3766, 3113, 7434, 743, 2934, 10492, 1435, 294, 7434, 743, 31, 203, 5411, 1250, 5061, 4625, 23601, 273, 5402, 11987, 424, 20603, 1179, 18, 7163, 6999, 23601, 812, 12, 13385, 8791, 1785, 16, 24165, 8791, 1785, 16, 1842, 8791, 1785, 16, 7434, 743, 16, 729, 1769, 203, 203, 5411, 309, 261, 14044, 4625, 23601, 13, 288, 203, 7734, 22250, 25488, 273, 394, 22250, 5621, 203, 7734, 25488, 18, 542, 8046, 12, 20870, 18, 5151, 67, 26549, 1769, 203, 7734, 327, 394, 2306, 1943, 29667, 2932, 18303, 4374, 326, 3695, 20865, 364, 326, 24165, 315, 397, 5402, 11987, 424, 20603, 18, 588, 4109, 461, 9334, 25488, 16, 21153, 18, 3141, 1769, 203, 5411, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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23601, 3908, 358, 2103, 326, 3695, 20865, 28105, 326, 1842, 18, 1977, 585, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 1021, 1599, 434, 326, 5402, 11987, 24165, 364, 1492, 326, 3695, 20865, 1410, 336, 4374, 203, 377, 380, 632, 2463, 1021, 2306, 1943, 598, 1267, 3786, 261, 6119, 13, 578, 598, 1267, 7409, 261, 6434, 1567, 13, 309, 326, 1472, 854, 2057, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
hasAtLeastOneStudentResult
null
@GetMapping(Endpoints.TEST_CASE_STATE) @PreAuthorize("hasRole('TA')") public ResponseEntity<ProgrammingExerciseTestCaseStateDTO> hasAtLeastOneStudentResult(@PathVariable long exerciseId) { var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.TEACHING_ASSISTANT, programmingExercise, null); boolean hasAtLeastOneStudentResult = programmingExerciseService.hasAtLeastOneStudentResult(programmingExercise); boolean isReleased = programmingExercise.isReleased(); ProgrammingExerciseTestCaseStateDTO testCaseDTO = new ProgrammingExerciseTestCaseStateDTO().released(isReleased).studentResult(hasAtLeastOneStudentResult) .testCasesChanged(programmingExercise.getTestCasesChanged()) .buildAndTestStudentSubmissionsAfterDueDate(programmingExercise.getBuildAndTestStudentSubmissionsAfterDueDate()); return ResponseEntity.ok(testCaseDTO); }
/** * GET /programming-exercises/:exerciseId/test-case-state : Returns a DTO that offers information on the test case state of the programming exercise. * * @param exerciseId the id of a ProgrammingExercise * @return the ResponseEntity with status 200 (OK) and ProgrammingExerciseTestCaseStateDTO. Returns 404 (notFound) if the exercise does not exist. */
GET /programming-exercises/:exerciseId/test-case-state : Returns a DTO that offers information on the test case state of the programming exercise. @param exerciseId the id of a ProgrammingExercise @return the ResponseEntity with status 200 (OK) and ProgrammingExerciseTestCaseStateDTO. Returns 404 (notFound) if the exercise does not exist.
[ "GET", "/", "programming", "-", "exercises", "/", ":", "exerciseId", "/", "test", "-", "case", "-", "state", ":", "Returns", "a", "DTO", "that", "offers", "information", "on", "the", "test", "case", "state", "of", "the", "programming", "exercise", ".", "@param", "exerciseId", "the", "id", "of", "a", "ProgrammingExercise", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "and", "ProgrammingExerciseTestCaseStateDTO", ".", "Returns", "404", "(", "notFound", ")", "if", "the", "exercise", "does", "not", "exist", "." ]
@GetMapping(Endpoints.TEST_CASE_STATE) @PreAuthorize("hasRole('TA')") public ResponseEntity<ProgrammingExerciseTestCaseStateDTO> hasAtLeastOneStudentResult(@PathVariable long exerciseId) { var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.TEACHING_ASSISTANT, programmingExercise, null); boolean hasAtLeastOneStudentResult = programmingExerciseService.hasAtLeastOneStudentResult(programmingExercise); boolean isReleased = programmingExercise.isReleased(); ProgrammingExerciseTestCaseStateDTO testCaseDTO = new ProgrammingExerciseTestCaseStateDTO().released(isReleased).studentResult(hasAtLeastOneStudentResult) .testCasesChanged(programmingExercise.getTestCasesChanged()) .buildAndTestStudentSubmissionsAfterDueDate(programmingExercise.getBuildAndTestStudentSubmissionsAfterDueDate()); return ResponseEntity.ok(testCaseDTO); }
[ "@", "GetMapping", "(", "Endpoints", ".", "TEST_CASE_STATE", ")", "@", "PreAuthorize", "(", "\"hasRole('TA')\"", ")", "public", "ResponseEntity", "<", "ProgrammingExerciseTestCaseStateDTO", ">", "hasAtLeastOneStudentResult", "(", "@", "PathVariable", "long", "exerciseId", ")", "{", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "TEACHING_ASSISTANT", ",", "programmingExercise", ",", "null", ")", ";", "boolean", "hasAtLeastOneStudentResult", "=", "programmingExerciseService", ".", "hasAtLeastOneStudentResult", "(", "programmingExercise", ")", ";", "boolean", "isReleased", "=", "programmingExercise", ".", "isReleased", "(", ")", ";", "ProgrammingExerciseTestCaseStateDTO", "testCaseDTO", "=", "new", "ProgrammingExerciseTestCaseStateDTO", "(", ")", ".", "released", "(", "isReleased", ")", ".", "studentResult", "(", "hasAtLeastOneStudentResult", ")", ".", "testCasesChanged", "(", "programmingExercise", ".", "getTestCasesChanged", "(", ")", ")", ".", "buildAndTestStudentSubmissionsAfterDueDate", "(", "programmingExercise", ".", "getBuildAndTestStudentSubmissionsAfterDueDate", "(", ")", ")", ";", "return", "ResponseEntity", ".", "ok", "(", "testCaseDTO", ")", ";", "}" ]
GET /programming-exercises/:exerciseId/test-case-state : Returns a DTO that offers information on the test case state of the programming exercise.
[ "GET", "/", "programming", "-", "exercises", "/", ":", "exerciseId", "/", "test", "-", "case", "-", "state", ":", "Returns", "a", "DTO", "that", "offers", "information", "on", "the", "test", "case", "state", "of", "the", "programming", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 967, 3233, 12, 10357, 18, 16961, 67, 13415, 67, 7998, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 9833, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 9459, 11987, 424, 20603, 4709, 2449, 1119, 19792, 34, 711, 25070, 3335, 19943, 319, 1253, 26964, 743, 3092, 1525, 24165, 548, 13, 288, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 1190, 2283, 1876, 16135, 1988, 24629, 367, 8689, 7729, 809, 10487, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 1448, 18133, 1360, 67, 8423, 5511, 6856, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 3639, 1250, 711, 25070, 3335, 19943, 319, 1253, 273, 5402, 11987, 424, 20603, 1179, 18, 5332, 25070, 3335, 19943, 319, 1253, 12, 12890, 11987, 424, 20603, 1769, 203, 3639, 1250, 353, 26363, 273, 5402, 11987, 424, 20603, 18, 291, 26363, 5621, 203, 3639, 13586, 11987, 424, 20603, 4709, 2449, 1119, 19792, 1842, 2449, 19792, 273, 394, 13586, 11987, 424, 20603, 4709, 2449, 1119, 19792, 7675, 9340, 72, 12, 291, 26363, 2934, 26240, 1253, 12, 5332, 25070, 3335, 19943, 319, 1253, 13, 203, 7734, 263, 3813, 30744, 5033, 12, 12890, 11987, 424, 20603, 18, 588, 4709, 30744, 5033, 10756, 203, 7734, 263, 3510, 1876, 4709, 19943, 319, 1676, 7300, 4436, 30023, 1626, 12, 12890, 11987, 424, 20603, 18, 588, 3116, 1876, 4709, 19943, 319, 1676, 7300, 4436, 30023, 1626, 10663, 203, 3639, 327, 2306, 1943, 18, 601, 12, 3813, 2449, 19792, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4978, 342, 12890, 11987, 17, 8913, 71, 6141, 16880, 8913, 30708, 548, 19, 3813, 17, 3593, 17, 2019, 294, 2860, 279, 463, 4296, 716, 28641, 1779, 603, 326, 1842, 648, 919, 434, 326, 5402, 11987, 24165, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 612, 434, 279, 13586, 11987, 424, 20603, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 471, 13586, 11987, 424, 20603, 4709, 2449, 1119, 19792, 18, 2860, 7709, 261, 902, 2043, 13, 309, 326, 24165, 1552, 486, 1005, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
checkPlagiarism
null
@GetMapping(Endpoints.CHECK_PLAGIARISM) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<TextPlagiarismResult> checkPlagiarism(@PathVariable long exerciseId, @RequestParam float similarityThreshold, @RequestParam int minimumScore) throws ExitException, IOException { log.debug("REST request to check plagiarism for ProgrammingExercise with id: {}", exerciseId); ProgrammingExercise programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, null); ProgrammingLanguage language = programmingExercise.getProgrammingLanguage(); ProgrammingLanguageFeature programmingLanguageFeature = programmingLanguageFeatureService.getProgrammingLanguageFeatures(language); if (!programmingLanguageFeature.isPlagiarismCheckSupported()) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "programmingLanguageNotSupported", "Artemis does not support plagiarism checks for the programming language " + language)).body(null); } long start = System.nanoTime(); TextPlagiarismResult result = programmingPlagiarismDetectionService.checkPlagiarism(exerciseId, similarityThreshold, minimumScore); log.info("Finished programmingExerciseExportService.checkPlagiarism call for {} comparisons in {}", result.getComparisons().size(), TimeLogUtil.formatDurationFrom(start)); return ResponseEntity.ok(result); }
/** * GET /programming-exercises/{exerciseId}/check-plagiarism * <p> * Start the automated plagiarism detection for the given exercise and return its result. * * @param exerciseId The ID of the programming exercise for which the plagiarism check should be executed * @param similarityThreshold ignore comparisons whose similarity is below this threshold (%) * @param minimumScore consider only submissions whose score is greater or equal to this value * @return the ResponseEntity with status 200 (OK) and the list of at most 500 pair-wise submissions with a similarity above the given threshold (e.g. 50%). * @throws ExitException is thrown if JPlag exits unexpectedly * @throws IOException is thrown for file handling errors */
GET /programming-exercises/{exerciseId}/check-plagiarism Start the automated plagiarism detection for the given exercise and return its result. @param exerciseId The ID of the programming exercise for which the plagiarism check should be executed @param similarityThreshold ignore comparisons whose similarity is below this threshold (%) @param minimumScore consider only submissions whose score is greater or equal to this value @return the ResponseEntity with status 200 (OK) and the list of at most 500 pair-wise submissions with a similarity above the given threshold . @throws ExitException is thrown if JPlag exits unexpectedly @throws IOException is thrown for file handling errors
[ "GET", "/", "programming", "-", "exercises", "/", "{", "exerciseId", "}", "/", "check", "-", "plagiarism", "Start", "the", "automated", "plagiarism", "detection", "for", "the", "given", "exercise", "and", "return", "its", "result", ".", "@param", "exerciseId", "The", "ID", "of", "the", "programming", "exercise", "for", "which", "the", "plagiarism", "check", "should", "be", "executed", "@param", "similarityThreshold", "ignore", "comparisons", "whose", "similarity", "is", "below", "this", "threshold", "(", "%", ")", "@param", "minimumScore", "consider", "only", "submissions", "whose", "score", "is", "greater", "or", "equal", "to", "this", "value", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "and", "the", "list", "of", "at", "most", "500", "pair", "-", "wise", "submissions", "with", "a", "similarity", "above", "the", "given", "threshold", ".", "@throws", "ExitException", "is", "thrown", "if", "JPlag", "exits", "unexpectedly", "@throws", "IOException", "is", "thrown", "for", "file", "handling", "errors" ]
@GetMapping(Endpoints.CHECK_PLAGIARISM) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<TextPlagiarismResult> checkPlagiarism(@PathVariable long exerciseId, @RequestParam float similarityThreshold, @RequestParam int minimumScore) throws ExitException, IOException { log.debug("REST request to check plagiarism for ProgrammingExercise with id: {}", exerciseId); ProgrammingExercise programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, null); ProgrammingLanguage language = programmingExercise.getProgrammingLanguage(); ProgrammingLanguageFeature programmingLanguageFeature = programmingLanguageFeatureService.getProgrammingLanguageFeatures(language); if (!programmingLanguageFeature.isPlagiarismCheckSupported()) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "programmingLanguageNotSupported", "Artemis does not support plagiarism checks for the programming language " + language)).body(null); } long start = System.nanoTime(); TextPlagiarismResult result = programmingPlagiarismDetectionService.checkPlagiarism(exerciseId, similarityThreshold, minimumScore); log.info("Finished programmingExerciseExportService.checkPlagiarism call for {} comparisons in {}", result.getComparisons().size(), TimeLogUtil.formatDurationFrom(start)); return ResponseEntity.ok(result); }
[ "@", "GetMapping", "(", "Endpoints", ".", "CHECK_PLAGIARISM", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "TextPlagiarismResult", ">", "checkPlagiarism", "(", "@", "PathVariable", "long", "exerciseId", ",", "@", "RequestParam", "float", "similarityThreshold", ",", "@", "RequestParam", "int", "minimumScore", ")", "throws", "ExitException", ",", "IOException", "{", "log", ".", "debug", "(", "\"REST request to check plagiarism for ProgrammingExercise with id: {}\"", ",", "exerciseId", ")", ";", "ProgrammingExercise", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "EDITOR", ",", "programmingExercise", ",", "null", ")", ";", "ProgrammingLanguage", "language", "=", "programmingExercise", ".", "getProgrammingLanguage", "(", ")", ";", "ProgrammingLanguageFeature", "programmingLanguageFeature", "=", "programmingLanguageFeatureService", ".", "getProgrammingLanguageFeatures", "(", "language", ")", ";", "if", "(", "!", "programmingLanguageFeature", ".", "isPlagiarismCheckSupported", "(", ")", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createFailureAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "\"programmingLanguageNotSupported\"", ",", "\"Artemis does not support plagiarism checks for the programming language \"", "+", "language", ")", ")", ".", "body", "(", "null", ")", ";", "}", "long", "start", "=", "System", ".", "nanoTime", "(", ")", ";", "TextPlagiarismResult", "result", "=", "programmingPlagiarismDetectionService", ".", "checkPlagiarism", "(", "exerciseId", ",", "similarityThreshold", ",", "minimumScore", ")", ";", "log", ".", "info", "(", "\"Finished programmingExerciseExportService.checkPlagiarism call for {} comparisons in {}\"", ",", "result", ".", "getComparisons", "(", ")", ".", "size", "(", ")", ",", "TimeLogUtil", ".", "formatDurationFrom", "(", "start", ")", ")", ";", "return", "ResponseEntity", ".", "ok", "(", "result", ")", ";", "}" ]
GET /programming-exercises/{exerciseId}/check-plagiarism <p> Start the automated plagiarism detection for the given exercise and return its result.
[ "GET", "/", "programming", "-", "exercises", "/", "{", "exerciseId", "}", "/", "check", "-", "plagiarism", "<p", ">", "Start", "the", "automated", "plagiarism", "detection", "for", "the", "given", "exercise", "and", "return", "its", "result", "." ]
[]
[ { "param": "exerciseId", "type": "long" }, { "param": "similarityThreshold", "type": "float" }, { "param": "minimumScore", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "similarityThreshold", "type": "float", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "minimumScore", "type": "int", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 967, 3233, 12, 10357, 18, 10687, 67, 6253, 1781, 45, 985, 5127, 49, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 1528, 1749, 346, 77, 297, 6228, 1253, 34, 866, 1749, 346, 77, 297, 6228, 26964, 743, 3092, 1525, 24165, 548, 16, 632, 691, 786, 1431, 16416, 7614, 16, 632, 691, 786, 509, 5224, 7295, 13, 203, 5411, 1216, 9500, 503, 16, 1860, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 866, 886, 346, 77, 297, 6228, 364, 13586, 11987, 424, 20603, 598, 612, 30, 3728, 16, 24165, 548, 1769, 203, 3639, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 13208, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 203, 3639, 13586, 11987, 3779, 2653, 273, 5402, 11987, 424, 20603, 18, 588, 9459, 11987, 3779, 5621, 203, 3639, 13586, 11987, 3779, 4595, 5402, 11987, 3779, 4595, 273, 5402, 11987, 3779, 4595, 1179, 18, 588, 9459, 11987, 3779, 8696, 12, 4923, 1769, 203, 203, 3639, 309, 16051, 12890, 11987, 3779, 4595, 18, 291, 1749, 346, 77, 297, 6228, 1564, 7223, 10756, 288, 203, 5411, 327, 2306, 1943, 18, 8759, 691, 7675, 2485, 12, 1864, 1304, 18, 2640, 5247, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 315, 12890, 11987, 3779, 16106, 3113, 203, 10792, 315, 686, 874, 291, 1552, 486, 2865, 886, 346, 77, 297, 6228, 4271, 364, 326, 5402, 11987, 2653, 315, 397, 2653, 13, 2934, 3432, 12, 2011, 1769, 203, 3639, 289, 203, 203, 3639, 1525, 787, 273, 2332, 18, 13569, 83, 950, 5621, 203, 3639, 3867, 1749, 346, 77, 297, 6228, 1253, 563, 273, 5402, 11987, 1749, 346, 77, 297, 6228, 10214, 1179, 18, 1893, 1749, 346, 77, 297, 6228, 12, 8913, 30708, 548, 16, 16416, 7614, 16, 5224, 7295, 1769, 203, 3639, 613, 18, 1376, 2932, 10577, 5402, 11987, 424, 20603, 6144, 1179, 18, 1893, 1749, 346, 77, 297, 6228, 745, 364, 2618, 23068, 316, 3728, 16, 563, 18, 588, 16059, 87, 7675, 1467, 9334, 2647, 1343, 1304, 18, 2139, 5326, 1265, 12, 1937, 10019, 203, 3639, 327, 2306, 1943, 18, 601, 12, 2088, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 4978, 342, 12890, 11987, 17, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 1893, 17, 412, 346, 77, 297, 6228, 203, 377, 380, 411, 84, 34, 203, 377, 380, 3603, 326, 18472, 690, 886, 346, 77, 297, 6228, 11649, 364, 326, 864, 24165, 471, 327, 2097, 563, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 1850, 1021, 1599, 434, 326, 5402, 11987, 24165, 364, 1492, 326, 886, 346, 77, 297, 6228, 866, 1410, 506, 7120, 203, 377, 380, 632, 891, 16416, 7614, 2305, 23068, 8272, 16416, 353, 5712, 333, 5573, 6142, 13, 203, 377, 380, 632, 891, 5224, 7295, 3639, 5260, 1338, 22071, 8272, 4462, 353, 6802, 578, 3959, 358, 333, 460, 203, 377, 380, 632, 2463, 326, 2306, 2 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
checkPlagiarismWithJPlagReport
null
@GetMapping(value = Endpoints.CHECK_PLAGIARISM_JPLAG_REPORT, produces = MediaType.TEXT_PLAIN_VALUE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> checkPlagiarismWithJPlagReport(@PathVariable long exerciseId, @RequestParam float similarityThreshold, @RequestParam int minimumScore) throws ExitException, IOException { log.debug("REST request to check plagiarism for ProgrammingExercise with id: {}", exerciseId); ProgrammingExercise programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, null); var language = programmingExercise.getProgrammingLanguage(); ProgrammingLanguageFeature programmingLanguageFeature = programmingLanguageFeatureService.getProgrammingLanguageFeatures(language); if (!programmingLanguageFeature.isPlagiarismCheckSupported()) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "programmingLanguageNotSupported", "Artemis does not support plagiarism checks for the programming language " + language)).body(null); } File zipFile = programmingPlagiarismDetectionService.checkPlagiarismWithJPlagReport(exerciseId, similarityThreshold, minimumScore); if (zipFile == null) { return ResponseEntity.badRequest().headers( HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "internalServerError", "Insufficient amount of comparisons available for comparison.")) .body(null); } InputStreamResource resource = new InputStreamResource(new FileInputStream(zipFile)); return ResponseEntity.ok().contentLength(zipFile.length()).contentType(MediaType.APPLICATION_OCTET_STREAM).header("filename", zipFile.getName()).body(resource); }
/** * GET /programming-exercises/{exerciseId}/plagiarism-check : Uses JPlag to check for plagiarism * and returns the generated output as zip file * * @param exerciseId The ID of the programming exercise for which the plagiarism check should be * executed * @param similarityThreshold ignore comparisons whose similarity is below this threshold (%) * @param minimumScore consider only submissions whose score is greater or equal to this value * @return The ResponseEntity with status 201 (Created) or with status 400 (Bad Request) if the parameters are invalid * @throws ExitException is thrown if JPlag exits unexpectedly * @throws IOException is thrown for file handling errors */
GET /programming-exercises/{exerciseId}/plagiarism-check : Uses JPlag to check for plagiarism and returns the generated output as zip file
[ "GET", "/", "programming", "-", "exercises", "/", "{", "exerciseId", "}", "/", "plagiarism", "-", "check", ":", "Uses", "JPlag", "to", "check", "for", "plagiarism", "and", "returns", "the", "generated", "output", "as", "zip", "file" ]
@GetMapping(value = Endpoints.CHECK_PLAGIARISM_JPLAG_REPORT, produces = MediaType.TEXT_PLAIN_VALUE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<Resource> checkPlagiarismWithJPlagReport(@PathVariable long exerciseId, @RequestParam float similarityThreshold, @RequestParam int minimumScore) throws ExitException, IOException { log.debug("REST request to check plagiarism for ProgrammingExercise with id: {}", exerciseId); ProgrammingExercise programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, null); var language = programmingExercise.getProgrammingLanguage(); ProgrammingLanguageFeature programmingLanguageFeature = programmingLanguageFeatureService.getProgrammingLanguageFeatures(language); if (!programmingLanguageFeature.isPlagiarismCheckSupported()) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "programmingLanguageNotSupported", "Artemis does not support plagiarism checks for the programming language " + language)).body(null); } File zipFile = programmingPlagiarismDetectionService.checkPlagiarismWithJPlagReport(exerciseId, similarityThreshold, minimumScore); if (zipFile == null) { return ResponseEntity.badRequest().headers( HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "internalServerError", "Insufficient amount of comparisons available for comparison.")) .body(null); } InputStreamResource resource = new InputStreamResource(new FileInputStream(zipFile)); return ResponseEntity.ok().contentLength(zipFile.length()).contentType(MediaType.APPLICATION_OCTET_STREAM).header("filename", zipFile.getName()).body(resource); }
[ "@", "GetMapping", "(", "value", "=", "Endpoints", ".", "CHECK_PLAGIARISM_JPLAG_REPORT", ",", "produces", "=", "MediaType", ".", "TEXT_PLAIN_VALUE", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "Resource", ">", "checkPlagiarismWithJPlagReport", "(", "@", "PathVariable", "long", "exerciseId", ",", "@", "RequestParam", "float", "similarityThreshold", ",", "@", "RequestParam", "int", "minimumScore", ")", "throws", "ExitException", ",", "IOException", "{", "log", ".", "debug", "(", "\"REST request to check plagiarism for ProgrammingExercise with id: {}\"", ",", "exerciseId", ")", ";", "ProgrammingExercise", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "EDITOR", ",", "programmingExercise", ",", "null", ")", ";", "var", "language", "=", "programmingExercise", ".", "getProgrammingLanguage", "(", ")", ";", "ProgrammingLanguageFeature", "programmingLanguageFeature", "=", "programmingLanguageFeatureService", ".", "getProgrammingLanguageFeatures", "(", "language", ")", ";", "if", "(", "!", "programmingLanguageFeature", ".", "isPlagiarismCheckSupported", "(", ")", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createFailureAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "\"programmingLanguageNotSupported\"", ",", "\"Artemis does not support plagiarism checks for the programming language \"", "+", "language", ")", ")", ".", "body", "(", "null", ")", ";", "}", "File", "zipFile", "=", "programmingPlagiarismDetectionService", ".", "checkPlagiarismWithJPlagReport", "(", "exerciseId", ",", "similarityThreshold", ",", "minimumScore", ")", ";", "if", "(", "zipFile", "==", "null", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createFailureAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "\"internalServerError\"", ",", "\"Insufficient amount of comparisons available for comparison.\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "InputStreamResource", "resource", "=", "new", "InputStreamResource", "(", "new", "FileInputStream", "(", "zipFile", ")", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "contentLength", "(", "zipFile", ".", "length", "(", ")", ")", ".", "contentType", "(", "MediaType", ".", "APPLICATION_OCTET_STREAM", ")", ".", "header", "(", "\"filename\"", ",", "zipFile", ".", "getName", "(", ")", ")", ".", "body", "(", "resource", ")", ";", "}" ]
GET /programming-exercises/{exerciseId}/plagiarism-check : Uses JPlag to check for plagiarism and returns the generated output as zip file
[ "GET", "/", "programming", "-", "exercises", "/", "{", "exerciseId", "}", "/", "plagiarism", "-", "check", ":", "Uses", "JPlag", "to", "check", "for", "plagiarism", "and", "returns", "the", "generated", "output", "as", "zip", "file" ]
[]
[ { "param": "exerciseId", "type": "long" }, { "param": "similarityThreshold", "type": "float" }, { "param": "minimumScore", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "similarityThreshold", "type": "float", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "minimumScore", "type": "int", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 967, 3233, 12, 1132, 273, 19258, 18, 10687, 67, 6253, 1781, 45, 985, 5127, 49, 67, 46, 6253, 1781, 67, 22710, 16, 15505, 273, 12206, 18, 5151, 67, 26549, 67, 4051, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 1420, 34, 866, 1749, 346, 77, 297, 6228, 1190, 46, 1749, 346, 4820, 26964, 743, 3092, 1525, 24165, 548, 16, 632, 691, 786, 1431, 16416, 7614, 16, 632, 691, 786, 509, 5224, 7295, 13, 203, 5411, 1216, 9500, 503, 16, 1860, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 866, 886, 346, 77, 297, 6228, 364, 13586, 11987, 424, 20603, 598, 612, 30, 3728, 16, 24165, 548, 1769, 203, 203, 3639, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 13208, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 203, 3639, 569, 2653, 273, 5402, 11987, 424, 20603, 18, 588, 9459, 11987, 3779, 5621, 203, 3639, 13586, 11987, 3779, 4595, 5402, 11987, 3779, 4595, 273, 5402, 11987, 3779, 4595, 1179, 18, 588, 9459, 11987, 3779, 8696, 12, 4923, 1769, 203, 203, 3639, 309, 16051, 12890, 11987, 3779, 4595, 18, 291, 1749, 346, 77, 297, 6228, 1564, 7223, 10756, 288, 203, 5411, 327, 2306, 1943, 18, 8759, 691, 7675, 2485, 12, 1864, 1304, 18, 2640, 5247, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 315, 12890, 11987, 3779, 16106, 3113, 203, 10792, 315, 686, 874, 291, 1552, 486, 2865, 886, 346, 77, 297, 6228, 4271, 364, 326, 5402, 11987, 2653, 315, 397, 2653, 13, 2934, 3432, 12, 2011, 1769, 203, 3639, 289, 203, 203, 3639, 1387, 19450, 273, 5402, 11987, 1749, 346, 77, 297, 6228, 10214, 1179, 18, 1893, 1749, 346, 77, 297, 6228, 1190, 46, 1749, 346, 4820, 12, 8913, 30708, 548, 16, 16416, 7614, 16, 5224, 7295, 1769, 203, 203, 3639, 309, 261, 4450, 812, 422, 446, 13, 288, 203, 5411, 327, 2306, 1943, 18, 8759, 691, 7675, 2485, 12, 203, 10792, 4304, 1304, 18, 2640, 5247, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 315, 7236, 8777, 3113, 315, 5048, 11339, 3844, 434, 23068, 2319, 364, 5826, 1199, 3719, 203, 10792, 263, 3432, 12, 2011, 1769, 203, 3639, 289, 203, 203, 3639, 5037, 1420, 1058, 273, 394, 5037, 1420, 12, 2704, 11907, 12, 4450, 812, 10019, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 1745, 1782, 12, 4450, 812, 18, 2469, 1435, 2934, 22194, 12, 20870, 18, 25039, 67, 51, 1268, 1584, 67, 13693, 2934, 3374, 2932, 3459, 3113, 19450, 18, 17994, 1435, 2934, 3432, 12, 3146, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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 487, 3144, 585, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 1850, 1021, 1599, 434, 326, 5402, 11987, 24165, 364, 1492, 326, 886, 346, 77, 297, 6228, 866, 1410, 506, 203, 377, 380, 18701, 7120, 203, 377, 380, 632, 891, 16416, 7614, 2305, 23068, 8272, 16416, 353, 5712, 333, 5573, 6142, 13, 203, 377, 380, 632, 891, 5224, 7295, 3639, 5260, 1338, 22071, 8272, 4462, 353, 6802, 578, 3959, 358, 333, 460, 203, 377, 380, 632, 2463, 1021, 2306, 2 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
unlockAllRepositories
null
@PutMapping(Endpoints.UNLOCK_ALL_REPOSITORIES) @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Void> unlockAllRepositories(@PathVariable Long exerciseId) { log.info("REST request to unlock all repositories of programming exercise {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, programmingExercise, null); programmingExerciseService.unlockAllRepositories(exerciseId); log.info("Unlocked all repositories of programming exercise {} upon manual request", exerciseId); return ResponseEntity.ok().build(); }
/** * Unlock all repositories of the given programming exercise. * * @param exerciseId of the exercise * @return The ResponseEntity with status 200 (OK) or with status 404 (Not Found) if the exerciseId is invalid */
Unlock all repositories of the given programming exercise. @param exerciseId of the exercise @return The ResponseEntity with status 200 (OK) or with status 404 (Not Found) if the exerciseId is invalid
[ "Unlock", "all", "repositories", "of", "the", "given", "programming", "exercise", ".", "@param", "exerciseId", "of", "the", "exercise", "@return", "The", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "or", "with", "status", "404", "(", "Not", "Found", ")", "if", "the", "exerciseId", "is", "invalid" ]
@PutMapping(Endpoints.UNLOCK_ALL_REPOSITORIES) @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Void> unlockAllRepositories(@PathVariable Long exerciseId) { log.info("REST request to unlock all repositories of programming exercise {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, programmingExercise, null); programmingExerciseService.unlockAllRepositories(exerciseId); log.info("Unlocked all repositories of programming exercise {} upon manual request", exerciseId); return ResponseEntity.ok().build(); }
[ "@", "PutMapping", "(", "Endpoints", ".", "UNLOCK_ALL_REPOSITORIES", ")", "@", "PreAuthorize", "(", "\"hasRole('INSTRUCTOR')\"", ")", "public", "ResponseEntity", "<", "Void", ">", "unlockAllRepositories", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "log", ".", "info", "(", "\"REST request to unlock all repositories of programming exercise {}\"", ",", "exerciseId", ")", ";", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "INSTRUCTOR", ",", "programmingExercise", ",", "null", ")", ";", "programmingExerciseService", ".", "unlockAllRepositories", "(", "exerciseId", ")", ";", "log", ".", "info", "(", "\"Unlocked all repositories of programming exercise {} upon manual request\"", ",", "exerciseId", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "build", "(", ")", ";", "}" ]
Unlock all repositories of the given programming exercise.
[ "Unlock", "all", "repositories", "of", "the", "given", "programming", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 10357, 18, 2124, 6589, 67, 4685, 67, 862, 28284, 916, 8805, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 706, 13915, 916, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 7186, 1595, 18429, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 613, 18, 1376, 2932, 12030, 590, 358, 7186, 777, 14531, 434, 5402, 11987, 24165, 3728, 16, 24165, 548, 1769, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 706, 13915, 916, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 3639, 5402, 11987, 424, 20603, 1179, 18, 26226, 1595, 18429, 12, 8913, 30708, 548, 1769, 203, 3639, 613, 18, 1376, 2932, 7087, 329, 777, 14531, 434, 5402, 11987, 24165, 2618, 12318, 11297, 590, 3113, 24165, 548, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 3510, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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14531, 434, 326, 864, 5402, 11987, 24165, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 434, 326, 24165, 203, 377, 380, 632, 2463, 1021, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 578, 598, 1267, 7709, 261, 1248, 10750, 13, 309, 326, 24165, 548, 353, 2057, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
lockAllRepositories
null
@PutMapping(Endpoints.LOCK_ALL_REPOSITORIES) @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Void> lockAllRepositories(@PathVariable Long exerciseId) { log.info("REST request to lock all repositories of programming exercise {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, programmingExercise, null); programmingExerciseService.lockAllRepositories(exerciseId); log.info("Locked all repositories of programming exercise {} upon manual request", exerciseId); return ResponseEntity.ok().build(); }
/** * Lock all repositories of the given programming exercise. * * @param exerciseId of the exercise * @return The ResponseEntity with status 200 (OK) or with status 404 (Not Found) if the exerciseId is invalid */
Lock all repositories of the given programming exercise. @param exerciseId of the exercise @return The ResponseEntity with status 200 (OK) or with status 404 (Not Found) if the exerciseId is invalid
[ "Lock", "all", "repositories", "of", "the", "given", "programming", "exercise", ".", "@param", "exerciseId", "of", "the", "exercise", "@return", "The", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "or", "with", "status", "404", "(", "Not", "Found", ")", "if", "the", "exerciseId", "is", "invalid" ]
@PutMapping(Endpoints.LOCK_ALL_REPOSITORIES) @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Void> lockAllRepositories(@PathVariable Long exerciseId) { log.info("REST request to lock all repositories of programming exercise {}", exerciseId); var programmingExercise = programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, programmingExercise, null); programmingExerciseService.lockAllRepositories(exerciseId); log.info("Locked all repositories of programming exercise {} upon manual request", exerciseId); return ResponseEntity.ok().build(); }
[ "@", "PutMapping", "(", "Endpoints", ".", "LOCK_ALL_REPOSITORIES", ")", "@", "PreAuthorize", "(", "\"hasRole('INSTRUCTOR')\"", ")", "public", "ResponseEntity", "<", "Void", ">", "lockAllRepositories", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "log", ".", "info", "(", "\"REST request to lock all repositories of programming exercise {}\"", ",", "exerciseId", ")", ";", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "INSTRUCTOR", ",", "programmingExercise", ",", "null", ")", ";", "programmingExerciseService", ".", "lockAllRepositories", "(", "exerciseId", ")", ";", "log", ".", "info", "(", "\"Locked all repositories of programming exercise {} upon manual request\"", ",", "exerciseId", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "build", "(", ")", ";", "}" ]
Lock all repositories of the given programming exercise.
[ "Lock", "all", "repositories", "of", "the", "given", "programming", "exercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 10357, 18, 6589, 67, 4685, 67, 862, 28284, 916, 8805, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 706, 13915, 916, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 2176, 1595, 18429, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 613, 18, 1376, 2932, 12030, 590, 358, 2176, 777, 14531, 434, 5402, 11987, 24165, 3728, 16, 24165, 548, 1769, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 706, 13915, 916, 16, 5402, 11987, 424, 20603, 16, 446, 1769, 203, 3639, 5402, 11987, 424, 20603, 1179, 18, 739, 1595, 18429, 12, 8913, 30708, 548, 1769, 203, 3639, 613, 18, 1376, 2932, 8966, 777, 14531, 434, 5402, 11987, 24165, 2618, 12318, 11297, 590, 3113, 24165, 548, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 3510, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 3488, 777, 14531, 434, 326, 864, 5402, 11987, 24165, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 434, 326, 24165, 203, 377, 380, 632, 2463, 1021, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 578, 598, 1267, 7709, 261, 1248, 10750, 13, 309, 326, 24165, 548, 353, 2057, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
recreateBuildPlans
null
@PutMapping(Endpoints.RECREATE_BUILD_PLANS) @PreAuthorize("hasRole('EDITOR')") public ResponseEntity<Void> recreateBuildPlans(@PathVariable Long exerciseId) { var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesElseThrow(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, user); continuousIntegrationService.get().recreateBuildPlansForExercise(programmingExercise); return ResponseEntity.ok().build(); }
/** * Deletes BASE and SOLUTION build plan of a programming exercise and creates those again. * This reuses the build plan creation logic of the programming exercise creation service. * * @param exerciseId of the programming exercise * @return the ResponseEntity with status 200 (OK) if the recreation was successful. */
Deletes BASE and SOLUTION build plan of a programming exercise and creates those again. This reuses the build plan creation logic of the programming exercise creation service. @param exerciseId of the programming exercise @return the ResponseEntity with status 200 (OK) if the recreation was successful.
[ "Deletes", "BASE", "and", "SOLUTION", "build", "plan", "of", "a", "programming", "exercise", "and", "creates", "those", "again", ".", "This", "reuses", "the", "build", "plan", "creation", "logic", "of", "the", "programming", "exercise", "creation", "service", ".", "@param", "exerciseId", "of", "the", "programming", "exercise", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "if", "the", "recreation", "was", "successful", "." ]
@PutMapping(Endpoints.RECREATE_BUILD_PLANS) @PreAuthorize("hasRole('EDITOR')") public ResponseEntity<Void> recreateBuildPlans(@PathVariable Long exerciseId) { var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesElseThrow(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, user); continuousIntegrationService.get().recreateBuildPlansForExercise(programmingExercise); return ResponseEntity.ok().build(); }
[ "@", "PutMapping", "(", "Endpoints", ".", "RECREATE_BUILD_PLANS", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "public", "ResponseEntity", "<", "Void", ">", "recreateBuildPlans", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "var", "programmingExercise", "=", "programmingExerciseRepository", ".", "findByIdWithTemplateAndSolutionParticipationAndAuxiliaryRepositoriesElseThrow", "(", "exerciseId", ")", ";", "User", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "EDITOR", ",", "programmingExercise", ",", "user", ")", ";", "continuousIntegrationService", ".", "get", "(", ")", ".", "recreateBuildPlansForExercise", "(", "programmingExercise", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "build", "(", ")", ";", "}" ]
Deletes BASE and SOLUTION build plan of a programming exercise and creates those again.
[ "Deletes", "BASE", "and", "SOLUTION", "build", "plan", "of", "a", "programming", "exercise", "and", "creates", "those", "again", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 10357, 18, 862, 9344, 67, 20215, 67, 6253, 11607, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 23052, 3116, 22846, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 569, 5402, 11987, 424, 20603, 273, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 1190, 2283, 1876, 16135, 1988, 24629, 367, 1876, 21981, 20606, 18429, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 2177, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 13208, 16, 5402, 11987, 424, 20603, 16, 729, 1769, 203, 3639, 17235, 15372, 1179, 18, 588, 7675, 266, 2640, 3116, 22846, 1290, 424, 20603, 12, 12890, 11987, 424, 20603, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 3510, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 17973, 10250, 471, 27175, 13269, 1361, 4995, 434, 279, 5402, 11987, 24165, 471, 3414, 5348, 3382, 18, 203, 377, 380, 1220, 283, 6117, 326, 1361, 4995, 6710, 4058, 434, 326, 5402, 11987, 24165, 6710, 1156, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 434, 326, 5402, 11987, 24165, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 309, 326, 283, 17169, 1703, 6873, 18, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
e169a06feeaf9c6197fd48497e1e88ec832e1899
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ProgrammingExerciseResource.java
[ "MIT" ]
Java
reEvaluateAndUpdateProgrammingExercise
null
@PutMapping(Endpoints.REEVALUATE_EXERCISE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> reEvaluateAndUpdateProgrammingExercise(@PathVariable long exerciseId, @RequestBody ProgrammingExercise programmingExercise, @RequestParam(value = "deleteFeedback", required = false) Boolean deleteFeedbackAfterGradingInstructionUpdate) { log.debug("REST request to re-evaluate ProgrammingExercise : {}", programmingExercise); // check that the exercise is exist for given id programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkGivenExerciseIdSameForExerciseInRequestBodyElseThrow(exerciseId, programmingExercise); // fetch course from database to make sure client didn't change groups var user = userRepository.getUserWithGroupsAndAuthorities(); Course course = courseService.retrieveCourseOverExerciseGroupOrCourseId(programmingExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, user); exerciseService.reEvaluateExercise(programmingExercise, deleteFeedbackAfterGradingInstructionUpdate); return updateProgrammingExercise(programmingExercise, null); }
/** * PUT /programming-exercises/{exerciseId}/re-evaluate : Re-evaluates and updates an existing ProgrammingExercise. * * @param exerciseId of the exercise * @param programmingExercise the ProgrammingExercise to re-evaluate and update * @param deleteFeedbackAfterGradingInstructionUpdate boolean flag that indicates whether the associated feedback should be deleted or not * * @return the ResponseEntity with status 200 (OK) and with body the updated ProgrammingExercise, or * with status 400 (Bad Request) if the ProgrammingExercise is not valid, or with status 409 (Conflict) * if given exerciseId is not same as in the object of the request body, or with status 500 (Internal * Server Error) if the ProgrammingExercise couldn't be updated */
PUT /programming-exercises/{exerciseId}/re-evaluate : Re-evaluates and updates an existing ProgrammingExercise. @param exerciseId of the exercise @param programmingExercise the ProgrammingExercise to re-evaluate and update @param deleteFeedbackAfterGradingInstructionUpdate boolean flag that indicates whether the associated feedback should be deleted or not @return the ResponseEntity with status 200 (OK) and with body the updated ProgrammingExercise, or with status 400 (Bad Request) if the ProgrammingExercise is not valid, or with status 409 (Conflict) if given exerciseId is not same as in the object of the request body, or with status 500 (Internal Server Error) if the ProgrammingExercise couldn't be updated
[ "PUT", "/", "programming", "-", "exercises", "/", "{", "exerciseId", "}", "/", "re", "-", "evaluate", ":", "Re", "-", "evaluates", "and", "updates", "an", "existing", "ProgrammingExercise", ".", "@param", "exerciseId", "of", "the", "exercise", "@param", "programmingExercise", "the", "ProgrammingExercise", "to", "re", "-", "evaluate", "and", "update", "@param", "deleteFeedbackAfterGradingInstructionUpdate", "boolean", "flag", "that", "indicates", "whether", "the", "associated", "feedback", "should", "be", "deleted", "or", "not", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "and", "with", "body", "the", "updated", "ProgrammingExercise", "or", "with", "status", "400", "(", "Bad", "Request", ")", "if", "the", "ProgrammingExercise", "is", "not", "valid", "or", "with", "status", "409", "(", "Conflict", ")", "if", "given", "exerciseId", "is", "not", "same", "as", "in", "the", "object", "of", "the", "request", "body", "or", "with", "status", "500", "(", "Internal", "Server", "Error", ")", "if", "the", "ProgrammingExercise", "couldn", "'", "t", "be", "updated" ]
@PutMapping(Endpoints.REEVALUATE_EXERCISE) @PreAuthorize("hasRole('EDITOR')") @FeatureToggle(Feature.PROGRAMMING_EXERCISES) public ResponseEntity<ProgrammingExercise> reEvaluateAndUpdateProgrammingExercise(@PathVariable long exerciseId, @RequestBody ProgrammingExercise programmingExercise, @RequestParam(value = "deleteFeedback", required = false) Boolean deleteFeedbackAfterGradingInstructionUpdate) { log.debug("REST request to re-evaluate ProgrammingExercise : {}", programmingExercise); programmingExerciseRepository.findByIdElseThrow(exerciseId); authCheckService.checkGivenExerciseIdSameForExerciseInRequestBodyElseThrow(exerciseId, programmingExercise); var user = userRepository.getUserWithGroupsAndAuthorities(); Course course = courseService.retrieveCourseOverExerciseGroupOrCourseId(programmingExercise); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, user); exerciseService.reEvaluateExercise(programmingExercise, deleteFeedbackAfterGradingInstructionUpdate); return updateProgrammingExercise(programmingExercise, null); }
[ "@", "PutMapping", "(", "Endpoints", ".", "REEVALUATE_EXERCISE", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "@", "FeatureToggle", "(", "Feature", ".", "PROGRAMMING_EXERCISES", ")", "public", "ResponseEntity", "<", "ProgrammingExercise", ">", "reEvaluateAndUpdateProgrammingExercise", "(", "@", "PathVariable", "long", "exerciseId", ",", "@", "RequestBody", "ProgrammingExercise", "programmingExercise", ",", "@", "RequestParam", "(", "value", "=", "\"deleteFeedback\"", ",", "required", "=", "false", ")", "Boolean", "deleteFeedbackAfterGradingInstructionUpdate", ")", "{", "log", ".", "debug", "(", "\"REST request to re-evaluate ProgrammingExercise : {}\"", ",", "programmingExercise", ")", ";", "programmingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "authCheckService", ".", "checkGivenExerciseIdSameForExerciseInRequestBodyElseThrow", "(", "exerciseId", ",", "programmingExercise", ")", ";", "var", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "Course", "course", "=", "courseService", ".", "retrieveCourseOverExerciseGroupOrCourseId", "(", "programmingExercise", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleInCourseElseThrow", "(", "Role", ".", "EDITOR", ",", "course", ",", "user", ")", ";", "exerciseService", ".", "reEvaluateExercise", "(", "programmingExercise", ",", "deleteFeedbackAfterGradingInstructionUpdate", ")", ";", "return", "updateProgrammingExercise", "(", "programmingExercise", ",", "null", ")", ";", "}" ]
PUT /programming-exercises/{exerciseId}/re-evaluate : Re-evaluates and updates an existing ProgrammingExercise.
[ "PUT", "/", "programming", "-", "exercises", "/", "{", "exerciseId", "}", "/", "re", "-", "evaluate", ":", "Re", "-", "evaluates", "and", "updates", "an", "existing", "ProgrammingExercise", "." ]
[ "// check that the exercise is exist for given id", "// fetch course from database to make sure client didn't change groups" ]
[ { "param": "exerciseId", "type": "long" }, { "param": "programmingExercise", "type": "ProgrammingExercise" }, { "param": "deleteFeedbackAfterGradingInstructionUpdate", "type": "Boolean" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "programmingExercise", "type": "ProgrammingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "deleteFeedbackAfterGradingInstructionUpdate", "type": "Boolean", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 12, 10357, 18, 9719, 2669, 57, 1777, 67, 2294, 654, 7266, 1090, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 632, 4595, 17986, 12, 4595, 18, 21418, 49, 1360, 67, 2294, 654, 7266, 1090, 55, 13, 203, 565, 1071, 2306, 1943, 32, 9459, 11987, 424, 20603, 34, 283, 15369, 1876, 1891, 9459, 11987, 424, 20603, 26964, 743, 3092, 1525, 24165, 548, 16, 632, 28843, 13586, 11987, 424, 20603, 5402, 11987, 424, 20603, 16, 203, 5411, 632, 691, 786, 12, 1132, 273, 315, 3733, 15888, 3113, 1931, 273, 629, 13, 3411, 1430, 15888, 4436, 30420, 310, 11983, 1891, 13, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 283, 17, 21024, 13586, 11987, 424, 20603, 294, 3728, 16, 5402, 11987, 424, 20603, 1769, 203, 203, 3639, 368, 866, 716, 326, 24165, 353, 1005, 364, 864, 612, 203, 3639, 5402, 11987, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 203, 3639, 1357, 1564, 1179, 18, 1893, 6083, 424, 20603, 548, 8650, 1290, 424, 20603, 382, 28843, 12427, 8282, 12, 8913, 30708, 548, 16, 5402, 11987, 424, 20603, 1769, 203, 203, 3639, 368, 2158, 4362, 628, 2063, 358, 1221, 3071, 1004, 10242, 1404, 2549, 3252, 203, 3639, 569, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 385, 3117, 4362, 273, 4362, 1179, 18, 17466, 39, 3117, 4851, 424, 20603, 1114, 1162, 39, 3117, 548, 12, 12890, 11987, 424, 20603, 1769, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 382, 39, 3117, 12427, 8282, 12, 2996, 18, 13208, 16, 4362, 16, 729, 1769, 203, 203, 3639, 24165, 1179, 18, 266, 15369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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 11443, 342, 12890, 11987, 17, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 266, 17, 21024, 294, 868, 17, 14168, 815, 471, 4533, 392, 2062, 13586, 11987, 424, 20603, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 4766, 282, 434, 326, 24165, 203, 377, 380, 632, 891, 5402, 11987, 424, 20603, 12900, 326, 13586, 11987, 424, 20603, 358, 283, 17, 21024, 471, 1089, 203, 377, 380, 632, 891, 1430, 15888, 4436, 30420, 310, 11983, 1891, 225, 1250, 2982, 716, 8527, 2856, 326, 3627, 10762, 1410, 506, 4282, 578, 486, 203, 377, 380, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 471, 598, 1417, 326, 3526, 13586, 11987, 424, 20603, 16, 578, 203, 377, 2 ]
28152ab43ebd2f079d108b798e3640fc9aef74ce
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/domain/notification/SingleUserNotificationFactory.java
[ "MIT" ]
Java
createNotification
SingleUserNotification
public static SingleUserNotification createNotification(AnswerPost answerPost, NotificationType notificationType) { if (notificationType == NotificationType.NEW_ANSWER_POST_FOR_EXERCISE || notificationType == NotificationType.NEW_ANSWER_POST_FOR_LECTURE) { User recipient = answerPost.getPost().getAuthor(); User author = answerPost.getAuthor(); String title = NotificationTitleTypeConstants.NEW_ANSWER_POST_FOR_EXERCISE_TITLE; String text = "Your post got replied."; SingleUserNotification notification = new SingleUserNotification(recipient, author, title, text); if (notificationType == NotificationType.NEW_ANSWER_POST_FOR_EXERCISE) { notification.setTarget(notification.answerPostTargetForExercise(answerPost)); } else { notification.setTarget(notification.answerPostTargetForLecture(answerPost)); } return notification; } throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); }
/** * Creates an instance of SingleUserNotification. * * @param answerPost answer for which a notification should be created * @param notificationType type of the notification that should be created * @return an instance of SingleUserNotification */
Creates an instance of SingleUserNotification. @param answerPost answer for which a notification should be created @param notificationType type of the notification that should be created @return an instance of SingleUserNotification
[ "Creates", "an", "instance", "of", "SingleUserNotification", ".", "@param", "answerPost", "answer", "for", "which", "a", "notification", "should", "be", "created", "@param", "notificationType", "type", "of", "the", "notification", "that", "should", "be", "created", "@return", "an", "instance", "of", "SingleUserNotification" ]
public static SingleUserNotification createNotification(AnswerPost answerPost, NotificationType notificationType) { if (notificationType == NotificationType.NEW_ANSWER_POST_FOR_EXERCISE || notificationType == NotificationType.NEW_ANSWER_POST_FOR_LECTURE) { User recipient = answerPost.getPost().getAuthor(); User author = answerPost.getAuthor(); String title = NotificationTitleTypeConstants.NEW_ANSWER_POST_FOR_EXERCISE_TITLE; String text = "Your post got replied."; SingleUserNotification notification = new SingleUserNotification(recipient, author, title, text); if (notificationType == NotificationType.NEW_ANSWER_POST_FOR_EXERCISE) { notification.setTarget(notification.answerPostTargetForExercise(answerPost)); } else { notification.setTarget(notification.answerPostTargetForLecture(answerPost)); } return notification; } throw new UnsupportedOperationException("Unsupported NotificationType: " + notificationType); }
[ "public", "static", "SingleUserNotification", "createNotification", "(", "AnswerPost", "answerPost", ",", "NotificationType", "notificationType", ")", "{", "if", "(", "notificationType", "==", "NotificationType", ".", "NEW_ANSWER_POST_FOR_EXERCISE", "||", "notificationType", "==", "NotificationType", ".", "NEW_ANSWER_POST_FOR_LECTURE", ")", "{", "User", "recipient", "=", "answerPost", ".", "getPost", "(", ")", ".", "getAuthor", "(", ")", ";", "User", "author", "=", "answerPost", ".", "getAuthor", "(", ")", ";", "String", "title", "=", "NotificationTitleTypeConstants", ".", "NEW_ANSWER_POST_FOR_EXERCISE_TITLE", ";", "String", "text", "=", "\"Your post got replied.\"", ";", "SingleUserNotification", "notification", "=", "new", "SingleUserNotification", "(", "recipient", ",", "author", ",", "title", ",", "text", ")", ";", "if", "(", "notificationType", "==", "NotificationType", ".", "NEW_ANSWER_POST_FOR_EXERCISE", ")", "{", "notification", ".", "setTarget", "(", "notification", ".", "answerPostTargetForExercise", "(", "answerPost", ")", ")", ";", "}", "else", "{", "notification", ".", "setTarget", "(", "notification", ".", "answerPostTargetForLecture", "(", "answerPost", ")", ")", ";", "}", "return", "notification", ";", "}", "throw", "new", "UnsupportedOperationException", "(", "\"Unsupported NotificationType: \"", "+", "notificationType", ")", ";", "}" ]
Creates an instance of SingleUserNotification.
[ "Creates", "an", "instance", "of", "SingleUserNotification", "." ]
[]
[ { "param": "answerPost", "type": "AnswerPost" }, { "param": "notificationType", "type": "NotificationType" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "answerPost", "type": "AnswerPost", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationType", "type": "NotificationType", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 1071, 760, 10326, 1299, 4386, 752, 4386, 12, 13203, 3349, 5803, 3349, 16, 8050, 559, 3851, 559, 13, 288, 203, 3639, 309, 261, 9927, 559, 422, 8050, 559, 18, 12917, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 747, 3851, 559, 422, 8050, 559, 18, 12917, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 3918, 4830, 13, 288, 203, 5411, 2177, 8027, 273, 5803, 3349, 18, 588, 3349, 7675, 588, 3594, 5621, 203, 5411, 2177, 2869, 273, 5803, 3349, 18, 588, 3594, 5621, 203, 5411, 514, 2077, 273, 8050, 4247, 559, 2918, 18, 12917, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 67, 14123, 31, 203, 5411, 514, 977, 273, 315, 15446, 1603, 2363, 283, 3110, 1199, 31, 203, 5411, 10326, 1299, 4386, 3851, 273, 394, 10326, 1299, 4386, 12, 20367, 16, 2869, 16, 2077, 16, 977, 1769, 203, 5411, 309, 261, 9927, 559, 422, 8050, 559, 18, 12917, 67, 11607, 18839, 67, 3798, 67, 7473, 67, 2294, 654, 7266, 1090, 13, 288, 203, 7734, 3851, 18, 542, 2326, 12, 9927, 18, 13490, 3349, 2326, 1290, 424, 20603, 12, 13490, 3349, 10019, 203, 5411, 289, 203, 5411, 469, 288, 203, 7734, 3851, 18, 542, 2326, 12, 9927, 18, 13490, 3349, 2326, 1290, 48, 386, 594, 12, 13490, 3349, 10019, 203, 5411, 289, 203, 5411, 327, 3851, 31, 203, 3639, 289, 203, 3639, 604, 394, 13172, 2932, 8544, 8050, 559, 30, 315, 397, 3851, 559, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 10210, 392, 791, 434, 10326, 1299, 4386, 18, 203, 377, 380, 203, 377, 380, 632, 891, 5803, 3349, 5803, 364, 1492, 279, 3851, 1410, 506, 2522, 203, 377, 380, 632, 891, 3851, 559, 618, 434, 326, 3851, 716, 1410, 506, 2522, 203, 377, 380, 632, 2463, 392, 791, 434, 10326, 1299, 4386, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
ac4d0be1ace6d1834d45f06cf20805db8495ca4c
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ModelingExerciseResource.java
[ "MIT" ]
Java
createModelingExercise
null
@PostMapping("/modeling-exercises") @PreAuthorize("hasRole('EDITOR')") public ResponseEntity<ModelingExercise> createModelingExercise(@RequestBody ModelingExercise modelingExercise) throws URISyntaxException { log.debug("REST request to save ModelingExercise : {}", modelingExercise); if (modelingExercise.getId() != null) { return ResponseEntity.badRequest() .headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "idexists", "A new modeling exercise cannot already have an ID")).body(null); } modelingExercise.checkCourseAndExerciseGroupExclusivity("Modeling Exercise"); // make sure the course actually exists var course = courseRepository.findByIdElseThrow(modelingExercise.getCourseViaExerciseGroupOrCourseMember().getId()); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, null); // validates general settings: points, dates exerciseService.validateGeneralSettings(modelingExercise); // if exercise is created from scratch we create a new knowledge instance modelingExercise.setKnowledge(modelAssessmentKnowledgeService.createNewKnowledge()); ModelingExercise result = modelingExerciseRepository.save(modelingExercise); modelingExerciseService.scheduleOperations(result.getId()); instanceMessageSendService.sendExerciseReleaseNotificationSchedule(modelingExercise.getId()); return ResponseEntity.created(new URI("/api/modeling-exercises/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())).body(result); }
// TODO: we should add courses/{courseId} here
we should add courses/{courseId} here
[ "we", "should", "add", "courses", "/", "{", "courseId", "}", "here" ]
@PostMapping("/modeling-exercises") @PreAuthorize("hasRole('EDITOR')") public ResponseEntity<ModelingExercise> createModelingExercise(@RequestBody ModelingExercise modelingExercise) throws URISyntaxException { log.debug("REST request to save ModelingExercise : {}", modelingExercise); if (modelingExercise.getId() != null) { return ResponseEntity.badRequest() .headers(HeaderUtil.createFailureAlert(applicationName, true, ENTITY_NAME, "idexists", "A new modeling exercise cannot already have an ID")).body(null); } modelingExercise.checkCourseAndExerciseGroupExclusivity("Modeling Exercise"); var course = courseRepository.findByIdElseThrow(modelingExercise.getCourseViaExerciseGroupOrCourseMember().getId()); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, null); exerciseService.validateGeneralSettings(modelingExercise); modelingExercise.setKnowledge(modelAssessmentKnowledgeService.createNewKnowledge()); ModelingExercise result = modelingExerciseRepository.save(modelingExercise); modelingExerciseService.scheduleOperations(result.getId()); instanceMessageSendService.sendExerciseReleaseNotificationSchedule(modelingExercise.getId()); return ResponseEntity.created(new URI("/api/modeling-exercises/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())).body(result); }
[ "@", "PostMapping", "(", "\"/modeling-exercises\"", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "public", "ResponseEntity", "<", "ModelingExercise", ">", "createModelingExercise", "(", "@", "RequestBody", "ModelingExercise", "modelingExercise", ")", "throws", "URISyntaxException", "{", "log", ".", "debug", "(", "\"REST request to save ModelingExercise : {}\"", ",", "modelingExercise", ")", ";", "if", "(", "modelingExercise", ".", "getId", "(", ")", "!=", "null", ")", "{", "return", "ResponseEntity", ".", "badRequest", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createFailureAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "\"idexists\"", ",", "\"A new modeling exercise cannot already have an ID\"", ")", ")", ".", "body", "(", "null", ")", ";", "}", "modelingExercise", ".", "checkCourseAndExerciseGroupExclusivity", "(", "\"Modeling Exercise\"", ")", ";", "var", "course", "=", "courseRepository", ".", "findByIdElseThrow", "(", "modelingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ".", "getId", "(", ")", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleInCourseElseThrow", "(", "Role", ".", "EDITOR", ",", "course", ",", "null", ")", ";", "exerciseService", ".", "validateGeneralSettings", "(", "modelingExercise", ")", ";", "modelingExercise", ".", "setKnowledge", "(", "modelAssessmentKnowledgeService", ".", "createNewKnowledge", "(", ")", ")", ";", "ModelingExercise", "result", "=", "modelingExerciseRepository", ".", "save", "(", "modelingExercise", ")", ";", "modelingExerciseService", ".", "scheduleOperations", "(", "result", ".", "getId", "(", ")", ")", ";", "instanceMessageSendService", ".", "sendExerciseReleaseNotificationSchedule", "(", "modelingExercise", ".", "getId", "(", ")", ")", ";", "return", "ResponseEntity", ".", "created", "(", "new", "URI", "(", "\"/api/modeling-exercises/\"", "+", "result", ".", "getId", "(", ")", ")", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityCreationAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "result", ".", "getId", "(", ")", ".", "toString", "(", ")", ")", ")", ".", "body", "(", "result", ")", ";", "}" ]
TODO: we should add courses/{courseId} here
[ "TODO", ":", "we", "should", "add", "courses", "/", "{", "courseId", "}", "here" ]
[ "// make sure the course actually exists", "// validates general settings: points, dates", "// if exercise is created from scratch we create a new knowledge instance" ]
[ { "param": "modelingExercise", "type": "ModelingExercise" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "modelingExercise", "type": "ModelingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 3349, 3233, 2932, 19, 2284, 310, 17, 8913, 71, 6141, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 1488, 310, 424, 20603, 34, 15552, 310, 424, 20603, 26964, 28843, 3164, 310, 424, 20603, 938, 310, 424, 20603, 13, 1216, 19883, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 1923, 3164, 310, 424, 20603, 294, 3728, 16, 938, 310, 424, 20603, 1769, 203, 3639, 309, 261, 2284, 310, 424, 20603, 18, 26321, 1435, 480, 446, 13, 288, 203, 5411, 327, 2306, 1943, 18, 8759, 691, 1435, 203, 10792, 263, 2485, 12, 1864, 1304, 18, 2640, 5247, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 315, 77, 561, 1486, 3113, 315, 37, 394, 938, 310, 24165, 2780, 1818, 1240, 392, 1599, 7923, 2934, 3432, 12, 2011, 1769, 203, 3639, 289, 203, 3639, 938, 310, 424, 20603, 18, 1893, 39, 3117, 1876, 424, 20603, 1114, 424, 830, 407, 2818, 2932, 1488, 310, 1312, 20603, 8863, 203, 3639, 368, 1221, 3071, 326, 4362, 6013, 1704, 203, 3639, 569, 4362, 273, 4362, 3305, 18, 4720, 5132, 12427, 8282, 12, 2284, 310, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 7675, 26321, 10663, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 382, 39, 3117, 12427, 8282, 12, 2996, 18, 13208, 16, 4362, 16, 446, 1769, 203, 3639, 368, 11964, 7470, 1947, 30, 3143, 16, 7811, 203, 3639, 24165, 1179, 18, 5662, 12580, 2628, 12, 2284, 310, 424, 20603, 1769, 203, 203, 3639, 368, 309, 24165, 353, 2522, 628, 15289, 732, 752, 279, 394, 20272, 791, 203, 3639, 938, 310, 424, 20603, 18, 542, 47, 14390, 12, 2284, 15209, 47, 14390, 1179, 18, 2640, 1908, 47, 14390, 10663, 203, 203, 3639, 3164, 310, 424, 20603, 563, 273, 938, 310, 424, 20603, 3305, 18, 5688, 12, 2284, 310, 424, 20603, 1769, 203, 203, 3639, 938, 310, 424, 20603, 1179, 18, 10676, 9343, 12, 2088, 18, 26321, 10663, 203, 203, 3639, 791, 1079, 3826, 1179, 18, 4661, 424, 20603, 7391, 4386, 6061, 12, 2284, 310, 424, 20603, 18, 26321, 10663, 203, 3639, 327, 2306, 1943, 18, 4824, 12, 2704, 3699, 2932, 19, 2425, 19, 2284, 310, 17, 8913, 71, 6141, 4898, 397, 563, 18, 26321, 1435, 3719, 203, 7734, 263, 2485, 12, 1864, 1304, 18, 2640, 1943, 9906, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 563, 18, 26321, 7675, 10492, 10756, 2934, 3432, 12, 2088, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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, 548, 97, 2674, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
ac4d0be1ace6d1834d45f06cf20805db8495ca4c
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ModelingExerciseResource.java
[ "MIT" ]
Java
updateModelingExercise
null
@PutMapping("/modeling-exercises") @PreAuthorize("hasRole('EDITOR')") public ResponseEntity<ModelingExercise> updateModelingExercise(@RequestBody ModelingExercise modelingExercise, @RequestParam(value = "notificationText", required = false) String notificationText) throws URISyntaxException { log.debug("REST request to update ModelingExercise : {}", modelingExercise); if (modelingExercise.getId() == null) { return createModelingExercise(modelingExercise); } modelingExercise.checkCourseAndExerciseGroupExclusivity("Modeling Exercise"); var user = userRepository.getUserWithGroupsAndAuthorities(); // make sure the course actually exists var course = courseRepository.findByIdElseThrow(modelingExercise.getCourseViaExerciseGroupOrCourseMember().getId()); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, user); // validates general settings: points, dates exerciseService.validateGeneralSettings(modelingExercise); ModelingExercise modelingExerciseBeforeUpdate = modelingExerciseRepository.findByIdElseThrow(modelingExercise.getId()); // Forbid changing the course the exercise belongs to. if (!Objects.equals(modelingExerciseBeforeUpdate.getCourseViaExerciseGroupOrCourseMember().getId(), modelingExercise.getCourseViaExerciseGroupOrCourseMember().getId())) { return conflict("Exercise course id does not match the stored course id", ENTITY_NAME, "cannotChangeCourseId"); } ModelingExercise updatedModelingExercise = modelingExerciseRepository.save(modelingExercise); exerciseService.logUpdate(modelingExercise, modelingExercise.getCourseViaExerciseGroupOrCourseMember(), user); exerciseService.updatePointsInRelatedParticipantScores(modelingExerciseBeforeUpdate, updatedModelingExercise); // Avoid recursions if (updatedModelingExercise.getExampleSubmissions().size() != 0) { Set<ExampleSubmission> exampleSubmissionsWithResults = exampleSubmissionRepository.findAllWithResultByExerciseId(updatedModelingExercise.getId()); updatedModelingExercise.setExampleSubmissions(exampleSubmissionsWithResults); updatedModelingExercise.getExampleSubmissions().forEach(exampleSubmission -> exampleSubmission.setExercise(null)); updatedModelingExercise.getExampleSubmissions().forEach(exampleSubmission -> exampleSubmission.setTutorParticipations(null)); } modelingExerciseService.scheduleOperations(updatedModelingExercise.getId()); if ((notificationText != null && modelingExercise.isCourseExercise()) || modelingExercise.isExamExercise()) { groupNotificationService.notifyStudentAndEditorAndInstructorGroupAboutExerciseUpdate(modelingExercise, notificationText); } return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, modelingExercise.getId().toString())) .body(updatedModelingExercise); }
/** * PUT /modeling-exercises : Updates an existing modelingExercise. * * @param modelingExercise the modelingExercise to update * @param notificationText the text shown to students * @return the ResponseEntity with status 200 (OK) and with body the updated modelingExercise, or with status 400 (Bad Request) if the modelingExercise is not valid, or with * status 500 (Internal Server Error) if the modelingExercise couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */
PUT /modeling-exercises : Updates an existing modelingExercise. @param modelingExercise the modelingExercise to update @param notificationText the text shown to students @return the ResponseEntity with status 200 (OK) and with body the updated modelingExercise, or with status 400 (Bad Request) if the modelingExercise is not valid, or with status 500 (Internal Server Error) if the modelingExercise couldn't be updated @throws URISyntaxException if the Location URI syntax is incorrect
[ "PUT", "/", "modeling", "-", "exercises", ":", "Updates", "an", "existing", "modelingExercise", ".", "@param", "modelingExercise", "the", "modelingExercise", "to", "update", "@param", "notificationText", "the", "text", "shown", "to", "students", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")", "and", "with", "body", "the", "updated", "modelingExercise", "or", "with", "status", "400", "(", "Bad", "Request", ")", "if", "the", "modelingExercise", "is", "not", "valid", "or", "with", "status", "500", "(", "Internal", "Server", "Error", ")", "if", "the", "modelingExercise", "couldn", "'", "t", "be", "updated", "@throws", "URISyntaxException", "if", "the", "Location", "URI", "syntax", "is", "incorrect" ]
@PutMapping("/modeling-exercises") @PreAuthorize("hasRole('EDITOR')") public ResponseEntity<ModelingExercise> updateModelingExercise(@RequestBody ModelingExercise modelingExercise, @RequestParam(value = "notificationText", required = false) String notificationText) throws URISyntaxException { log.debug("REST request to update ModelingExercise : {}", modelingExercise); if (modelingExercise.getId() == null) { return createModelingExercise(modelingExercise); } modelingExercise.checkCourseAndExerciseGroupExclusivity("Modeling Exercise"); var user = userRepository.getUserWithGroupsAndAuthorities(); var course = courseRepository.findByIdElseThrow(modelingExercise.getCourseViaExerciseGroupOrCourseMember().getId()); authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, course, user); exerciseService.validateGeneralSettings(modelingExercise); ModelingExercise modelingExerciseBeforeUpdate = modelingExerciseRepository.findByIdElseThrow(modelingExercise.getId()); if (!Objects.equals(modelingExerciseBeforeUpdate.getCourseViaExerciseGroupOrCourseMember().getId(), modelingExercise.getCourseViaExerciseGroupOrCourseMember().getId())) { return conflict("Exercise course id does not match the stored course id", ENTITY_NAME, "cannotChangeCourseId"); } ModelingExercise updatedModelingExercise = modelingExerciseRepository.save(modelingExercise); exerciseService.logUpdate(modelingExercise, modelingExercise.getCourseViaExerciseGroupOrCourseMember(), user); exerciseService.updatePointsInRelatedParticipantScores(modelingExerciseBeforeUpdate, updatedModelingExercise); if (updatedModelingExercise.getExampleSubmissions().size() != 0) { Set<ExampleSubmission> exampleSubmissionsWithResults = exampleSubmissionRepository.findAllWithResultByExerciseId(updatedModelingExercise.getId()); updatedModelingExercise.setExampleSubmissions(exampleSubmissionsWithResults); updatedModelingExercise.getExampleSubmissions().forEach(exampleSubmission -> exampleSubmission.setExercise(null)); updatedModelingExercise.getExampleSubmissions().forEach(exampleSubmission -> exampleSubmission.setTutorParticipations(null)); } modelingExerciseService.scheduleOperations(updatedModelingExercise.getId()); if ((notificationText != null && modelingExercise.isCourseExercise()) || modelingExercise.isExamExercise()) { groupNotificationService.notifyStudentAndEditorAndInstructorGroupAboutExerciseUpdate(modelingExercise, notificationText); } return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, modelingExercise.getId().toString())) .body(updatedModelingExercise); }
[ "@", "PutMapping", "(", "\"/modeling-exercises\"", ")", "@", "PreAuthorize", "(", "\"hasRole('EDITOR')\"", ")", "public", "ResponseEntity", "<", "ModelingExercise", ">", "updateModelingExercise", "(", "@", "RequestBody", "ModelingExercise", "modelingExercise", ",", "@", "RequestParam", "(", "value", "=", "\"notificationText\"", ",", "required", "=", "false", ")", "String", "notificationText", ")", "throws", "URISyntaxException", "{", "log", ".", "debug", "(", "\"REST request to update ModelingExercise : {}\"", ",", "modelingExercise", ")", ";", "if", "(", "modelingExercise", ".", "getId", "(", ")", "==", "null", ")", "{", "return", "createModelingExercise", "(", "modelingExercise", ")", ";", "}", "modelingExercise", ".", "checkCourseAndExerciseGroupExclusivity", "(", "\"Modeling Exercise\"", ")", ";", "var", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "var", "course", "=", "courseRepository", ".", "findByIdElseThrow", "(", "modelingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ".", "getId", "(", ")", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleInCourseElseThrow", "(", "Role", ".", "EDITOR", ",", "course", ",", "user", ")", ";", "exerciseService", ".", "validateGeneralSettings", "(", "modelingExercise", ")", ";", "ModelingExercise", "modelingExerciseBeforeUpdate", "=", "modelingExerciseRepository", ".", "findByIdElseThrow", "(", "modelingExercise", ".", "getId", "(", ")", ")", ";", "if", "(", "!", "Objects", ".", "equals", "(", "modelingExerciseBeforeUpdate", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ".", "getId", "(", ")", ",", "modelingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ".", "getId", "(", ")", ")", ")", "{", "return", "conflict", "(", "\"Exercise course id does not match the stored course id\"", ",", "ENTITY_NAME", ",", "\"cannotChangeCourseId\"", ")", ";", "}", "ModelingExercise", "updatedModelingExercise", "=", "modelingExerciseRepository", ".", "save", "(", "modelingExercise", ")", ";", "exerciseService", ".", "logUpdate", "(", "modelingExercise", ",", "modelingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ",", "user", ")", ";", "exerciseService", ".", "updatePointsInRelatedParticipantScores", "(", "modelingExerciseBeforeUpdate", ",", "updatedModelingExercise", ")", ";", "if", "(", "updatedModelingExercise", ".", "getExampleSubmissions", "(", ")", ".", "size", "(", ")", "!=", "0", ")", "{", "Set", "<", "ExampleSubmission", ">", "exampleSubmissionsWithResults", "=", "exampleSubmissionRepository", ".", "findAllWithResultByExerciseId", "(", "updatedModelingExercise", ".", "getId", "(", ")", ")", ";", "updatedModelingExercise", ".", "setExampleSubmissions", "(", "exampleSubmissionsWithResults", ")", ";", "updatedModelingExercise", ".", "getExampleSubmissions", "(", ")", ".", "forEach", "(", "exampleSubmission", "->", "exampleSubmission", ".", "setExercise", "(", "null", ")", ")", ";", "updatedModelingExercise", ".", "getExampleSubmissions", "(", ")", ".", "forEach", "(", "exampleSubmission", "->", "exampleSubmission", ".", "setTutorParticipations", "(", "null", ")", ")", ";", "}", "modelingExerciseService", ".", "scheduleOperations", "(", "updatedModelingExercise", ".", "getId", "(", ")", ")", ";", "if", "(", "(", "notificationText", "!=", "null", "&&", "modelingExercise", ".", "isCourseExercise", "(", ")", ")", "||", "modelingExercise", ".", "isExamExercise", "(", ")", ")", "{", "groupNotificationService", ".", "notifyStudentAndEditorAndInstructorGroupAboutExerciseUpdate", "(", "modelingExercise", ",", "notificationText", ")", ";", "}", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityUpdateAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "modelingExercise", ".", "getId", "(", ")", ".", "toString", "(", ")", ")", ")", ".", "body", "(", "updatedModelingExercise", ")", ";", "}" ]
PUT /modeling-exercises : Updates an existing modelingExercise.
[ "PUT", "/", "modeling", "-", "exercises", ":", "Updates", "an", "existing", "modelingExercise", "." ]
[ "// make sure the course actually exists", "// validates general settings: points, dates", "// Forbid changing the course the exercise belongs to.", "// Avoid recursions" ]
[ { "param": "modelingExercise", "type": "ModelingExercise" }, { "param": "notificationText", "type": "String" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "modelingExercise", "type": "ModelingExercise", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "notificationText", "type": "String", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 6426, 3233, 2932, 19, 2284, 310, 17, 8913, 71, 6141, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 13208, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 1488, 310, 424, 20603, 34, 1089, 1488, 310, 424, 20603, 26964, 28843, 3164, 310, 424, 20603, 938, 310, 424, 20603, 16, 203, 5411, 632, 691, 786, 12, 1132, 273, 315, 9927, 1528, 3113, 1931, 273, 629, 13, 514, 3851, 1528, 13, 1216, 19883, 288, 203, 3639, 613, 18, 4148, 2932, 12030, 590, 358, 1089, 3164, 310, 424, 20603, 294, 3728, 16, 938, 310, 424, 20603, 1769, 203, 3639, 309, 261, 2284, 310, 424, 20603, 18, 26321, 1435, 422, 446, 13, 288, 203, 5411, 327, 15552, 310, 424, 20603, 12, 2284, 310, 424, 20603, 1769, 203, 3639, 289, 203, 3639, 938, 310, 424, 20603, 18, 1893, 39, 3117, 1876, 424, 20603, 1114, 424, 830, 407, 2818, 2932, 1488, 310, 1312, 20603, 8863, 203, 3639, 569, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 368, 1221, 3071, 326, 4362, 6013, 1704, 203, 3639, 569, 4362, 273, 4362, 3305, 18, 4720, 5132, 12427, 8282, 12, 2284, 310, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 7675, 26321, 10663, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 382, 39, 3117, 12427, 8282, 12, 2996, 18, 13208, 16, 4362, 16, 729, 1769, 203, 3639, 368, 11964, 7470, 1947, 30, 3143, 16, 7811, 203, 3639, 24165, 1179, 18, 5662, 12580, 2628, 12, 2284, 310, 424, 20603, 1769, 203, 203, 3639, 3164, 310, 424, 20603, 938, 310, 424, 20603, 4649, 1891, 273, 938, 310, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 2284, 310, 424, 20603, 18, 26321, 10663, 203, 203, 3639, 368, 2457, 19773, 12770, 326, 4362, 326, 24165, 11081, 358, 18, 203, 3639, 309, 16051, 4710, 18, 14963, 12, 2284, 310, 424, 20603, 4649, 1891, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 7675, 26321, 9334, 938, 310, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 7675, 26321, 1435, 3719, 288, 203, 5411, 327, 7546, 2932, 424, 20603, 4362, 612, 1552, 486, 845, 326, 4041, 4362, 612, 3113, 17020, 67, 1985, 16, 315, 12892, 3043, 39, 3117, 548, 8863, 203, 3639, 289, 203, 203, 3639, 3164, 310, 424, 20603, 3526, 1488, 310, 424, 20603, 273, 938, 310, 424, 20603, 3305, 18, 5688, 12, 2284, 310, 424, 20603, 1769, 203, 3639, 24165, 1179, 18, 1330, 1891, 12, 2284, 310, 424, 20603, 16, 938, 310, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 9334, 729, 1769, 203, 203, 3639, 24165, 1179, 18, 2725, 5636, 382, 8017, 22540, 20037, 12, 2284, 310, 424, 20603, 4649, 1891, 16, 3526, 1488, 310, 424, 20603, 1769, 203, 3639, 368, 17843, 283, 2789, 1115, 203, 3639, 309, 261, 7007, 1488, 310, 424, 20603, 18, 588, 10908, 1676, 7300, 7675, 1467, 1435, 480, 374, 13, 288, 203, 5411, 1000, 32, 10908, 17865, 34, 3454, 1676, 7300, 1190, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ 1, 26873, 203, 377, 380, 11443, 342, 2284, 310, 17, 8913, 71, 6141, 294, 15419, 392, 2062, 938, 310, 424, 20603, 18, 203, 377, 380, 203, 377, 380, 632, 891, 938, 310, 424, 20603, 326, 938, 310, 424, 20603, 358, 1089, 203, 377, 380, 632, 891, 3851, 1528, 326, 977, 12188, 358, 10068, 4877, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 471, 598, 1417, 326, 3526, 938, 310, 424, 20603, 16, 578, 598, 1267, 7409, 261, 6434, 1567, 13, 309, 326, 938, 310, 424, 20603, 353, 486, 923, 16, 578, 598, 203, 377, 380, 540, 1267, 6604, 261, 3061, 3224, 1068, 13, 309, 326, 938, 310, 424, 20603, 17991, 1404, 506, 3526, 203, 377, 380, 632, 15069, 19883, 309, 326, 2 ]
ac4d0be1ace6d1834d45f06cf20805db8495ca4c
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ModelingExerciseResource.java
[ "MIT" ]
Java
printCompassStatisticForExercise
null
@GetMapping("/modeling-exercises/{exerciseId}/print-statistic") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<Void> printCompassStatisticForExercise(@PathVariable Long exerciseId) { ModelingExercise modelingExercise = modelingExerciseRepository.findByIdElseThrow(exerciseId); // compassService.printStatistic(modelingExercise.getId()); return ResponseEntity.ok().build(); }
/** * Prints the Compass statistic regarding the automatic assessment of the modeling exercise with the given id. * * @param exerciseId the id of the modeling exercise for which we want to get the Compass statistic * @return the statistic as key-value pairs in json */
Prints the Compass statistic regarding the automatic assessment of the modeling exercise with the given id. @param exerciseId the id of the modeling exercise for which we want to get the Compass statistic @return the statistic as key-value pairs in json
[ "Prints", "the", "Compass", "statistic", "regarding", "the", "automatic", "assessment", "of", "the", "modeling", "exercise", "with", "the", "given", "id", ".", "@param", "exerciseId", "the", "id", "of", "the", "modeling", "exercise", "for", "which", "we", "want", "to", "get", "the", "Compass", "statistic", "@return", "the", "statistic", "as", "key", "-", "value", "pairs", "in", "json" ]
@GetMapping("/modeling-exercises/{exerciseId}/print-statistic") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<Void> printCompassStatisticForExercise(@PathVariable Long exerciseId) { ModelingExercise modelingExercise = modelingExerciseRepository.findByIdElseThrow(exerciseId); return ResponseEntity.ok().build(); }
[ "@", "GetMapping", "(", "\"/modeling-exercises/{exerciseId}/print-statistic\"", ")", "@", "PreAuthorize", "(", "\"hasRole('ADMIN')\"", ")", "public", "ResponseEntity", "<", "Void", ">", "printCompassStatisticForExercise", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "ModelingExercise", "modelingExercise", "=", "modelingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "build", "(", ")", ";", "}" ]
Prints the Compass statistic regarding the automatic assessment of the modeling exercise with the given id.
[ "Prints", "the", "Compass", "statistic", "regarding", "the", "automatic", "assessment", "of", "the", "modeling", "exercise", "with", "the", "given", "id", "." ]
[ "// compassService.printStatistic(modelingExercise.getId());" ]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 967, 3233, 2932, 19, 2284, 310, 17, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 1188, 17, 5642, 5846, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 15468, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 1172, 2945, 428, 20673, 1290, 424, 20603, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 3164, 310, 424, 20603, 938, 310, 424, 20603, 273, 938, 310, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 368, 1161, 428, 1179, 18, 1188, 20673, 12, 2284, 310, 424, 20603, 18, 26321, 10663, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 3510, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 3038, 87, 326, 5427, 428, 21605, 29012, 326, 5859, 14158, 434, 326, 938, 310, 24165, 598, 326, 864, 612, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 612, 434, 326, 938, 310, 24165, 364, 1492, 732, 2545, 358, 336, 326, 5427, 428, 21605, 203, 377, 380, 632, 2463, 326, 21605, 487, 498, 17, 1132, 5574, 316, 1163, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
ac4d0be1ace6d1834d45f06cf20805db8495ca4c
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ModelingExerciseResource.java
[ "MIT" ]
Java
deleteModelingExercise
null
@DeleteMapping("/modeling-exercises/{exerciseId}") @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Void> deleteModelingExercise(@PathVariable Long exerciseId) { log.info("REST request to delete ModelingExercise : {}", exerciseId); var modelingExercise = modelingExerciseRepository.findByIdElseThrow(exerciseId); modelingExerciseService.cancelScheduledOperations(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, modelingExercise, user); // note: we use the exercise service here, because this one makes sure to clean up all lazy references correctly. exerciseService.logDeletion(modelingExercise, modelingExercise.getCourseViaExerciseGroupOrCourseMember(), user); exerciseService.delete(exerciseId, false, false); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, modelingExercise.getTitle())).build(); }
/** * DELETE /modeling-exercises/:id : delete the "id" modelingExercise. * * @param exerciseId the id of the modelingExercise to delete * @return the ResponseEntity with status 200 (OK) */
DELETE /modeling-exercises/:id : delete the "id" modelingExercise. @param exerciseId the id of the modelingExercise to delete @return the ResponseEntity with status 200 (OK)
[ "DELETE", "/", "modeling", "-", "exercises", "/", ":", "id", ":", "delete", "the", "\"", "id", "\"", "modelingExercise", ".", "@param", "exerciseId", "the", "id", "of", "the", "modelingExercise", "to", "delete", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")" ]
@DeleteMapping("/modeling-exercises/{exerciseId}") @PreAuthorize("hasRole('INSTRUCTOR')") public ResponseEntity<Void> deleteModelingExercise(@PathVariable Long exerciseId) { log.info("REST request to delete ModelingExercise : {}", exerciseId); var modelingExercise = modelingExerciseRepository.findByIdElseThrow(exerciseId); modelingExerciseService.cancelScheduledOperations(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.INSTRUCTOR, modelingExercise, user); exerciseService.logDeletion(modelingExercise, modelingExercise.getCourseViaExerciseGroupOrCourseMember(), user); exerciseService.delete(exerciseId, false, false); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, modelingExercise.getTitle())).build(); }
[ "@", "DeleteMapping", "(", "\"/modeling-exercises/{exerciseId}\"", ")", "@", "PreAuthorize", "(", "\"hasRole('INSTRUCTOR')\"", ")", "public", "ResponseEntity", "<", "Void", ">", "deleteModelingExercise", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "log", ".", "info", "(", "\"REST request to delete ModelingExercise : {}\"", ",", "exerciseId", ")", ";", "var", "modelingExercise", "=", "modelingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "modelingExerciseService", ".", "cancelScheduledOperations", "(", "exerciseId", ")", ";", "User", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "INSTRUCTOR", ",", "modelingExercise", ",", "user", ")", ";", "exerciseService", ".", "logDeletion", "(", "modelingExercise", ",", "modelingExercise", ".", "getCourseViaExerciseGroupOrCourseMember", "(", ")", ",", "user", ")", ";", "exerciseService", ".", "delete", "(", "exerciseId", ",", "false", ",", "false", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityDeletionAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "modelingExercise", ".", "getTitle", "(", ")", ")", ")", ".", "build", "(", ")", ";", "}" ]
DELETE /modeling-exercises/:id : delete the "id" modelingExercise.
[ "DELETE", "/", "modeling", "-", "exercises", "/", ":", "id", ":", "delete", "the", "\"", "id", "\"", "modelingExercise", "." ]
[ "// note: we use the exercise service here, because this one makes sure to clean up all lazy references correctly." ]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 2613, 3233, 2932, 19, 2284, 310, 17, 8913, 71, 6141, 4938, 8913, 30708, 548, 1532, 13, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 706, 13915, 916, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 1430, 1488, 310, 424, 20603, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 613, 18, 1376, 2932, 12030, 590, 358, 1430, 3164, 310, 424, 20603, 294, 3728, 16, 24165, 548, 1769, 203, 3639, 569, 938, 310, 424, 20603, 273, 938, 310, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 203, 3639, 938, 310, 424, 20603, 1179, 18, 10996, 10660, 9343, 12, 8913, 30708, 548, 1769, 203, 203, 3639, 2177, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 706, 13915, 916, 16, 938, 310, 424, 20603, 16, 729, 1769, 203, 3639, 368, 4721, 30, 732, 999, 326, 24165, 1156, 2674, 16, 2724, 333, 1245, 7297, 3071, 358, 2721, 731, 777, 7962, 5351, 8783, 18, 203, 3639, 24165, 1179, 18, 1330, 13064, 12, 2284, 310, 424, 20603, 16, 938, 310, 424, 20603, 18, 588, 39, 3117, 21246, 424, 20603, 1114, 1162, 39, 3117, 4419, 9334, 729, 1769, 203, 3639, 24165, 1179, 18, 3733, 12, 8913, 30708, 548, 16, 629, 16, 629, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 2485, 12, 1864, 1304, 18, 2640, 1943, 13064, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 938, 310, 424, 20603, 18, 588, 4247, 10756, 2934, 3510, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 8568, 342, 2284, 310, 17, 8913, 71, 6141, 16880, 350, 294, 1430, 326, 315, 350, 6, 938, 310, 424, 20603, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 612, 434, 326, 938, 310, 424, 20603, 358, 1430, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
ac4d0be1ace6d1834d45f06cf20805db8495ca4c
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ModelingExerciseResource.java
[ "MIT" ]
Java
checkClusters
null
@GetMapping("/modeling-exercises/{exerciseId}/check-clusters") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<Integer> checkClusters(@PathVariable Long exerciseId) { log.info("REST request to check clusters of ModelingExercise : {}", exerciseId); var modelingExercise = modelingExerciseRepository.findByIdElseThrow(exerciseId); int clusterCount = modelClusterRepository.countByExerciseIdWithEagerElements(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.ADMIN, modelingExercise, user); return ResponseEntity.ok().body(clusterCount); }
/** * DELETE /modeling-exercises/:id/clusters : delete the clusters and elements of "id" modelingExercise. * * @param exerciseId the id of the modelingExercise to delete clusters and elements * @return the ResponseEntity with status 200 (OK) */
DELETE /modeling-exercises/:id/clusters : delete the clusters and elements of "id" modelingExercise. @param exerciseId the id of the modelingExercise to delete clusters and elements @return the ResponseEntity with status 200 (OK)
[ "DELETE", "/", "modeling", "-", "exercises", "/", ":", "id", "/", "clusters", ":", "delete", "the", "clusters", "and", "elements", "of", "\"", "id", "\"", "modelingExercise", ".", "@param", "exerciseId", "the", "id", "of", "the", "modelingExercise", "to", "delete", "clusters", "and", "elements", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")" ]
@GetMapping("/modeling-exercises/{exerciseId}/check-clusters") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<Integer> checkClusters(@PathVariable Long exerciseId) { log.info("REST request to check clusters of ModelingExercise : {}", exerciseId); var modelingExercise = modelingExerciseRepository.findByIdElseThrow(exerciseId); int clusterCount = modelClusterRepository.countByExerciseIdWithEagerElements(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.ADMIN, modelingExercise, user); return ResponseEntity.ok().body(clusterCount); }
[ "@", "GetMapping", "(", "\"/modeling-exercises/{exerciseId}/check-clusters\"", ")", "@", "PreAuthorize", "(", "\"hasRole('ADMIN')\"", ")", "public", "ResponseEntity", "<", "Integer", ">", "checkClusters", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "log", ".", "info", "(", "\"REST request to check clusters of ModelingExercise : {}\"", ",", "exerciseId", ")", ";", "var", "modelingExercise", "=", "modelingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "int", "clusterCount", "=", "modelClusterRepository", ".", "countByExerciseIdWithEagerElements", "(", "exerciseId", ")", ";", "User", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "ADMIN", ",", "modelingExercise", ",", "user", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "body", "(", "clusterCount", ")", ";", "}" ]
DELETE /modeling-exercises/:id/clusters : delete the clusters and elements of "id" modelingExercise.
[ "DELETE", "/", "modeling", "-", "exercises", "/", ":", "id", "/", "clusters", ":", "delete", "the", "clusters", "and", "elements", "of", "\"", "id", "\"", "modelingExercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 967, 3233, 2932, 19, 2284, 310, 17, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 1893, 17, 16806, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 15468, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 4522, 34, 866, 13698, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 613, 18, 1376, 2932, 12030, 590, 358, 866, 9566, 434, 3164, 310, 424, 20603, 294, 3728, 16, 24165, 548, 1769, 203, 3639, 569, 938, 310, 424, 20603, 273, 938, 310, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 3639, 509, 2855, 1380, 273, 938, 3629, 3305, 18, 1883, 858, 424, 20603, 548, 1190, 41, 6817, 3471, 12, 8913, 30708, 548, 1769, 203, 3639, 2177, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 15468, 16, 938, 310, 424, 20603, 16, 729, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 3432, 12, 7967, 1380, 1769, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 8568, 342, 2284, 310, 17, 8913, 71, 6141, 16880, 350, 19, 16806, 294, 1430, 326, 9566, 471, 2186, 434, 315, 350, 6, 938, 310, 424, 20603, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 612, 434, 326, 938, 310, 424, 20603, 358, 1430, 9566, 471, 2186, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
ac4d0be1ace6d1834d45f06cf20805db8495ca4c
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ModelingExerciseResource.java
[ "MIT" ]
Java
deleteModelingExerciseClustersAndElements
null
@DeleteMapping("/modeling-exercises/{exerciseId}/clusters") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<Void> deleteModelingExerciseClustersAndElements(@PathVariable Long exerciseId) { log.info("REST request to delete ModelingExercise : {}", exerciseId); var modelingExercise = modelingExerciseRepository.findByIdElseThrow(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.ADMIN, modelingExercise, user); modelingExerciseService.deleteClustersAndElements(modelingExercise); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, modelingExercise.getTitle())).build(); }
/** * DELETE /modeling-exercises/:id/clusters : delete the clusters and elements of "id" modelingExercise. * * @param exerciseId the id of the modelingExercise to delete clusters and elements * @return the ResponseEntity with status 200 (OK) */
DELETE /modeling-exercises/:id/clusters : delete the clusters and elements of "id" modelingExercise. @param exerciseId the id of the modelingExercise to delete clusters and elements @return the ResponseEntity with status 200 (OK)
[ "DELETE", "/", "modeling", "-", "exercises", "/", ":", "id", "/", "clusters", ":", "delete", "the", "clusters", "and", "elements", "of", "\"", "id", "\"", "modelingExercise", ".", "@param", "exerciseId", "the", "id", "of", "the", "modelingExercise", "to", "delete", "clusters", "and", "elements", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")" ]
@DeleteMapping("/modeling-exercises/{exerciseId}/clusters") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<Void> deleteModelingExerciseClustersAndElements(@PathVariable Long exerciseId) { log.info("REST request to delete ModelingExercise : {}", exerciseId); var modelingExercise = modelingExerciseRepository.findByIdElseThrow(exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.ADMIN, modelingExercise, user); modelingExerciseService.deleteClustersAndElements(modelingExercise); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, modelingExercise.getTitle())).build(); }
[ "@", "DeleteMapping", "(", "\"/modeling-exercises/{exerciseId}/clusters\"", ")", "@", "PreAuthorize", "(", "\"hasRole('ADMIN')\"", ")", "public", "ResponseEntity", "<", "Void", ">", "deleteModelingExerciseClustersAndElements", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "log", ".", "info", "(", "\"REST request to delete ModelingExercise : {}\"", ",", "exerciseId", ")", ";", "var", "modelingExercise", "=", "modelingExerciseRepository", ".", "findByIdElseThrow", "(", "exerciseId", ")", ";", "User", "user", "=", "userRepository", ".", "getUserWithGroupsAndAuthorities", "(", ")", ";", "authCheckService", ".", "checkHasAtLeastRoleForExerciseElseThrow", "(", "Role", ".", "ADMIN", ",", "modelingExercise", ",", "user", ")", ";", "modelingExerciseService", ".", "deleteClustersAndElements", "(", "modelingExercise", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "headers", "(", "HeaderUtil", ".", "createEntityDeletionAlert", "(", "applicationName", ",", "true", ",", "ENTITY_NAME", ",", "modelingExercise", ".", "getTitle", "(", ")", ")", ")", ".", "build", "(", ")", ";", "}" ]
DELETE /modeling-exercises/:id/clusters : delete the clusters and elements of "id" modelingExercise.
[ "DELETE", "/", "modeling", "-", "exercises", "/", ":", "id", "/", "clusters", ":", "delete", "the", "clusters", "and", "elements", "of", "\"", "id", "\"", "modelingExercise", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 2613, 3233, 2932, 19, 2284, 310, 17, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 16806, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 15468, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 1430, 1488, 310, 424, 20603, 13698, 1876, 3471, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 613, 18, 1376, 2932, 12030, 590, 358, 1430, 3164, 310, 424, 20603, 294, 3728, 16, 24165, 548, 1769, 203, 3639, 569, 938, 310, 424, 20603, 273, 938, 310, 424, 20603, 3305, 18, 4720, 5132, 12427, 8282, 12, 8913, 30708, 548, 1769, 203, 203, 3639, 2177, 729, 273, 729, 3305, 18, 588, 1299, 1190, 3621, 1876, 3594, 1961, 5621, 203, 3639, 1357, 1564, 1179, 18, 1893, 5582, 25070, 2996, 1290, 424, 20603, 12427, 8282, 12, 2996, 18, 15468, 16, 938, 310, 424, 20603, 16, 729, 1769, 203, 3639, 938, 310, 424, 20603, 1179, 18, 3733, 13698, 1876, 3471, 12, 2284, 310, 424, 20603, 1769, 203, 3639, 327, 2306, 1943, 18, 601, 7675, 2485, 12, 1864, 1304, 18, 2640, 1943, 13064, 13298, 12, 3685, 461, 16, 638, 16, 17020, 67, 1985, 16, 938, 310, 424, 20603, 18, 588, 4247, 10756, 2934, 3510, 5621, 203, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 8568, 342, 2284, 310, 17, 8913, 71, 6141, 16880, 350, 19, 16806, 294, 1430, 326, 9566, 471, 2186, 434, 315, 350, 6, 938, 310, 424, 20603, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 326, 612, 434, 326, 938, 310, 424, 20603, 358, 1430, 9566, 471, 2186, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]
ac4d0be1ace6d1834d45f06cf20805db8495ca4c
ls1intum/Artemis
src/main/java/de/tum/in/www1/artemis/web/rest/ModelingExerciseResource.java
[ "MIT" ]
Java
triggerAutomaticAssessment
null
@PostMapping("/modeling-exercises/{exerciseId}/trigger-automatic-assessment") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<Void> triggerAutomaticAssessment(@PathVariable Long exerciseId) { instanceMessageSendService.sendModelingExerciseInstantClustering(exerciseId); return ResponseEntity.ok().build(); }
/** * POST /modeling-exercises/{exerciseId}/trigger-automatic-assessment: trigger automatic assessment * (clustering task) for given exercise id As the clustering can be performed on a different * node, this will always return 200, despite an error could occur on the other node. * * @param exerciseId id of the exercised that for which the automatic assessment should be * triggered * @return the ResponseEntity with status 200 (OK) */
POST /modeling-exercises/{exerciseId}/trigger-automatic-assessment: trigger automatic assessment (clustering task) for given exercise id As the clustering can be performed on a different node, this will always return 200, despite an error could occur on the other node. @param exerciseId id of the exercised that for which the automatic assessment should be triggered @return the ResponseEntity with status 200 (OK)
[ "POST", "/", "modeling", "-", "exercises", "/", "{", "exerciseId", "}", "/", "trigger", "-", "automatic", "-", "assessment", ":", "trigger", "automatic", "assessment", "(", "clustering", "task", ")", "for", "given", "exercise", "id", "As", "the", "clustering", "can", "be", "performed", "on", "a", "different", "node", "this", "will", "always", "return", "200", "despite", "an", "error", "could", "occur", "on", "the", "other", "node", ".", "@param", "exerciseId", "id", "of", "the", "exercised", "that", "for", "which", "the", "automatic", "assessment", "should", "be", "triggered", "@return", "the", "ResponseEntity", "with", "status", "200", "(", "OK", ")" ]
@PostMapping("/modeling-exercises/{exerciseId}/trigger-automatic-assessment") @PreAuthorize("hasRole('ADMIN')") public ResponseEntity<Void> triggerAutomaticAssessment(@PathVariable Long exerciseId) { instanceMessageSendService.sendModelingExerciseInstantClustering(exerciseId); return ResponseEntity.ok().build(); }
[ "@", "PostMapping", "(", "\"/modeling-exercises/{exerciseId}/trigger-automatic-assessment\"", ")", "@", "PreAuthorize", "(", "\"hasRole('ADMIN')\"", ")", "public", "ResponseEntity", "<", "Void", ">", "triggerAutomaticAssessment", "(", "@", "PathVariable", "Long", "exerciseId", ")", "{", "instanceMessageSendService", ".", "sendModelingExerciseInstantClustering", "(", "exerciseId", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "build", "(", ")", ";", "}" ]
POST /modeling-exercises/{exerciseId}/trigger-automatic-assessment: trigger automatic assessment (clustering task) for given exercise id As the clustering can be performed on a different node, this will always return 200, despite an error could occur on the other node.
[ "POST", "/", "modeling", "-", "exercises", "/", "{", "exerciseId", "}", "/", "trigger", "-", "automatic", "-", "assessment", ":", "trigger", "automatic", "assessment", "(", "clustering", "task", ")", "for", "given", "exercise", "id", "As", "the", "clustering", "can", "be", "performed", "on", "a", "different", "node", "this", "will", "always", "return", "200", "despite", "an", "error", "could", "occur", "on", "the", "other", "node", "." ]
[]
[ { "param": "exerciseId", "type": "Long" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exerciseId", "type": "Long", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
[ 1, 3495, 21872, 5110, 30, 632, 3349, 3233, 2932, 19, 2284, 310, 17, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 10668, 17, 5854, 4941, 17, 18222, 7923, 203, 565, 632, 1386, 18987, 2932, 5332, 2996, 2668, 15468, 23291, 13, 203, 565, 1071, 2306, 1943, 32, 19038, 34, 3080, 7150, 4941, 15209, 26964, 743, 3092, 3407, 24165, 548, 13, 288, 203, 3639, 791, 1079, 3826, 1179, 18, 4661, 1488, 310, 424, 20603, 10675, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ 1, 26873, 203, 377, 380, 5485, 342, 2284, 310, 17, 8913, 71, 6141, 4938, 8913, 30708, 548, 4004, 10668, 17, 5854, 4941, 17, 18222, 30, 3080, 5859, 14158, 203, 377, 380, 261, 7967, 310, 1562, 13, 364, 864, 24165, 612, 2970, 326, 18743, 848, 506, 9591, 603, 279, 3775, 203, 377, 380, 756, 16, 333, 903, 3712, 327, 4044, 16, 2832, 84, 1137, 392, 555, 3377, 3334, 603, 326, 1308, 756, 18, 203, 377, 380, 203, 377, 380, 632, 891, 24165, 548, 612, 434, 326, 431, 12610, 5918, 716, 364, 1492, 326, 5859, 14158, 1410, 506, 203, 377, 380, 10402, 10861, 203, 377, 380, 632, 2463, 326, 2306, 1943, 598, 1267, 4044, 261, 3141, 13, 203, 377, 1195, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100 ]