Skip to content

Commit 006e7d7

Browse files
committed
Fixing behavior of group exam page (proper reloads).
1 parent e11894f commit 006e7d7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pages/GroupExams/GroupExams.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class GroupExams extends Component {
210210
</Row>
211211
)}
212212

213-
{examId && hasPermissions(group, 'viewStudents', 'setExamPeriod') && (
213+
{examId && !this.state.examInProgress && hasPermissions(group, 'viewStudents', 'setExamPeriod') && (
214214
<Row>
215215
<Col xs={12}>
216216
<ResourceRenderer resource={groupExamLocks} bulkyLoading>
@@ -295,8 +295,12 @@ export default withLinks(
295295
loadGroupExamLocks: () => dispatch(fetchGroupExamLocksIfNeeded(groupId, examId)),
296296
reload: () => dispatch(fetchGroup(groupId)),
297297
addNotification: (...args) => dispatch(addNotification(...args)),
298-
setExamPeriod: (begin, end, strict) => dispatch(setExamPeriod(groupId, begin, end, strict)),
299-
removeExamPeriod: () => dispatch(removeExamPeriod(groupId)),
298+
setExamPeriod: (begin, end, strict) =>
299+
dispatch(setExamPeriod(groupId, begin, end, strict)).then(() =>
300+
GroupExams.loadAsync({ groupId, examId }, dispatch)
301+
),
302+
removeExamPeriod: () =>
303+
dispatch(removeExamPeriod(groupId)).then(() => GroupExams.loadAsync({ groupId, examId }, dispatch)),
300304
})
301305
)(GroupExams)
302306
);

0 commit comments

Comments
 (0)