forked from makeopensource/devU-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Submission problem score (makeopensource#43)
Add the submission problem score entity Add documentation rename filenames to be consistently singular Co-authored-by: Emil Kovacev <[email protected]> Co-authored-by: Emil Kovacev <[email protected]> Co-authored-by: John Abramo <[email protected]> Co-authored-by: Alex M <[email protected]> Co-authored-by: dylanzinsley <[email protected]> Co-authored-by: Adrian Carter <[email protected]> Co-authored-by: alan soto <[email protected]> Co-authored-by: Alan Soto <[email protected]> Co-authored-by: --global <--global> Co-authored-by: Adrian Carter <[email protected]> Co-authored-by: zhikangxie107 <[email protected]> Co-authored-by: Dylanz5 <[email protected]> Co-authored-by: ToNewAutumn <[email protected]>
- Loading branch information
1 parent
6d7c15a
commit 0ca1c2d
Showing
69 changed files
with
3,076 additions
and
10,402 deletions.
There are no files selected for viewing
This file contains 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 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,121 @@ | ||
# Entities | ||
|
||
- [x] [User](#user) | ||
- [x] [Course](#course) | ||
- [x] [UserCourse](#usercourse) | ||
- [x] [Assignment](#assignment) | ||
- [x] [Submission](#submission) | ||
- [x] [AssignmentProblem](#assignmentproblem) | ||
- [ ] [SubmissionProblemScore](#submissionproblemscore) | ||
- [ ] [SubmissionScore](#submissionscore) | ||
- [ ] [AssignmentScore](#assignmentscore) | ||
- [ ] [CategoryScore](#categoryscore) | ||
- [ ] [Category](#category) | ||
- [ ] [CourseScore](#coursescore) | ||
|
||
|
||
|
||
# Entity Details | ||
|
||
### Generic Entity Attributes | ||
* id | ||
* createdAt | ||
* updatedAt | ||
* deletedAt | ||
|
||
|
||
### User | ||
*Student user for devu* | ||
* email: string | ||
* externalId: foreign_key | ||
* preferredName: string | ||
|
||
|
||
### Course | ||
* name: string | ||
* semester: string | ||
* number: string *ex: cse220* | ||
* startDate: ? | ||
* endDate: ? | ||
|
||
|
||
### UserCourse | ||
*Links a user to a course* | ||
* userId: foreign_key | ||
* courseId: foreign_key | ||
* level: ? | ||
* dropped: boolean | ||
|
||
|
||
### Assignment | ||
* courseId: foreign_key | ||
* name: string | ||
* startDate: ? | ||
* dueDate: ? | ||
* endDate: ? | ||
* gradingType: ? | ||
* categoryName: ? | ||
* description: string | ||
* maxFileSize: ? | ||
* maxSubmissions: ? | ||
* disableHandins: boolean | ||
|
||
|
||
### Submission | ||
* courseId: foreign_key | ||
* assignmentId: foreign_key | ||
* userId: foreign_key | ||
* content: ? | ||
* type: ? | ||
* submitterIp: ? | ||
* submittedBy: ? | ||
* orignalSubmissionId: ? | ||
|
||
|
||
### AssignmentProblem | ||
* assignmentId: foreign_key | ||
* problemName: ? | ||
* maxScore: ? | ||
|
||
|
||
**------ Everything above this line exists in the code. Everything below needs to be built ------** | ||
|
||
|
||
### SubmissionProblemScore | ||
* submissionId: foreign_key | ||
* assignmentProblemId: foreign_key | ||
* score: ? | ||
* feedback: ? | ||
* released: ? | ||
|
||
|
||
### SubmissionScore | ||
* submissionId: foreign_key | ||
* score: ? | ||
* feedback: ? | ||
* released: ? | ||
|
||
|
||
### AssignmentScore | ||
* assignmentId: foreign_key | ||
* userId: foreign_key | ||
* score: ? | ||
|
||
|
||
### CategoryScore | ||
* categoryId: foreign_key | ||
* userId: foreign_key | ||
* *missing attributes* | ||
|
||
|
||
### Category | ||
* courseId: foreign_key | ||
* *missing attributes* | ||
|
||
|
||
### CourseScore | ||
* courseId: foreign_key | ||
* userId: foreign_key | ||
* *missing attributes* | ||
|
||
|
This file contains 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 |
---|---|---|
|
@@ -14,8 +14,50 @@ If you wish to better understand how this works, here's a bit more information. | |
When developer auth is enabled, users can provide the email & externalId of the user they wish to login as (or create) and recieve a valid refresh/ access token. | ||
### Fetching the bearer token | ||
Request: `POST /login/developer` | ||
|
||
Sample Request body: | ||
``` | ||
{ | ||
"email": "[email protected]", | ||
"externalId": "101" | ||
} | ||
``` | ||
|
||
Sample Response: | ||
|
||
``` | ||
{ | ||
"message": "Login successful" | ||
} | ||
``` | ||
|
||
Sample Response Headers: | ||
``` | ||
{ | ||
"Set-Cookie": "refreshToken=<token>;<cookie settings>" | ||
} | ||
``` | ||
|
||
### Using the Bearer token | ||
|
||
Request: `GET /users` | ||
|
||
Request headers (notice the space between `Bearer` and `<token>`!): | ||
|
||
``` | ||
{ | ||
"Authorization": "Bearer <token>" | ||
} | ||
``` | ||
|
||
With this flag on, it enabled the `/login/developer` route (see `./router/login.router.ts` for more details). | ||
|
||
|
||
|
||
## Testing SAML Authentication Locally | ||
|
||
To test SAML authentication, you will need to configure an Identity Provider (IDP) for the API to authenticate against. As we don't expect anyone to just have a configured IDP laying around ready to go, this will walk through using [SamlTest.id](https://samltest.id/). | ||
|
This file contains 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,20 @@ | ||
# Postman Setup | ||
|
||
[JSON configuration file for Postman](https://www.getpostman.com/collections/b817928ddd3489a9f8a4) | ||
|
||
Postman is a great tool for testing API endpoints. The link above is a configuration file that | ||
will help setup the basic configuration for working with most of the basic endpoints. | ||
|
||
### Get Started | ||
1. Install/Open Postman | ||
2. Copy JSON configuration file link | ||
3. Select `Import > Link` | ||
4. Paste the link, click continue, and then click `Import` | ||
|
||
### Setup Auth | ||
See `docs/localAuth.md` for examples | ||
|
||
1. Using the auth folder, run `retrieve auth token` | ||
2. Copy the **content** of the refresh token | ||
3. Under the devU collection, set a variable called `authorization` to the content of the previous step | ||
4. Run all the requests you want! |
Oops, something went wrong.