Skip to content

Commit b4b931f

Browse files
committed
Improving notification and filtering of solutions suspected from plagiarism.
1 parent 9b687f6 commit b4b931f

File tree

5 files changed

+31
-13
lines changed

5 files changed

+31
-13
lines changed

recodex-web.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
%define name recodex-web
22
%define short_name web-app
33
%define version 2.10.0
4-
%define unmangled_version 71640583ebf97d6c8f73a78a97f272d2aaa24a6a
5-
%define release 1
4+
%define unmangled_version 137ce75c61aec51b5c721de71173ae6f67266283
5+
%define release 2
66

77
Summary: ReCodEx web-app component
88
Name: %{name}

src/locales/cs.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,15 @@
157157
"app.assignmentSolutions.assignmentSolutions": "Řešení zadané úlohy",
158158
"app.assignmentSolutions.noSolutions": "Momentálně zde nejsou žádná odevzdaná řešení.",
159159
"app.assignmentSolutions.pendingReviews": "V tuto chvíli {count, plural, one {je otevřena} =2 {jsou otevřeny} =3 {jsou otevřeny} =4 {jsou otevřeny} other {je otevřeno}} {count} {count, plural, one {revize} =2 {revize} =3 {revize} =4 {revize} other {revizí}} ze všech řešení vybrané úlohy. Nezapomeňte, že autoři úloh vidí vaše komentáře zdrojových kódů až poté, co jsou příslušné revize uzavřeny.",
160-
"app.assignmentSolutions.plagiarismsDetected": "V seznamu {count, plural, one {je zobrazeno} =2 {jsou zobrazena} =3 {jsou zobrazena} =4 {jsou zobrazena} other {je zobrazeno}} {count} řešení, {count, plural, one {ke kterému} other {ke kterým}} byla nelezena podobná řešení. V takových případech se může jednat o plagiáty.",
160+
"app.assignmentSolutions.plagiarismsDetected.assignments": "V seznamu {count, plural, one {je zobrazeno} =2 {jsou zobrazena} =3 {jsou zobrazena} =4 {jsou zobrazena} other {je zobrazeno}} {count} řešení ({assignments, plural, =2 {ze} =3 {ze} =4 {ze} other {z}} {assignments} {assignments, plural, one {úlohy} other {úloh}}), {count, plural, one {ke kterému} other {ke kterým}} byla nalezena podobná řešení. V takových případech se může jednat o plagiáty.",
161+
"app.assignmentSolutions.plagiarismsDetected.authors": "V seznamu {count, plural, one {je zobrazeno} =2 {jsou zobrazena} =3 {jsou zobrazena} =4 {jsou zobrazena} other {je zobrazeno}} {count} řešení (od {authors} {authors, plural, one {autora} other {různých autorů}}), {count, plural, one {ke kterému} other {ke kterým}} byla nalezena podobná řešení. V takových případech se může jednat o plagiáty.",
161162
"app.assignmentSolutions.title": "Všechna řešení zadané úlohy",
162163
"app.assignmentSolutions.viewModes.accepted": "Pouze akceptovaná řešení",
163164
"app.assignmentSolutions.viewModes.best": "Pouze nejlepší řešení",
164165
"app.assignmentSolutions.viewModes.default": "Všechna řešení (výchozí)",
165166
"app.assignmentSolutions.viewModes.grouped": "Seskupit dle uživatelů",
166167
"app.assignmentSolutions.viewModes.last": "Pouze poslední řešení",
168+
"app.assignmentSolutions.viewModes.plagiarism": "Řešení podezřelá z plagiátorství",
167169
"app.assignmentSolutions.viewModes.reviewed": "Pouze revidovaná řešení",
168170
"app.assignmentSolutions.viewModesTitle": "Vyberte způsob zobrazení řešení",
169171
"app.assignments.deadline": "Termín odevzdání",

