Skip to content
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

refactor: migrate creation and editing process to new element instance structure #4343

Merged
merged 15 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions packages/graphql/src/graphql/ops/FElementDataInfo.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
fragment ElementDataInfo on ElementInstance {
elementData {
... on ChoicesElementData {
__typename
id
elementId
name
type
content
explanation
pointsMultiplier
}

... on NumericalElementData {
__typename
id
elementId
name
type
content
explanation
pointsMultiplier
}

... on FreeTextElementData {
__typename
id
elementId
name
type
content
explanation
pointsMultiplier
}

... on FlashcardElementData {
__typename
id
elementId
name
type
content
explanation
pointsMultiplier
}

... on ContentElementData {
__typename
id
elementId
name
type
content
explanation
pointsMultiplier
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
mutation CreateSession(
mutation CreateLiveQuiz(
$name: String!
$displayName: String!
$description: String
$blocks: [BlockInput!]!
$blocks: [ElementBlockInput!]!
$courseId: String
$multiplier: Int!
$maxBonusPoints: Int!
Expand All @@ -12,7 +12,7 @@ mutation CreateSession(
$isLiveQAEnabled: Boolean!
$isModerationEnabled: Boolean!
) {
createSession(
createLiveQuiz(
name: $name
displayName: $displayName
description: $description
Expand All @@ -34,9 +34,9 @@ mutation CreateSession(
id
status
timeLimit
instances {
elements {
id
...QuestionDataInfo
...ElementDataInfo
}
}
course {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
mutation EditSession(
mutation EditLiveQuiz(
$id: String!
$name: String!
$displayName: String!
$description: String
$blocks: [BlockInput!]!
$blocks: [ElementBlockInput!]!
$courseId: String
$multiplier: Int!
$maxBonusPoints: Int!
Expand All @@ -13,7 +13,7 @@ mutation EditSession(
$isLiveQAEnabled: Boolean!
$isModerationEnabled: Boolean!
) {
editSession(
editLiveQuiz(
id: $id
name: $name
displayName: $displayName
Expand All @@ -36,9 +36,9 @@ mutation EditSession(
id
status
timeLimit
instances {
elements {
id
...QuestionDataInfo
...ElementDataInfo
}
}
course {
Expand Down
Loading
Loading