Skip to content

Commit

Permalink
change .value references
Browse files Browse the repository at this point in the history
  • Loading branch information
ozer550 committed Nov 28, 2023
1 parent c7b4e51 commit ef789e1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function isExercise(o) {
/**
* Composable function presenting primary interface for Quiz Creation
*/
export default function useQuizCreation(DEBUG = false) {
export default function useQuizCreation(DEBUG = true) {
// -----------
// Local state
// -----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:label="quizTitle$()"
:autofocus="true"
:maxlength="100"
@blur="e => updateQuiz({ title: e.target.value })"
@blur="e => updateQuiz({ title: e.target })"
@change="title => updateQuiz({ title })"
/>
</KGridItem>
Expand All @@ -44,8 +44,8 @@
class="section-tabs"
:tabs="tabs"
:appearanceOverrides="{ padding: '0px', overflow: 'hidden' }"
:activeTabId="activeSection.value ?
activeSection.value.section_id :
:activeTabId="activeSection ?
activeSection.section_id :
'' "
backgroundColor="transparent"
hoverBackgroundColor="transparent"
Expand Down Expand Up @@ -84,7 +84,7 @@
<!-- Maybe not so easy since they're styled differently -->
<KButton
appearance="flat-button"
:primary="activeSection.value.section_id === option.id"
:primary="activeSection.section_id === option.id"
:appearanceOverrides="tabStyles"
class="menu-button"
@click="() => setActiveSection(option.id)"
Expand Down Expand Up @@ -134,14 +134,14 @@
</KGrid>

<KTabsPanel
v-if="activeSection.value"
v-if="activeSection"
class="no-question-layout"
tabsId="quizSectionTabs"
:activeTabId="activeSection.value ? activeSection.value.section_id : ''"
:activeTabId="activeSection ? activeSection.section_id : ''"
>
<p>{{ activeSection.value.section_id }}</p>
<p>{{ activeSection.section_id }}</p>
<!-- TODO This should be a separate component like "empty section container" or something -->
<div v-if="!activeQuestions.value.length" class="no-question-style">
<div v-if="!activeQuestions.length" class="no-question-style">
<KGrid class="questions-list-label-row">
<KGridItem
class="right-side-heading"
Expand Down Expand Up @@ -177,7 +177,7 @@
<KButton
primary
icon="plus"
@click="openSelectResources(activeSection.value.section_id)"
@click="openSelectResources(activeSection.section_id)"
>
{{ addQuestionsLabel$() }}
</KButton>
Expand Down Expand Up @@ -216,7 +216,7 @@
</KGrid>

<AccordionContainer
:items="activeQuestions.value"
:items="activeQuestions"
@toggled="items => expandedQuestionIds = items"
>
<template #top="{ expandAll, collapseAll }">
Expand All @@ -228,9 +228,9 @@
<KCheckbox
ref="selectAllCheckbox"
class="select-all-box"
:label="selectAllLabel.value"
:checked="allQuestionsSelected.value"
:indeterminate="selectAllIsIndeterminate.value"
:label="selectAllLabel"
:checked="allQuestionsSelected"
:indeterminate="selectAllIsIndeterminate"
@change="() => selectAllQuestions()"
/>
</KGridItem>
Expand All @@ -242,8 +242,8 @@
<KIconButton
icon="expandAll"
:tooltip="expandAll$()"
:disabled="expandedQuestionIds.length === activeQuestions.value.length"
@click="expandAll(activeQuestions.value.map(i => i.question_id))"
:disabled="expandedQuestionIds.length === activeQuestions.length"
@click="expandAll(activeQuestions.map(i => i.question_id))"
/>
<KIconButton
icon="collapseAll"
Expand All @@ -254,14 +254,14 @@
<KIconButton
icon="refresh"
:tooltip="replaceAction$()"
:disabled="selectedActiveQuestions.value.length === 0"
:disabled="selectedActiveQuestions.length === 0"
@click="handleReplaceSelection"
/>
<KIconButton
icon="trash"
:tooltip="coreString('deleteAction')"
:aria-label="coreString('deleteAction')"
:disabled="selectedActiveQuestions.value.length === 0"
:disabled="selectedActiveQuestions.length === 0"
@click="deleteActiveSelectedQuestions"
/>
</KGridItem>
Expand All @@ -271,7 +271,7 @@
<template #default="{ toggleItemState, isItemExpanded }">
<DragContainer
key="drag-container"
:items="activeQuestions.value"
:items="activeQuestions"
@sort="handleQuestionOrderChange"
@dragStart="handleDragStart"
>
Expand All @@ -281,7 +281,7 @@
class="wrapper"
>
<Draggable
v-for="(question, index) in activeQuestions.value"
v-for="(question, index) in activeQuestions"
:key="`drag-${question.question_id}`"
tabindex="-1"
style="background: white"
Expand All @@ -299,15 +299,15 @@
moveDownText="down"
:noDrag="true"
:isFirst="index === 0"
:isLast="index === activeQuestions.value.length - 1"
:isLast="index === activeQuestions.length - 1"
@moveUp="shiftOne(index, -1)"
@moveDown="shiftOne(index, +1)"
/>
</div>
</DragHandle>
<KCheckbox
style="padding-left: 0.5em"
:checked="selectedActiveQuestions.value.includes(
:checked="selectedActiveQuestions.includes(
question.question_id
)"
@change="() => toggleQuestionInSelection(question.question_id)"
Expand All @@ -334,10 +334,10 @@
<div
:id="`question-panel-${question.question_id}`"
:ref="`question-panel-${question.question_id}`"
:style="{ userSelect: dragActive.value ? 'none!important' : 'text' }"
:style="{ userSelect: dragActive ? 'none!important' : 'text' }"
>
<p
v-if="isItemExpanded(question.question_id) && !dragActive.value"
v-if="isItemExpanded(question.question_id) && !dragActive"
class="question-content-panel"
>
CONTENT OF {{ question.title }}
Expand Down Expand Up @@ -547,13 +547,13 @@
this.$router.replace({ path: 'new/' + section_id + '/replace-questions' });
},
handleActiveSectionAction(opt) {
const section_id = this.activeSection.value.section_id;
const section_id = this.activeSection.section_id;
switch (opt.label) {
case this.editSectionLabel$():
this.$router.replace({ path: 'new/' + section_id + '/edit' });
break;
case this.deleteSectionLabel$():
this.removeSection(this.activeSection.value.section_id);
this.removeSection(this.activeSection.section_id);
this.focusActiveSectionTab();
break;
}
Expand All @@ -562,7 +562,7 @@
return `section-tab-${section_id}`;
},
focusActiveSectionTab() {
const label = this.tabRefLabel(this.activeSection.value.section_id);
const label = this.tabRefLabel(this.activeSection.section_id);
const tabRef = this.$refs[label];
// TODO Consider the "Delete section" button on the side panel; maybe we need to await
// nextTick if we're getting the error
Expand Down

0 comments on commit ef789e1

Please sign in to comment.