src/locales/en.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,15 @@
157157
"app.assignmentSolutions.assignmentSolutions": "Assignment Solutions",
158158
"app.assignmentSolutions.noSolutions": "There are currently no submitted solutions.",
159159
"app.assignmentSolutions.pendingReviews": "There {count, plural, one {is} other {are}} {count} pending {count, plural, one {review} other {reviews}} among the solutions of the selected assignment. Remember that the review comments are visible to the author after a review is closed.",
160-
"app.assignmentSolutions.plagiarismsDetected": "There {count, plural, one {is} other {are}} {count} {count, plural, one {solution} other {solutions}} with detected similarities. Such solutions may be plagiarisms.",
160+
"app.assignmentSolutions.plagiarismsDetected.assignments": "There {count, plural, one {is} other {are}} {count} {count, plural, one {solution} other {solutions}} (of {assignments} {assignments, plural, one {assignment} other {assignments}}) with detected similarities. Such solutions may be plagiarisms.",
161+
"app.assignmentSolutions.plagiarismsDetected.authors": "There {count, plural, one {is} other {are}} {count} {count, plural, one {solution} other {solutions}} (from {authors} {authors, plural, one {author} other {unique authors}}) with detected similarities. Such solutions may be plagiarisms.",
161162
"app.assignmentSolutions.title": "All Submissions of The Assignment",
162163
"app.assignmentSolutions.viewModes.accepted": "Accepted solutions only",
163164
"app.assignmentSolutions.viewModes.best": "Best solutions only",
164165
"app.assignmentSolutions.viewModes.default": "All solutions (default)",
165166
"app.assignmentSolutions.viewModes.grouped": "Grouped by users",
166167
"app.assignmentSolutions.viewModes.last": "Latest solutions only",
168+
"app.assignmentSolutions.viewModes.plagiarism": "Only plagiarism suspects",
167169
"app.assignmentSolutions.viewModes.reviewed": "Reviewed solutions only",
168170
"app.assignmentSolutions.viewModesTitle": "Select solutions view filter",
169171
"app.assignments.deadline": "Deadline",
@@ -2067,4 +2069,4 @@
20672069
"recodex-judge-shuffle-all": "Unordered-tokens-and-rows judge",
20682070
"recodex-judge-shuffle-newline": "Unordered-tokens judge (ignoring ends of lines)",
20692071
"recodex-judge-shuffle-rows": "Unordered-rows judge"
2070-
}
2072+
}

src/pages/AssignmentSolutions/AssignmentSolutions.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import { isReady, getJsData, getId } from '../../redux/helpers/resourceManager';
6767

6868
import { storageGetItem, storageSetItem } from '../../helpers/localStorage';
6969
import withLinks from '../../helpers/withLinks';
70-
import { safeGet, identity, arrayToObject, toPlainAscii, hasPermissions } from '../../helpers/common';
70+
import { safeGet, identity, arrayToObject, toPlainAscii, hasPermissions, unique } from '../../helpers/common';
7171

7272
// View mode keys, labels, and filtering functions
7373
const VIEW_MODE_DEFAULT = 'default';
@@ -76,6 +76,7 @@ const VIEW_MODE_BEST = 'best';
7676
const VIEW_MODE_LAST = 'last';
7777
const VIEW_MODE_ACCEPTED = 'accepted';
7878
const VIEW_MODE_REVIEWD = 'reviewed';
79+
const VIEW_MODE_PLAGIARISM = 'plagiarism';
7980

