Skip to content

Commit c5937d4

Browse files
committed
Move hints inside question box for accordionless questions
1 parent 428d9d4 commit c5937d4

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

src/app/components/content/IsaacQuestion.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,7 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.Questio
284284
}
285285
</div>
286286
{/* Physics Hints */}
287-
{isPhy && <div>
288-
<IsaacTabbedHints questionPartId={doc.id as string} hints={doc.hints} />
289-
</div>}
287+
{isPhy && <IsaacTabbedHints questionPartId={doc.id as string} hints={doc.hints} />}
290288
</Form>
291289

292290
{/* LLM free-text question validation response */}

src/scss/common/questions.scss

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $cloze-scrollbar-height: 4px;
2424
min-width: auto;
2525
}
2626

27-
.question-component {
27+
form:has(> .question-component) {
2828
margin-bottom: 2rem;
2929
clear: both;
3030

@@ -70,6 +70,12 @@ $cloze-scrollbar-height: 4px;
7070
}
7171
}
7272

73+
.question-component {
74+
background-color: white;
75+
box-shadow: 0 2px 30px 0 rgba(0, 0, 0, 0.08);
76+
padding: 1rem;
77+
}
78+
7379
$inline-feedback-size: 20px;
7480
$inline-feedback-padding: 2px;
7581

@@ -395,13 +401,6 @@ $inline-feedback-padding: 2px;
395401
}
396402
}
397403

398-
// NOMENSA question.scss
399-
.question-component {
400-
background-color: white;
401-
box-shadow: 0 2px 30px 0 rgba(0, 0, 0, 0.08);
402-
padding: 1rem;
403-
}
404-
405404
.cloze-question {
406405
// This is a work around, allowing KaTeX to be used for cloze questions.
407406
// There is no guarantee that it works all of the time, so needs to be

src/scss/phy/questions.scss

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,35 @@
125125
}
126126

127127
// styling for question components outside an accordion
128-
.question-component {
128+
form:has(> .question-component) {
129129
border: 2px solid var(--nav-primary);
130130
padding: 0;
131131
border-radius: 8px;
132132
margin-bottom: 1rem;
133133

134-
> div:first-child {
134+
> .question-component > div:first-child {
135135
padding: 2rem 2rem 0.5rem;
136136

137137
&:last-child {
138138
padding-bottom: 3rem;
139139
}
140140
}
141+
142+
> .tabbed-hints {
143+
padding: 0 2rem;
144+
}
141145
}
142146

143147
// any such styling that should not be present in an accordion
144-
.isaac-accordion .question-component {
148+
.isaac-accordion form:has(> .question-component) {
145149
border: unset;
146150
// padding is overridden above
147151
border-radius: unset;
152+
153+
> .tabbed-hints {
154+
padding: 0;
155+
}
156+
148157
}
149158

150159
.content-metadata-container {

0 commit comments

Comments
 (0)