Skip to content

Latest commit

 

History

History
1141 lines (867 loc) · 22.1 KB

api.md

File metadata and controls

1141 lines (867 loc) · 22.1 KB

Flashcard Service API

Table of Contents

Query

Field Argument Type Description
flashcardsByIds [Flashcard!]!

Get flashcards by their ids. 🔒 The user must be enrolled in the course the flashcards belong to. Otherwise an error is thrown.

ids [UUID!]!
findFlashcardSetsByAssessmentIds [FlashcardSet]!

Get flashcard sets by their assessment ids. Returns a list of flashcard sets in the same order as the provided ids. Each element is null if the corresponding id is not found. 🔒 The user must be enrolled in the course the flashcard sets belong to. Otherwise for that element null is returned.

assessmentIds [UUID!]!
dueFlashcardsByCourseId [Flashcard!]!

Get flashcards of a course that are due to be reviewed. 🔒 The user must be enrolled in the course the flashcards belong to. Otherwise an error is thrown.

courseId UUID!

Mutation

Mutations for the flashcard service. Provides mutations for creating, updating, and deleting flashcard as well as creating and deleting flashcard sets. To update a flashcard set, update, delete, and create flashcards individually.

Field Argument Type Description
_internal_noauth_createFlashcardSet FlashcardSet!

Creates a new flashcard set. Mutation is only accessible internally within the system by other services and the gateway. ⚠️ This mutation is only accessible internally in the system and allows the caller to create FlashcardSets without any permissions check and should not be called without any validation of the caller's permissions. ⚠️

courseId UUID!
assessmentId UUID!
input CreateFlashcardSetInput!
deleteFlashcardSet ⚠️ UUID!

Deletes a flashcard set. Throws an error if the flashcard set does not exist. The contained flashcards are deleted as well.

⚠️ DEPRECATED

Only for development, will be removed in production. Use deleteAssessment in contents service instead.

input UUID!
mutateFlashcardSet FlashcardSetMutation!

Modify a flashcard set. 🔒 The user must be an admin the course the flashcard set is in to perform this action.

assessmentId UUID!
logFlashcardLearned FlashcardLearnedFeedback!

Logs that a user has learned a flashcard. 🔒 The user must be enrolled in the course the flashcard set is in to perform this action.

input LogFlashcardLearnedInput!

Objects

Flashcard

A flashcard is a set of two or more sides. Each side has a label and a text. The label is used to specify which side of the flashcard is being shown to the user first for learning and which sides he has to guess.

Field Argument Type Description
id UUID!

Unique identifier of this flashcard.

sides [FlashcardSide!]!

List of sides of this flashcard.

userProgressData FlashcardProgressData!

Progress data of the flashcard, specific to given users. If userId is not provided, the progress data of the current user is returned.

FlashcardLearnedFeedback

Feedback for the logFlashcardLearned mutation.

Field Argument Type Description
success Boolean!

Whether the flashcard was learned correctly.

nextLearnDate DateTime!

Next date when the flashcard should be learned again.

flashcardSetProgress FlashcardSetProgress!

Progress of the whole flashcard set.

FlashcardProgressData

Field Argument Type Description
lastLearned DateTime

The date the user learned the flashcard. This is null it the user has not learned the content item once.

learningInterval Int

The learning interval in days for the content item.

nextLearn DateTime

The next time the content should be learned. Calculated using the date the user completed the content item and the learning interval. This is null if the user has not completed the content item once.

FlashcardProgressDataLog

Field Argument Type Description
id UUID

The id of the Log

learnedAt DateTime!

The date the user learned the flashcard.

success Boolean!

Whether the user knew the flashcard or not.

FlashcardSet

A set of flashcards. A flashcard set belongs to exactly one assessment. Therefore, the uuid of the assessment also serves as the identifier of a flashcard set.

Field Argument Type Description
assessmentId UUID!

The uuid of the assessment this flashcard set belongs to. This also serves as the identifier of this flashcard set.

courseId UUID!

Id of the course this flashcard set belongs to.

flashcards [Flashcard!]!

List of flashcards in this set.

FlashcardSetMutation

Field Argument Type Description
assessmentId UUID!

ID of the flashcard set that is being modified.

createFlashcard Flashcard!

