Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • j.michal/grady
1 result
Show changes
Commits on Source (4)
Showing
with 51 additions and 30 deletions
......@@ -31,13 +31,14 @@
<script lang="ts">
import Vue from 'vue'
import Component, { mixins } from 'vue-class-component'
import { Watch } from 'vue-property-decorator'
import { mapState } from 'vuex'
import { Authentication } from '@/store/modules/authentication'
import { actions } from '@/store/actions'
import { getters } from '@/store/getters'
@Component({
name: 'auto-logout',
computed: {...mapState(['lastAppInteraction'])}
name: 'auto-logout'
})
export default class AutoLogout extends Vue {
timer = 0
......@@ -46,6 +47,7 @@ export default class AutoLogout extends Vue {
get lastTokenRefreshTry () { return Authentication.state.lastTokenRefreshTry }
get refreshingToken () { return Authentication.state.refreshingToken }
get jwtTimeDelta () { return Authentication.state.jwtTimeDelta }
get lastAppInteraction () { return getters.state.lastAppInteraction }
logout () {
this.logoutDialog = false
......@@ -57,7 +59,8 @@ export default class AutoLogout extends Vue {
this.logoutDialog = false
}
lastAppInteraction () {
@Watch('lastAppInteraction')
onLastInteractionChange () {
const timeSinceLastRefresh = Date.now() - this.lastTokenRefreshTry
const timeDelta = this.jwtTimeDelta
// refresh jwt if it's older than 20% of his maximum age
......@@ -67,10 +70,6 @@ export default class AutoLogout extends Vue {
}
}
watch () {
this.lastAppInteraction()
}
mounted () {
this.timer = setInterval(() => {
const timeDialogAppearsBeforeLogout = Math.min(600 * 1e3,
......
......@@ -5,7 +5,7 @@
</v-card-title>
<div v-if="loaded">
<ul class="inline-list mx-3">
<li>Submissions per student: <span>{{statistics.submissionsPerStudent}}</span></li>
<li>Submissions per participant: <span>{{statistics.submissionsPerStudent}}</span></li>
<li>Submissions per type: <span>{{statistics.submissionsPerType}}</span></li>
<li>Curr. mean score:
<span>
......
......@@ -2,7 +2,7 @@
<v-card>
<v-card-title>
<span class="title">
Students
Participants
</span>
<student-list-reverse-mapper class="ml-4"/>
<v-spacer/>
......@@ -53,8 +53,8 @@
<v-icon small v-if="!props.item.isActive">lock</v-icon>
<v-icon small v-else>lock_open</v-icon>
</template>
<span v-if="!props.item.isActive">Student doesn't have access.</span>
<span v-else>Student has access.</span>
<span v-if="!props.item.isActive">Participant doesn't have access.</span>
<span v-else>Participant has access.</span>
</v-tooltip>
</td>
<td
......
......@@ -27,8 +27,8 @@ export default {
return [
{
title: this.studentsActive
? 'Remove student access'
: 'Grant student access',
? 'Remove participant access'
: 'Grant participant access',
action: this.changeStudentsAccess
}
]
......
......@@ -93,6 +93,10 @@ export default {
},
feedback: {
type: Object
},
ignoreHiddenState: {
type: Boolean,
default: false,
}
},
computed: {
......@@ -154,6 +158,7 @@ export default {
SubmissionNotes.RESET_STATE()
SubmissionNotes.SET_SUBMISSION(this.submissionObj)
SubmissionNotes.SET_ORIG_FEEDBACK(this.feedbackObj)
SubmissionNotes.SET_SHOW_FEEDBACK(this.ignoreHiddenState ? true : !SubmissionNotes.state.hasOrigFeedback)
}
},
watch: {
......
......@@ -11,7 +11,7 @@
>
<correction-help-card/>
</v-dialog>
<span class="title">Student submission</span>
<span class="title">Participant submission</span>
<toggle-feedback-visibility-button/>
<v-spacer/>
<v-tooltip top>
......
......@@ -5,21 +5,26 @@
</v-btn>
</template>
<script>
<script lang="ts">
import Vue from 'vue'
import { SubmissionNotes } from '@/store/modules/submission-notes'
import { createComputedGetterSetter } from '@/util/helpers'
import { getters } from '@/store/getters'
import Component from 'vue-class-component';
export default {
name: 'toggle-feedback-visibility-button',
computed: {
showFeedback: createComputedGetterSetter({
path: 'SubmissionNotes.ui.showFeedback',
mutation: SubmissionNotes.SET_SHOW_FEEDBACK
})
@Component
export default class ToggleFeedbackVisibilityButton extends Vue {
get showFeedback () {
return getters.state.SubmissionNotes.ui.showFeedback
}
set showFeedback (val) {
SubmissionNotes.SET_SHOW_FEEDBACK(val)
}
}
</script>
<style scoped>
</style>
......@@ -30,8 +30,10 @@
type="password"
required
/>
<v-btn @click="registerDialog = true" id="register">register</v-btn>
<v-btn :loading="loading" type="submit" color="primary">Access</v-btn>
<v-layout class="btn-container">
<v-btn @click="registerDialog = true" id="register">Register</v-btn>
<v-btn :loading="loading" type="submit" color="primary">Access</v-btn>
</v-layout>
</v-form>
</v-flex>
</v-layout>
......@@ -88,4 +90,13 @@ export default {
</script>
<style scoped>
.v-btn {
margin: 0px;
}
.btn-container {
display: flex;
flex-wrap: nowrap;
justify-content: space-around;
}
</style>
......@@ -5,6 +5,7 @@
:submission-without-assignment="submission"
:feedback="submission.feedback"
@feedbackCreated="refresh"
:ignoreHiddenState="true"
/>
<submission-tests
:tests="submission.tests"
......
......@@ -31,8 +31,8 @@ export default {
return {
subGeneralNavItems: [
{
name: 'Students',
route: '/student-overview',
name: 'Participants',
route: '/participant-overview',
icon: 'people'
},
{
......
......@@ -124,17 +124,17 @@ const router = new Router({
]
},
{
path: 'student-overview',
path: 'participant-overview',
beforeEnter: reviewerOnly,
component: StudentOverviewPage,
children: [
{
path: '',
name: 'student-overview',
name: 'participant-overview',
component: StudentListHelpCard
},
{
path: 'student/:studentPk/submission/:submissionPk',
path: 'participant/:studentPk/submission/:submissionPk',
name: 'submission-side-view',
component: StudentSubmissionSideView,
meta: {
......
......@@ -106,7 +106,7 @@ class FrontPageTestsReviewer(UntestedParent.FrontPageTestsTutorReviewer):
drawer = self.browser.find_element_by_class_name('v-navigation-drawer')
links = extract_hrefs_hashes(drawer.find_elements_by_tag_name('a'))
self.assertTrue(all(link in links for link in
['/home', '/feedback', '/student-overview', '/tutor-overview']))
['/home', '/feedback', '/participant-overview', '/tutor-overview']))
task_title = drawer.find_element_by_class_name('v-toolbar__title')
self.assertEqual('Tasks', task_title.text)
footer = drawer.find_element_by_class_name('sidebar-footer')
......