Skip to content

Commit ae0c6a4

Browse files
committed
Adding info about plagiarism checks (for assignment solutions) even when no similar solutions were detected.
1 parent 84ee38d commit ae0c6a4

File tree

6 files changed

+39
-10
lines changed

6 files changed

+39
-10
lines changed

recodex-web.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%define short_name web-app
33
%define version 2.15.2
44
%define unmangled_version ebc78182eb1009c8c0198e703eace2fc2a7052a9
5-
%define release 1
5+
%define release 2
66

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

src/components/icons/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export const OutputIcon = props => <Icon {...props} icon="sign-out-alt" />;
9292
export const PastDeadlineIcon = props => <Icon {...props} icon="skull" />;
9393
export const PipelineIcon = props => <Icon {...props} icon="random" />;
9494
export const PipelineStructureIcon = props => <Icon {...props} icon="sitemap" />;
95+
export const PlagiarismCheckedIcon = props => <Icon icon="person-circle-check" {...props} />;
9596
export const PlagiarismIcon = props => <Icon icon="person-circle-exclamation" {...props} />;
9697
export const PointsIcon = props => <Icon icon="comment-dollar" {...props} />;
9798
export const PointsDecreasedIcon = props => <Icon icon="level-down-alt" className="text-body-secondary" {...props} />;

src/components/widgets/DateTime/DateTime.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const dateTime = ({
3131
showSeconds = false,
3232
showRelative = isDeadline,
3333
noWrap = true,
34+
compact = false,
3435
}) => {
3536
const { dateFormatOverride = null } = useContext(UserUIDataContext);
3637

@@ -58,17 +59,14 @@ const dateTime = ({
5859
<FormattedDate value={unixts * 1000} />
5960
)}
6061

61-
{(showTime || showRelative) && <span className="px-1"> </span>}
62+
{(showTime || showRelative) && <span className={compact ? '' : 'px-1'}> </span>}
6263
</span>
6364
)}
6465

6566
{showTime && (
66-
<span
67-
className={classnames({
68-
'text-nowrap': true,
69-
})}>
67+
<span className="text-nowrap">
7068
<FormattedTime value={unixts * 1000} format={showSeconds ? '24hourWithSeconds' : '24hour'} />
71-
{showRelative && <span className="px-1"> </span>}
69+
{showRelative && <span className={compact ? '' : 'px-1'}> </span>}
7270
</span>
7371
)}
7472

@@ -143,6 +141,7 @@ dateTime.propTypes = {
143141
deadlineDangerTime: PropTypes.number,
144142
deadlineAlertTime: PropTypes.number,
145143
noWrap: PropTypes.bool,
144+
compact: PropTypes.bool,
146145
};
147146

148147
DateTime.propTypes = {

src/locales/cs.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@
168168
"app.assignmentSolutions.assignmentSolutions": "Řešení zadané úlohy",
169169
"app.assignmentSolutions.noSolutions": "Momentálně zde nejsou žádná odevzdaná řešení.",
170170
"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.",
171+
"app.assignmentSolutions.plagiarismsChecked": "Tato řešení byla zkontrolována na plagiáty {date}. Žádné podobnosti nebyly nalezeny.",
171172
"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.",
172173
"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.",
174+
"app.assignmentSolutions.plagiarismsDetected.time": "Poslední kontrola na plagiáty proběhla {date}.",
173175
"app.assignmentSolutions.title": "Všechna řešení zadané úlohy",
174176
"app.assignmentSolutions.viewModes.accepted": "Pouze akceptovaná řešení",
175177
"app.assignmentSolutions.viewModes.best": "Pouze nejlepší řešení",
@@ -2197,4 +2199,4 @@
21972199
"recodex-judge-shuffle-all": "Sudí neuspořádaných tokenů a řádků",
21982200
"recodex-judge-shuffle-newline": "Sudí neuspořádaných tokenů (ignorující konce řádků)",
21992201
"recodex-judge-shuffle-rows": "Sudí neuspořádaných řádků"
2200-
}
2202+
}

src/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@
168168
"app.assignmentSolutions.assignmentSolutions": "Assignment Solutions",
169169
"app.assignmentSolutions.noSolutions": "There are currently no submitted solutions.",
170170
"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.",
171+
"app.assignmentSolutions.plagiarismsChecked": "These assignment solutions were checked for plagiarisms at {date}. No similarities found.",
171172
"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.",
172173
"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.",
174+
"app.assignmentSolutions.plagiarismsDetected.time": "The latest plagiarism check ended at {date}.",
173175
"app.assignmentSolutions.title": "All Submissions of The Assignment",
174176
"app.assignmentSolutions.viewModes.accepted": "Accepted solutions only",
175177
"app.assignmentSolutions.viewModes.best": "Best solutions only",
@@ -2197,4 +2199,4 @@
21972199
"recodex-judge-shuffle-all": "Unordered-tokens-and-rows judge",
21982200
"recodex-judge-shuffle-newline": "Unordered-tokens judge (ignoring ends of lines)",
21992201
"recodex-judge-shuffle-rows": "Unordered-rows judge"
2200-
}
2202+
}

src/pages/AssignmentSolutions/AssignmentSolutions.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Icon, {
2020
DetailIcon,
2121
CodeFileIcon,
2222
LoadingIcon,
23+
PlagiarismCheckedIcon,
2324
PlagiarismIcon,
2425
ResultsIcon,
2526
UserIcon,
@@ -460,14 +461,38 @@ class AssignmentSolutions extends Component {
460461
linkFactory={links.GROUP_EDIT_URI_FACTORY}
461462
/>
462463

463-
{plagiarisms && plagiarisms.length > 0 && (
464+
{plagiarisms && plagiarisms.length > 0 ? (
464465
<Callout variant="danger" icon={<PlagiarismIcon />}>
465466
<FormattedMessage
466467
id="app.assignmentSolutions.plagiarismsDetected.authors"
467468
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."
468469
values={{ count: plagiarisms.length, authors: getPlagiarismUniqueAuthors(plagiarisms).length }}
469470
/>
471+
{assignment.plagiarismCheckedAt && (
472+
<>
473+
<br />
474+
<FormattedMessage
475+
id="app.assignmentSolutions.plagiarismsDetected.time"
476+
defaultMessage="The latest plagiarism check ended at {date}."
477+
values={{
478+
date: <DateTime unixts={assignment.plagiarismCheckedAt} compact />,
479+
}}
480+
/>
481+
</>
482+
)}
470483
</Callout>
484+
) : (
485+
assignment.plagiarismCheckedAt && (
486+
<Callout variant="success" icon={<PlagiarismCheckedIcon />}>
487+
<FormattedMessage
488+
id="app.assignmentSolutions.plagiarismsChecked"
489+
defaultMessage="These assignment solutions were checked for plagiarisms at {date}. No similarities found."
490+
values={{
491+
date: <DateTime unixts={assignment.plagiarismCheckedAt} compact />,
492+
}}
493+
/>
494+
</Callout>
495+
)
471496
)}
472497

473498
{pendingReviews && pendingReviews.length > 0 && !group.archived && (

0 commit comments

Comments
 (0)