Skip to content

Commit

Permalink
Merge pull request #55 from BioMediaLab/big-one
Browse files Browse the repository at this point in the history
Implement MVP
  • Loading branch information
Cliff Pyles authored Jul 1, 2019
2 parents c69c831 + 68800ee commit be2701a
Show file tree
Hide file tree
Showing 21,122 changed files with 263,943 additions and 3,120 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
137 changes: 123 additions & 14 deletions amplify/backend/api/whiteboard/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
type Course
@model
@key(name: "ByCourseId", fields: ["courseId", "createdAt"])
@auth(
rules: [
{ allow: groups, groups: ["admin", "professor", "teacher_assistant"] }
{ allow: groups, groups: ["student"], operations: [read] }
]
) {
id: ID!
createdAt: AWSDateTime
updatedAt: AWSDateTime
courseId: String!
title: String!
description: String
semester: Semester
settings: [KeyValue]
quizzes: [Quiz] @connection(name: "CourseQuizzes")
enrollments: [Enrollment] @connection(name: "CourseEnrollments")
instructor: Instructor @connection(name: "InstructorCourses")
quizAttempts: [QuizAttempt] @connection(name: "CourseQuizAttempts")
}

type Quiz
Expand All @@ -21,39 +30,139 @@ type Quiz
]
) {
id: ID!
createdAt: AWSDateTime
updatedAt: AWSDateTime
title: String!
description: String
course: Course! @connection(name: "CourseQuizzes")
questions: [AWSJSON!]!
course: Course @connection(name: "CourseQuizzes")
questions: [Question]
settings: [KeyValue]
}

type QuizTemplate
type Student @model @auth(rules: [{ allow: owner }]) {
id: ID!
createdAt: AWSDateTime
updatedAt: AWSDateTime
profile: Profile!
enrollments: [Enrollment] @connection(name: "StudentEnrollments")
settings: [KeyValue]
}

type Instructor @model @auth(rules: [{ allow: owner }]) {
id: ID!
createdAt: AWSDateTime
updatedAt: AWSDateTime
profile: Profile!
courses: [Course] @connection(name: "InstructorCourses")
settings: [KeyValue]
}

type Profile
@model
@key(name: "ByEmail", fields: ["email"])
@auth(
rules: [
{ allow: groups, groups: ["admin", "professor", "teacher_assistant"] }
{ allow: owner }
{
allow: groups
groups: ["admin", "professor", "teacher_assistant"]
operations: [read]
}
]
) {
id: ID!
title: String!
description: String
questions: [AWSJSON!]!
createdAt: AWSDateTime
updatedAt: AWSDateTime
firstName: String!
middleInitial: String
lastName: String!
email: AWSEmail!
}

type Enrollment @model(queries: null) {
id: ID!
createdAt: AWSDateTime
updatedAt: AWSDateTime
student: Student! @connection(name: "StudentEnrollments")
course: Course! @connection(name: "CourseEnrollments")
}

type Question
type QuizAttempt
@model
@auth(
rules: [
{ allow: groups, groups: ["admin", "professor", "teacher_assistant"] }
{ allow: owner }
{
allow: groups
groups: ["admin", "professor", "teacher_assistant"]
operations: [read]
}
]
) {
id: String!
student: String!
createdAt: AWSDateTime
updatedAt: AWSDateTime
responses: [Response]
questions: [Question]
course: Course @connection(name: "CourseQuizAttempts")
}

type Question {
key: Int
question: String
choices: [KeyValue]
answers: [KeyValue]
@auth(
rules: [
{ allow: groups, groups: ["admin", "professor", "teacher_assistant"] }
{ allow: groups, groups: ["student"], operations: [null] }
]
)
}

type Response {
id: ID!
question: String!
choices: [Answer]
answer: Answer
choices: [KeyValue]
answers: [KeyValue]
@auth(
rules: [
{ allow: owner }
{ allow: groups, groups: ["admin", "professor", "teacher_assistant"] }
]
)
}

type QuestionBank
@model
@key(name: "ByCourseId", fields: ["courseId", "createdAt"])
@auth(
rules: [
{ allow: groups, groups: ["admin", "professor", "teacher_assistant"] }
]
) {
id: ID!
createdAt: AWSDateTime
updatedAt: AWSDateTime
title: String!
courseId: String!
description: String
questions: [Question]
}

type KeyValue {
key: String
value: String
}

type Semester {
season: Season
year: Int
}

type Answer {
key: String!
value: String!
enum Season {
spring
fall
summer
}
32 changes: 32 additions & 0 deletions groups.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
UserPoolAdminGroup:
Type: "AWS::Cognito::UserPoolGroup"
Properties:
Description: "A user who is an admin"
GroupName: "admin"
Precedence: 0
UserPoolId: !Ref UserPool
DependsOn: UserPool
UserPoolProfessorGroup:
Type: "AWS::Cognito::UserPoolGroup"
Properties:
Description: "A user who is a professor"
GroupName: "professor"
Precedence: 1
UserPoolId: !Ref UserPool
DependsOn: UserPool
UserPoolTeacherAssistantGroup:
Type: "AWS::Cognito::UserPoolGroup"
Properties:
Description: "A user who is a teacher assistant"
GroupName: "teacher_assistant"
Precedence: 2
UserPoolId: !Ref UserPool
DependsOn: UserPool
UserPoolStudentGroup:
Type: "AWS::Cognito::UserPoolGroup"
Properties:
Description: "A user who is a student"
GroupName: "student"
Precedence: 3
UserPoolId: !Ref UserPool
DependsOn: UserPool
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@
"dependencies": {
"@reach/router": "1.2.1",
"@shopify/polaris": "3.17.0",
"@types/jest": "^24.0.15",
"@types/node": "^12.0.8",
"@types/react": "^16.8.20",
"@types/react-dom": "^16.8.4",
"aws-amplify": "1.1.27",
"aws-amplify-react": "2.3.9",
"aws-amplify-react": "2.3.7",
"aws-appsync": "^1.8.1",
"dot-prop": "^5.1.0",
"graphql-tag": "^2.10.1",
"gravatar-url": "3.0.1",
"react": "16.8.6",
"react-dom": "16.8.6",
"react-scripts": "2.1.8"
"react-redux": "^7.1.0",
"react-scripts": "2.1.8",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"typescript": "^3.5.2"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -31,10 +42,11 @@
"devDependencies": {
"cypress": "3.3.0",
"esm": "^3.2.25",
"faker": "^4.1.0",
"jest-dom": "3.1.3",
"jest-extended": "^0.11.1",
"node-fetch": "2.3.0",
"react-testing-library": "8.0.1",
"supertest": "^4.0.2"
}
}
}
Loading

0 comments on commit be2701a

Please sign in to comment.