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