Skip to content
Snippets Groups Projects
Commit f8b83054 authored by Bereczki Sandor's avatar Bereczki Sandor
Browse files

Fixed an issue with solution retrieving

Fixed the bug when the admin browses the solutions and the student uploads a solution during this, the admin did not see the new solution. Now works correctly.
parent 90c4537f
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,9 @@ import { connect } from 'react-redux';
import CorrectSolutionForm from './CorrectSolutionForm';
import { emptyMessage } from '../pages/Homework';
import './Forms.css';
import {
getSolutions,
} from '../../actions/homework';
class SolutionDetailsForm extends Component {
constructor(props) {
......@@ -45,7 +48,13 @@ class SolutionDetailsForm extends Component {
<Modal
open={this.state.showModal}
trigger={
<button id='task' onClick={() => { this.setState({ showModal: true }); }}>
<button
id='task'
onClick={() => {
this.setState({ showModal: true });
this.props.getSolutions();
}}
>
<Icon name='external' />
{this.props.tasktitle}
</button>
......@@ -115,4 +124,5 @@ class SolutionDetailsForm extends Component {
const mapStateToProps = ({ homeworks, user }) => ({ homeworks, user });
export default connect(mapStateToProps, {
getSolutions,
})(SolutionDetailsForm);
......@@ -68,7 +68,6 @@ export const emptyMessage = (header, text, marginBottom, warning) => (
class Homework extends Component {
componentDidMount() {
this.props.getTasks();
this.props.getSolutions(this.props.user.id);
this.props.getProfiles();
this.props.getDocuments();
}
......@@ -161,7 +160,11 @@ class Homework extends Component {
}
>
<Table.Cell>
<SolutionDetailsForm taskid={task.id} tasktitle={task.title} taskdesc={task.text} />
<SolutionDetailsForm
taskid={task.id}
tasktitle={task.title}
taskdesc={task.text}
/>
</Table.Cell>
<Table.Cell>
{moment(task.deadline).format('YYYY. MM. DD. HH:mm')}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment