Skip to content

Commit

Permalink
Switch to using bootstraps success, danger, and warning colors.
Browse files Browse the repository at this point in the history
Dispense with the ResultsWithErrors, ResultsWithoutErrors, and
ResultsAlert classes, and use bootstrap alerts instead.
  • Loading branch information
drgrice1 committed Oct 23, 2023
1 parent 4bec4a2 commit 0aa0a56
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 39 deletions.
35 changes: 5 additions & 30 deletions htdocs/js/Problem/problem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -209,33 +209,6 @@

/* Feedback */

.ResultsWithoutError {
color: #0f5132; /* Dark Green */
background-color: #8f8; /* Light Green */
padding: 0.25rem;
border: 1px solid transparent;
border-radius: 0.25rem;
box-shadow: 3px 3px 3px darkgray;
}

.ResultsWithError {
color: #400; /* Dark Red */
background-color: #d69191; /* Light Red */
padding: 0.25rem;
border: 1px solid transparent;
border-radius: 0.25rem;
box-shadow: 3px 3px 3px darkgray;
}

.ResultsAlert {
color: #0e038c; /* Dark Blue */
background-color: #fbd2b8; /* Light Orange */
padding: 0.25rem;
border: 1px solid transparent;
border-radius: 0.25rem;
box-shadow: 3px 3px 3px darkgray;
}

.ww-feedback-popover {
--bs-popover-body-padding-x: 0;
--bs-popover-body-padding-y: 0;
Expand All @@ -248,19 +221,21 @@

&.correct {
.popover-header {
--bs-popover-header-bg: #8f8;
--bs-popover-header-bg: var(--bs-success);
--bs-popover-header-color: white;
}
}

&.incorrect {
.popover-header {
--bs-popover-header-bg: #d69191;
--bs-popover-header-bg: var(--bs-danger);
--bs-popover-header-color: white;
}
}

&.partially-correct {
.popover-header {
--bs-popover-header-bg: #ffc107;
--bs-popover-header-bg: var(--bs-warning);
}
}

Expand Down
5 changes: 5 additions & 0 deletions htdocs/js/RadioMultiAnswer/RadioMultiAnswer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
.rma-state-disabled {
opacity: 0.35;
}

.ww-feedback-btn {
top: 50%;
transform: translateY(-50%);
}
}

.ww-feedback-btn {
Expand Down
18 changes: 9 additions & 9 deletions macros/PG.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsWithoutError mb-2',
class => 'alert alert-success mb-2 p-1',
maketext('The answer is correct.')
)
);
Expand All @@ -1356,7 +1356,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsAlert mb-2',
class => 'alert alert-info mb-2 p-1',
maketext('The answer will be graded later.')
)
);
Expand All @@ -1365,7 +1365,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsAlert mb-2',
class => 'alert alert-warning mb-2 p-1',
maketext('The question has not been answered.')
)
);
Expand All @@ -1374,7 +1374,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsWithError mb-2',
class => 'alert alert-danger mb-2 p-1',
maketext('The answer is NOT correct.')
)
);
Expand All @@ -1386,7 +1386,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsWithoutError mb-2',
class => 'alert alert-success mb-2 p-1',
maketext('All of the gradeable answers are correct.')
)
);
Expand All @@ -1395,7 +1395,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsWithoutError mb-2',
class => 'alert alert-success mb-2 p-1',
maketext('All of the answers are correct.')
)
);
Expand All @@ -1405,7 +1405,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsWithError mb-2',
class => 'alert alert-danger mb-2 p-1',
maketext(
'[_1] of the answers [plural,_1,is,are] NOT correct.',
@answerNames - $numBlank - $numCorrect - $numEssay
Expand All @@ -1418,7 +1418,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsAlert mb-2',
class => 'alert alert-warning mb-2 p-1',
maketext(
'[quant,_1,of the questions remains,of the questions remain] unanswered.',
$numBlank
Expand All @@ -1431,7 +1431,7 @@ sub ENDDOCUMENT {
@summary,
Mojo::DOM->new_tag(
'div',
class => 'ResultsAlert mb-2',
class => 'alert alert-info mb-2 p-1',
maketext('[_1] of the answers will be graded later.', $numEssay)
)
);
Expand Down

0 comments on commit 0aa0a56

Please sign in to comment.