Skip to content

Commit

Permalink
Custom view (#59)
Browse files Browse the repository at this point in the history
* expose custom-view to service-info api

* expose custom-view to service-info api

* Most horrible commit in history: pdf downloader + necessary fixes in shared modules and dep updates

* include a subset of the newest version of shared modules from mother ship repo

* fix system tests and translations work

* real data in custom view

* check for undefined user_answers

* try to fix undefined answers error
  • Loading branch information
anadis504 committed Mar 28, 2024
1 parent e5035c8 commit c2a9c93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/PdfDownload/PdfGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ const MyDoc: React.FC<React.PropsWithChildren<CustomViewIframeState>> = (props)
.flatMap((exercise) => {
return exercise.exercise_tasks.flatMap((task) => {
const grading = task.grading as CustomViewExerciseTaskGrading
const answer = task.user_answer
? ((task.user_answer as CustomViewExerciseTaskSubmission[])[0].data_json as UserAnswer)
: null
const answer =
((task.user_answer as CustomViewExerciseTaskSubmission)?.data_json as UserAnswer) ?? null

const pubSpec = task.public_spec as PublicSpec
const gradingFeedback = grading.feedback_json
? (grading.feedback_json as ExerciseFeedback)
Expand Down

0 comments on commit c2a9c93

Please sign in to comment.