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

Cherry-pick #12485 #12492

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
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
57 changes: 40 additions & 17 deletions kolibri/plugins/learn/assets/src/views/ExamPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
>
<main :class="{ 'column-contents-wrapper': !windowIsSmall }">
<KPageContainer
v-if="windowIsLarge"
dir="auto"
style="overflow-x: visible"
>
<KGrid v-if="windowIsLarge">
<KGrid>
<KGridItem :layout12="{ span: 8 }">
<h2 class="section-title">
{{ displaySectionTitle(currentSection, currentSectionIndex) }}
Expand All @@ -59,15 +60,30 @@
</div>
</KGridItem>
</KGrid>
<div
v-else
style="overflow-x: visible"
</KPageContainer>
<div v-else>
<KPageContainer
dir="auto"
class="quiz-container"
>
<span>{{ coreString('timeSpentLabel') }}:</span>
<TimeDuration
class="timer"
aria-live="polite"
role="timer"
:seconds="time_spent"
/>
</KPageContainer>
<KPageContainer
dir="auto"
class="quiz-container"
>
<div v-if="windowIsSmall || windowIsMedium">
<KSelect
v-if="sectionSelectOptions.length > 1"
:value="currentSectionOption"
:options="sectionSelectOptions"
:label="quizSectionsLabel$()"
@select="handleSectionOptionChange"
>
<template #display>
Expand All @@ -94,32 +110,24 @@
{{ currentSectionOption.label }}
</h2>
</div>
<p>{{ currentSection.description }}</p>
<p v-if="currentSection.description">{{ currentSection.description }}</p>
<p v-if="content && content.duration">
{{ learnString('suggestedTime') }}
</p>
<div :style="{ margin: '0 auto', textAlign: 'center', width: '100%' }">
<span>{{ coreString('timeSpentLabel') }}:</span>
<TimeDuration
class="timer"
aria-live="polite"
role="timer"
:seconds="time_spent"
/>
</div>
<SuggestedTime
v-if="content && content.duration"
class="timer"
:seconds="content.duration"
/>
</div>
</KPageContainer>
</KPageContainer>
</div>
<KPageContainer style="overflow-x: visible">
<KSelect
v-if="windowIsSmall || windowIsMedium"
style="margin-top: 1em"
:value="currentQuestionOption"
:options="questionSelectOptions"
:label="questionsLabel$()"
@select="handleQuestionOptionChange"
>
<template #display>
Expand Down Expand Up @@ -305,7 +313,10 @@

import { mapState } from 'vuex';
import isEqual from 'lodash/isEqual';
import { displaySectionTitle } from 'kolibri-common/strings/enhancedQuizManagementStrings';
import {
displaySectionTitle,
enhancedQuizManagementStrings,
} from 'kolibri-common/strings/enhancedQuizManagementStrings';
import debounce from 'lodash/debounce';
import BottomAppBar from 'kolibri.coreVue.components.BottomAppBar';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
Expand Down Expand Up @@ -345,7 +356,10 @@
} = useProgressTracking();
const { windowBreakpoint, windowIsMedium, windowIsLarge, windowIsSmall } =
useKResponsiveWindow();
const { quizSectionsLabel$, questionsLabel$ } = enhancedQuizManagementStrings;
return {
questionsLabel$,
quizSectionsLabel$,
displaySectionTitle,
pastattempts,
time_spent,
Expand Down Expand Up @@ -880,4 +894,13 @@
margin-right: 5px;
}

.section-select {
margin: 0;
}

.quiz-container {
padding: 1em !important;
overflow-x: visible;
}

</style>