Skip to content
Snippets Groups Projects
Commit 6765ddf5 authored by Jakob Dieterle's avatar Jakob Dieterle
Browse files

not working unfortunately

parent 307c54fb
Branches
Tags
1 merge request!291Resolve "Add dropdown to participantspage to set students groups"
Pipeline #321408 passed
...@@ -89,6 +89,8 @@ class UserAccount(AbstractUser): ...@@ -89,6 +89,8 @@ class UserAccount(AbstractUser):
return self.role == 'Reviewer' return self.role == 'Reviewer'
def set_groups(self, groups): def set_groups(self, groups):
print("\n\n\n\n\n\n\n")
print(groups)
if groups == [] or groups is None: if groups == [] or groups is None:
self.exercise_groups.set(group_default()) self.exercise_groups.set(group_default())
else: else:
......
...@@ -260,10 +260,9 @@ export default { ...@@ -260,10 +260,9 @@ export default {
'getStudents' 'getStudents'
]), ]),
async userAccountGroups(student) { async userAccountGroups(student) {
const groups = await (await fetchUser(student.pk)).exerciseGroups return await (await fetchUser(student.userPk)).exerciseGroups
return groups
}, },
getStudentListItems () { async getStudentListItems () {
if (!this.loading) { if (!this.loading) {
let filteredStudents = this.students let filteredStudents = this.students
if (this.selectedGroup !== null) { if (this.selectedGroup !== null) {
...@@ -272,8 +271,9 @@ export default { ...@@ -272,8 +271,9 @@ export default {
return userGroups.some(group => group.pk === this.selectedGroup.pk) return userGroups.some(group => group.pk === this.selectedGroup.pk)
}) })
} }
console.log(filteredStudents)
this.studentList = Object.values(filteredStudents).map(student => { this.studentList = Object.values(filteredStudents).map(student => {
console.log(student)
return { return {
pk: student.pk, pk: student.pk,
user: student.user, user: student.user,
...@@ -281,7 +281,7 @@ export default { ...@@ -281,7 +281,7 @@ export default {
exam: student.exam, exam: student.exam,
name: student.name, name: student.name,
isActive: student.isActive, isActive: student.isActive,
exerciseGroup: [], exerciseGroups: ["3175670b-c405-4756-9c5d-7bd50143f0f8"],
matrikelNo: student.matrikelNo, matrikelNo: student.matrikelNo,
...this.reduceArrToDict(student.submissions, 'type'), ...this.reduceArrToDict(student.submissions, 'type'),
total: this.sumSubmissionScores(student.submissions) total: this.sumSubmissionScores(student.submissions)
...@@ -293,6 +293,8 @@ export default { ...@@ -293,6 +293,8 @@ export default {
this.user = await fetchUser(student.userPk) this.user = await fetchUser(student.userPk)
}, },
setExerciseGroups (groups, student) { setExerciseGroups (groups, student) {
console.log(groups)
groups = groups.shift()
this.getUser(student).then(() => { this.getUser(student).then(() => {
setGroups(this.user.pk, groups) setGroups(this.user.pk, groups)
}) })
......
...@@ -193,6 +193,7 @@ export default class TutorList extends Vue { ...@@ -193,6 +193,7 @@ export default class TutorList extends Vue {
} }
setExerciseGroups (groups: Group[], tutor: Tutor){ setExerciseGroups (groups: Group[], tutor: Tutor){
console.log(groups)
setGroups(tutor.pk, groups).then(() => { setGroups(tutor.pk, groups).then(() => {
TutorOverview.getTutors() TutorOverview.getTutors()
}).catch(() => { }).catch(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment