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

Improve Ada inline question styling #1015

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions src/app/components/content/IsaacQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.Questio
const invalidFormatFeeback = <p>
Your answer is not in a format we recognise, please enter your answer as a decimal number.<br/>
{invalidFormatErrorStdForm && <>When writing standard form, you must include <code>^</code> or <code>**</code> between the 10 and the exponent.<br/></>}
{isPhy && <>For help, see our <a target="_blank" href="/solving_problems#units">guide to answering numeric questions</a></>}.
{isPhy && <>For help, see our <a target="_blank" href="/solving_problems#units">guide to answering numeric questions</a>.</>}
</p>;

// Register Question Part in Redux
Expand Down Expand Up @@ -177,19 +177,17 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.Questio
{isInlineQuestion && numInlineQuestions && numInlineQuestions > 1 ? <>
<span>You can view feedback for a specific box by either selecting it above, or by using the control panel below.</span>
<div className={`feedback-panel-${almost ? "light" : "dark"}`} role="note" aria-labelledby="answer-feedback">
<div className={`w-100 mt-2 d-flex feedback-panel-header`}>
<div className={`w-100 mt-2 d-flex feedback-panel-header justify-content-around`}>
<RS.Button color="transparent" onClick={() => {
inlineContext.setFeedbackIndex(((inlineContext?.feedbackIndex as number - 1) + numInlineQuestions) % numInlineQuestions);
}}>
{below["xs"](deviceSize) ? "◀" : "Previous" }
</RS.Button>
<Spacer/>
<RS.Button color="transparent" className="inline-part-jump align-self-center" onClick={() => {
inlineContext.feedbackIndex && inlineContext.setFocusSelection(true);
}}>
Box {inlineContext.feedbackIndex as number + 1} of {numInlineQuestions}
</RS.Button>
<Spacer/>
<RS.Button color="transparent" onClick={() => {
inlineContext.setFeedbackIndex((inlineContext?.feedbackIndex as number + 1) % numInlineQuestions);
}}>
Expand Down
5 changes: 0 additions & 5 deletions src/scss/common/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
}
}

input.form-control.is-unanswered {
border: solid 1px theme-color("warning");
@include border-radius($input-border-radius, 0);
}

.date-input .is-invalid, .date-input .is-valid {
background: white;
}
Expand Down
17 changes: 1 addition & 16 deletions src/scss/common/questions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@
> button {
color: inherit;
min-width: 176px;
flex-basis: 100%;
@media (max-width: 576px) {
min-width: 0;
}
Expand Down Expand Up @@ -495,22 +496,6 @@
}
}

.inline-part {
$shadow-size: 3px;
&.selected-feedback {
box-shadow: 0 0 0 $shadow-size #000;
&.is-valid {
box-shadow: 0 0 0 $shadow-size theme-color("success");
}
&.is-invalid {
box-shadow: 0 0 0 $shadow-size theme-color("danger");
}
&.is-unanswered {
box-shadow: 0 0 0 $shadow-size theme-color("warning");
}
}
}

.inline-dropdown {
min-width: unset !important;
}
26 changes: 26 additions & 0 deletions src/scss/cs/questions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,32 @@
color: $cs-black;
border-top: none;
}
&.almost {
background: $yellow-400;
color: $cs-black;
border-top: none;
}
}

input.form-control.is-unanswered {
border: solid 1px $yellow-200;
@include border-radius($input-border-radius, 0);
}

.inline-part {
$shadow-size: 3px;
&.selected-feedback {
box-shadow: 0 0 0 $shadow-size #000;
&.is-valid {
box-shadow: 0 0 0 $shadow-size theme-color("success");
}
&.is-invalid {
box-shadow: 0 0 0 $shadow-size theme-color("danger");
}
&.is-unanswered {
box-shadow: 0 0 0 $shadow-size $yellow-200;
}
}
}

// Quick questions
Expand Down
21 changes: 21 additions & 0 deletions src/scss/phy/questions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,24 @@
border: solid 1px $black;
}
}

input.form-control.is-unanswered {
border: solid 1px theme-color("warning");
@include border-radius($input-border-radius, 0);
}

.inline-part {
$shadow-size: 3px;
&.selected-feedback {
box-shadow: 0 0 0 $shadow-size #000;
&.is-valid {
box-shadow: 0 0 0 $shadow-size theme-color("success");
}
&.is-invalid {
box-shadow: 0 0 0 $shadow-size theme-color("danger");
}
&.is-unanswered {
box-shadow: 0 0 0 $shadow-size theme-color("warning");
}
}
}