diff --git a/resources/vue/components/courseware/CoursewareStructuralElement.vue b/resources/vue/components/courseware/CoursewareStructuralElement.vue index 6642d95802e804f7dcecb6fd16c57a6c1a426c5e..009c34d12981b016be821e91a2d6a4ee3966c647 100755 --- a/resources/vue/components/courseware/CoursewareStructuralElement.vue +++ b/resources/vue/components/courseware/CoursewareStructuralElement.vue @@ -34,6 +34,7 @@ :title="structuralElement.attributes.title" > <span>{{ structuralElement.attributes.title || "–" }}</span> + <span v-if="isTask">[ {{ solverName }} ]</span> </li> </template> <template #breadcrumbFallback> @@ -672,6 +673,7 @@ export default { sortMode: 'structuralElementSortMode', viewMode: 'viewMode', taskById: 'courseware-tasks/byId', + userById: 'users/byId', }), currentId() { @@ -1080,6 +1082,31 @@ export default { return this.taskById({ id: this.structuralElement.relationships.task.data.id }); }, + solver() { + if (this.task) { + const solver = this.task.relationships.solver.data; + if (solver.type === 'users') { + return this.userById({ id: solver.id }); + } + if (solver.type === 'status-groups') { + return this.groupById({ id: solver.id }); + } + } + + return null; + }, + solverName() { + if (this.solver) { + if (this.solver.type === 'users') { + return this.solver.attributes['formatted-name']; + } + if (this.solver.type === 'status-groups') { + return this.solver.attributes.name; + } + } + + return ''; + }, canAddElements() { if (!this.isTask) { return true;