Skip to content

Load editorValue from solutionTemplate or answer #215

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

Merged
merged 13 commits into from
Jul 20, 2018

Conversation

ning-y
Copy link
Member

@ning-y ning-y commented Jul 18, 2018

This branch is based off #204. After that is merged, it will be rebased off master and be cleaner (5 commits).

Features

  • The default editor value is undefined for assessment workspaces.
  • If an assessment workspace has an editor value, load that editor value
    • This represents a user navigating back into the assessment workspace after having briefly navigated away e.g. to the playground, but not to other assessment questions
  • Otherwise, if the question being loaded has an answer, load that answer
    • This represents a user who has just navigated into a question that they have saved an answer for in the past. The saved answer was sent into the backend, and is now provided to us via the backend api as the property answer.
  • Otherwise, load the solution template
    • This represents a user who has just started a question for the first time

Note that all of these features apply only for programming questions. The mcq questions need fixes w.r.t. response bodies.

Todos

  • Saving an answer should also change the answer property of the IAssessment in our local state. Right now it only does the saving via an api call to the backend. The relevant action is saga-handled SUBMIT_ANSWER.

@ning-y ning-y force-pushed the use-solution-template branch 3 times, most recently from a743567 to def691f Compare July 19, 2018 07:26
@coveralls
Copy link

coveralls commented Jul 19, 2018

Pull Request Test Coverage Report for Build 380

  • 12 of 74 (16.22%) changed or added relevant lines in 7 files are covered.
  • 10 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.8%) to 25.442%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/actions/session.ts 1 2 50.0%
src/sagas/index.ts 0 5 0.0%
src/components/academy/grading/GradingWorkspace.tsx 0 9 0.0%
src/components/assessment/AssessmentWorkspace.tsx 1 10 10.0%
src/sagas/backend.ts 7 45 15.56%
Files with Coverage Reduction New Missed Lines %
src/sagas/backend.ts 1 17.89%
src/components/academy/grading/GradingWorkspace.tsx 1 12.7%
src/components/assessment/AssessmentWorkspace.tsx 8 52.7%
Totals Coverage Status
Change from base Build 365: -0.8%
Covered Lines: 754
Relevant Lines: 2515

💛 - Coveralls

@ning-y ning-y changed the title Waiting on #204: Load solutionTemplate, answer into editorValue when appropriate WIP: Load solutionTemplate, answer into editorValue when appropriate Jul 19, 2018
@ning-y ning-y changed the title WIP: Load solutionTemplate, answer into editorValue when appropriate Load solutionTemplate, answer into editorValue when appropriate Jul 20, 2018
@ning-y ning-y changed the title Load solutionTemplate, answer into editorValue when appropriate Load editorValue from solutionTemplate or answer Jul 20, 2018
@ning-y ning-y requested a review from remo5000 July 20, 2018 04:40
@ning-y ning-y force-pushed the use-solution-template branch from cee4da3 to 9c7e233 Compare July 20, 2018 05:17
@ning-y
Copy link
Member Author

ning-y commented Jul 20, 2018

@remo5000 Rebased to master

@ning-y
Copy link
Member Author

ning-y commented Jul 20, 2018

@remo5000 Fixed the issue where evaluating an assessment workspace that has just been mounted always results in a missing semicolon syntax error, because the editor value in the state which eval editors uses still has the default value of undefined. 31a84c2

@@ -58,7 +58,7 @@ export interface IWorkspaceManagerState {

interface IWorkspaceState {
readonly context: Context
readonly editorValue: string
readonly editorValue: string | undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be changed to null?

notification.show({
intent: Intent.SUCCESS,
message,
timeout
})
}

export const showWarningMessage = (message: string, timeout = 500) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, could you try timeout: number = 500? If it doesn't work, then keeping the current change is fine too

@remo5000 remo5000 merged commit 7480501 into master Jul 20, 2018
@ning-y ning-y deleted the use-solution-template branch July 23, 2018 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants