Skip to content

Commit

Permalink
push changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ozer550 committed Feb 4, 2025
1 parent 0a64cbc commit 0dbdc85
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 109 deletions.
1 change: 1 addition & 0 deletions kolibri/plugins/coach/assets/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class CoachToolsModule extends KolibriApp {
PageNames.LESSON_SELECT_RESOURCES_INDEX,
PageNames.LESSON_SELECT_RESOURCES_BOOKMARKS,
PageNames.LESSON_SELECT_RESOURCES_TOPIC_TREE,
PageNames.LESSON_PREVIEW_SELECTED_QUESTIONS,
];
// If we're navigating to the same page for a quiz summary page, don't set loading
if (
Expand Down
4 changes: 2 additions & 2 deletions kolibri/plugins/coach/assets/src/composables/useFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export default function useFetch(options) {
}
error.value = err;
}

loading.value = false;
// loading.value = false;
};

const fetchMore = async (...args) => {
console.log("inside fetchMore");
if (!moreParams.value || !fetchMoreMethod || loadingMore.value || loading.value) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions kolibri/plugins/coach/assets/src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const PageNames = {
LESSON_SELECT_RESOURCES_BOOKMARKS: 'LESSON_SELECT_RESOURCES_BOOKMARKS',
LESSON_SELECT_RESOURCES_TOPIC_TREE: 'LESSON_SELECT_RESOURCES_TOPIC_TREE',
LESSON_PREVIEW_SELECTED_RESOURCES: 'LESSON_PREVIEW_SELECTED_RESOURCES',
LESSON_PREVIEW_SELECTED_QUESTIONS: 'LESSON_PREVIEW_SELECTED_QUESTIONS',
LESSON_PREVIEW_RESOURCE: 'LESSON_PREVIEW_RESOURCE',
LESSON_LEARNER_REPORT: 'LESSON_LEARNER_REPORT',
LESSON_RESOURCE_LEARNERS_REPORT: 'LESSON_RESOURCE_LEARNERS_REPORT',
Expand Down
6 changes: 6 additions & 0 deletions kolibri/plugins/coach/assets/src/routes/lessonsRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import SelectionIndex from '../views/lessons/LessonSummaryPage/sidePanels/Lesson
import SelectFromBookmarks from '../views/lessons/LessonSummaryPage/sidePanels/LessonResourceSelection/subPages/SelectFromBookmarks.vue';
import SelectFromChannels from '../views/lessons/LessonSummaryPage/sidePanels/LessonResourceSelection/subPages/SelectFromChannels.vue';
import ManageSelectedResources from '../views/lessons/LessonSummaryPage/sidePanels/LessonResourceSelection/subPages/ManageSelectedResources.vue';
import ManageSelectedQuestions from '../views/lessons/LessonSummaryPage/sidePanels/LessonResourceSelection/subPages/ManageSelectedQuestions.vue';

import { classIdParamRequiredGuard, RouteSegments } from './utils';

Expand Down Expand Up @@ -161,6 +162,11 @@ export default [
path: 'preview-resources',
component: ManageSelectedResources,
},
{
name: PageNames.LESSON_PREVIEW_SELECTED_QUESTIONS,
path: 'preview-questions',
component: ManageSelectedQuestions,
},
],
},
{
Expand Down
182 changes: 91 additions & 91 deletions kolibri/plugins/coach/assets/src/views/common/QuestionsAccordion.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>

<AccordionContainer>
<template #header="{ canExpandAll, expandAll, canCollapseAll, collapseAll }">
<div>
<!-- <template #header="{ canExpandAll, expandAll, canCollapseAll, collapseAll }">
<div class="questions-accordion-header">
<div>
<KCheckbox
Expand Down Expand Up @@ -105,108 +105,108 @@
</AccordionItem>
</Draggable>
</transition-group>
</DragContainer>
</AccordionContainer>
</DragContainer> -->
</div>

</template>


<script>
import { ref } from 'vue';
import {
enhancedQuizManagementStrings,
displayQuestionTitle,
} from 'kolibri-common/strings/enhancedQuizManagementStrings';
import Draggable from 'kolibri-common/components/sortable/Draggable';
import DragHandle from 'kolibri-common/components/sortable/DragHandle';
import DragContainer from 'kolibri-common/components/sortable/DragContainer';
import DragSortWidget from 'kolibri-common/components/sortable/DragSortWidget';
import AccordionItem from 'kolibri-common/components/accordion/AccordionItem';
import AccordionContainer from 'kolibri-common/components/accordion/AccordionContainer';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import useDrag from './useDrag.js';
// import { ref } from 'vue';
// import {
// enhancedQuizManagementStrings,
// displayQuestionTitle,
// } from 'kolibri-common/strings/enhancedQuizManagementStrings';
// import Draggable from 'kolibri-common/components/sortable/Draggable';
// import DragHandle from 'kolibri-common/components/sortable/DragHandle';
// import DragContainer from 'kolibri-common/components/sortable/DragContainer';
// import DragSortWidget from 'kolibri-common/components/sortable/DragSortWidget';
// import AccordionItem from 'kolibri-common/components/accordion/AccordionItem';
// import AccordionContainer from 'kolibri-common/components/accordion/AccordionContainer';
// import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
// import useDrag from './useDrag.js';
export default {
name: 'QuestionsAccordion',
components: {
Draggable,
DragHandle,
DragContainer,
DragSortWidget,
AccordionItem,
AccordionContainer,
},
setup() {
const dragActive = ref(false);
const { upLabel$, downLabel$ } = searchAndFilterStrings;
const { selectAllLabel$, expandAll$, collapseAll$ } = enhancedQuizManagementStrings;
const { moveUpOne, moveDownOne } = useDrag();
return {
moveUpOne,
moveDownOne,
dragActive,
displayQuestionTitle,
upLabel$,
downLabel$,
selectAllLabel$,
expandAll$,
collapseAll$,
};
},
props: {
questions: {
type: Array,
required: true,
},
getQuestionContent: {
type: Function,
required: true,
},
selectedQuestions: {
type: Array,
required: true,
},
selectAllIsChecked: {
type: Boolean,
required: false,
},
selectAllIsIndeterminate: {
type: Boolean,
required: false,
},
},
methods: {
handleDragStart() {
// Used to mitigate the issue of text being selected while dragging
this.dragActive = true;
},
handleQuestionOrderChange({ newArray }) {
this.$emit('sort', { newArray });
this.dragActive = false;
},
handleKeyboardDragDown(oldIndex) {
const newArray = this.moveDownOne(oldIndex, this.questions);
this.handleQuestionOrderChange({ newArray });
},
handleKeyboardDragUp(oldIndex) {
const newArray = this.moveUpOne(oldIndex, this.questions);
this.handleQuestionOrderChange({ newArray });
},
handleQuestionCheckboxChange(questionItem, value, $event) {
$event.stopPropagation();
this.$emit('select', questionItem, value);
},
},
// components: {
// Draggable,
// DragHandle,
// DragContainer,
// DragSortWidget,
// AccordionItem,
// AccordionContainer,
// },
// setup() {
// const dragActive = ref(false);
// const { upLabel$, downLabel$ } = searchAndFilterStrings;
// const { selectAllLabel$, expandAll$, collapseAll$ } = enhancedQuizManagementStrings;
// const { moveUpOne, moveDownOne } = useDrag();
// return {
// moveUpOne,
// moveDownOne,
// dragActive,
// displayQuestionTitle,
// upLabel$,
// downLabel$,
// selectAllLabel$,
// expandAll$,
// collapseAll$,
// };
// },
// props: {
// questions: {
// type: array,
// required: true,
// },
// getquestioncontent: {
// type: function,
// required: true,
// },
// selectedquestions: {
// type: array,
// required: true,
// },
// selectallischecked: {
// type: boolean,
// required: false,
// },
// selectallisindeterminate: {
// type: boolean,
// required: false,
// },
// },
// methods: {
// handleDragStart() {
// // Used to mitigate the issue of text being selected while dragging
// this.dragActive = true;
// },
// handleQuestionOrderChange({ newArray }) {
// this.$emit('sort', { newArray });
// this.dragActive = false;
// },
// handleKeyboardDragDown(oldIndex) {
// const newArray = this.moveDownOne(oldIndex, this.questions);
// this.handleQuestionOrderChange({ newArray });
// },
// handleKeyboardDragUp(oldIndex) {
// const newArray = this.moveUpOne(oldIndex, this.questions);
// this.handleQuestionOrderChange({ newArray });
// },
// handleQuestionCheckboxChange(questionItem, value, $event) {
// $event.stopPropagation();
// this.$emit('select', questionItem, value);
// },
// },
};
</script>


<style lang="scss" scoped>
<!-- <style lang="scss" scoped>

.questions-accordion-header {
display: flex;
Expand Down Expand Up @@ -235,4 +235,4 @@
margin-left: 0.5em;
}

</style>
</style> -->
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
</div>

<router-view
v-else
:setTitle="setTitle"
:setGoBack="setGoBack"
:topic="topic"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>

<QuestionsAccordion
:questions="[]"
:getQuestionContent="() => {}"
:selectedQuestions="[]"
/>

</template>


<script>
import QuestionsAccordion from '../../../../../common/QuestionsAccordion.vue';
export default {
name: 'QuestionsAccordion',
components: {
QuestionsAccordion,
},
data() {
return {
questions: [],
selectedQuestions: [],
// selectAllIsChecked: false,
// selectAllIsIndeterminate: false,
}
},
mounted() {
console.log("subpage being mounted");
},
created() {
console.log("subpage being called when created");
}
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<KButton
icon="filter"
:text="searchLabel$()"
@click="$router.push({
name: 'LESSON_PREVIEW_SELECTED_QUESTIONS'
})"
/>
</div>
<p
Expand Down
30 changes: 15 additions & 15 deletions packages/kolibri-common/components/accordion/AccordionContainer.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>

<div
<!-- <div
class="accordion"
:style="{ border: `1px solid ${$themeTokens.fineLine}` }"
>
Expand All @@ -24,31 +24,31 @@
<div>
<slot name="default"></slot>
</div>
</div>

</div> -->
<div></div>
</template>


<script>
import { computed } from 'vue';
import useAccordion from './useAccordion';
// import useAccordion from './useAccordion';
export default {
name: 'AccordionContainer',
setup(prop, { slots }) {
const { canExpandAll, canCollapseAll, collapseAll, expandAll } = useAccordion();
// setup(prop, { slots }) {
// const { canExpandAll, canCollapseAll, collapseAll, expandAll } = useAccordion();
const hasHeaderSlot = computed(() => !!slots.header);
// const hasHeaderSlot = computed(() => !!slots.header);
return {
hasHeaderSlot,
canExpandAll,
canCollapseAll,
collapseAll,
expandAll,
};
},
// return {
// hasHeaderSlot,
// canExpandAll,
// canCollapseAll,
// collapseAll,
// expandAll,
// };
// },
props: {
headerAppearanceOverrides: {
type: [Object, String],
Expand Down

0 comments on commit 0dbdc85

Please sign in to comment.