add new assessement v2
This commit is contained in:
12
app/graphql/resolvers/categories_query_resolver.rb
Normal file
12
app/graphql/resolvers/categories_query_resolver.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
module Resolvers
|
||||||
|
class CategoriesQueryResolver
|
||||||
|
def initialize(context)
|
||||||
|
@context = context
|
||||||
|
end
|
||||||
|
|
||||||
|
def resolve
|
||||||
|
CategoryPolicy::Scope.new(@context[:current_user], Category).resolve
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -7,6 +7,7 @@ module Types
|
|||||||
argument :where, Inputs::QuestionWhereInput, required: false
|
argument :where, Inputs::QuestionWhereInput, required: false
|
||||||
end
|
end
|
||||||
field :subjects, SubjectType.connection_type, null: false
|
field :subjects, SubjectType.connection_type, null: false
|
||||||
|
field :categories, CategoryType.connection_type, null: false
|
||||||
field :reviewers, UserType.connection_type, null: false
|
field :reviewers, UserType.connection_type, null: false
|
||||||
field :question_filter_options, QuestionFilterOptionsType, null: false
|
field :question_filter_options, QuestionFilterOptionsType, null: false
|
||||||
field :current_user, Types::UserType, null: true
|
field :current_user, Types::UserType, null: true
|
||||||
@@ -19,6 +20,10 @@ module Types
|
|||||||
Resolvers::SubjectsQueryResolver.new(context).resolve
|
Resolvers::SubjectsQueryResolver.new(context).resolve
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def categories
|
||||||
|
Resolvers::CategoriesQueryResolver.new(context).resolve
|
||||||
|
end
|
||||||
|
|
||||||
def reviewers
|
def reviewers
|
||||||
Resolvers::ReviewersQueryResolver.new(context).resolve
|
Resolvers::ReviewersQueryResolver.new(context).resolve
|
||||||
end
|
end
|
||||||
|
|||||||
294
app/javascript/__generated__/graphql-schema.ts
generated
294
app/javascript/__generated__/graphql-schema.ts
generated
@@ -3,37 +3,60 @@ export type InputMaybe<T> = Maybe<T>;
|
|||||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
||||||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
||||||
|
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
|
||||||
|
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
|
||||||
/** All built-in and custom scalars, mapped to their actual values */
|
/** All built-in and custom scalars, mapped to their actual values */
|
||||||
export type Scalars = {
|
export type Scalars = {
|
||||||
ID: string;
|
ID: { input: string; output: string; }
|
||||||
String: string;
|
String: { input: string; output: string; }
|
||||||
Boolean: boolean;
|
Boolean: { input: boolean; output: boolean; }
|
||||||
Int: number;
|
Int: { input: number; output: number; }
|
||||||
Float: number;
|
Float: { input: number; output: number; }
|
||||||
/** An ISO 8601-encoded date */
|
/** An ISO 8601-encoded date */
|
||||||
ISO8601Date: any;
|
ISO8601Date: { input: any; output: any; }
|
||||||
/** An ISO 8601-encoded datetime */
|
/** An ISO 8601-encoded datetime */
|
||||||
ISO8601DateTime: any;
|
ISO8601DateTime: { input: any; output: any; }
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Axis = {
|
export type Axis = {
|
||||||
__typename?: 'Axis';
|
__typename?: 'Axis';
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['output'];
|
||||||
name: Scalars['String'];
|
name: Scalars['String']['output'];
|
||||||
subjects: Array<Subject>;
|
subjects: Array<Subject>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Category = {
|
export type Category = {
|
||||||
__typename?: 'Category';
|
__typename?: 'Category';
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['output'];
|
||||||
name: Scalars['String'];
|
name: Scalars['String']['output'];
|
||||||
subjects: Array<Subject>;
|
subjects: Array<Subject>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** The connection type for Category. */
|
||||||
|
export type CategoryConnection = {
|
||||||
|
__typename?: 'CategoryConnection';
|
||||||
|
/** A list of edges. */
|
||||||
|
edges: Array<CategoryEdge>;
|
||||||
|
/** A list of nodes. */
|
||||||
|
nodes: Array<Category>;
|
||||||
|
/** Information to aid in pagination. */
|
||||||
|
pageInfo: PageInfo;
|
||||||
|
totalCount: Scalars['Int']['output'];
|
||||||
|
};
|
||||||
|
|
||||||
|
/** An edge in a connection. */
|
||||||
|
export type CategoryEdge = {
|
||||||
|
__typename?: 'CategoryEdge';
|
||||||
|
/** A cursor for use in pagination. */
|
||||||
|
cursor: Scalars['String']['output'];
|
||||||
|
/** The item at the end of the edge. */
|
||||||
|
node?: Maybe<Category>;
|
||||||
|
};
|
||||||
|
|
||||||
/** Autogenerated input type of CreateQuestion */
|
/** Autogenerated input type of CreateQuestion */
|
||||||
export type CreateQuestionInput = {
|
export type CreateQuestionInput = {
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: InputMaybe<Scalars['String']>;
|
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||||
question: QuestionCreateInput;
|
question: QuestionCreateInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -41,16 +64,16 @@ export type CreateQuestionInput = {
|
|||||||
export type CreateQuestionPayload = {
|
export type CreateQuestionPayload = {
|
||||||
__typename?: 'CreateQuestionPayload';
|
__typename?: 'CreateQuestionPayload';
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: Maybe<Scalars['String']>;
|
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||||
/** Errors encountered during execution of the mutation. */
|
/** Errors encountered during execution of the mutation. */
|
||||||
errors: Array<Scalars['String']>;
|
errors: Array<Scalars['String']['output']>;
|
||||||
question?: Maybe<Question>;
|
question?: Maybe<Question>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Autogenerated input type of CreateReviewMessage */
|
/** Autogenerated input type of CreateReviewMessage */
|
||||||
export type CreateReviewMessageInput = {
|
export type CreateReviewMessageInput = {
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: InputMaybe<Scalars['String']>;
|
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||||
message: ReviewMessageInput;
|
message: ReviewMessageInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -58,48 +81,48 @@ export type CreateReviewMessageInput = {
|
|||||||
export type CreateReviewMessagePayload = {
|
export type CreateReviewMessagePayload = {
|
||||||
__typename?: 'CreateReviewMessagePayload';
|
__typename?: 'CreateReviewMessagePayload';
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: Maybe<Scalars['String']>;
|
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||||
/** Errors encountered during execution of the mutation. */
|
/** Errors encountered during execution of the mutation. */
|
||||||
errors: Array<Scalars['String']>;
|
errors: Array<Scalars['String']['output']>;
|
||||||
reviewMessage?: Maybe<ReviewMessage>;
|
reviewMessage?: Maybe<ReviewMessage>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DateRangeInput = {
|
export type DateRangeInput = {
|
||||||
endAt: Scalars['ISO8601Date'];
|
endAt: Scalars['ISO8601Date']['input'];
|
||||||
startAt: Scalars['ISO8601Date'];
|
startAt: Scalars['ISO8601Date']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Autogenerated input type of DestroyQuestion */
|
/** Autogenerated input type of DestroyQuestion */
|
||||||
export type DestroyQuestionInput = {
|
export type DestroyQuestionInput = {
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: InputMaybe<Scalars['String']>;
|
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||||
questionId: Scalars['ID'];
|
questionId: Scalars['ID']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Autogenerated return type of DestroyQuestion */
|
/** Autogenerated return type of DestroyQuestion */
|
||||||
export type DestroyQuestionPayload = {
|
export type DestroyQuestionPayload = {
|
||||||
__typename?: 'DestroyQuestionPayload';
|
__typename?: 'DestroyQuestionPayload';
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: Maybe<Scalars['String']>;
|
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||||
deletedQuestionId?: Maybe<Scalars['ID']>;
|
deletedQuestionId?: Maybe<Scalars['ID']['output']>;
|
||||||
/** Errors encountered during execution of the mutation. */
|
/** Errors encountered during execution of the mutation. */
|
||||||
errors: Array<Scalars['String']>;
|
errors: Array<Scalars['String']['output']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Autogenerated input type of FinishQuestion */
|
/** Autogenerated input type of FinishQuestion */
|
||||||
export type FinishQuestionInput = {
|
export type FinishQuestionInput = {
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: InputMaybe<Scalars['String']>;
|
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||||
questionId: Scalars['ID'];
|
questionId: Scalars['ID']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Autogenerated return type of FinishQuestion */
|
/** Autogenerated return type of FinishQuestion */
|
||||||
export type FinishQuestionPayload = {
|
export type FinishQuestionPayload = {
|
||||||
__typename?: 'FinishQuestionPayload';
|
__typename?: 'FinishQuestionPayload';
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: Maybe<Scalars['String']>;
|
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||||
/** Errors encountered during execution of the mutation. */
|
/** Errors encountered during execution of the mutation. */
|
||||||
errors: Array<Scalars['String']>;
|
errors: Array<Scalars['String']['output']>;
|
||||||
question?: Maybe<Question>;
|
question?: Maybe<Question>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -140,24 +163,25 @@ export type MutationUpdateQuestionArgs = {
|
|||||||
/** An object with an ID. */
|
/** An object with an ID. */
|
||||||
export type Node = {
|
export type Node = {
|
||||||
/** ID of the object. */
|
/** ID of the object. */
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Information about pagination in a connection. */
|
/** Information about pagination in a connection. */
|
||||||
export type PageInfo = {
|
export type PageInfo = {
|
||||||
__typename?: 'PageInfo';
|
__typename?: 'PageInfo';
|
||||||
/** When paginating forwards, the cursor to continue. */
|
/** When paginating forwards, the cursor to continue. */
|
||||||
endCursor?: Maybe<Scalars['String']>;
|
endCursor?: Maybe<Scalars['String']['output']>;
|
||||||
/** When paginating forwards, are there more items? */
|
/** When paginating forwards, are there more items? */
|
||||||
hasNextPage: Scalars['Boolean'];
|
hasNextPage: Scalars['Boolean']['output'];
|
||||||
/** When paginating backwards, are there more items? */
|
/** When paginating backwards, are there more items? */
|
||||||
hasPreviousPage: Scalars['Boolean'];
|
hasPreviousPage: Scalars['Boolean']['output'];
|
||||||
/** When paginating backwards, the cursor to continue. */
|
/** When paginating backwards, the cursor to continue. */
|
||||||
startCursor?: Maybe<Scalars['String']>;
|
startCursor?: Maybe<Scalars['String']['output']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Query = {
|
export type Query = {
|
||||||
__typename?: 'Query';
|
__typename?: 'Query';
|
||||||
|
categories: CategoryConnection;
|
||||||
currentUser?: Maybe<User>;
|
currentUser?: Maybe<User>;
|
||||||
/** Fetches an object given its ID. */
|
/** Fetches an object given its ID. */
|
||||||
node?: Maybe<Node>;
|
node?: Maybe<Node>;
|
||||||
@@ -170,81 +194,89 @@ export type Query = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type QueryCategoriesArgs = {
|
||||||
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
first?: InputMaybe<Scalars['Int']['input']>;
|
||||||
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
export type QueryNodeArgs = {
|
export type QueryNodeArgs = {
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type QueryNodesArgs = {
|
export type QueryNodesArgs = {
|
||||||
ids: Array<Scalars['ID']>;
|
ids: Array<Scalars['ID']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type QueryQuestionsArgs = {
|
export type QueryQuestionsArgs = {
|
||||||
after?: InputMaybe<Scalars['String']>;
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
before?: InputMaybe<Scalars['String']>;
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
first?: InputMaybe<Scalars['Int']>;
|
first?: InputMaybe<Scalars['Int']['input']>;
|
||||||
last?: InputMaybe<Scalars['Int']>;
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
where?: InputMaybe<QuestionWhereInput>;
|
where?: InputMaybe<QuestionWhereInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type QueryReviewersArgs = {
|
export type QueryReviewersArgs = {
|
||||||
after?: InputMaybe<Scalars['String']>;
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
before?: InputMaybe<Scalars['String']>;
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
first?: InputMaybe<Scalars['Int']>;
|
first?: InputMaybe<Scalars['Int']['input']>;
|
||||||
last?: InputMaybe<Scalars['Int']>;
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type QuerySubjectsArgs = {
|
export type QuerySubjectsArgs = {
|
||||||
after?: InputMaybe<Scalars['String']>;
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
before?: InputMaybe<Scalars['String']>;
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
first?: InputMaybe<Scalars['Int']>;
|
first?: InputMaybe<Scalars['Int']['input']>;
|
||||||
last?: InputMaybe<Scalars['Int']>;
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Question = Node & {
|
export type Question = Node & {
|
||||||
__typename?: 'Question';
|
__typename?: 'Question';
|
||||||
alternatives: Array<QuestionAlternative>;
|
alternatives: Array<QuestionAlternative>;
|
||||||
authorship?: Maybe<Scalars['String']>;
|
authorship?: Maybe<Scalars['String']['output']>;
|
||||||
authorshipYear?: Maybe<Scalars['String']>;
|
authorshipYear?: Maybe<Scalars['String']['output']>;
|
||||||
bloomTaxonomy?: Maybe<QuestionBloomTaxonomy>;
|
bloomTaxonomy?: Maybe<QuestionBloomTaxonomy>;
|
||||||
body?: Maybe<Scalars['String']>;
|
body?: Maybe<Scalars['String']['output']>;
|
||||||
checkType?: Maybe<QuestionCheckType>;
|
checkType?: Maybe<QuestionCheckType>;
|
||||||
createdAt: Scalars['ISO8601DateTime'];
|
createdAt: Scalars['ISO8601DateTime']['output'];
|
||||||
difficulty?: Maybe<QuestionDifficulty>;
|
difficulty?: Maybe<QuestionDifficulty>;
|
||||||
explanation?: Maybe<Scalars['String']>;
|
explanation?: Maybe<Scalars['String']['output']>;
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['output'];
|
||||||
instruction?: Maybe<Scalars['String']>;
|
instruction?: Maybe<Scalars['String']['output']>;
|
||||||
intention?: Maybe<Scalars['String']>;
|
intention?: Maybe<Scalars['String']['output']>;
|
||||||
references?: Maybe<Scalars['String']>;
|
references?: Maybe<Scalars['String']['output']>;
|
||||||
reviewMessages: ReviewMessageConnection;
|
reviewMessages: ReviewMessageConnection;
|
||||||
reviewer?: Maybe<User>;
|
reviewer?: Maybe<User>;
|
||||||
status: QuestionStatus;
|
status: QuestionStatus;
|
||||||
subject?: Maybe<Subject>;
|
subject?: Maybe<Subject>;
|
||||||
support?: Maybe<Scalars['String']>;
|
support?: Maybe<Scalars['String']['output']>;
|
||||||
updatedAt: Scalars['ISO8601DateTime'];
|
updatedAt: Scalars['ISO8601DateTime']['output'];
|
||||||
user: User;
|
user: User;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type QuestionReviewMessagesArgs = {
|
export type QuestionReviewMessagesArgs = {
|
||||||
after?: InputMaybe<Scalars['String']>;
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
before?: InputMaybe<Scalars['String']>;
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
first?: InputMaybe<Scalars['Int']>;
|
first?: InputMaybe<Scalars['Int']['input']>;
|
||||||
last?: InputMaybe<Scalars['Int']>;
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type QuestionAlternative = {
|
export type QuestionAlternative = {
|
||||||
__typename?: 'QuestionAlternative';
|
__typename?: 'QuestionAlternative';
|
||||||
correct: Scalars['Boolean'];
|
correct: Scalars['Boolean']['output'];
|
||||||
text?: Maybe<Scalars['String']>;
|
text?: Maybe<Scalars['String']['output']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type QuestionAlternativeInput = {
|
export type QuestionAlternativeInput = {
|
||||||
correct?: InputMaybe<Scalars['Boolean']>;
|
correct?: InputMaybe<Scalars['Boolean']['input']>;
|
||||||
text?: InputMaybe<Scalars['String']>;
|
text?: InputMaybe<Scalars['String']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum QuestionBloomTaxonomy {
|
export enum QuestionBloomTaxonomy {
|
||||||
@@ -278,25 +310,25 @@ export type QuestionConnection = {
|
|||||||
nodes: Array<Question>;
|
nodes: Array<Question>;
|
||||||
/** Information to aid in pagination. */
|
/** Information to aid in pagination. */
|
||||||
pageInfo: PageInfo;
|
pageInfo: PageInfo;
|
||||||
totalCount: Scalars['Int'];
|
totalCount: Scalars['Int']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type QuestionCreateInput = {
|
export type QuestionCreateInput = {
|
||||||
alternatives: Array<QuestionAlternativeInput>;
|
alternatives: Array<QuestionAlternativeInput>;
|
||||||
authorship: Scalars['String'];
|
authorship: Scalars['String']['input'];
|
||||||
authorshipYear: Scalars['String'];
|
authorshipYear: Scalars['String']['input'];
|
||||||
bloomTaxonomy?: InputMaybe<QuestionBloomTaxonomy>;
|
bloomTaxonomy?: InputMaybe<QuestionBloomTaxonomy>;
|
||||||
body: Scalars['String'];
|
body: Scalars['String']['input'];
|
||||||
checkType?: InputMaybe<QuestionCheckType>;
|
checkType?: InputMaybe<QuestionCheckType>;
|
||||||
difficulty?: InputMaybe<QuestionDifficulty>;
|
difficulty?: InputMaybe<QuestionDifficulty>;
|
||||||
explanation: Scalars['String'];
|
explanation: Scalars['String']['input'];
|
||||||
instruction: Scalars['String'];
|
instruction: Scalars['String']['input'];
|
||||||
intention?: InputMaybe<Scalars['String']>;
|
intention?: InputMaybe<Scalars['String']['input']>;
|
||||||
references: Scalars['String'];
|
references: Scalars['String']['input'];
|
||||||
reviewerUserId?: InputMaybe<Scalars['ID']>;
|
reviewerUserId?: InputMaybe<Scalars['ID']['input']>;
|
||||||
status: QuestionStatus;
|
status: QuestionStatus;
|
||||||
subjectId?: InputMaybe<Scalars['ID']>;
|
subjectId?: InputMaybe<Scalars['ID']['input']>;
|
||||||
support: Scalars['String'];
|
support: Scalars['String']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum QuestionDifficulty {
|
export enum QuestionDifficulty {
|
||||||
@@ -309,14 +341,14 @@ export enum QuestionDifficulty {
|
|||||||
export type QuestionEdge = {
|
export type QuestionEdge = {
|
||||||
__typename?: 'QuestionEdge';
|
__typename?: 'QuestionEdge';
|
||||||
/** A cursor for use in pagination. */
|
/** A cursor for use in pagination. */
|
||||||
cursor: Scalars['String'];
|
cursor: Scalars['String']['output'];
|
||||||
/** The item at the end of the edge. */
|
/** The item at the end of the edge. */
|
||||||
node?: Maybe<Question>;
|
node?: Maybe<Question>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type QuestionFilterOptions = {
|
export type QuestionFilterOptions = {
|
||||||
__typename?: 'QuestionFilterOptions';
|
__typename?: 'QuestionFilterOptions';
|
||||||
years: Array<Scalars['String']>;
|
years: Array<Scalars['String']['output']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum QuestionStatus {
|
export enum QuestionStatus {
|
||||||
@@ -329,43 +361,43 @@ export enum QuestionStatus {
|
|||||||
|
|
||||||
export type QuestionUpdateInput = {
|
export type QuestionUpdateInput = {
|
||||||
alternatives: Array<QuestionAlternativeInput>;
|
alternatives: Array<QuestionAlternativeInput>;
|
||||||
authorship: Scalars['String'];
|
authorship: Scalars['String']['input'];
|
||||||
authorshipYear: Scalars['String'];
|
authorshipYear: Scalars['String']['input'];
|
||||||
bloomTaxonomy?: InputMaybe<QuestionBloomTaxonomy>;
|
bloomTaxonomy?: InputMaybe<QuestionBloomTaxonomy>;
|
||||||
body: Scalars['String'];
|
body: Scalars['String']['input'];
|
||||||
checkType?: InputMaybe<QuestionCheckType>;
|
checkType?: InputMaybe<QuestionCheckType>;
|
||||||
difficulty?: InputMaybe<QuestionDifficulty>;
|
difficulty?: InputMaybe<QuestionDifficulty>;
|
||||||
explanation: Scalars['String'];
|
explanation: Scalars['String']['input'];
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['input'];
|
||||||
instruction: Scalars['String'];
|
instruction: Scalars['String']['input'];
|
||||||
intention?: InputMaybe<Scalars['String']>;
|
intention?: InputMaybe<Scalars['String']['input']>;
|
||||||
references: Scalars['String'];
|
references: Scalars['String']['input'];
|
||||||
reviewerUserId?: InputMaybe<Scalars['ID']>;
|
reviewerUserId?: InputMaybe<Scalars['ID']['input']>;
|
||||||
status: QuestionStatus;
|
status: QuestionStatus;
|
||||||
subjectId?: InputMaybe<Scalars['ID']>;
|
subjectId?: InputMaybe<Scalars['ID']['input']>;
|
||||||
support: Scalars['String'];
|
support: Scalars['String']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type QuestionWhereInput = {
|
export type QuestionWhereInput = {
|
||||||
authorshipYear?: InputMaybe<Array<Scalars['String']>>;
|
authorshipYear?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||||
bloomTaxonomy?: InputMaybe<Array<QuestionBloomTaxonomy>>;
|
bloomTaxonomy?: InputMaybe<Array<QuestionBloomTaxonomy>>;
|
||||||
checkType?: InputMaybe<Array<QuestionCheckType>>;
|
checkType?: InputMaybe<Array<QuestionCheckType>>;
|
||||||
createDate?: InputMaybe<DateRangeInput>;
|
createDate?: InputMaybe<DateRangeInput>;
|
||||||
difficulty?: InputMaybe<Array<QuestionDifficulty>>;
|
difficulty?: InputMaybe<Array<QuestionDifficulty>>;
|
||||||
status?: InputMaybe<Array<QuestionStatus>>;
|
status?: InputMaybe<Array<QuestionStatus>>;
|
||||||
subjectId?: InputMaybe<Scalars['ID']>;
|
subjectId?: InputMaybe<Scalars['ID']['input']>;
|
||||||
unifesoAuthorship?: InputMaybe<Scalars['Boolean']>;
|
unifesoAuthorship?: InputMaybe<Scalars['Boolean']['input']>;
|
||||||
userId?: InputMaybe<Scalars['ID']>;
|
userId?: InputMaybe<Scalars['ID']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ReviewMessage = {
|
export type ReviewMessage = {
|
||||||
__typename?: 'ReviewMessage';
|
__typename?: 'ReviewMessage';
|
||||||
createdAt: Scalars['ISO8601DateTime'];
|
createdAt: Scalars['ISO8601DateTime']['output'];
|
||||||
feedbackType: ReviewMessageFeedbackType;
|
feedbackType: ReviewMessageFeedbackType;
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['output'];
|
||||||
question: Question;
|
question: Question;
|
||||||
text: Scalars['String'];
|
text: Scalars['String']['output'];
|
||||||
updatedAt: Scalars['ISO8601DateTime'];
|
updatedAt: Scalars['ISO8601DateTime']['output'];
|
||||||
user: User;
|
user: User;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -378,14 +410,14 @@ export type ReviewMessageConnection = {
|
|||||||
nodes: Array<ReviewMessage>;
|
nodes: Array<ReviewMessage>;
|
||||||
/** Information to aid in pagination. */
|
/** Information to aid in pagination. */
|
||||||
pageInfo: PageInfo;
|
pageInfo: PageInfo;
|
||||||
totalCount: Scalars['Int'];
|
totalCount: Scalars['Int']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** An edge in a connection. */
|
/** An edge in a connection. */
|
||||||
export type ReviewMessageEdge = {
|
export type ReviewMessageEdge = {
|
||||||
__typename?: 'ReviewMessageEdge';
|
__typename?: 'ReviewMessageEdge';
|
||||||
/** A cursor for use in pagination. */
|
/** A cursor for use in pagination. */
|
||||||
cursor: Scalars['String'];
|
cursor: Scalars['String']['output'];
|
||||||
/** The item at the end of the edge. */
|
/** The item at the end of the edge. */
|
||||||
node?: Maybe<ReviewMessage>;
|
node?: Maybe<ReviewMessage>;
|
||||||
};
|
};
|
||||||
@@ -398,14 +430,14 @@ export enum ReviewMessageFeedbackType {
|
|||||||
|
|
||||||
export type ReviewMessageInput = {
|
export type ReviewMessageInput = {
|
||||||
feedbackType: ReviewMessageFeedbackType;
|
feedbackType: ReviewMessageFeedbackType;
|
||||||
questionId: Scalars['ID'];
|
questionId: Scalars['ID']['input'];
|
||||||
text: Scalars['String'];
|
text: Scalars['String']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ReviewRequest = {
|
export type ReviewRequest = {
|
||||||
__typename?: 'ReviewRequest';
|
__typename?: 'ReviewRequest';
|
||||||
answered: Scalars['Boolean'];
|
answered: Scalars['Boolean']['output'];
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['output'];
|
||||||
question: Question;
|
question: Question;
|
||||||
user: User;
|
user: User;
|
||||||
};
|
};
|
||||||
@@ -419,14 +451,14 @@ export type ReviewRequestConnection = {
|
|||||||
nodes: Array<ReviewRequest>;
|
nodes: Array<ReviewRequest>;
|
||||||
/** Information to aid in pagination. */
|
/** Information to aid in pagination. */
|
||||||
pageInfo: PageInfo;
|
pageInfo: PageInfo;
|
||||||
totalCount: Scalars['Int'];
|
totalCount: Scalars['Int']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** An edge in a connection. */
|
/** An edge in a connection. */
|
||||||
export type ReviewRequestEdge = {
|
export type ReviewRequestEdge = {
|
||||||
__typename?: 'ReviewRequestEdge';
|
__typename?: 'ReviewRequestEdge';
|
||||||
/** A cursor for use in pagination. */
|
/** A cursor for use in pagination. */
|
||||||
cursor: Scalars['String'];
|
cursor: Scalars['String']['output'];
|
||||||
/** The item at the end of the edge. */
|
/** The item at the end of the edge. */
|
||||||
node?: Maybe<ReviewRequest>;
|
node?: Maybe<ReviewRequest>;
|
||||||
};
|
};
|
||||||
@@ -435,17 +467,17 @@ export type Subject = {
|
|||||||
__typename?: 'Subject';
|
__typename?: 'Subject';
|
||||||
axis: Axis;
|
axis: Axis;
|
||||||
category: Category;
|
category: Category;
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['output'];
|
||||||
name: Scalars['String'];
|
name: Scalars['String']['output'];
|
||||||
questions: QuestionConnection;
|
questions: QuestionConnection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type SubjectQuestionsArgs = {
|
export type SubjectQuestionsArgs = {
|
||||||
after?: InputMaybe<Scalars['String']>;
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
before?: InputMaybe<Scalars['String']>;
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
first?: InputMaybe<Scalars['Int']>;
|
first?: InputMaybe<Scalars['Int']['input']>;
|
||||||
last?: InputMaybe<Scalars['Int']>;
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
where?: InputMaybe<QuestionWhereInput>;
|
where?: InputMaybe<QuestionWhereInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -458,14 +490,14 @@ export type SubjectConnection = {
|
|||||||
nodes: Array<Subject>;
|
nodes: Array<Subject>;
|
||||||
/** Information to aid in pagination. */
|
/** Information to aid in pagination. */
|
||||||
pageInfo: PageInfo;
|
pageInfo: PageInfo;
|
||||||
totalCount: Scalars['Int'];
|
totalCount: Scalars['Int']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** An edge in a connection. */
|
/** An edge in a connection. */
|
||||||
export type SubjectEdge = {
|
export type SubjectEdge = {
|
||||||
__typename?: 'SubjectEdge';
|
__typename?: 'SubjectEdge';
|
||||||
/** A cursor for use in pagination. */
|
/** A cursor for use in pagination. */
|
||||||
cursor: Scalars['String'];
|
cursor: Scalars['String']['output'];
|
||||||
/** The item at the end of the edge. */
|
/** The item at the end of the edge. */
|
||||||
node?: Maybe<Subject>;
|
node?: Maybe<Subject>;
|
||||||
};
|
};
|
||||||
@@ -473,7 +505,7 @@ export type SubjectEdge = {
|
|||||||
/** Autogenerated input type of UpdateQuestion */
|
/** Autogenerated input type of UpdateQuestion */
|
||||||
export type UpdateQuestionInput = {
|
export type UpdateQuestionInput = {
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: InputMaybe<Scalars['String']>;
|
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||||
question: QuestionUpdateInput;
|
question: QuestionUpdateInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -481,37 +513,37 @@ export type UpdateQuestionInput = {
|
|||||||
export type UpdateQuestionPayload = {
|
export type UpdateQuestionPayload = {
|
||||||
__typename?: 'UpdateQuestionPayload';
|
__typename?: 'UpdateQuestionPayload';
|
||||||
/** A unique identifier for the client performing the mutation. */
|
/** A unique identifier for the client performing the mutation. */
|
||||||
clientMutationId?: Maybe<Scalars['String']>;
|
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||||
/** Errors encountered during execution of the mutation. */
|
/** Errors encountered during execution of the mutation. */
|
||||||
errors: Array<Scalars['String']>;
|
errors: Array<Scalars['String']['output']>;
|
||||||
question?: Maybe<Question>;
|
question?: Maybe<Question>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type User = {
|
export type User = {
|
||||||
__typename?: 'User';
|
__typename?: 'User';
|
||||||
activeReviewRequests: ReviewRequestConnection;
|
activeReviewRequests: ReviewRequestConnection;
|
||||||
avatarUrl?: Maybe<Scalars['String']>;
|
avatarUrl?: Maybe<Scalars['String']['output']>;
|
||||||
email: Scalars['String'];
|
email: Scalars['String']['output'];
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID']['output'];
|
||||||
inactiveReviewRequests: ReviewRequestConnection;
|
inactiveReviewRequests: ReviewRequestConnection;
|
||||||
name: Scalars['String'];
|
name: Scalars['String']['output'];
|
||||||
roles: Array<UserRole>;
|
roles: Array<UserRole>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type UserActiveReviewRequestsArgs = {
|
export type UserActiveReviewRequestsArgs = {
|
||||||
after?: InputMaybe<Scalars['String']>;
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
before?: InputMaybe<Scalars['String']>;
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
first?: InputMaybe<Scalars['Int']>;
|
first?: InputMaybe<Scalars['Int']['input']>;
|
||||||
last?: InputMaybe<Scalars['Int']>;
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type UserInactiveReviewRequestsArgs = {
|
export type UserInactiveReviewRequestsArgs = {
|
||||||
after?: InputMaybe<Scalars['String']>;
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
before?: InputMaybe<Scalars['String']>;
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
first?: InputMaybe<Scalars['Int']>;
|
first?: InputMaybe<Scalars['Int']['input']>;
|
||||||
last?: InputMaybe<Scalars['Int']>;
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The connection type for User. */
|
/** The connection type for User. */
|
||||||
@@ -523,14 +555,14 @@ export type UserConnection = {
|
|||||||
nodes: Array<User>;
|
nodes: Array<User>;
|
||||||
/** Information to aid in pagination. */
|
/** Information to aid in pagination. */
|
||||||
pageInfo: PageInfo;
|
pageInfo: PageInfo;
|
||||||
totalCount: Scalars['Int'];
|
totalCount: Scalars['Int']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** An edge in a connection. */
|
/** An edge in a connection. */
|
||||||
export type UserEdge = {
|
export type UserEdge = {
|
||||||
__typename?: 'UserEdge';
|
__typename?: 'UserEdge';
|
||||||
/** A cursor for use in pagination. */
|
/** A cursor for use in pagination. */
|
||||||
cursor: Scalars['String'];
|
cursor: Scalars['String']['output'];
|
||||||
/** The item at the end of the edge. */
|
/** The item at the end of the edge. */
|
||||||
node?: Maybe<User>;
|
node?: Maybe<User>;
|
||||||
};
|
};
|
||||||
|
|||||||
57
app/javascript/__generated__/schema.graphql
generated
57
app/javascript/__generated__/schema.graphql
generated
@@ -10,6 +10,42 @@ type Category {
|
|||||||
subjects: [Subject!]!
|
subjects: [Subject!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"""
|
||||||
|
The connection type for Category.
|
||||||
|
"""
|
||||||
|
type CategoryConnection {
|
||||||
|
"""
|
||||||
|
A list of edges.
|
||||||
|
"""
|
||||||
|
edges: [CategoryEdge!]!
|
||||||
|
|
||||||
|
"""
|
||||||
|
A list of nodes.
|
||||||
|
"""
|
||||||
|
nodes: [Category!]!
|
||||||
|
|
||||||
|
"""
|
||||||
|
Information to aid in pagination.
|
||||||
|
"""
|
||||||
|
pageInfo: PageInfo!
|
||||||
|
totalCount: Int!
|
||||||
|
}
|
||||||
|
|
||||||
|
"""
|
||||||
|
An edge in a connection.
|
||||||
|
"""
|
||||||
|
type CategoryEdge {
|
||||||
|
"""
|
||||||
|
A cursor for use in pagination.
|
||||||
|
"""
|
||||||
|
cursor: String!
|
||||||
|
|
||||||
|
"""
|
||||||
|
The item at the end of the edge.
|
||||||
|
"""
|
||||||
|
node: Category
|
||||||
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Autogenerated input type of CreateQuestion
|
Autogenerated input type of CreateQuestion
|
||||||
"""
|
"""
|
||||||
@@ -202,6 +238,27 @@ type PageInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Query {
|
type Query {
|
||||||
|
categories(
|
||||||
|
"""
|
||||||
|
Returns the elements in the list that come after the specified cursor.
|
||||||
|
"""
|
||||||
|
after: String
|
||||||
|
|
||||||
|
"""
|
||||||
|
Returns the elements in the list that come before the specified cursor.
|
||||||
|
"""
|
||||||
|
before: String
|
||||||
|
|
||||||
|
"""
|
||||||
|
Returns the first _n_ elements from the list.
|
||||||
|
"""
|
||||||
|
first: Int
|
||||||
|
|
||||||
|
"""
|
||||||
|
Returns the last _n_ elements from the list.
|
||||||
|
"""
|
||||||
|
last: Int
|
||||||
|
): CategoryConnection!
|
||||||
currentUser: User
|
currentUser: User
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,93 +1,180 @@
|
|||||||
import React from "react";
|
import { gql, useQuery } from "@apollo/client";
|
||||||
import { Button, Navigator } from '../../components'
|
import React, { useState } from "react";
|
||||||
|
import { Controller, useForm } from "react-hook-form";
|
||||||
|
import { Query } from "../../__generated__/graphql-schema";
|
||||||
|
import { Button, Card, Input, Navigator } from '../../components';
|
||||||
|
|
||||||
|
type NewAssessementForm = {
|
||||||
|
subjectWeights: Record<string, any>
|
||||||
|
}
|
||||||
|
|
||||||
|
const NEW_ASSESSEMENT_DATA_QUERY = gql`
|
||||||
|
query NewAssessementDataQuery {
|
||||||
|
categories {
|
||||||
|
nodes {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
subjects {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
export const NewAssessement = () => {
|
export const NewAssessement = () => {
|
||||||
|
const { data } = useQuery<Query>(NEW_ASSESSEMENT_DATA_QUERY)
|
||||||
|
|
||||||
|
const [subjectsIds, setSubjectsIds] = useState<string[]>([])
|
||||||
|
const subjectForm = useForm<{ subjectId: string }>()
|
||||||
|
const { register, control, watch } = useForm<NewAssessementForm>({
|
||||||
|
mode: 'onBlur'
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleSubjectFormSubmit = (data: {
|
||||||
|
subjectId: string
|
||||||
|
}) => {
|
||||||
|
setSubjectsIds(prev => [...prev, data.subjectId])
|
||||||
|
subjectForm.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data?.categories) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Navigator home />
|
<Navigator home />
|
||||||
<div className="m-auto grid gap-4 mt-4 mx-6">
|
<div className="m-auto grid gap-4 mt-4 mx-6">
|
||||||
<div
|
<Card title="Detalhes">
|
||||||
className="mx-1 sm:mx-0 mb-4 sm:mb-0 border-l-8 border-primary-light flex bg-white rounded shadow group transition-all duration-500"
|
<div className="flex flex-col">
|
||||||
|
<p className="pr-2 my-auto">Titulo: </p>
|
||||||
|
<div className="w-full">
|
||||||
|
<Input></Input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col mt-3">
|
||||||
|
<p className="pr-2 my-auto">Observações: </p>
|
||||||
|
<div className="w-full">
|
||||||
|
<Input></Input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<Card title="Assuntos e Pesos">
|
||||||
|
<div className="mb-6">
|
||||||
|
<form
|
||||||
|
className="flex flex-row"
|
||||||
|
onSubmit={subjectForm.handleSubmit(handleSubjectFormSubmit)}
|
||||||
>
|
>
|
||||||
<div className="flex flex-row w-full px-3 py-2 justify-between">
|
<select
|
||||||
<h2>
|
className="w-full rounded p-1 border-gray-400 border shadow-sm"
|
||||||
Ano de Criação
|
{...subjectForm.register('subjectId')}
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div className="flex">
|
|
||||||
<h3>Apenas inéditas?</h3>
|
|
||||||
<input className="ml-3" type="radio" id="huey" name="drone" value="huey"
|
|
||||||
checked />
|
|
||||||
<label className="ml-1" htmlFor="huey">Sim</label>
|
|
||||||
<input className="ml-3" type="radio" id="dewey" name="drone" value="dewey" />
|
|
||||||
<label className="ml-1" htmlFor="dewey">Não</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="mx-1 sm:mx-0 mb-4 sm:mb-0 border-l-8 border-primary-light flex bg-white rounded shadow group transition-all duration-500"
|
|
||||||
>
|
>
|
||||||
<div className="flex flex-row w-full px-3 py-2 justify-between">
|
{data.categories.nodes.map(category => (
|
||||||
<h2>
|
<optgroup label={category.name} key={`category-${category.id}`}>
|
||||||
Habilidade Cognitiva
|
{category.subjects.map(subject =>
|
||||||
</h2>
|
subjectsIds.includes(subject.id) ? null : <option value={subject.id} key={`subject-${subject.id}`}>{subject.name}</option>
|
||||||
|
)}
|
||||||
<div className="flex">
|
</optgroup>
|
||||||
<select>
|
))}
|
||||||
<option>Cálculo</option>
|
|
||||||
<option>Geometria Analítica</option>
|
|
||||||
<option>Álgebra Linear</option>
|
|
||||||
<option>Probabilidade e Estatística</option>
|
|
||||||
<option>Matemática Discreta</option>
|
|
||||||
<option>Lógica Matemática</option>
|
|
||||||
<option>Pesquisa Operacional</option>
|
|
||||||
<option>Cálculo Numérico</option>
|
|
||||||
<option>Física</option>
|
|
||||||
<option>Algoritmos e Estruturas de Dados</option>
|
|
||||||
<option>Projeto e Análise de Algoritmos</option>
|
|
||||||
<option>Programação Estruturada</option>
|
|
||||||
<option>Programação Orientada a Objetos</option>
|
|
||||||
<option>Programação Funcional</option>
|
|
||||||
<option>Programação Web</option>
|
|
||||||
<option>Programação para Dispositivos</option>
|
|
||||||
<option>Engenharia de Software</option>
|
|
||||||
<option>Banco de Dados</option>
|
|
||||||
<option>Gerência de Projetos</option>
|
|
||||||
<option>Arquitetura de Computadores</option>
|
|
||||||
<option>Sistemas Digitais</option>
|
|
||||||
<option>Sistemas Operacionais</option>
|
|
||||||
<option>Redes de Computadores</option>
|
|
||||||
<option>Compiladores</option>
|
|
||||||
<option>Teoria da Computação</option>
|
|
||||||
<option>Sistemas Inteligentes</option>
|
|
||||||
<option>Robótica</option>
|
|
||||||
<option>Computação Gráfica</option>
|
|
||||||
<option>Processamento de Sinais</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
<Button className="ml-4" htmlType="submit">Adicionar</Button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<div>
|
||||||
|
{data.categories.nodes.map(category => (
|
||||||
|
category.subjects.find(subject => subjectsIds.includes(subject.id)) ?
|
||||||
<div
|
<div
|
||||||
className="mx-1 sm:mx-0 mb-4 sm:mb-0 border-l-8 border-primary-light flex bg-white rounded shadow group transition-all duration-500"
|
key={`list-category-${category.id}`}
|
||||||
|
className="flex flex-col w-full border border-gray-300 rounded p-4 mt-4 shadow-sm"
|
||||||
>
|
>
|
||||||
<div className="flex flex-row w-full px-3 py-2 justify-between">
|
<h5 className="text-xl">{category.name}</h5>
|
||||||
<h2>
|
{category.subjects.map(subject =>
|
||||||
Habilidade Cognitiva
|
subjectsIds.includes(subject.id)
|
||||||
</h2>
|
? <div key={`list-subject-${subject.id}`} className="ml-4">
|
||||||
|
<div className="text-lg">{subject.name}</div>
|
||||||
|
<div className="ml-4 grid grid-cols-3">
|
||||||
|
Fácil
|
||||||
|
<span>
|
||||||
|
{watch(`subjectWeights.easy.${subject.id}`) ?? 5}
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<Controller
|
||||||
|
name={`subjectWeights.easy.${subject.id}`}
|
||||||
|
control={control}
|
||||||
|
defaultValue={5}
|
||||||
|
render={({ field }) => (
|
||||||
|
<input
|
||||||
|
className="w-full"
|
||||||
|
type="range"
|
||||||
|
min={0}
|
||||||
|
max={10}
|
||||||
|
{...field}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="flex">
|
|
||||||
<select>
|
|
||||||
<option>Algoritmos de Alto Desempenho</option>
|
|
||||||
<option>Ciência, Tecnologia e Sociedade</option>
|
|
||||||
<option>Sistemas de Software</option>
|
|
||||||
<option>Infraestrutura de Sistemas Computacionais</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div className="ml-4 grid grid-cols-3">
|
||||||
|
Médio
|
||||||
|
<span>
|
||||||
|
{watch(`subjectWeights.medium.${subject.id}`) ?? 5}
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<Controller
|
||||||
|
name={`subjectWeights.medium.${subject.id}`}
|
||||||
|
control={control}
|
||||||
|
defaultValue={5}
|
||||||
|
render={({ field }) => (
|
||||||
|
<input
|
||||||
|
className="w-full"
|
||||||
|
type="range"
|
||||||
|
min={0}
|
||||||
|
max={10}
|
||||||
|
{...field}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className="ml-4 grid grid-cols-3">
|
||||||
|
Difícil
|
||||||
|
<span>
|
||||||
|
{watch(`subjectWeights.hard.${subject.id}`) ?? 5}
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<Controller
|
||||||
|
name={`subjectWeights.hard.${subject.id}`}
|
||||||
|
control={control}
|
||||||
|
defaultValue={5}
|
||||||
|
render={({ field }) => (
|
||||||
|
<input
|
||||||
|
className="w-full"
|
||||||
|
type="range"
|
||||||
|
min={0}
|
||||||
|
max={10}
|
||||||
|
{...field}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
: null
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
: null
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
<Button type="primary" className="ml-auto mr-6 mt-6">
|
<Button type="primary" className="ml-auto mr-6 mt-6">
|
||||||
Gerar
|
Gerar
|
||||||
|
|||||||
7
app/policies/category_policy.rb
Normal file
7
app/policies/category_policy.rb
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
class CategoryPolicy < ApplicationPolicy
|
||||||
|
class Scope < Scope
|
||||||
|
def resolve
|
||||||
|
scope.all
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<script src="<%= ENV['WIRIS_PLUGIN_SRC'] %>" async=true></script>
|
<script src="<%= ENV['WIRIS_PLUGIN_SRC'] %>" async=true></script>
|
||||||
|
|
||||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||||
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
|
<%= javascript_include_tag "react", "data-turbo-track": "reload", defer: true %>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user