status === 'done' || status === 'failed';
-
const SolutionsTableRow = ({
id,
attemptIndex,
assignmentId,
groupId,
- status = null,
note,
lastSubmission,
maxPoints,
@@ -90,7 +87,6 @@ const SolutionsTableRow = ({
accepted={accepted}
review={review}
isBestSolution={isBestSolution}
- status={status}
lastSubmission={lastSubmission}
commentsStats={commentsStats}
isReviewer={permissionHints && permissionHints.review}
@@ -103,7 +99,7 @@ const SolutionsTableRow = ({
- {showScoreAndPoints(status) ? (
+ {lastSubmission.evaluation ? (
@@ -113,7 +109,7 @@ const SolutionsTableRow = ({
|
- {showScoreAndPoints(status) ? (
+ {lastSubmission.evaluation ? (
@@ -206,7 +202,6 @@ SolutionsTableRow.propTypes = {
attemptIndex: PropTypes.number.isRequired,
assignmentId: PropTypes.string.isRequired,
groupId: PropTypes.string.isRequired,
- status: PropTypes.string,
note: PropTypes.any.isRequired,
maxPoints: PropTypes.number.isRequired,
bonusPoints: PropTypes.number.isRequired,
diff --git a/src/components/Exercises/ReferenceSolutionsTable/ReferenceSolutionsTableRow.js b/src/components/Exercises/ReferenceSolutionsTable/ReferenceSolutionsTableRow.js
index 248f54a04..6af7c291d 100644
--- a/src/components/Exercises/ReferenceSolutionsTable/ReferenceSolutionsTableRow.js
+++ b/src/components/Exercises/ReferenceSolutionsTable/ReferenceSolutionsTableRow.js
@@ -71,7 +71,7 @@ const ReferenceSolutionsTableRow = ({
) : (
-
+ = 1.0 ? 'text-success' : 'text-danger'}>
)}
diff --git a/src/components/ReferenceSolutions/EvaluationTable/EvaluationTable.js b/src/components/ReferenceSolutions/EvaluationTable/EvaluationTable.js
index bf692ff5b..9ae86c20b 100644
--- a/src/components/ReferenceSolutions/EvaluationTable/EvaluationTable.js
+++ b/src/components/ReferenceSolutions/EvaluationTable/EvaluationTable.js
@@ -27,7 +27,7 @@ const EvaluationTable = ({ evaluations, renderButtons, selectedRowId = '' }) =>
{evaluations
.sort((a, b) => {
if (!a.submittedAt || !b.submittedAt) {
- return a.evaluationStatus.localeCompare(b.evaluationStatus);
+ return a.id.localeCompare(b.id); // just to make it deterministic
}
return (
((b.evaluation && b.evaluation.evaluatedAt) || b.submittedAt) -
@@ -38,7 +38,7 @@ const EvaluationTable = ({ evaluations, renderButtons, selectedRowId = '' }) =>
-
+
{e.isDebug && (
{e.evaluation && (
= 1.0,
})}>
diff --git a/src/components/ReferenceSolutions/ReferenceSolutionDetail/ReferenceSolutionDetail.js b/src/components/ReferenceSolutions/ReferenceSolutionDetail/ReferenceSolutionDetail.js
index f5e096228..3d6fece8b 100644
--- a/src/components/ReferenceSolutions/ReferenceSolutionDetail/ReferenceSolutionDetail.js
+++ b/src/components/ReferenceSolutions/ReferenceSolutionDetail/ReferenceSolutionDetail.js
@@ -80,12 +80,7 @@ class ReferenceSolutionDetail extends Component {
if (activeSubmissionId && evaluationsJS[activeSubmissionId] && evaluationsJS[activeSubmissionId].data) {
/* eslint-disable no-var */
- var { submittedBy, evaluation, failure, isCorrect, evaluationStatus, isDebug, ...restSub } =
- evaluationsJS[activeSubmissionId].data;
- } else evaluationStatus = 'missing-submission';
-
- if (evaluationStatus === 'evaluation-failed' && !failure) {
- failure = true;
+ var { submittedBy, evaluation, failure, isDebug, ...restSub } = evaluationsJS[activeSubmissionId].data;
}
return (
@@ -214,8 +209,6 @@ class ReferenceSolutionDetail extends Component {
{evaluation && (
= 1.0,
})}>
@@ -113,8 +108,8 @@ const EvaluationDetail = ({
| 0,
+ 'text-danger': evaluation.score < 1.0 || evaluation.points <= 0,
+ 'text-success': evaluation.score >= 1.0 && evaluation.points > 0,
})}>
{evaluation.points} / {maxPoints}
@@ -123,53 +118,6 @@ const EvaluationDetail = ({
| | |
)}
- {!referenceSolution && (
-
-
-
-
-
- |
-
- :
- |
-
-
- {evaluationStatus === 'done' && (
-
- )}
- {evaluationStatus === 'work-in-progress' && (
-
- )}
- {evaluationStatus === 'failed' && (
-
- )}
- {evaluationStatus === 'evaluation-failed' && (
-
- )}
- {evaluationStatus === 'missing-submission' && (
-
- )}
-
- |
-
- )}
-
{viewResumbissions && (
@@ -195,12 +143,8 @@ const EvaluationDetail = ({
);
EvaluationDetail.propTypes = {
- isCorrect: PropTypes.bool.isRequired,
- submittedAt: PropTypes.number.isRequired,
evaluation: PropTypes.object,
maxPoints: PropTypes.number,
- accepted: PropTypes.bool,
- evaluationStatus: PropTypes.string,
isDebug: PropTypes.bool.isRequired,
viewResumbissions: PropTypes.bool,
showScoreDetail: PropTypes.func,
diff --git a/src/components/Solutions/SolutionDetail/SolutionDetail.js b/src/components/Solutions/SolutionDetail/SolutionDetail.js
index 2f34aeea6..02e2ebea8 100644
--- a/src/components/Solutions/SolutionDetail/SolutionDetail.js
+++ b/src/components/Solutions/SolutionDetail/SolutionDetail.js
@@ -92,14 +92,7 @@ class SolutionDetail extends Component {
const evaluationsJS = evaluations.toJS();
if (activeSubmissionId && evaluationsJS[activeSubmissionId] && evaluationsJS[activeSubmissionId].data) {
/* eslint-disable no-var */
- var { submittedBy, evaluation, failure, isCorrect, evaluationStatus, isDebug, ...restSub } =
- evaluationsJS[activeSubmissionId].data;
- } else {
- evaluationStatus = 'missing-submission';
- }
-
- if (evaluationStatus === 'evaluation-failed' && !failure) {
- failure = true;
+ var { submittedBy, evaluation, failure, isDebug, ...restSub } = evaluationsJS[activeSubmissionId].data;
}
return (
@@ -110,7 +103,7 @@ class SolutionDetail extends Component {
id={id}
attemptIndex={attemptIndex}
evaluation={evaluation}
- evaluationStatus={safeGet(lastSubmission, ['evaluationStatus'], 'missing-submission')}
+ lastSubmission={lastSubmission}
submittedAt={createdAt}
userId={authorId}
submittedBy={submittedBy}
@@ -222,11 +215,7 @@ class SolutionDetail extends Component {
{evaluation && (
-
+
|
:
@@ -613,7 +613,7 @@ SolutionStatus.propTypes = {
pointsPercentualThreshold: PropTypes.number,
}).isRequired,
evaluation: PropTypes.object,
- evaluationStatus: PropTypes.string.isRequired,
+ lastSubmission: PropTypes.object,
submittedAt: PropTypes.number.isRequired,
userId: PropTypes.string.isRequired,
submittedBy: PropTypes.string,
diff --git a/src/pages/AssignmentSolutions/AssignmentSolutions.js b/src/pages/AssignmentSolutions/AssignmentSolutions.js
index c54963e17..8172884fd 100644
--- a/src/pages/AssignmentSolutions/AssignmentSolutions.js
+++ b/src/pages/AssignmentSolutions/AssignmentSolutions.js
@@ -131,7 +131,6 @@ const prepareTableColumnDescriptors = defaultMemoize((loggedUserId, assignmentId
review={info.review}
isReviewer={info.permissionHints && info.permissionHints.review}
isBestSolution={info.isBestSolution}
- status={info.lastSubmission ? info.lastSubmission.evaluationStatus : null}
lastSubmission={info.lastSubmission}
commentsStats={info.commentsStats}
plagiarism={Boolean(info.plagiarism)}
@@ -314,9 +313,7 @@ const prepareTableData = defaultMemoize(
permissionHints,
plagiarism = null,
}) => {
- const statusEvaluated =
- lastSubmission &&
- (lastSubmission.evaluationStatus === 'done' || lastSubmission.evaluationStatus === 'failed');
+ const statusEvaluated = lastSubmission && (lastSubmission.evaluation || lastSubmission.failure);
return {
icon: { id, commentsStats, lastSubmission, accepted, review, permissionHints, isBestSolution, plagiarism },
user: usersIndex[authorId],
diff --git a/src/pages/ExerciseReferenceSolutions/ExerciseReferenceSolutions.js b/src/pages/ExerciseReferenceSolutions/ExerciseReferenceSolutions.js
index 896b92aad..102eb0896 100644
--- a/src/pages/ExerciseReferenceSolutions/ExerciseReferenceSolutions.js
+++ b/src/pages/ExerciseReferenceSolutions/ExerciseReferenceSolutions.js
@@ -136,12 +136,11 @@ const prepareTableColumnDescriptors = defaultMemoize((loggedUserId, locale, link
safeGet(c2, ['evaluation', 'score'], -1) - safeGet(c1, ['evaluation', 'score'], -1) || d2 - d1,
cellRenderer: lastSubmission => {
const score = safeGet(lastSubmission, ['evaluation', 'score'], null);
- const isCorrect = safeGet(lastSubmission, ['isCorrect'], false);
return score !== null ? (
= 1.0,
})}>
diff --git a/src/pages/GroupUserSolutions/GroupUserSolutions.js b/src/pages/GroupUserSolutions/GroupUserSolutions.js
index c0f2f7df0..29bad2ec5 100644
--- a/src/pages/GroupUserSolutions/GroupUserSolutions.js
+++ b/src/pages/GroupUserSolutions/GroupUserSolutions.js
@@ -96,7 +96,6 @@ const prepareTableColumnDescriptors = defaultMemoize((assignments, groupId, loca
review={info.review}
isReviewer={info.permissionHints && info.permissionHints.review}
isBestSolution={info.isBestSolution}
- status={info.lastSubmission ? info.lastSubmission.evaluationStatus : null}
lastSubmission={info.lastSubmission}
commentsStats={info.commentsStats}
plagiarism={Boolean(info.plagiarism)}
@@ -255,9 +254,7 @@ const prepareTableData = defaultMemoize(
permissionHints,
plagiarism = null,
}) => {
- const statusEvaluated =
- lastSubmission &&
- (lastSubmission.evaluationStatus === 'done' || lastSubmission.evaluationStatus === 'failed');
+ const statusEvaluated = lastSubmission && (lastSubmission.evalutaion || lastSubmission.failure);
const rte = getRuntime(runtimeEnvironmentId);
res.push({
diff --git a/src/redux/modules/solutions.js b/src/redux/modules/solutions.js
index 2390a0688..d02a48fe9 100644
--- a/src/redux/modules/solutions.js
+++ b/src/redux/modules/solutions.js
@@ -19,7 +19,7 @@ import { objectFilter } from '../../helpers/common';
const resourceName = 'solutions';
const needsRefetching = item =>
- defaultNeedsRefetching(item) || item.getIn(['data', 'evaluationStatus']) === 'work-in-progress';
+ defaultNeedsRefetching(item) || (!item.getIn(['data', 'evaluation']) && !item.getIn(['data', 'failure']));
const apiEndpointFactory = id => `/assignment-solutions/${id}`;
const { actions, actionTypes, reduceActions } = factory({
| | |