This commit is contained in:
PMKuipers 2024-02-19 11:34:40 +01:00
parent e1c6d07b2c
commit 8f6d48b981
6 changed files with 40 additions and 32 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -163,10 +163,14 @@ export default {
);
for(const student of group.users){
self.studentresults[student.id] = {
loading: true,
results: [],
};
self.$set(
self.studentresults,
student.id,
{
loading: true,
results: [],
}
);
call([{
methodname: 'local_treestudyplan_get_report_data',
args: { pageid: self.structure.page.id,
@ -215,7 +219,8 @@ export default {
<q-studentresults v-for="student in group.users"
:student='student'
:structure='structure'
:results='studentresults[student.id]'
:results='studentresults[student.id].results'
:loading='studentresults[student.id].loading'
:expansion='expansioninfo'
></q-studentresults>
</template>
@ -355,10 +360,14 @@ export default {
type: Object,
},
results: {
type: Object
},
type: Array,
},
loading: {
type: Boolean,
default: false
},
expansion: {
type: Object
type: Object,
},
},
data() {
@ -440,7 +449,7 @@ export default {
const list = [];
for (const item of line.items) {
let newitm = item;
for (const itm of this.results.results) {
for (const itm of this.results) {
if (item.id == itm.id) {
newitm = itm;
break;
@ -451,6 +460,7 @@ export default {
return list;
}
},
/* https://css-tricks.com/position-sticky-and-table-headers/ */
template: `
<div class='q-student-results'>
<div class='q-studentname '><span>{{student.firstname}} {{student.lastname}}</span></div>
@ -461,21 +471,16 @@ export default {
<div class='q-item-results' v-for='item in useritems(l)'>
<div v-if="expansion.items[item.id].expanded" class='q-result-details'>
<div class='q-result q-overviewresult'>
<template v-if='!item.course.enrolled'>
<template v-if="loading">
<div class="spinner-border spinner-border-sm text-info" role="status"></div>
</template>
<template v-else-if='!item.course.enrolled'>
<i v-b-popover.top
class="r-course-result fa fa-exclamation-triangle t-not-enrolled-alert"
:title="text.student_not_tracked"></i>
</template>
<template v-else-if='hasprogressinfo(item)'>
<r-progress-circle v-if='["failed", "progress","incomplete"].includes(item.completion)'
:value='courseprogress(item)'
:max='1'
:min='0'
:class="'r-course-result r-completion-'+item.completion"
:icon='circle_icon(item.completion)'
:title="text['completion_'+item.completion]"
></r-progress-circle>
<i v-else v-b-popover.top
<i v-b-popover.top
:class="'r-course-result fa fa-'+completion_icon(item.completion)+
' r-completion-'+item.completion"
:title="text['completion_'+item.completion]"></i>
@ -494,21 +499,16 @@ export default {
</div>
</div>
<div v-else class='q-result q-overviewresult'>
<template v-if='!item.course.enrolled'>
<template v-if="loading">
<div class="spinner-border spinner-border-sm text-info" role="status"></div>
</template>
<template v-else-if='!item.course.enrolled'>
<i v-b-popover.top
class="r-course-result fa fa-exclamation-triangle t-not-enrolled-alert"
:title="text.student_not_tracked"></i>
</template>
<template v-else-if='hasprogressinfo(item)'>
<r-progress-circle v-if='["failed", "progress","incomplete"].includes(item.completion)'
:value='courseprogress(item)'
:max='1'
:min='0'
:class="'r-course-result r-completion-'+item.completion"
:icon='circle_icon(item.completion)'
:title="text['completion_'+item.completion]"
></r-progress-circle>
<i v-else v-b-popover.top
<i v-b-popover.top
:class="'r-course-result fa fa-'+completion_icon(item.completion)+
' r-completion-'+item.completion"
:title="text['completion_'+item.completion]"></i>

View File

@ -1681,6 +1681,9 @@ body.path-local-treestudyplan .editmode-switch-form > * {
.path-local-treestudyplan .q-header .q-result,
.path-local-treestudyplan .q-student-results .q-result {
height: 2rem;
display: flex;
justify-content: center;
padding-top: 0.25rem;
}
.path-local-treestudyplan .q-header,
.path-local-treestudyplan .q-student-results {

View File

@ -38,7 +38,9 @@
.q-result {
height: 2rem;
display: flex;
justify-content: center;
padding-top: 0.25rem;
}
}

View File

@ -1681,6 +1681,9 @@ body.path-local-treestudyplan .editmode-switch-form > * {
.path-local-treestudyplan .q-header .q-result,
.path-local-treestudyplan .q-student-results .q-result {
height: 2rem;
display: flex;
justify-content: center;
padding-top: 0.25rem;
}
.path-local-treestudyplan .q-header,
.path-local-treestudyplan .q-student-results {