8081
const viewModes = {
8182
[VIEW_MODE_DEFAULT]: (
@@ -96,6 +97,9 @@ const viewModes = {
9697
[VIEW_MODE_REVIEWD]: (
9798
<FormattedMessage id="app.assignmentSolutions.viewModes.reviewed" defaultMessage="Reviewed solutions only" />
9899
),
100+
[VIEW_MODE_PLAGIARISM]: (
101+
<FormattedMessage id="app.assignmentSolutions.viewModes.plagiarism" defaultMessage="Only plagiarism suspects" />
102+
),
99103
};
100104

101105
const _getLastAttemptIndices = defaultMemoize(solutions => {
@@ -114,6 +118,7 @@ const viewModeFilters = {
114118
solution && solution.attemptIndex === _getLastAttemptIndices(solutions)[solution.authorId],
115119
[VIEW_MODE_ACCEPTED]: solution => solution && solution.accepted,
116120
[VIEW_MODE_REVIEWD]: solution => solution && solution.review,
121+
[VIEW_MODE_PLAGIARISM]: solution => solution && solution.plagiarism,
117122
};
118123

119124
const prepareTableColumnDescriptors = defaultMemoize((loggedUserId, assignmentId, groupId, viewMode, locale, links) => {
@@ -323,6 +328,8 @@ const getPlagiarisms = defaultMemoize(assignmentSolutions =>
323328
.filter(solution => solution && solution.plagiarism)
324329
);
325330

331+
const getPlagiarismUniqueAuthors = defaultMemoize(plagiarisms => unique(plagiarisms.map(({ authorId }) => authorId)));
332+
326333
const localStorageStateKey = 'AssignmentSolutions.state';
327334

328335
class AssignmentSolutions extends Component {
@@ -438,9 +445,9 @@ class AssignmentSolutions extends Component {
438445
{plagiarisms && plagiarisms.length > 0 && (
439446
<Callout variant="danger" icon={<PlagiarismIcon />}>
440447
<FormattedMessage
441-
id="app.assignmentSolutions.plagiarismsDetected"
442-
defaultMessage="There {count, plural, one {is} other {are}} {count} {count, plural, one {solution} other {solutions}} with detected similarities. Such solutions may be plagiarisms."
443-
values={{ count: plagiarisms.length }}
448+
id="app.assignmentSolutions.plagiarismsDetected.authors"
449+
defaultMessage="There {count, plural, one {is} other {are}} {count} {count, plural, one {solution} other {solutions}} (from {authors} {authors, plural, one {author} other {unique authors}}) with detected similarities. Such solutions may be plagiarisms."
450+
values={{ count: plagiarisms.length, authors: getPlagiarismUniqueAuthors(plagiarisms).length }}
444451
/>
445452
</Callout>
446453
)}

src/pages/GroupUserSolutions/GroupUserSolutions.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import { compareAssignmentsReverted } from '../../components/helpers/assignments
5959
import { storageGetItem, storageSetItem } from '../../helpers/localStorage';
6060
import { getLocalizedName } from '../../helpers/localizedData';
6161
import withLinks from '../../helpers/withLinks';
62-
import { safeGet, identity, hasPermissions, hasOneOfPermissions } from '../../helpers/common';
62+
import { safeGet, identity, hasPermissions, hasOneOfPermissions, unique } from '../../helpers/common';
6363

6464
/**
6565
* Sorts all assignments and create a numerical index, so the solutions can be sorted faster
@@ -292,6 +292,10 @@ const getPlagiarisms = defaultMemoize((assignments, getAssignmentSolutions) =>
292292
: []
293293
);
294294

295+
const getPlagiarismUniqueAssignments = defaultMemoize(plagiarisms =>
296+
unique(plagiarisms.map(({ assignmentId }) => assignmentId))
297+
);
298+
295299
const localStorageStateKey = 'GroupUserSolutions.state';
296300

297301
class GroupUserSolutions extends Component {
@@ -403,9 +407,12 @@ class GroupUserSolutions extends Component {
403407
{plagiarisms && plagiarisms.length > 0 && (
404408
<Callout variant="danger" icon={<PlagiarismIcon />}>
405409
<FormattedMessage
406-
id="app.assignmentSolutions.plagiarismsDetected"
407-
defaultMessage="There {count, plural, one {is} other {are}} {count} {count, plural, one {solution} other {solutions}} with detected similarities. Such solutions may be plagiarisms."
408-
values={{ count: plagiarisms.length }}
410+
id="app.assignmentSolutions.plagiarismsDetected.assignments"
411+
defaultMessage="There {count, plural, one {is} other {are}} {count} {count, plural, one {solution} other {solutions}} (of {assignments} {assignments, plural, one {assignment} other {assignments}}) with detected similarities. Such solutions may be plagiarisms."
412+
values={{
413+
count: plagiarisms.length,
414+
assignments: getPlagiarismUniqueAssignments(plagiarisms).length,
415+
}}
409416
/>
410417
</Callout>
411418
)}

0 commit comments

Comments
 (0)