-
Notifications
You must be signed in to change notification settings - Fork 12
feat: non numeric grades for faps #1180
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
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
65ed13a
feat: non numeric grades for faps WIP
TCMeldrum 61f63ca
feat: finish non numeric grading for faps
TCMeldrum 2a57637
Merge branch 'develop' into non-numeric-grades-for-faps
TCMeldrum 0b7e5d6
clean up console log
TCMeldrum 8a5adbf
Merge branch 'develop' into non-numeric-grades-for-faps
TCMeldrum 3e8c985
Merge branch 'develop' into non-numeric-grades-for-faps
TCMeldrum bdbb0f3
Merge branch 'develop' into non-numeric-grades-for-faps
TCMeldrum 1284f31
Merge branch 'develop' into non-numeric-grades-for-faps
TCMeldrum d841553
Merge branch 'develop' into non-numeric-grades-for-faps
TCMeldrum 74e2912
make test template export stable
TCMeldrum 2cf823a
default dp to 0
TCMeldrum ace9238
settings test fix
TCMeldrum 07bbc6f
Merge branch 'develop' into non-numeric-grades-for-faps
TCMeldrum 3f22add
fix test
TCMeldrum dbc9742
Merge branch 'non-numeric-grades-for-faps' of https://github.com/User…
TCMeldrum 5ca7d1a
fix test
TCMeldrum 8debf43
bump validation package
TCMeldrum f79d66d
Merge branch 'non-numeric-grades-for-faps' of https://github.com/User…
TCMeldrum 62d3391
update packagelock
TCMeldrum 32285eb
Merge branch 'develop' into non-numeric-grades-for-faps
TCMeldrum fcc712b
fix test
TCMeldrum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| DO | ||
| $$ | ||
| BEGIN | ||
| IF register_patch('ChangeFapGradeToString.sql', 'TCMeldrum', 'Make grade a string for FAPs', '2025-09-04') THEN | ||
| BEGIN | ||
|
|
||
| DROP VIEW review_data; | ||
|
|
||
| ALTER TABLE fap_reviews | ||
| ALTER COLUMN grade type varchar(30); | ||
|
|
||
| CREATE OR REPLACE VIEW public.review_data | ||
| AS SELECT proposal.proposal_pk, | ||
| proposal.proposal_id, | ||
| proposal.title, | ||
| proposal.instrument_name, | ||
| proposal.availability_time, | ||
| proposal.time_allocation, | ||
| proposal.fap_id, | ||
| proposal.rank_order, | ||
| proposal.call_id, | ||
| proposal.proposer_id, | ||
| proposal.instrument_id, | ||
| proposal.fap_time_allocation, | ||
| proposal.questionary_id, | ||
| grade.avg AS average_grade, | ||
| proposal.public_comment AS comment | ||
| FROM ( SELECT fp.proposal_pk, | ||
| p.proposal_id, | ||
| p.title, | ||
| i.name AS instrument_name, | ||
| chi.availability_time, | ||
| tr.time_allocation, | ||
| f.fap_id, | ||
| fmd.rank_order, | ||
| c.call_id, | ||
| p.proposer_id, | ||
| i.instrument_id, | ||
| fp.fap_time_allocation, | ||
| p.questionary_id, | ||
| tr.public_comment | ||
| FROM fap_proposals fp | ||
| JOIN faps f ON f.fap_id = fp.fap_id | ||
| JOIN call c ON c.call_id = fp.call_id | ||
| JOIN proposals p ON p.proposal_pk = fp.proposal_pk | ||
| JOIN technical_review tr ON tr.proposal_pk = p.proposal_pk AND tr.instrument_id = fp.instrument_id | ||
| LEFT JOIN fap_meeting_decisions fmd ON fmd.proposal_pk = p.proposal_pk | ||
| JOIN call_has_instruments chi ON chi.instrument_id = fp.instrument_id AND chi.call_id = c.call_id | ||
| JOIN instruments i ON i.instrument_id = chi.instrument_id | ||
| WHERE p.status_id <> 9 AND p.status_id <> 1) proposal | ||
| LEFT JOIN ( SELECT fr.proposal_pk, | ||
| avg(CASE | ||
| WHEN fr.grade ~ '^\d+(\.\d+)\?$' THEN fr.grade::double precision | ||
| ELSE NULL | ||
| END) AS avg | ||
| FROM fap_proposals fp | ||
| JOIN fap_reviews fr ON fr.proposal_pk = fp.proposal_pk | ||
| GROUP BY fr.proposal_pk) grade ON grade.proposal_pk = proposal.proposal_pk; | ||
|
|
||
|
|
||
| UPDATE questions SET default_config = jsonb_set(default_config, '{maxGrade}', '10', true) WHERE question_id = 'fap_review_basis'; | ||
| UPDATE questions SET default_config = jsonb_set(default_config, '{minGrade}', '1', true) WHERE question_id = 'fap_review_basis'; | ||
| UPDATE questions SET default_config = jsonb_set(default_config, '{decimalPoints}', '0', true) WHERE question_id = 'fap_review_basis'; | ||
| UPDATE templates_has_questions SET config = jsonb_set(config, '{maxGrade}', '10', true) WHERE question_id = 'fap_review_basis'; | ||
| UPDATE templates_has_questions SET config = jsonb_set(config, '{minGrade}', '1', true) WHERE question_id = 'fap_review_basis'; | ||
| UPDATE templates_has_questions SET config = jsonb_set(config, '{decimalPoints}', '0', true) WHERE question_id = 'fap_review_basis'; | ||
|
|
||
| DELETE FROM settings WHERE settings_id = 'GRADE_PRECISION'; | ||
| END; | ||
| END IF; | ||
| END; | ||
| $$ | ||
| LANGUAGE plpgsql; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,7 @@ export const dummyFapReview = new Review( | |
| 1, | ||
| 1, | ||
| 'Dummy Fap review', | ||
| 7, | ||
| '7', | ||
| 0, | ||
| 1, | ||
| 1, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There were 4 questions with sortOrder 6 meaning the templete export tests was failing as these 6 questiond could appear in the topic array in any order. IDK what about this PR made this unstable but hopefully this should make it more stable going forward