Skip to content
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

Survey: Append copy (fixes #5091) #6527

Merged
merged 7 commits into from
Jun 22, 2020
Merged

Survey: Append copy (fixes #5091) #6527

merged 7 commits into from
Jun 22, 2020

Conversation

jsschf
Copy link
Member

@jsschf jsschf commented Jun 9, 2020

Fixes #5091

So the query works, however I'm having a strange issue where planet updates the amount of times a survey has been taken, but the submissions database doesn't reflect that.
Annotation 2020-06-09 150912
Annotation 2020-06-09 151011

This doesn't make sense to me because that data in SurveysComponent is coming from the submissions database. @paulbert @lmmrssa could you shed some light on what's happening here or tell me if I'm misunderstanding?

@paulbert
Copy link
Member

paulbert commented Jun 9, 2020

I think the taken field is making it into the submissions document by mistake. That's a calculated field based on the number of documents in the submissions database for that test/survey, and it's not updated for all documents when the value changes.

Generally we try to make sure calculated fields like that do not make it into the database because it is misleading, but it looks like this one made it in. Sorry for the confusion!

@jsschf
Copy link
Member Author

jsschf commented Jun 9, 2020

@paulbert Ok thanks that makes sense.

@jsschf jsschf removed the question label Jun 9, 2020
@jsschf jsschf changed the title Add query (fixes #5091) Survey: Append copy (fixes #5091) Jun 9, 2020
@jsschf
Copy link
Member Author

jsschf commented Jun 10, 2020

@paulbert @lmmrssa I'm having trouble pushing my code because tslint is failing, and the debug log doesn't give specific information. Is there a way to find which line or which rule I'm breaking, or setting up an auto-format on save using the tslint.json rules?

@jsschf jsschf added question and removed question labels Jun 10, 2020
@jsschf
Copy link
Member Author

jsschf commented Jun 11, 2020

Hi @paulbert @lmmrssa two things:

  • So yesterday I was working on this issue and it wasn't saving the updated name with - COPY appended. While I was trying to figure it out, I tried it again without changing anything and it worked. Today it doesn't work again and I'm not sure why.
  • The copied surveys don't save the survey information, only the name and I'm not sure why either.
    Annotation 2020-06-11 083806

I would appreciate guidance on this issue.

@paulbert
Copy link
Member

@jsschf When I tested I saw ** - COPY** added correctly after saving, but it was not added in the form. I also saw all of the question information was saved correctly.

I see that if you edit the name and then change it back to the previous one it will still save. You'll need to reset the validator to no exceptions (line 101 but without the parameter).

}
}, (error) => {
console.log(error);
});
Copy link
Member

Choose a reason for hiding this comment

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

Small thing, but there should be one more space in this indentation

@jsschf
Copy link
Member Author

jsschf commented Jun 15, 2020

@paulbert Two of the Code Climate issues are that the constructor in ExamsAddComponent looks similar to the constructor in CoursesComponent, which I don't think necessitates a fix. The other two issues are that ngOnInit() exceeded both the Cognitive Complexity and lines of code allowances. I'm not sure how to refactor to resolve those issues. I would appreciate guidance.

@paulbert paulbert merged commit 41d59ae into master Jun 22, 2020
@paulbert paulbert deleted the 5091-survey-copy branch June 23, 2020 02:32
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.

Surveys: Once survey taken do not allow edit only copy
2 participants