Language finetuning in completion list

This commit is contained in:
PMKuipers 2023-09-01 12:27:56 +02:00
parent 4708860f9f
commit 6f71cfd4b3
10 changed files with 79 additions and 85 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,6 @@ import Vue from './vue/vue';
import RVComponents from './report-viewer-components';
Vue.use(RVComponents);
import TSComponents from './treestudyplan-components';
import Debugger from './util/debugger';
import {ProcessStudyplans} from './studyplan-processor';

View File

@ -15,9 +15,6 @@ import Debugger from './util/debugger';
import {load_strings} from './util/string-helper';
import {ProcessStudyplan} from './studyplan-processor';
import TSComponents from './treestudyplan-components';
Vue.use(TSComponents);
import RVComponents from './report-viewer-components';
Vue.use(RVComponents);
import ModalComponents from './modedit-modal';

View File

@ -15,6 +15,8 @@ import {svgarcpath} from './util/svgarc';
import Debugger from './util/debugger';
import Config from 'core/config';
import TSComponents from './treestudyplan-components';
// Make π available as a constant
const π = Math.PI;
// Gravity value for arrow lines - determines how much a line is pulled in the direction of the start/end before changing direction
@ -22,6 +24,7 @@ const LINE_GRAVITY = 1.3;
export default {
install(Vue/*,options*/){
Vue.use(TSComponents);
let debug = new Debugger("treestudyplan-viewer");
debug.warn(Config);
@ -64,12 +67,27 @@ export default {
ungraded: "ungraded",
aggregation_all: "aggregation_all",
aggregation_any: "aggregation_any",
aggregation_one: "aggregation_one",
aggregation_overall_all: "aggregation_overall_all",
aggregation_overall_any: "aggregation_overall_any",
aggregation_overall_one: "aggregation_overall_one",
completion_not_configured: "completion_not_configured",
configure_completion: "configure_completion",
view_completion_report: "view_completion_report",
completion_incomplete: "completion_incomplete",
completion_failed: "completion_failed",
completion_pending: "completion_pending",
completion_progress: "completion_progress",
completion_completed: "completion_completed",
completion_good: "completion_good",
completion_excellent: "completion_excellent",
view_feedback: "view_feedback",
coursetiming_past: "coursetiming_past",
coursetiming_present: "coursetiming_present",
coursetiming_future: "coursetiming_future",
required_goal: "required_goal",
student_not_tracked: "student_not_tracked",
completion_not_enabled: "completion_not_enabled",
},
badge: {
share_badge: "share_badge",
@ -838,19 +856,6 @@ export default {
}
},
created(){
const self = this;
// Get text strings for condition settings
let stringkeys = [];
for(const key in this.text){
stringkeys.push({ key: key, component: 'local_treestudyplan'});
}
get_strings(stringkeys).then(function(strings){
let i = 0;
for(const key in self.text){
self.text[key] = strings[i];
i++;
}
});
},
methods: {
completion_icon(completion) {
@ -1111,38 +1116,10 @@ export default {
},
data() {
return {
text: {
completion_incomplete: "completion_incomplete",
completion_failed: "completion_failed",
completion_pending: "completion_pending",
completion_progress: "completion_progress",
completion_completed: "completion_completed",
completion_good: "completion_good",
completion_excellent: "completion_excellent",
view_feedback: "view_feedback",
coursetiming_past: "coursetiming_past",
coursetiming_present: "coursetiming_present",
coursetiming_future: "coursetiming_future",
required_goal: "required_goal",
student_not_tracked: "student_not_tracked",
completion_not_enabled: "completion_not_enabled",
},
text: strings.completion,
};
},
created(){
const self = this;
// Get text strings for condition settings
let stringkeys = [];
for(const key in this.text){
stringkeys.push({ key: key, component: 'local_treestudyplan'});
}
get_strings(stringkeys).then(function(strings){
let i = 0;
for(const key in self.text){
self.text[key] = strings[i];
i++;
}
});
},
computed: {
},
@ -1161,16 +1138,41 @@ export default {
return "circle-o";
}
},
completion_tag(cgroup){
return cgroup.completion?'completed':'incomplete';
}
},
hasCompletions() {
if(this.value.conditions) {
for(const cgroup of this.value.conditions){
if(cgroup.items && cgroup.items.length > 0){
return true;
}
}
}
return false;
},
},
template: `
<table class="r-item-course-grade-details">
<tr v-if="hasCompletions">
<td colspan='2'
><span v-if="value.conditions.length <= 1">{{ text.aggregation_overall_one }}</span
><span v-else if="value.aggregation == 'all'">{{ text.aggregation_overall_all}}</span
><span v-else>{{ text.aggregation_overall_any }}</span
></td>
</tr>
<tr v-else>
<td colspan='2'>{{text.completion_not_configured}}!
</td>
</tr>
<template v-for='cgroup in value.conditions' v-if='value.enabled && value.tracked'>
<tr>
<th colspan='2'>{{cgroup.title}}</th>
<th colspan='2'><span v-if="cgroup.items.length > 1"
><span v-if="cgroup.aggregation == 'all'">{{ text.aggregation_all}}</span
><span v-else>{{ text.aggregation_any}}</span></span
><span v-else>{{ text.aggregation_one }}</span>
{{ cgroup.title.toLowerCase() }}:
</th>
<th><r-progress-circle v-if="cgroup.progress < cgroup.count"
:value='cgroup.progress'
:max='cgroup.count'
@ -1335,19 +1337,7 @@ export default {
}
},
created(){
const self = this;
// Get text strings for condition settings
let stringkeys = [];
for(const key in this.text){
stringkeys.push({ key: key, component: 'local_treestudyplan'});
}
get_strings(stringkeys).then(function(strings){
let i = 0;
for(const key in self.text){
self.text[key] = strings[i];
i++;
}
});
},
methods: {
course_grading_state(){
@ -1753,8 +1743,11 @@ export default {
template: `
<table class="r-item-course-grade-details">
<tr v-if="hasCompletions">
<td colspan='2'><span v-if="value.aggregation == 'all'">{{ text.aggregation_overall_all}}</span
><span v-else>{{ text.aggregation_overall_any}}</span></td>
<td colspan='2'
><span v-if="value.conditions.length <= 1">{{ text.aggregation_overall_one }}</span
><span v-else if="value.aggregation == 'all'">{{ text.aggregation_overall_all}}</span
><span v-else>{{ text.aggregation_overall_any }}</span
></td>
</tr>
<tr v-else>
<td colspan='2'>{{text.completion_not_configured}}!
@ -1767,8 +1760,10 @@ export default {
<tr>
<th colspan='2'><span v-if="cgroup.items.length > 1"
><span v-if="cgroup.aggregation == 'all'">{{ text.aggregation_all}}</span
><span v-else>{{ text.aggregation_any}}</span></span>
{{cgroup.title}}</th>
><span v-else>{{ text.aggregation_any}}</span></span
><span v-else>{{ text.aggregation_one }}</span>
{{ cgroup.title.toLowerCase() }}:
</th>
</tr>
<tr v-for='ci in cgroup.items'>
<td><span v-html='ci.details.criteria'></span>

View File

@ -16,6 +16,8 @@ import Debugger from './util/debugger';
import {download,upload} from './downloader';
import {ProcessStudyplan} from './studyplan-processor';
import TSComponents from './treestudyplan-components';
const STUDYPLAN_EDITOR_FIELDS =
['name','shortname','description','idnumber','context_id', 'aggregation','aggregation_config'];
@ -35,7 +37,7 @@ const datechanger_globals = {
export default {
STUDYPLAN_EDITOR_FIELDS: STUDYPLAN_EDITOR_FIELDS, // make copy available in plugin
install(Vue/*,options*/){
Vue.use(TSComponents);
let debug = new Debugger("treestudyplan-editor");
/************************************

View File

@ -68,7 +68,6 @@ $string['invite_mail_text'] = '
<p>Dear {$a->invitee},</p>
<p>I\'d like to invite you to view my study plan and progess.</p>
<p>The link below gives you access at any time to view the most recent results. Feel free to bookmark this link in your browser.</p>
<p>Click the link below to view the study plan:<br>
<a href="{$a->link}">{$a->link}</a></p>
<p>Kind regards,<br>
@ -300,10 +299,13 @@ $string["advanced_disable_autoenddate_title"] = 'Disable automatic end date';
$string["advanced_disable_autoenddate_desc"] = 'Disable the default on automatic end date function weekly topics have set in all courses in the study plan';
$string["advanced_disable_autoenddate_button"] = 'Disable';
$string["myreport_teachermode"] = 'Study plans I am teaching';
$string["aggregation_overall_all"] = "Complete all of the categories";
$string["aggregation_overall_any"] = "Complete one or more of the categories";
$string["aggregation_all"] = "Complete all";
$string["aggregation_any"] = "Complete one or more";
$string["aggregation_overall_all"] = "Complete all of the following to complete this course";
$string["aggregation_overall_any"] = "Complete one or more of the following to complete this course";
$string["aggregation_overall_one"] = "Complete the following to complete this course";
$string["aggregation_all"] = "Complete all ";
$string["aggregation_any"] = "Complete one or more ";
$string["aggregation_one"] = "Achieve ";
$string["share_badge"] = "Share badge";
$string["dateissued"] = "Issued on";

View File

@ -67,12 +67,9 @@ $string['invite_mail_subject'] = 'Gedeeld rapport van {$a->sender}';
$string['invite_mail_text'] = '
<p>Beste {$a->invitee}, </p>
<p>Bij deze wil ik je graag uitnodigen om mijn studieplan en studievoortgang te bekijken.</p>
<p>Via de link hieronder kun je op elk moment het meest recente resultatenoverzicht bekijken. Je kunt deze link ook bewaren als bookmark in je browser.</p>
<p>Klik op de volgende link om het studieplan te bekijken:<br>
<a href="{$a->link}">{$a->link}</a></p>
<p>Met vriendelijke groet, <br>
{$a->sender}</p>
';
@ -212,7 +209,6 @@ $string['name'] = 'Naam';
$string['context'] = 'Categorie';
$string['error'] = "Fout";
$string['ungraded'] = 'Nog beoordelen';
$string['graded'] = 'Beoordeeld';
$string['allgraded'] = 'Alles beoordeeld';
@ -304,10 +300,13 @@ $string["advanced_disable_autoenddate_title"] = 'Automatische einddatum uitschak
$string["advanced_disable_autoenddate_desc"] = 'Schakel de optie automatische einddatum uit in alle cursussen in dit studieplan';
$string["advanced_disable_autoenddate_button"] = 'Uitschakelen';
$string["myreport_teachermode"] = 'Studieplannen waar ik les aan geef';
$string["aggregation_overall_all"] = "Behaal alle categorieë";
$string["aggregation_overall_any"] = "Behaal één of meer categorieën";
$string["aggregation_all"] = "Alles behalen";
$string["aggregation_any"] = "Eén of meer behalen";
$string["aggregation_overall_all"] = "Je voltooit de module door alles van het volgende";
$string["aggregation_overall_any"] = "Je voltooit de module door één of meer van het volgende";
$string["aggregation_overall_one"] = "Je voltooit de module door het volgende";
$string["aggregation_all"] = "Voltooi alle ";
$string["aggregation_any"] = "Voltooi één van deze ";
$string["aggregation_one"] = "Behaal ";
$string["share_badge"] = "Bewijs delen";
$string["dateissued"] = "Afgegeven op";