Skip to content
Snippets Groups Projects
Commit 78f33395 authored by Ron Lucke's avatar Ron Lucke Committed by David Siegfried
Browse files

fix #3178

Closes #3178 and #3179

Merge request studip/studip!2155
parent 83c65df4
No related branches found
No related tags found
No related merge requests found
...@@ -327,6 +327,7 @@ export default { ...@@ -327,6 +327,7 @@ export default {
selectedGroups: [], selectedGroups: [],
bulkSelectGroups: false, bulkSelectGroups: false,
requirements: [], requirements: [],
distributing: false,
}; };
}, },
computed: { computed: {
...@@ -494,6 +495,7 @@ export default { ...@@ -494,6 +495,7 @@ export default {
copyStructuralElement: 'copyStructuralElement', copyStructuralElement: 'copyStructuralElement',
companionError: 'companionError', companionError: 'companionError',
companionSuccess: 'companionSuccess', companionSuccess: 'companionSuccess',
companionInfo: 'companionInfo',
loadCourseMemberships: 'course-memberships/loadRelated', loadCourseMemberships: 'course-memberships/loadRelated',
loadCourseStatusGroups: 'status-groups/loadRelated', loadCourseStatusGroups: 'status-groups/loadRelated',
createTaskGroup: 'createTaskGroup', createTaskGroup: 'createTaskGroup',
...@@ -515,6 +517,11 @@ export default { ...@@ -515,6 +517,11 @@ export default {
this.loadStructuralElement({ id: id, options: { include: 'children' } }); this.loadStructuralElement({ id: id, options: { include: 'children' } });
}, },
async distributeTask() { async distributeTask() {
if (this.distributing) {
this.companionInfo({ info: this.$gettext('Aufgaben werden bereits verteilt.') });
return;
}
this.distributing = true;
const taskGroup = { const taskGroup = {
attributes: { attributes: {
title: this.taskTitle, title: this.taskTitle,
...@@ -548,11 +555,12 @@ export default { ...@@ -548,11 +555,12 @@ export default {
solvers = this.selectedGroups.map((id) => ({ type: 'status-groups', id })); solvers = this.selectedGroups.map((id) => ({ type: 'status-groups', id }));
} }
taskGroup.relationships.solvers.data = solvers; taskGroup.relationships.solvers.data = solvers;
await this.createTaskGroup({ taskGroup }); await this.createTaskGroup({ taskGroup });
this.companionSuccess({ info: this.$gettext('Aufgaben wurden verteilt.') }); this.companionSuccess({ info: this.$gettext('Aufgaben wurden verteilt.') });
this.$emit('newtask'); this.$emit('newtask');
this.distributing = false;
this.setShowTasksDistributeDialog(false); this.setShowTasksDistributeDialog(false);
}, },
validateSolvers() { validateSolvers() {
if ( if (
......
...@@ -7,13 +7,15 @@ ...@@ -7,13 +7,15 @@
<MountingPortal mountTo="#courseware-action-widget" name="sidebar-actions" v-if="userIsTeacher"> <MountingPortal mountTo="#courseware-action-widget" name="sidebar-actions" v-if="userIsTeacher">
<courseware-tasks-action-widget /> <courseware-tasks-action-widget />
</MountingPortal> </MountingPortal>
<courseware-companion-overlay />
</div> </div>
</template> </template>
<script> <script>
import CoursewareTasksActionWidget from './CoursewareTasksActionWidget.vue'; import CoursewareTasksActionWidget from './CoursewareTasksActionWidget.vue';
import CoursewareDashboardTasks from './CoursewareDashboardTasks.vue' import CoursewareDashboardTasks from './CoursewareDashboardTasks.vue';
import CoursewareDashboardStudents from './CoursewareDashboardStudents.vue' import CoursewareDashboardStudents from './CoursewareDashboardStudents.vue';
import CoursewareCompanionOverlay from './CoursewareCompanionOverlay.vue';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
...@@ -21,6 +23,7 @@ export default { ...@@ -21,6 +23,7 @@ export default {
CoursewareTasksActionWidget, CoursewareTasksActionWidget,
CoursewareDashboardTasks, CoursewareDashboardTasks,
CoursewareDashboardStudents, CoursewareDashboardStudents,
CoursewareCompanionOverlay,
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
......
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