Display solutions for teachers always
This commit is contained in:
parent
bfbe0b38ff
commit
e940066db8
|
|
@ -0,0 +1,3 @@
|
|||
export const isTeacher = (self) => {
|
||||
return self.me.permissions.includes('users.can_manage_school_class_content')
|
||||
};
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<h1 class="survey-page__title">{{title}}</h1>
|
||||
<survey :survey='survey'></survey>
|
||||
|
||||
<solution :value="solution" v-if="module.solutionsEnabled"></solution>
|
||||
<solution :value="solution" v-if="module.solutionsEnabled || isTeacher"></solution>
|
||||
<div v-if="surveyComplete">
|
||||
<a class="button button--primary" @click="reopen">Übung bearbeiten</a>
|
||||
</div>
|
||||
|
|
@ -20,6 +20,9 @@
|
|||
import Solution from '@/components/content-blocks/Solution';
|
||||
|
||||
import {extractSurveySolutions} from '@/helpers/survey-solutions';
|
||||
import {isTeacher} from '@/helpers/is-teacher';
|
||||
|
||||
import {meQuery} from '@/graphql/queries';
|
||||
|
||||
const Survey = SurveyVue.Survey;
|
||||
|
||||
|
|
@ -35,7 +38,10 @@
|
|||
return {
|
||||
survey: this.initSurvey(),
|
||||
title: '',
|
||||
module: {}
|
||||
module: {},
|
||||
me: {
|
||||
permissions: []
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -61,6 +67,9 @@
|
|||
return this.survey.currentPage && this.survey.currentPage.elements
|
||||
? this.survey.currentPage.elements.reduce(extractSurveySolutions, [])
|
||||
: []
|
||||
},
|
||||
isTeacher() {
|
||||
return isTeacher(this);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -173,7 +182,8 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
me: meQuery
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue