Skip to content

Commit 758c01c

Browse files
feat: separate assessments
1 parent ac11f58 commit 758c01c

17 files changed

+255
-5
lines changed

src/App.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
22
import { ErrorPage } from '@edx/frontend-platform/react';
33
import { useIntl } from '@edx/frontend-platform/i18n';
44

5-
import AssessmentView from 'views/AssessmentView';
5+
import PeerAssessmentView from 'views/PeerAssessmentView';
6+
import SelfAssessmentView from 'views/SelfAssessmentView';
7+
import StudentTrainingView from 'views/StudentTrainingView';
68
import SubmissionView from 'views/SubmissionView';
79
import messages from './messages';
810
import routes from './routes';
@@ -13,7 +15,13 @@ const RouterRoot = () => {
1315
return (
1416
<Router>
1517
<Switch>
16-
<Route path={routes.assessment}>
18+
<Route path={routes.peerAssessment}>
19+
<AssessmentView />
20+
</Route>
21+
<Route path={routes.selfAssessment}>
22+
<AssessmentView />
23+
</Route>
24+
<Route path={routes.studentTraining}>
1725
<AssessmentView />
1826
</Route>
1927
<Route path={routes.submission}>

src/routes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export default {
22
assessment: '/assessment/:id',
3-
submission: '/submission/:id',
3+
peerSubmission: '/peer_submission/:id',
4+
selfSubmission: '/self_submission/:id',
5+
studentTraining: '/student_training/:id',
46
root: '/*',
57
};

src/views/AssessmentView/index.jsx renamed to src/views/PeerAssessmentView/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useIsORAConfigLoaded, usePageData } from 'data/services/lms/hooks/selec
77
import AssessmentContentLayout from './AssessmentContentLayout';
88
import AssessmentActions from './AssessmentActions';
99

10-
export const AssessmentView = () => {
10+
export const PeerAssessmentView = () => {
1111
const isORAConfigLoaded = useIsORAConfigLoaded();
1212
const pageData = usePageData();
1313
console.log({ pageData });
@@ -25,4 +25,4 @@ export const AssessmentView = () => {
2525
);
2626
};
2727

28-
export default AssessmentView;
28+
export default PeerAssessmentView;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
3+
import { ActionRow, Button } from '@edx/paragon';
4+
5+
const AssessmentActions = () => (
6+
<ActionRow className="border mt-3">
7+
<Button variant="secondary">Secondary Action</Button>
8+
<Button>Primary Action</Button>
9+
</ActionRow>
10+
);
11+
12+
export default AssessmentActions;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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';
7+
import FileUpload from 'components/FileUpload';
8+
9+
const AssessmentContent = () => {
10+
const { prompts } = useORAConfigData();
11+
return (
12+
<div>
13+
{React.Children.toArray(
14+
prompts.map((prompt, index) => (
15+
<div>
16+
<Prompt promptIndex={index} />
17+
<TextResponse promptIndex={index} />
18+
</div>
19+
)),
20+
)}
21+
<FileUpload isReadOnly />
22+
</div>
23+
);
24+
};
25+
26+
export default AssessmentContent;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 AssessmentContent from './AssessmentContent';
8+
9+
import './AssessmentContentLayout.scss';
10+
11+
const AssessmentContentLayout = () => {
12+
console.log(useRubricConfig());
13+
const showRubric = useRubricConfig().showDuringResponse;
14+
return (
15+
<div className="assessment-content-layout mr-auto ml-auto">
16+
<div className="content-wrapper">
17+
<Row className="flex-nowrap m-0">
18+
<Col className="p-0">
19+
<AssessmentContent />
20+
</Col>
21+
{showRubric && (<Rubric isGrading={false} />)}
22+
</Row>
23+
</div>
24+
</div>
25+
);
26+
};
27+
28+
export default AssessmentContentLayout;

0 commit comments

Comments
 (0)