Skip to content

Commit

Permalink
Merge pull request #12312 from marcellamaki/post-ditto-review-strings…
Browse files Browse the repository at this point in the history
…-and-ui-changes

First pass string updates following UX writing and ditto review
  • Loading branch information
rtibbles authored Jun 20, 2024
2 parents 8e46ec2 + 99ab30a commit d887f89
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 386 deletions.
2 changes: 2 additions & 0 deletions kolibri/core/assets/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,5 @@ export const Presets = Object.freeze({
// This should be kept in sync with the value in
// kolibri/core/exams/constants.py
export const MAX_QUESTIONS_PER_QUIZ_SECTION = 50;
// this is not used for the actual exam model
export const MAX_QUESTION_OPTIONS_PER_QUIZ_SECTION = 500;
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>

<div>
<p :style="addQuizSectionsStyles">
{{ addQuizSections$() }}
</p>

<KGrid :style="tabsWrapperStyles">
<KGridItem
Expand Down Expand Up @@ -142,8 +139,11 @@
:layout4="{ span: 2 }"
>
<h2 :style="{ color: $themeTokens.annotation }">
{{ questionList$() }}
{{ questionsLabel$() }}
</h2>
<p :style="{ color: $themeTokens.annotation, fontSize: '.75rem' }">
{{ numberOfReplacementsAvailable$({ count: replacementQuestionPool.length }) }}
</p>
</KGridItem>
<KGridItem
class="right-side-heading"
Expand Down Expand Up @@ -195,7 +195,7 @@
<KIconButton
icon="refresh"
:tooltip="replaceAction$()"
:disabled="selectedActiveQuestions.length === 0"
:disabled="!canReplaceQuestions"
@click="handleReplaceSelection()"
/>
<KIconButton
Expand Down Expand Up @@ -308,14 +308,6 @@
</div>

</KTabsPanel>

<NotEnoughResourcesModal
v-if="showNotEnoughResourcesModal"
:selectedQuestions="selectedActiveQuestions"
:availableQuestions="replacementQuestionPool"
@close="showNotEnoughResourcesModal = false"
@addResources="redirectToSelectResources"
/>
<KModal
v-if="showDeleteConfirmation"
:title="deleteSectionLabel$()"
Expand Down Expand Up @@ -356,7 +348,6 @@
import commonCoach from '../../common';
import { PageNames } from '../../../constants';
import TabsWithOverflow from './TabsWithOverflow';
import NotEnoughResourcesModal from './NotEnoughResourcesModal';
const logger = logging.getLogger(__filename);
Expand All @@ -370,14 +361,12 @@
DragSortWidget,
DragHandle,
TabsWithOverflow,
NotEnoughResourcesModal,
},
mixins: [commonCoreStrings, commonCoach],
setup() {
const {
sectionLabel$,
selectAllLabel$,
addQuizSections$,
addSectionLabel$,
quizSectionsLabel$,
addQuestionsLabel$,
Expand All @@ -387,10 +376,10 @@
editSectionLabel$,
deleteSectionLabel$,
replaceAction$,
questionList$,
questionsLabel$,
numberOfReplacementsAvailable$,
sectionDeletedNotification$,
deleteConfirmation$,
updateResources$,
changesSavedSuccessfully$,
questionsDeletedNotification$,
expandAll$,
Expand Down Expand Up @@ -448,7 +437,6 @@
expandAll$,
collapseAll$,
selectAllLabel$,
addQuizSections$,
quizSectionsLabel$,
addSectionLabel$,
addQuestionsLabel$,
Expand All @@ -459,7 +447,8 @@
deleteSectionLabel$,
questionDeletionConfirmation$,
replaceAction$,
questionList$,
questionsLabel$,
numberOfReplacementsAvailable$,
sectionDeletedNotification$,
deleteConfirmation$,
changesSavedSuccessfully$,
Expand All @@ -474,7 +463,6 @@
addSection,
removeSection,
updateQuiz,
updateResources$,
displaySectionTitle,
displayQuestionTitle,
Expand Down Expand Up @@ -504,12 +492,11 @@
userSelect: this.dragActive ? 'none!important' : 'text',
};
},
addQuizSectionsStyles() {
return {
margin: '0 0 1rem 0',
padding: '0 0 1rem 0',
borderBottom: `1px solid ${this.$themeTokens.fineLine}`,
};
canReplaceQuestions() {
return (
this.selectedActiveQuestions.length > 0 &&
this.selectedActiveQuestions.length <= this.replacementQuestionPool.length
);
},
tabsWrapperStyles() {
return {
Expand Down Expand Up @@ -701,10 +688,6 @@
})
);
},
redirectToSelectResources() {
this.showNotEnoughResourcesModal = false;
this.openSelectResources();
},
},
};
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
<template>

<div class="wrapper">
<h1 class="section-header" :style="{ color: `${$themeTokens.annotation}` }">
{{ activeSectionTitle }}
</h1>
<span
class="divider"
:style="{ borderTop: `solid 1px ${$themeTokens.fineLine}` }"
>
</span>
<h1 class="section-header">
{{ replaceQuestions$() }}
{{ replaceQuestions$({
sectionTitle: displaySectionTitle(activeSection, activeSectionIndex
) }) }}
</h1>
<p>{{ replaceQuestionsHeading$() }}</p>
<span
Expand Down Expand Up @@ -135,7 +129,9 @@
v-if="showReplacementConfirmation"
:submitText="coreString('confirmAction')"
:cancelText="coreString('cancelAction')"
:title="replaceQuestions$()"
:title="replaceQuestions$({
sectionTitle: displaySectionTitle(activeSection, activeSectionIndex)
})"
@cancel="showReplacementConfirmation = false"
@submit="submitReplacement"
>
Expand Down Expand Up @@ -198,7 +194,7 @@
numberOfSelectedReplacements$,
numberOfQuestionsReplaced$,
noUndoWarning$,
selectMoreQuestion$,
selectQuestionsToContinue$,
selectFewerQuestion$,
collapseAll$,
expandAll$,
Expand All @@ -207,6 +203,7 @@
const {
// Computed
activeSection,
activeSectionIndex,
selectedActiveQuestions,
activeResourceMap,
replacementQuestionPool,
Expand Down Expand Up @@ -301,6 +298,7 @@
toggleInReplacements,
activeSection,
activeSectionIndex,
activeSectionTitle,
selectAllReplacementQuestions,
selectedActiveQuestions,
Expand All @@ -327,11 +325,12 @@
noUndoWarning$,
replaceQuestionsExplaination$,
replaceQuestionsHeading$,
selectMoreQuestion$,
selectQuestionsToContinue$,
selectFewerQuestion$,
collapseAll$,
expandAll$,
displayQuestionTitle,
displaySectionTitle,
};
},
computed: {
Expand Down Expand Up @@ -361,13 +360,9 @@
count: this.replacements.length,
total: this.selectedActiveQuestions.length,
});
} else if (unreplacedCount > 0) {
return this.selectMoreQuestion$({
count: unreplacedCount,
});
} else {
return this.selectFewerQuestion$({
count: Math.abs(unreplacedCount),
return this.selectQuestionsToContinue$({
count: this.selectedActiveQuestions.length,
});
}
},
Expand Down
Loading

0 comments on commit d887f89

Please sign in to comment.