-
Notifications
You must be signed in to change notification settings - Fork 9
Improvement to the general models #89
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
45 commits
Select commit
Hold shift + click to select a range
b25c5a6
WIP: change Course model to handle fields
pstaabp e0de746
WIP: updating courses and generic problem sets on improvements.
pstaabp b7ff6fb
WIP: more work on switching models.
pstaabp fc7dd5d
WIP: work on getting the UI simpler with newer models.
pstaabp bc83691
WIP: fixed loading of users by file.
pstaabp bd8538b
WIP: cleanup
pstaabp 2b60eaf
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp 887f84f
FIX: set_visible for problem_sets was not a JSON boolean.
pstaabp 6ab7ec4
WIP: Move the enable_reduced_scoring from set_params to set_dates in …
pstaabp 9280563
WIP: contined work on the models and tests.
pstaabp 9265b45
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp e138f0a
FIX: for dates in csv files, remove time-zone and also hack to get te…
pstaabp ed81b0e
FIX: store tests
pstaabp 133098c
FIX: refactor the way csv files are loaded in the perl test files.
pstaabp d3fb3f6
FIX: linting and perlcritic cleanup.
pstaabp cbfab52
FIX: updated UI to reflect that enable_reduced_scoring is moved from …
pstaabp 0692d06
Merge branch 'main' into model-improvements
pstaabp 5c924d4
FIX: errors with tests after merge.
pstaabp 9af6bc2
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp 75080a6
TEST: adding tests to ensure that only valid models are added to the …
pstaabp 55a31fb
FIX: linting and typos
pstaabp d879ccd
FIX: tests now return the database to it's original state.
pstaabp 1edc7ab
FIX: linting
pstaabp e532ccf
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp e328665
FIX: testing errors
pstaabp f6a0977
FIX: cleanup and using true/false in tests.
pstaabp 753e0be
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp c02696c
WIP: check that enable_reduced_scoring is a boolean.
pstaabp 5165dbe
FIX: perltidy/perlcritic errors
pstaabp 5196256
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp 04e8fe5
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp f16d56d
FIX: issues after merge with main.
pstaabp 53839a5
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp e4a5dc9
FIX: cleanup after merge
pstaabp 282c1ea
FIX: unit tests for review sets.
pstaabp 597aa7f
Merge branch 'db-send-json-boolean' into model-improvements
pstaabp 7f6baed
FIX: linting after merge.
pstaabp f688760
FIX: perltidy
pstaabp dbe2f02
FIX: add users manually wasn't working. There was related model/stor…
pstaabp 9750fa0
FIX: linting error.
pstaabp 89c5842
FIX: make a server call only if the username is valid
pstaabp 14919ce
Merge branch 'main' into model-improvements
pstaabp 5ce8918
FIX: duplicated rule
pstaabp 7731de8
FIX: move TestUtils.pm to t/lib and remove unnecessary $set_type vari…
pstaabp a365b0a
FIX: updated lib in build_db.pl script.
pstaabp 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
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// General Error coming from the API service | ||
|
||
import { logger } from 'boot/logger'; | ||
import { Model } from '../models'; | ||
|
||
export interface ResponseError { | ||
exception: string; | ||
message: string; | ||
} | ||
|
||
export const invalidError = (model: Model, msg: string) => { | ||
logger.error(msg); | ||
logger.error(JSON.stringify(model.toObject())); | ||
return Promise.reject(new Error(msg)); | ||
}; |
This file was deleted.
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
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.
This doesn't make any sense, and needs to be rethought. It doesn't make sense to have optional non-date fields in the dates.
The JSON column structure is going to need to be thought out better. Right now there are several bad design ideas going on with that. The original idea was for these to be for non-essential uncommon things. Not dates that are pretty well mapped out. Furthermore, this is making the implementation rather convoluted.
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 moved the
enable_reduced_scoring
into the date structure so checking date validity is self-contained for cases of reduced scoring. This solved the issue of needing to pass inenable_reduced_scoring
from theset_params
field to check the validity. In order to not hard-code this field into the dates, I added this other method.Let me know if you have some better thoughts on this or we can revert back to the way I handled it before.
Although I'm crazy about having a non-date field inside this, it does make a lot of other things easier to handle now.