Skip to content

Commit 8c30b00

Browse files
Merge branch 'master' into lib
2 parents 1568276 + e174a82 commit 8c30b00

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

frontend/store.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export interface CodecastOptions {
8282
origin: string,
8383
task?: QuickalgoTask,
8484
taskInstructions?: string,
85+
taskSolution?: string,
8586
taskHints?: TaskHint[],
8687
taskSuccessMessage?: string,
8788
taskSuccessStayOnCurrentVersionDisabled?: boolean,

frontend/task/TaskSolution.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {useAppSelector} from "../hooks";
33
import {formatTaskInstructions} from './utils';
44
import {
55
convertHtmlInstructionsToReact,
6-
selectLanguageStrings,
6+
getTaskSolution,
77
} from './instructions/instructions';
88

99
export function TaskSolution() {
@@ -13,7 +13,7 @@ export function TaskSolution() {
1313
const contextId = useAppSelector(state => state.task.contextId);
1414
const [solutionsHtml, setSolutionsHtml] = useState(null);
1515
const platform = useAppSelector(state => state.options.platform);
16-
const solutionHtml = useAppSelector(state => selectLanguageStrings(state)?.solution);
16+
const solutionHtml = useAppSelector(getTaskSolution);
1717

1818
useEffect(() => {
1919
let instructionsJQuery = formatTaskInstructions(solutionHtml, platform, taskLevel, taskVariant);

frontend/task/instructions/instructions.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ export const getInstructionsForLevelSelector = memoize(({state, context}: {state
185185
};
186186
});
187187

188+
export function getTaskSolution(state: AppStore) {
189+
if (state.options.taskSolution) {
190+
return state.options.taskSolution;
191+
}
192+
193+
return selectLanguageStrings(state)?.solution;
194+
}
195+
188196
export const getFormattedInstructionsForLevelSelector = memoize(({state, context}: {state: AppStore, context: QuickAlgoLibrary}) => {
189197
const html = getInstructionsForLevelSelector({state, context}).html;
190198
const platform = state.options.platform;

frontend/task/task.scss

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,10 @@ pre, #app .ace_editor, .stack-view, .subtitles-band-frame {
747747
line-height: 1.1em;
748748
background-color: #efa124;
749749

750+
&:not(.submission-pending) {
751+
padding-right: 30px;
752+
}
753+
750754
.close-button, .maximize-button {
751755
position: absolute;
752756
top: 4px;
@@ -800,7 +804,7 @@ pre, #app .ace_editor, .stack-view, .subtitles-band-frame {
800804
display: flex;
801805
justify-content: space-between;
802806
align-items: center;
803-
margin-right: 34px;
807+
margin-right: 10px;
804808
.message {
805809
flex: 1 1 auto;
806810
color: #30242B;
@@ -818,12 +822,15 @@ pre, #app .ace_editor, .stack-view, .subtitles-band-frame {
818822
}
819823
}
820824

821-
.codehelp-help .quickalgo-button .bp4-button-text {
822-
display: flex;
823-
align-items: center;
824-
gap: 4px;
825-
.bp4-icon {
826-
color: white;
825+
.codehelp-help {
826+
margin-left: 10px;
827+
.quickalgo-button .bp4-button-text {
828+
display: flex;
829+
align-items: center;
830+
gap: 4px;
831+
.bp4-icon {
832+
color: white;
833+
}
827834
}
828835
}
829836

0 commit comments

Comments
 (0)