Skip to content

Commit 6ce2d00

Browse files
rtibblesbotclaude
andcommitted
Align the associate editor with the design spec
Pair rows, cards, chips and pool boxes took colours, padding and copy that diverge from the issue's mockups. Measured against them: - pair rows: grey.v_50 with a fineLine border, cards on surface, 40px tall - chips: 12px each side, 8px before the delete control, tinted only in the distractor pool, where they sit on the surface rather than the tint - pair validation message: aligned to the row's left edge, not indented under the cards - correct-answer chip border: green.v_600, as the sibling editors use - section and button copy taken verbatim from the mockups Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2c9fff3 commit 6ce2d00

2 files changed

Lines changed: 64 additions & 24 deletions

File tree

‎contentcuration/contentcuration/frontend/shared/views/QTIEditor/interactions/associate/AssociateInteractionEditor.vue‎

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
<li
231231
v-for="(choice, index) in state.distractors"
232232
:key="`${choice.id}-${index}`"
233-
:class="isDistractorOpen(index) ? 'distractor-editing' : 'chip'"
233+
:class="isDistractorOpen(index) ? 'distractor-editing' : 'chip is-tinted'"
234234
:style="cardStyle(choice.id)"
235235
>
236236
<ClickableRegion
@@ -530,7 +530,7 @@
530530
function poolChipStyle(id) {
531531
const isCorrect = props.showAnswers && pairedIds.value.has(id);
532532
return {
533-
borderColor: isCorrect ? palette.green.v_500 : tokens.fineLine,
533+
borderColor: isCorrect ? palette.green.v_600 : tokens.fineLine,
534534
backgroundColor: isCorrect ? palette.green.v_50 : null,
535535
};
536536
}
@@ -697,15 +697,19 @@
697697
display: grid;
698698
grid-template-areas:
699699
'label cards actions'
700-
'. message .';
700+
'message message message';
701701
grid-template-columns: auto 1fr auto;
702-
gap: 8px;
702+
703+
// Column-only: the message row track exists even when empty, so a row gap
704+
// would pad every row without a message.
705+
column-gap: 8px;
703706
align-items: center;
704707
border-radius: 4px;
705708
706709
&.is-editable {
707710
padding: 8px;
708-
background-color: v-bind('$themePalette.grey.v_100');
711+
background-color: v-bind('$themePalette.grey.v_50');
712+
border: 1px solid v-bind('$themeTokens.fineLine');
709713
}
710714
711715
&.is-stacked {
@@ -733,12 +737,33 @@
733737
734738
.is-stacked & {
735739
flex-direction: column;
740+
margin-top: 8px;
736741
}
737742
}
738743
744+
// A pair card sits on the tinted row, so it carries the surface colour itself.
739745
.pair-card {
740746
flex: 1;
741747
min-width: 0;
748+
background-color: v-bind('$themeTokens.surface');
749+
750+
.item-card-text {
751+
padding: 0;
752+
753+
&.is-closed {
754+
min-height: 40px;
755+
756+
// A closed card shows one line, so paragraph margins would only push it
757+
// past that height.
758+
::v-deep .ProseMirror p {
759+
margin: 0;
760+
}
761+
}
762+
}
763+
764+
::v-deep .editor-content {
765+
padding: 8px;
766+
}
742767
}
743768
744769
.pair-actions {
@@ -749,6 +774,7 @@
749774
750775
.pair-message {
751776
grid-area: message;
777+
margin-top: 8px;
752778
}
753779
754780
.pool-box {
@@ -760,7 +786,7 @@
760786
border-radius: 4px;
761787
762788
&.is-shuffled {
763-
background-color: v-bind('$themePalette.grey.v_100');
789+
background-color: v-bind('$themePalette.grey.v_50');
764790
}
765791
}
766792
@@ -773,16 +799,29 @@
773799
list-style: none;
774800
}
775801
776-
// A chip is a compact pill, so it overrides the editor's own content padding.
802+
// A chip is a compact pill, so it replaces the editor's own content padding
803+
// and paragraph margins with its own.
777804
.chip {
778805
display: flex;
806+
gap: 8px;
779807
align-items: center;
780-
padding: 0 4px 0 12px;
808+
padding: 4px 12px;
809+
background-color: v-bind('$themeTokens.surface');
781810
border: 1px solid;
782811
border-radius: 4px;
783812
813+
// Tinted only in the distractor pool, whose box sits on the surface; the
814+
// shuffled pool is itself tinted, so its chips stay on the surface.
815+
&.is-tinted {
816+
background-color: v-bind('$themePalette.grey.v_50');
817+
}
818+
784819
::v-deep .editor-content {
785-
padding: 8px 0;
820+
padding: 0;
821+
}
822+
823+
::v-deep .ProseMirror p {
824+
margin: 0;
786825
}
787826
}
788827

‎contentcuration/contentcuration/frontend/shared/views/QTIEditor/qtiEditorStrings.js‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,25 @@ export const qtiEditorStrings = createTranslator('QTIEditorStrings', {
109109
context: 'Description for the associate question type in the info modal',
110110
},
111111
correctPairsLabel: {
112-
message: 'Correct pairs',
112+
message: 'Matching pairs',
113113
context: 'Section header above the list of correctly associated pairs',
114114
},
115115
correctPairsDescription: {
116-
message: 'Learners will see all options shuffled together',
117-
context: 'Subtitle under the correct pairs header',
116+
message:
117+
'Learners match responses from a shuffled set to each prompt. Include distractors to increase difficulty.',
118+
context: 'Subtitle under the matching pairs header',
118119
},
119120
distractorsLabel: {
120-
message: 'Additional options',
121-
context: 'Section header above the options that belong to no correct pair',
121+
message: 'Distractors (optional)',
122+
context: 'Section header above the choices that belong to no correct pair',
122123
},
123124
distractorsDescription: {
124-
message: 'Options that are not part of any correct pair',
125-
context: 'Subtitle under the additional options header',
125+
message: "Extra items shown in the response pool that don't match any prompt",
126+
context: 'Subtitle under the distractors header',
126127
},
127128
responsePoolLabel: {
128-
message: 'Options (shuffled)',
129-
context: 'Header above the shuffled pool of options learners will pick from',
129+
message: 'Response pool (shuffled)',
130+
context: 'Header above the shuffled pool of choices learners will pick from',
130131
},
131132
correctAnswersLabel: {
132133
message: 'Answers',
@@ -145,20 +146,20 @@ export const qtiEditorStrings = createTranslator('QTIEditorStrings', {
145146
context: 'Accessible label for the delete icon button next to a pair row',
146147
},
147148
addDistractorBtn: {
148-
message: 'Add option',
149-
context: 'Button that appends a new additional option',
149+
message: 'Add distractor',
150+
context: 'Button that appends a new distractor',
150151
},
151152
deleteDistractorBtn: {
152-
message: 'Delete option {number}',
153-
context: 'Accessible label for the delete icon button on an additional option',
153+
message: 'Delete distractor {number}',
154+
context: 'Accessible label for the delete icon button on a distractor',
154155
},
155156
editPairItemLabel: {
156157
message: 'Edit pair {number}, item {position}',
157158
context: 'Accessible label for the clickable region to edit one item of a pair',
158159
},
159160
editDistractorLabel: {
160-
message: 'Edit option {number}',
161-
context: 'Accessible label for the clickable region to edit an additional option',
161+
message: 'Edit distractor {number}',
162+
context: 'Accessible label for the clickable region to edit a distractor',
162163
},
163164
errorTooFewPairs: {
164165
message: '1 or more valid pairs are required',

0 commit comments

Comments
 (0)