Creates a new flashcard. Throws an error if the flashcard set does not exist.

input CreateFlashcardInput!
updateFlashcard Flashcard!

Updates a flashcard. Throws an error if the flashcard does not exist.

input UpdateFlashcardInput!
deleteFlashcard UUID!

Deletes the flashcard with the specified ID. Throws an error if the flashcard does not exist.

id UUID!

FlashcardSetProgress

Field Argument Type Description
percentageLearned Float!

Percentage of how many flashcards in the set have been learned.

correctness Float!

Percentage of how many flashcards have been learned correctly of the ones that have been learned.

FlashcardSide

Field Argument Type Description
text JSON!

Text of this flashcard side as rich text in SlateJS json.

label String!

Label of this flashcard side. E.g. "Front" or "Back", or "Question" or "Answer".

isQuestion Boolean!

Whether this side is a question, i.e. should be shown to the user to guess the other sides or not.

isAnswer Boolean!

Whether this side is also an answer. Some Flashcards can have their sides be used as both questions or answers for the other sides

PaginationInfo

Return type for information about paginated results.

Field Argument Type Description
page Int!

The current page number.

size Int!

The number of elements per page.

totalElements Int!

The total number of elements across all pages.

totalPages Int!

The total number of pages.

hasNext Boolean!

Whether there is a next page.

Inputs

CreateFlashcardInput

Field Type Description
sides [FlashcardSideInput!]!

List of sides of this flashcard. Must be at least two sides.

CreateFlashcardSetInput

Field Type Description
flashcards [CreateFlashcardInput!]!

List of flashcards in this set.

DateTimeFilter

Filter for date values. If multiple filters are specified, they are combined with AND.

Field Type Description
after DateTime

If specified, filters for dates after the specified value.

before DateTime

If specified, filters for dates before the specified value.

FlashcardSideInput

Field Type Description
text JSON!

Text of this flashcard side.

label String!

Label of this flashcard side. E.g. "Front" or "Back", or "Question" or "Answer".

isQuestion Boolean!

Whether this side is a question, i.e. should be shown to the user to guess the other sides or not.

isAnswer Boolean!

Whether this side is also an answer. Some Flashcards can have their sides be used as both questions or answers for the other sides

IntFilter

Filter for integer values. If multiple filters are specified, they are combined with AND.

Field Type Description
equals Int

An integer value to match exactly.

greaterThan Int

If specified, filters for values greater than to the specified value.

lessThan Int

If specified, filters for values less than to the specified value.

LogFlashcardLearnedInput

Field Type Description
flashcardId UUID!

The id of the flashcard that was learned.

successful Boolean!

If the user knew the flashcard or not.

LogFlashcardSetLearnedInput

Field Type Description
flashcardSetId UUID!

The id of the flashcard that was learned.

userId UUID!

The id of the user that learned the flashcard.

percentageSuccess Float!

The percentage of flashcards in the set that the user knew.

Pagination

Specifies the page size and page number for paginated results.

Field Type Description
page Int!

The page number, starting at 0. If not specified, the default value is 0. For values greater than 0, the page size must be specified. If this value is larger than the number of pages, an empty page is returned.

size Int!

The number of elements per page.

StringFilter

Filter for string values. If multiple filters are specified, they are combined with AND.

Field Type Description
equals String

A string value to match exactly.

contains String

A string value that must be contained in the field that is being filtered.

ignoreCase Boolean!

If true, the filter is case-insensitive.

UpdateFlashcardInput

Field Type Description
id UUID!

Id of the flashcard to update.

sides [FlashcardSideInput!]!

List of sides of this flashcard. Must be at least two sides.

Enums

SortDirection

Specifies the sort direction, either ascending or descending.

Value Description
ASC
DESC

Scalars

Boolean

Built-in Boolean

Date

An RFC-3339 compliant Full Date Scalar

DateTime

A slightly refined version of RFC-3339 compliant DateTime Scalar

Float

Built-in Float

Int

Built-in Int

JSON

A JSON scalar

LocalTime

24-hour clock time value string in the format hh:mm:ss or hh:mm:ss.sss.

String

Built-in String

Time

An RFC-3339 compliant Full Time Scalar

UUID

A universally unique identifier compliant UUID Scalar

Url

A Url scalar