Skip to content

Commit b0a3a27

Browse files
chore: add Submission view
1 parent f19259d commit b0a3a27

File tree

5 files changed

+108
-7
lines changed

5 files changed

+108
-7
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
3+
import { ActionRow, Button } from '@edx/paragon';
4+
5+
const SubmissionActions = () => {
6+
return (
7+
<ActionRow className="border mt-3">
8+
<Button variant="secondary">Secondary Action</Button>
9+
<Button>Primary Action</Button>
10+
</ActionRow>
11+
);
12+
};
13+
14+
export default SubmissionActions;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
3+
import { useORAConfigData } from 'data/services/lms/hooks/selectors';
4+
5+
import Prompt from 'components/Prompt';
6+
import TextResponse from 'components/TextResponse/Editor';
7+
import FileUpload from 'components/FileUpload';
8+
9+
const SubmissionContent = () => {
10+
const { prompts } = useORAConfigData();
11+
return (
12+
<div>
13+
{prompts.map((prompt, index) => (
14+
<div key={index}>
15+
<Prompt promptIndex={index} />
16+
<TextResponse promptIndex={index} />
17+
</div>
18+
))}
19+
<FileUpload />
20+
</div>
21+
);
22+
};
23+
24+
export default SubmissionContent;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
3+
import { Col, Row } from '@edx/paragon';
4+
5+
import { useRubricConfig } from 'data/services/lms/hooks/selectors';
6+
import Rubric from 'components/Rubric';
7+
import SubmissionContent from './SubmissionContent';
8+
9+
import './SubmissionContentLayout.scss';
10+
11+
const SubmissionContentLayout = () => {
12+
const showRubric = useRubricConfig().showDuringResponse;
13+
return (
14+
<div className="assessment-content-layout mr-auto ml-auto">
15+
<div className="content-wrapper">
16+
<Row className="flex-nowrap m-0">
17+
<Col className="p-0">
18+
<SubmissionContent />
19+
</Col>
20+
{showRubric && (<Rubric isGrading={false} />)}
21+
</Row>
22+
</div>
23+
</div>
24+
);
25+
};
26+
27+
export default SubmissionContentLayout;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@import "@edx/paragon/scss/core/core";
2+
3+
.assessment-content-layout {
4+
& > div.content-body {
5+
height: 100%;
6+
.row {
7+
height: 100%;
8+
}
9+
}
10+
width: fit-content;
11+
margin: auto;
12+
height: 100%;
13+
14+
.content-wrapper {
15+
min-width: min-content;
16+
}
17+
}
18+
19+
@include media-breakpoint-down(sm) {
20+
.assessment-content-layout {
21+
.content-wrapper {
22+
width: 100%;
23+
}
24+
}
25+
}
26+

src/views/SubmissionView/index.jsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
import React from 'react';
2+
3+
import { FullscreenModal } from '@edx/paragon';
4+
25
import { useORAConfigData, useSubmissionData } from 'data/services/lms/hooks/selectors';
36

4-
export const AssessmentView = () => {
7+
import SubmissionContentLayout from './SubmissionContentLayout';
8+
import SubmissionActions from './SubmissionActions';
9+
10+
export const SubmissionView = () => {
511
const configData = useORAConfigData();
612
const submissionData = useSubmissionData();
7-
console.log({
8-
configData,
9-
submissionData,
10-
});
1113
return (
12-
<h1>Submission</h1>
14+
<FullscreenModal
15+
isOpen
16+
onClose={() => ({})}
17+
title="ORA Submission"
18+
modalBodyClassName="content-body"
19+
>
20+
{configData && (<SubmissionContentLayout />)}
21+
<SubmissionActions />
22+
</FullscreenModal>
1323
);
1424
};
1525

16-
export default AssessmentView;
26+
export default SubmissionView;

0 commit comments

Comments
 (0)