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>
|
<h1 class="survey-page__title">{{title}}</h1>
|
||||||
<survey :survey='survey'></survey>
|
<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">
|
<div v-if="surveyComplete">
|
||||||
<a class="button button--primary" @click="reopen">Übung bearbeiten</a>
|
<a class="button button--primary" @click="reopen">Übung bearbeiten</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -20,6 +20,9 @@
|
||||||
import Solution from '@/components/content-blocks/Solution';
|
import Solution from '@/components/content-blocks/Solution';
|
||||||
|
|
||||||
import {extractSurveySolutions} from '@/helpers/survey-solutions';
|
import {extractSurveySolutions} from '@/helpers/survey-solutions';
|
||||||
|
import {isTeacher} from '@/helpers/is-teacher';
|
||||||
|
|
||||||
|
import {meQuery} from '@/graphql/queries';
|
||||||
|
|
||||||
const Survey = SurveyVue.Survey;
|
const Survey = SurveyVue.Survey;
|
||||||
|
|
||||||
|
|
@ -35,7 +38,10 @@
|
||||||
return {
|
return {
|
||||||
survey: this.initSurvey(),
|
survey: this.initSurvey(),
|
||||||
title: '',
|
title: '',
|
||||||
module: {}
|
module: {},
|
||||||
|
me: {
|
||||||
|
permissions: []
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -61,6 +67,9 @@
|
||||||
return this.survey.currentPage && this.survey.currentPage.elements
|
return this.survey.currentPage && this.survey.currentPage.elements
|
||||||
? this.survey.currentPage.elements.reduce(extractSurveySolutions, [])
|
? this.survey.currentPage.elements.reduce(extractSurveySolutions, [])
|
||||||
: []
|
: []
|
||||||
|
},
|
||||||
|
isTeacher() {
|
||||||
|
return isTeacher(this);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -173,7 +182,8 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
me: meQuery
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue