Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass string updates following UX writing and ditto review #12312

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
951f2ba
First pass string updates following UX writing and ditto review
marcellamaki Jun 18, 2024
2145f5a
Additional edit to string file for string freeze
marcellamaki Jun 19, 2024
3adaaaf
Refactor resource selection to simplify UX. validation against max nu…
marcellamaki Jun 19, 2024
b38c9c9
Fix broken string reference keys
marcellamaki Jun 19, 2024
583e8e2
Fix checkbox bug
marcellamaki Jun 19, 2024
3f68cf8
Display number of replacement questions available. Disable replacemen…
marcellamaki Jun 19, 2024
15d16b9
Cleanup now-unused insufficient replacements modal
marcellamaki Jun 19, 2024
5a50ffe
Remove stray reference to NotEnoughReplacementsModal
marcellamaki Jun 19, 2024
6d4a533
Reinstate v-else condition which should not have been removed
marcellamaki Jun 20, 2024
fb7b65c
reinstate parameterization in string
marcellamaki Jun 20, 2024
8966326
clean up unused strings
marcellamaki Jun 20, 2024
37a2689
remove unused function
marcellamaki Jun 20, 2024
8e832d5
reinstate string I shouldn't have deleted
marcellamaki Jun 20, 2024
8dca44e
Ensure sectionTitle displays properly and doesn't break question repl…
marcellamaki Jun 20, 2024
213baa1
More string modifications
marcellamaki Jun 20, 2024
169afa2
linting cleanup
marcellamaki Jun 20, 2024
0fb356e
fix not-returned hasCheckbox value
marcellamaki Jun 20, 2024
00c010f
Make sure activeSection title related values are properly imported an…
marcellamaki Jun 20, 2024
19a74e7
Update unused question messaging to be consistent across all node types.
rtibbles Jun 20, 2024
e80e52f
Add additional strings to explain no learner or no resources scenarios
marcellamaki Jun 20, 2024
cccf97f
Ensure simplified replacement direction string is used
marcellamaki Jun 20, 2024
20023b2
Remove duplicative header
marcellamaki Jun 20, 2024
99ab30a
Remove unused exercises variable passed into string
marcellamaki Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just define this as a multiple of the constant above - either that, or it be dynamic depending on how many questions you are trying to select. But this is not required for string freeze.

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