Skip to content

Commit

Permalink
adds notice for quizzes created in older versions of kolibri prior to…
Browse files Browse the repository at this point in the history
… 0.17
  • Loading branch information
AllanOXDi committed Feb 6, 2025
1 parent 4b993e4 commit 7a96110
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
</div>
</div>
<MissingResourceAlert v-if="resource.missing_resource" />
<UiAlert v-if="isFromOldKolibiri">
<span>
{{ warningForQuizFromOldKolibri$() }}
</span>
</UiAlert>
</KPageContainer>

</template>
Expand All @@ -35,14 +40,23 @@
<script>
import { mapState } from 'vuex';
import UiAlert from 'kolibri-design-system/lib/keen/UiAlert';
import MissingResourceAlert from 'kolibri-common/components/MissingResourceAlert';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import BackLink from './BackLink';
export default {
name: 'QuizLessonDetailsHeader',
components: {
MissingResourceAlert,
BackLink,
UiAlert,
},
setup() {
const { warningForQuizFromOldKolibri$ } = searchAndFilterStrings;
return {
warningForQuizFromOldKolibri$,
};
},
props: {
backlink: {
Expand Down Expand Up @@ -72,6 +86,9 @@
resource() {
return this.examOrLesson === 'lesson' ? this.lesson : this.exam;
},
isFromOldKolibiri() {
return this.exam.data_model_version < 3 && this.exam.draft && !this.exam.active;
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
{ label: this.coreString('deleteAction'), value: 'DELETE' },
];
if (!this.exam?.archive) {
if (this.exam?.data_model_version > 2) {
options.unshift({
label: this.exam?.draft
? this.coreString('editAction')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
import { convertExamQuestionSources } from 'kolibri-common/quizzes/utils';
import { QUIZZES_TABS_ID, QuizzesTabs } from '../../../constants/tabsConstants';
import { useCoachTabs } from '../../../composables/useCoachTabs';
import commonCoach from '../../common';
import CoachAppBarPage from '../../CoachAppBarPage';
import { coachStringsMixin } from '../../common/commonCoachStrings';
Expand Down
5 changes: 5 additions & 0 deletions packages/kolibri-common/strings/searchAndFilterStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export const searchAndFilterStrings = createTranslator('SearchAndFilterStrings',
message: 'No resources selected',
context: 'Message displayed when no resources are selected',
},
warningForQuizFromOldKolibri: {
message:
'This quiz was created using an older version of Kolibri and cannot be edited directly. Create a copy of it to edit the resources.',
context: 'Warning message for quizzes created in an older version of Kolibri.',
},
searchInFolder: {
message: "Search in '{folder}'",
context: 'Title for search resources in folder',
Expand Down

0 comments on commit 7a96110

Please sign in to comment.