Skip to content

Commit

Permalink
enhance: make sure that element instances are loaded with correct sam…
Browse files Browse the repository at this point in the history
…ple solution setting into editor on edit
  • Loading branch information
sjschlapbach committed Sep 15, 2024
1 parent 9ac7c6b commit 07d7480
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ function MicroLearningWizard({
id: parseInt(element.elementData.id),
title: element.elementData.name,
type: element.elementData.type,
hasSampleSolution: true, // TODO: get value from element instance
hasSampleSolution:
element.elementData.options.hasSampleSolution ?? true,
}
}),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ function PracticeQuizWizard({
id: parseInt(element.elementData.id),
title: element.elementData.name,
type: element.elementData.type,
hasSampleSolution: true, // TODO: get value from element instance
hasSampleSolution:
element.elementData.options.hasSampleSolution ?? true,
}
}),
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "./FMicroLearningDataWithoutSolutions.graphql"
#import "./FMicroLearningData.graphql"

query GetSingleMicroLearning($id: String!) {
getSingleMicroLearning(id: $id) {
...MicroLearningDataWithoutSolutions
...MicroLearningData
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "./FPracticeQuizDataWithoutSolutions.graphql"
#import "./FPracticeQuizData.graphql"

query GetSinglePracticeQuiz($id: String!) {
getSinglePracticeQuiz(id: $id) {
...PracticeQuizDataWithoutSolutions
...PracticeQuizData
}
}
8 changes: 4 additions & 4 deletions packages/graphql/src/ops.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/graphql/src/public/client.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
"GetSessionLeaderboard": "09404af10f91c8da107743b4ba18a43e35507163176a8cd8ac6542feaa08bb91",
"GetSingleCourse": "76bae7597312b50e5134cc9c5ee5ef0751e30e184c3b1286106eae102ef53cc1",
"GetSingleLiveSession": "4c8a1a7a933c2b6508d39a3a104d1c1b708266cd3ed5a52de5606206f6da3775",
"GetSingleMicroLearning": "ba6a96b68ca7688a1c509f65c84f3664e0aeb08c11fd9256e2a1bbf7c0d8a07a",
"GetSinglePracticeQuiz": "79fa2a71ffff9ba289b470e0d3eeb44b6291a750edb035ddbc4fb430d76f04d7",
"GetSingleMicroLearning": "c5fa2bc8920c7b22ad26dcd615d7656338e1eb4dd7d8184cc70f9cf3487b1740",
"GetSinglePracticeQuiz": "4e3f9c85fd700cd8109a85d9efb974d7d86e4c6d1cf71b5dea1f2c0318744990",
"GetSingleQuestion": "8b081868e7513358812b6d8d1b6a43887fcdad0972cbdc31be9fcaf91e188cb2",
"GetStackElementFeedbacks": "8cbf597af706f68361dc9ff756ff6d59c888506c70b3514484a09aa2e609139c",
"GetUnassignedSessions": "513bdcda8f5ff54d01c0da150edcf8eacb505f455c407adc971d27f4585fb66c",
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/src/public/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
"09404af10f91c8da107743b4ba18a43e35507163176a8cd8ac6542feaa08bb91": "query GetSessionLeaderboard($sessionId: String!) {\n sessionLeaderboard(sessionId: $sessionId) {\n id\n participantId\n rank\n username\n avatar\n score\n isSelf\n lastBlockOrder\n __typename\n }\n}",
"76bae7597312b50e5134cc9c5ee5ef0751e30e184c3b1286106eae102ef53cc1": "query GetSingleCourse($courseId: String!) {\n course(id: $courseId) {\n id\n isArchived\n isGamificationEnabled\n pinCode\n name\n displayName\n description\n color\n numOfParticipants\n numOfActiveParticipants\n averageScore\n averageActiveScore\n startDate\n endDate\n isGroupCreationEnabled\n groupDeadlineDate\n maxGroupSize\n preferredGroupSize\n randomAssignmentFinalized\n sessions {\n id\n name\n displayName\n isGamificationEnabled\n pinCode\n accessMode\n status\n createdAt\n numOfBlocks\n numOfQuestions\n __typename\n }\n practiceQuizzes {\n id\n name\n displayName\n status\n availableFrom\n numOfStacks\n __typename\n }\n groupActivities {\n id\n name\n displayName\n status\n scheduledStartAt\n scheduledEndAt\n numOfQuestions\n __typename\n }\n microLearnings {\n id\n name\n displayName\n status\n scheduledStartAt\n scheduledEndAt\n numOfStacks\n __typename\n }\n leaderboard {\n id\n score\n rank\n username\n email\n avatar\n __typename\n }\n __typename\n }\n}",
"4c8a1a7a933c2b6508d39a3a104d1c1b708266cd3ed5a52de5606206f6da3775": "fragment QuestionData on QuestionInstance {\n questionData {\n id\n questionId\n name\n type\n content\n explanation\n pointsMultiplier\n ... on ChoicesQuestionData {\n options {\n hasSampleSolution\n hasAnswerFeedbacks\n displayMode\n choices {\n ix\n correct\n feedback\n value\n __typename\n }\n __typename\n }\n __typename\n }\n ... on NumericalQuestionData {\n options {\n hasSampleSolution\n accuracy\n placeholder\n unit\n restrictions {\n min\n max\n __typename\n }\n solutionRanges {\n min\n max\n __typename\n }\n __typename\n }\n __typename\n }\n ... on FreeTextQuestionData {\n options {\n hasSampleSolution\n restrictions {\n maxLength\n __typename\n }\n solutions\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\nquery GetSingleLiveSession($sessionId: String!) {\n liveSession(id: $sessionId) {\n id\n name\n displayName\n description\n blocks {\n id\n status\n timeLimit\n instances {\n id\n ...QuestionData\n __typename\n }\n __typename\n }\n course {\n id\n __typename\n }\n pointsMultiplier\n isGamificationEnabled\n isLiveQAEnabled\n isConfusionFeedbackEnabled\n isModerationEnabled\n __typename\n }\n}",
"ba6a96b68ca7688a1c509f65c84f3664e0aeb08c11fd9256e2a1bbf7c0d8a07a": "fragment MicroLearningDataWithoutSolutions on MicroLearning {\n id\n name\n status\n displayName\n description\n pointsMultiplier\n scheduledStartAt\n scheduledEndAt\n course {\n id\n displayName\n color\n __typename\n }\n stacks {\n id\n type\n displayName\n description\n order\n elements {\n id\n type\n elementType\n ...ElementDataWithoutSolutions\n __typename\n }\n __typename\n }\n __typename\n}\nfragment ElementDataWithoutSolutions on ElementInstance {\n elementData {\n id\n elementId\n name\n type\n content\n explanation\n ... on ChoicesElementData {\n options {\n displayMode\n choices {\n ix\n value\n __typename\n }\n __typename\n }\n __typename\n }\n ... on NumericalElementData {\n options {\n accuracy\n placeholder\n unit\n restrictions {\n min\n max\n __typename\n }\n __typename\n }\n __typename\n }\n ... on FreeTextElementData {\n options {\n restrictions {\n maxLength\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\nquery GetSingleMicroLearning($id: String!) {\n getSingleMicroLearning(id: $id) {\n ...MicroLearningDataWithoutSolutions\n __typename\n }\n}",
"79fa2a71ffff9ba289b470e0d3eeb44b6291a750edb035ddbc4fb430d76f04d7": "fragment PracticeQuizDataWithoutSolutions on PracticeQuiz {\n id\n status\n name\n displayName\n description\n pointsMultiplier\n resetTimeDays\n availableFrom\n orderType\n numOfStacks\n course {\n id\n displayName\n color\n __typename\n }\n stacks {\n id\n type\n displayName\n description\n order\n elements {\n id\n type\n elementType\n ...ElementDataWithoutSolutions\n __typename\n }\n __typename\n }\n __typename\n}\nfragment ElementDataWithoutSolutions on ElementInstance {\n elementData {\n id\n elementId\n name\n type\n content\n explanation\n ... on ChoicesElementData {\n options {\n displayMode\n choices {\n ix\n value\n __typename\n }\n __typename\n }\n __typename\n }\n ... on NumericalElementData {\n options {\n accuracy\n placeholder\n unit\n restrictions {\n min\n max\n __typename\n }\n __typename\n }\n __typename\n }\n ... on FreeTextElementData {\n options {\n restrictions {\n maxLength\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\nquery GetSinglePracticeQuiz($id: String!) {\n getSinglePracticeQuiz(id: $id) {\n ...PracticeQuizDataWithoutSolutions\n __typename\n }\n}",
"c5fa2bc8920c7b22ad26dcd615d7656338e1eb4dd7d8184cc70f9cf3487b1740": "fragment MicroLearningData on MicroLearning {\n id\n name\n status\n displayName\n description\n pointsMultiplier\n scheduledStartAt\n scheduledEndAt\n course {\n id\n displayName\n color\n __typename\n }\n stacks {\n id\n type\n displayName\n description\n order\n elements {\n id\n type\n elementType\n ...ElementData\n __typename\n }\n __typename\n }\n __typename\n}\nfragment ElementData on ElementInstance {\n elementData {\n id\n elementId\n name\n type\n content\n explanation\n ... on ChoicesElementData {\n options {\n hasSampleSolution\n displayMode\n choices {\n ix\n correct\n feedback\n value\n __typename\n }\n __typename\n }\n __typename\n }\n ... on NumericalElementData {\n options {\n hasSampleSolution\n accuracy\n placeholder\n unit\n restrictions {\n min\n max\n __typename\n }\n solutionRanges {\n min\n max\n __typename\n }\n __typename\n }\n __typename\n }\n ... on FreeTextElementData {\n options {\n hasSampleSolution\n restrictions {\n maxLength\n __typename\n }\n solutions\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\nquery GetSingleMicroLearning($id: String!) {\n getSingleMicroLearning(id: $id) {\n ...MicroLearningData\n __typename\n }\n}",
"4e3f9c85fd700cd8109a85d9efb974d7d86e4c6d1cf71b5dea1f2c0318744990": "fragment PracticeQuizData on PracticeQuiz {\n id\n status\n name\n displayName\n description\n pointsMultiplier\n resetTimeDays\n availableFrom\n orderType\n numOfStacks\n course {\n id\n displayName\n color\n __typename\n }\n stacks {\n id\n type\n displayName\n description\n order\n elements {\n id\n type\n elementType\n ...ElementData\n __typename\n }\n __typename\n }\n __typename\n}\nfragment ElementData on ElementInstance {\n elementData {\n id\n elementId\n name\n type\n content\n explanation\n ... on ChoicesElementData {\n options {\n hasSampleSolution\n displayMode\n choices {\n ix\n correct\n feedback\n value\n __typename\n }\n __typename\n }\n __typename\n }\n ... on NumericalElementData {\n options {\n hasSampleSolution\n accuracy\n placeholder\n unit\n restrictions {\n min\n max\n __typename\n }\n solutionRanges {\n min\n max\n __typename\n }\n __typename\n }\n __typename\n }\n ... on FreeTextElementData {\n options {\n hasSampleSolution\n restrictions {\n maxLength\n __typename\n }\n solutions\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\nquery GetSinglePracticeQuiz($id: String!) {\n getSinglePracticeQuiz(id: $id) {\n ...PracticeQuizData\n __typename\n }\n}",
"8b081868e7513358812b6d8d1b6a43887fcdad0972cbdc31be9fcaf91e188cb2": "query GetSingleQuestion($id: Int!) {\n question(id: $id) {\n id\n name\n status\n type\n content\n explanation\n pointsMultiplier\n questionData {\n id\n questionId\n ... on ChoicesQuestionData {\n options {\n displayMode\n hasSampleSolution\n hasAnswerFeedbacks\n choices {\n ix\n correct\n feedback\n value\n __typename\n }\n __typename\n }\n __typename\n }\n ... on NumericalQuestionData {\n options {\n hasSampleSolution\n unit\n accuracy\n placeholder\n restrictions {\n min\n max\n __typename\n }\n solutionRanges {\n min\n max\n __typename\n }\n __typename\n }\n __typename\n }\n ... on FreeTextQuestionData {\n options {\n hasSampleSolution\n restrictions {\n maxLength\n __typename\n }\n solutions\n __typename\n }\n __typename\n }\n __typename\n }\n tags {\n id\n name\n __typename\n }\n __typename\n }\n}",
"8cbf597af706f68361dc9ff756ff6d59c888506c70b3514484a09aa2e609139c": "query GetStackElementFeedbacks($instanceIds: [Int!]!) {\n getStackElementFeedbacks(elementInstanceIds: $instanceIds) {\n id\n upvote\n downvote\n feedback\n elementInstanceId\n __typename\n }\n}",
"513bdcda8f5ff54d01c0da150edcf8eacb505f455c407adc971d27f4585fb66c": "query GetUnassignedSessions {\n unassignedSessions {\n id\n name\n status\n __typename\n }\n}",
Expand Down

0 comments on commit 07d7480

Please sign in to comment.