Skip to content

Commit

Permalink
Fix reference solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
SemaiCZE committed Nov 14, 2017
1 parent e234019 commit b75be00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import ExercisesNameContainer from '../../../containers/ExercisesNameContainer';

const ReferenceSolutionDetail = ({
description,
uploadedAt,
solution: { userId },
solution: { userId, createdAt },
exerciseId
}) => (
}) =>
<Box
title={
<FormattedMessage
Expand Down Expand Up @@ -51,7 +50,9 @@ const ReferenceSolutionDetail = ({
defaultMessage="Description"
/>
</th>
<td>{description}</td>
<td>
{description}
</td>
</tr>
<tr>
<td className="text-center">
Expand All @@ -64,9 +65,9 @@ const ReferenceSolutionDetail = ({
/>
</th>
<td>
<FormattedDate value={uploadedAt * 1000} />
<FormattedDate value={createdAt * 1000} />
&nbsp;
<FormattedTime value={uploadedAt * 1000} />
<FormattedTime value={createdAt * 1000} />
</td>
</tr>
<tr>
Expand All @@ -85,14 +86,13 @@ const ReferenceSolutionDetail = ({
</tr>
</tbody>
</Table>
</Box>
);
</Box>;

ReferenceSolutionDetail.propTypes = {
description: PropTypes.string.isRequired,
uploadedAt: PropTypes.number.isRequired,
solution: PropTypes.shape({
userId: PropTypes.string.isRequired
userId: PropTypes.string.isRequired,
createdAt: PropTypes.number.isRequired
}).isRequired,
exerciseId: PropTypes.string.isRequired
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ class ReferenceSolutionEvaluationsContainer extends Component {

return (
<ResourceRenderer resource={evaluations.toArray()}>
{(...evaluations) => (
{(...evaluations) =>
<ReferenceSolutionEvaluations
referenceSolutionId={referenceSolutionId}
evaluations={evaluations}
exerciseId={exerciseId}
/>
)}
/>}
</ResourceRenderer>
);
}
Expand All @@ -51,7 +50,7 @@ ReferenceSolutionEvaluationsContainer.propTypes = {
export default connect(
(state, { referenceSolution }) => ({
evaluations: getReferenceSolutionEvaluationsByIdsSelector(
referenceSolution.evaluations
referenceSolution.submissions
)(state)
}),
(dispatch, { referenceSolutionId, exerciseId }) => ({
Expand Down

0 comments on commit b75be00

Please sign in to comment.