-
Notifications
You must be signed in to change notification settings - Fork 174
Grading comments #162
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
Grading comments #162
Conversation
Pull Request Test Coverage Report for Build 210
💛 - Coveralls |
| export const UPDATE_CURRENT_SUBMISSION_ID = 'UPDATE_CURRENT_SUBMISSION_ID' | ||
| export const UPDATE_GRADING_COMMENTS_VALUE = 'UPDATE_GRADING_COMMENTS_VALUE' | ||
| export const UPDATE_GRADING_XP = 'UPDATE_GRADING_XP' | ||
| export const SAVE_GRADING_INPUT = 'SAVE_GRADING_INPUT' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I change this to UPLOAD_GRADING_INPUT instead? It's only use is to call a saga.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think save is fine
|
|
||
| constructor(props: GradingEditorProps) { | ||
| super(props) | ||
| this.state = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local state is used to keep track of everything here, because the editor already uses it. Upon unmounting, the values are dispatched.
| public componentWillMount() { | ||
| const assessmentId = stringParamToInt(this.props.match.params.assessmentId) | ||
| const questionId = stringParamToInt(this.props.match.params.questionId) | ||
| if (assessmentId === null || questionId === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug that applies for Grading but not Assessment. I changed it for consistency.
The original predicate fails when questionid is null but submissionId is non-null (because we have not assigned 0 to it yet). In the case of assessments, the 0 value is provided by the card, since it must provide a value in the link within.
| /* word-wrap and word-break are added to make text wrap. */ | ||
| word-wrap: break-word; | ||
| word-break: break-word; | ||
| .grading-editor-input-parent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can move this to another file if needed. I didn't because grading editor is present only inside a side-content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine
| export const UPDATE_CURRENT_SUBMISSION_ID = 'UPDATE_CURRENT_SUBMISSION_ID' | ||
| export const UPDATE_GRADING_COMMENTS_VALUE = 'UPDATE_GRADING_COMMENTS_VALUE' | ||
| export const UPDATE_GRADING_XP = 'UPDATE_GRADING_XP' | ||
| export const SAVE_GRADING_INPUT = 'SAVE_GRADING_INPUT' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think save is fine
| /* word-wrap and word-break are added to make text wrap. */ | ||
| word-wrap: break-word; | ||
| word-break: break-word; | ||
| .grading-editor-input-parent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine
- ~400 stars - In Typescript - Vertical layout for the slightly narrow side-content section - In actual Markdown Only caveats are that it is not WYSIWYG and does not have a markdown to html converter.
The main library react-mde runs on.
To convert markdown to HTML and vice-versa
I'll remove this to use blueprint icons instead, later on.
Or else, the styles do not work.
Trying to use componentDidMount and componentWillUnmount to handle updates.
Alphabetisizing, typos.
The `markdown` value in `mdeState` being undefined causes a runtime error. So it is easier to just deal with a definite string (since undefined is not allowed anyway). The typedef for the value allows undefined though.
The problem is that the current <a href> implementation is a hard redirect, causing a change in URL (and loss of all state). I'm trying to get a NavLink
Since it will be set by the default state, it is never null.
Checks only for submissionId, if it is present then there should be a questionId as well.
Used to reset the workspace as well.
714f3a2 to
4d563dd
Compare
The issue has been created at the backend cadet repo -- #162. As triple equality was used to verify if the button should be pressed, this caused all the equality checks to return false (string is not === any number). I've added a workaround to parse the received string.
The issue has been created at the backend cadet repo -- #162. As triple equality was used to verify if the button should be pressed, this caused all the equality checks to return false (string is not === any number). I've added a workaround to parse the received string.
* Add handleOptionSelect handler for MCQChooser * Use handleOptionSelect in Button Had to use a curried function to get around the "Lambdas forbidden in rendering method" rule (and consequently save performance) * Use handleMCQSubmit name instead * Change mcq question prop -> mcqProps Thus, anything that calls workspace will have to provide a method to handle MCQs, if the question is an MCQ question * Pass correct props for GradingWorkspace * Use correct props for AssessmentWorkspace * Remove unused import from workspace * Format AssessmentWorkspace * Add localState to remove visual lag of choosing Before: Option chosen (active momentarily) -> dispatch (button inactive due to current state) -> component updated with answer (active) Now: Constructor takes in current option from state -> Option chosen (active momentarily) -> local state updated (active) and dispatch is sent -> any update from the dispatch will cause constructor to set the state (during render) to the new option * Pass in chosenOption prop from workspace parents * Format and update a test * Add workaround for mcq being passed as string The issue has been created at the backend cadet repo -- #162. As triple equality was used to verify if the button should be pressed, this caused all the equality checks to return false (string is not === any number). I've added a workaround to parse the received string. * Move parsing to the backend saga * Format files * Make resetWorkspace accept arguments to set values * Export IWorkspaceState * Change reducer for RESET_WORKSPACE * Modify workspace parent containers * Modify component handler definitions * Use handleResetWorkspace to set editorValue * Dont show save button for mcq question * Format files * Remove parsing * Simplify chosenMCQAnswer expression * Remove chosenMCQAnswer I did not realise that this can just be used from the IMCQQuestion passed in. * Add mock call for SUBMIT_ANSWER * Format files
Features
gradingCommentsTODO