@digabi/exam-engine-core 16.6.5 → 16.6.7-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  2. package/dist/components/attachments/Attachment.d.ts +1 -2
  3. package/dist/components/attachments/Attachment.d.ts.map +1 -1
  4. package/dist/components/attachments/Attachments.d.ts +1 -2
  5. package/dist/components/attachments/Attachments.d.ts.map +1 -1
  6. package/dist/components/attachments/Question.d.ts +1 -2
  7. package/dist/components/attachments/Question.d.ts.map +1 -1
  8. package/dist/components/context/AttachmentContext.d.ts +1 -2
  9. package/dist/components/context/AttachmentContext.d.ts.map +1 -1
  10. package/dist/components/context/ExamContext.d.ts +1 -2
  11. package/dist/components/context/ExamContext.d.ts.map +1 -1
  12. package/dist/components/context/QuestionContext.d.ts +1 -2
  13. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  14. package/dist/components/context/ResultsContext.d.ts +1 -2
  15. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  16. package/dist/components/context/SectionContext.d.ts +1 -2
  17. package/dist/components/context/SectionContext.d.ts.map +1 -1
  18. package/dist/components/context/withContext.d.ts +1 -1
  19. package/dist/components/context/withContext.d.ts.map +1 -1
  20. package/dist/components/context/withContext.js.map +1 -1
  21. package/dist/components/exam/Attachment.d.ts +1 -2
  22. package/dist/components/exam/Attachment.d.ts.map +1 -1
  23. package/dist/components/exam/Exam.d.ts +1 -1
  24. package/dist/components/exam/Question.d.ts +1 -2
  25. package/dist/components/exam/Question.d.ts.map +1 -1
  26. package/dist/components/exam/Section.d.ts +1 -2
  27. package/dist/components/exam/Section.d.ts.map +1 -1
  28. package/dist/components/grading/ChoiceAnswer.d.ts +6 -0
  29. package/dist/components/grading/ChoiceAnswer.d.ts.map +1 -0
  30. package/dist/components/grading/ChoiceAnswer.js +57 -0
  31. package/dist/components/grading/ChoiceAnswer.js.map +1 -0
  32. package/dist/components/grading/DropdownAnswer.d.ts +6 -0
  33. package/dist/components/grading/DropdownAnswer.d.ts.map +1 -0
  34. package/dist/components/grading/DropdownAnswer.js +43 -0
  35. package/dist/components/grading/DropdownAnswer.js.map +1 -0
  36. package/dist/components/grading/Grading.d.ts +15 -0
  37. package/dist/components/grading/Grading.d.ts.map +1 -0
  38. package/dist/components/grading/Grading.js +69 -0
  39. package/dist/components/grading/Grading.js.map +1 -0
  40. package/dist/components/grading/MultiLineAnswer.d.ts +8 -0
  41. package/dist/components/grading/MultiLineAnswer.d.ts.map +1 -0
  42. package/dist/components/grading/MultiLineAnswer.js +21 -0
  43. package/dist/components/grading/MultiLineAnswer.js.map +1 -0
  44. package/dist/components/grading/Question.d.ts +5 -0
  45. package/dist/components/grading/Question.d.ts.map +1 -0
  46. package/dist/components/grading/Question.js +23 -0
  47. package/dist/components/grading/Question.js.map +1 -0
  48. package/dist/components/grading/QuestionTitle.d.ts +6 -0
  49. package/dist/components/grading/QuestionTitle.d.ts.map +1 -0
  50. package/dist/components/grading/QuestionTitle.js +21 -0
  51. package/dist/components/grading/QuestionTitle.js.map +1 -0
  52. package/dist/components/grading/Results.d.ts +15 -0
  53. package/dist/components/grading/Results.d.ts.map +1 -0
  54. package/dist/components/grading/Results.js +77 -0
  55. package/dist/components/grading/Results.js.map +1 -0
  56. package/dist/components/grading/ScoredTextAnswer.d.ts +6 -0
  57. package/dist/components/grading/ScoredTextAnswer.d.ts.map +1 -0
  58. package/dist/components/grading/ScoredTextAnswer.js +22 -0
  59. package/dist/components/grading/ScoredTextAnswer.js.map +1 -0
  60. package/dist/components/grading/Section.d.ts +5 -0
  61. package/dist/components/grading/Section.d.ts.map +1 -0
  62. package/dist/components/grading/Section.js +18 -0
  63. package/dist/components/grading/Section.js.map +1 -0
  64. package/dist/components/grading/SingleLineAnswer.d.ts +12 -0
  65. package/dist/components/grading/SingleLineAnswer.d.ts.map +1 -0
  66. package/dist/components/grading/SingleLineAnswer.js +23 -0
  67. package/dist/components/grading/SingleLineAnswer.js.map +1 -0
  68. package/dist/components/grading/TextAnswer.d.ts +7 -0
  69. package/dist/components/grading/TextAnswer.d.ts.map +1 -0
  70. package/dist/components/grading/TextAnswer.js +53 -0
  71. package/dist/components/grading/TextAnswer.js.map +1 -0
  72. package/dist/components/grading/internal/AnnotationList.d.ts +5 -0
  73. package/dist/components/grading/internal/AnnotationList.d.ts.map +1 -0
  74. package/dist/components/grading/internal/AnnotationList.js +43 -0
  75. package/dist/components/grading/internal/AnnotationList.js.map +1 -0
  76. package/dist/components/grading/internal/QuestionAutoScore.d.ts +10 -0
  77. package/dist/components/grading/internal/QuestionAutoScore.d.ts.map +1 -0
  78. package/dist/components/grading/internal/QuestionAutoScore.js +17 -0
  79. package/dist/components/grading/internal/QuestionAutoScore.js.map +1 -0
  80. package/dist/components/grading/internal/QuestionManualScore.d.ts +12 -0
  81. package/dist/components/grading/internal/QuestionManualScore.d.ts.map +1 -0
  82. package/dist/components/grading/internal/QuestionManualScore.js +61 -0
  83. package/dist/components/grading/internal/QuestionManualScore.js.map +1 -0
  84. package/dist/components/grading/internal/QuestionScoresContainer.d.ts +10 -0
  85. package/dist/components/grading/internal/QuestionScoresContainer.d.ts.map +1 -0
  86. package/dist/components/grading/internal/QuestionScoresContainer.js +12 -0
  87. package/dist/components/grading/internal/QuestionScoresContainer.js.map +1 -0
  88. package/dist/components/grading-instructions/Question.d.ts +1 -2
  89. package/dist/components/grading-instructions/Question.d.ts.map +1 -1
  90. package/dist/components/grading-instructions/Section.d.ts +1 -2
  91. package/dist/components/grading-instructions/Section.d.ts.map +1 -1
  92. package/dist/components/results/Question.d.ts +1 -2
  93. package/dist/components/results/Question.d.ts.map +1 -1
  94. package/dist/components/results/Results.d.ts +1 -1
  95. package/dist/components/results/Section.d.ts +1 -2
  96. package/dist/components/results/Section.d.ts.map +1 -1
  97. package/dist/editAnnotations.d.ts +2 -0
  98. package/dist/editAnnotations.d.ts.map +1 -0
  99. package/dist/editAnnotations.js +8 -0
  100. package/dist/editAnnotations.js.map +1 -0
  101. package/dist/editAnnotationsOld.d.ts +3 -0
  102. package/dist/editAnnotationsOld.d.ts.map +1 -0
  103. package/dist/editAnnotationsOld.js +340 -0
  104. package/dist/editAnnotationsOld.js.map +1 -0
  105. package/dist/i18n/index.js +1 -1
  106. package/dist/i18n/index.js.map +1 -1
  107. package/dist/main-bundle.js +1 -1
  108. package/dist/main-bundle.js.LICENSE.txt +33 -3
  109. package/dist/main.css +1 -1
  110. package/package.json +4 -4
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ExamComponentProps } from '../../createRenderChildNodes';
3
- declare const _default: React.MemoExoticComponent<React.ComponentType<ExamComponentProps>>;
2
+ declare const _default: React.MemoExoticComponent<React.ComponentType<any>>;
4
3
  export default _default;
5
4
  //# sourceMappingURL=Attachment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../src/components/attachments/Attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAYjE,wBAA4D"}
1
+ {"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../src/components/attachments/Attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;;AAczC,wBAA4D"}
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { ExamProps } from '../exam/Exam';
3
2
  export declare const AttachmentsPageTitle: React.FunctionComponent;
4
- declare const _default: React.MemoExoticComponent<React.ComponentType<ExamProps>>;
3
+ declare const _default: React.MemoExoticComponent<React.ComponentType<any>>;
5
4
  export default _default;
6
5
  //# sourceMappingURL=Attachments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Attachments.d.ts","sourceRoot":"","sources":["../../../src/components/attachments/Attachments.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAapD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAqDxC,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,iBAGxC,CAAA;;AAED,wBAA8E"}
1
+ {"version":3,"file":"Attachments.d.ts","sourceRoot":"","sources":["../../../src/components/attachments/Attachments.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAkEpD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,iBAGxC,CAAA;;AAED,wBAA8E"}
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ExamComponentProps } from '../../createRenderChildNodes';
3
- declare const _default: React.MemoExoticComponent<React.ComponentType<ExamComponentProps>>;
2
+ declare const _default: React.MemoExoticComponent<React.ComponentType<any>>;
4
3
  export default _default;
5
4
  //# sourceMappingURL=Question.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../src/components/attachments/Question.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAiB,MAAM,8BAA8B,CAAA;;AA4BhF,wBAAwD"}
1
+ {"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../src/components/attachments/Question.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;;AA6BzC,wBAAwD"}
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ExamComponentProps } from '../../createRenderChildNodes';
3
2
  export declare type AttachmentContext = {
4
3
  name: string | null;
5
4
  isExternal: false;
@@ -10,5 +9,5 @@ export declare type AttachmentContext = {
10
9
  displayNumber: string;
11
10
  };
12
11
  export declare const AttachmentContext: React.Context<AttachmentContext>;
13
- export declare const withAttachmentContext: (Component: React.ComponentType<ExamComponentProps>) => React.ComponentType<ExamComponentProps>;
12
+ export declare const withAttachmentContext: (Component: React.ComponentType<any>) => React.ComponentType<any>;
14
13
  //# sourceMappingURL=AttachmentContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/AttachmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEjE,oBAAY,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,IAAI,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,eAAO,MAAM,iBAAiB,kCAAkE,CAAA;AAEhG,eAAO,MAAM,qBAAqB,iGASjC,CAAA"}
1
+ {"version":3,"file":"AttachmentContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/AttachmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,oBAAY,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,IAAI,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,eAAO,MAAM,iBAAiB,kCAAkE,CAAA;AAEhG,eAAO,MAAM,qBAAqB,mEASjC,CAAA"}
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { ExamProps } from '../exam/Exam';
3
2
  import { ExamServerAPI } from '../../index';
4
3
  export interface ExamContext {
5
4
  casCountdownDuration: number;
6
5
  examServerApi: ExamServerAPI;
7
6
  }
8
7
  export declare const ExamContext: React.Context<ExamContext>;
9
- export declare const withExamContext: (Component: React.ComponentType<ExamProps>) => React.ComponentType<ExamProps>;
8
+ export declare const withExamContext: (Component: React.ComponentType<any>) => React.ComponentType<any>;
10
9
  //# sourceMappingURL=ExamContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExamContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ExamContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,WAAW;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED,eAAO,MAAM,WAAW,4BAAyC,CAAA;AAEjE,eAAO,MAAM,eAAe,+EAO1B,CAAA"}
1
+ {"version":3,"file":"ExamContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ExamContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,WAAW;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED,eAAO,MAAM,WAAW,4BAAyC,CAAA;AAEjE,eAAO,MAAM,eAAe,mEAO1B,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ExamComponentProps } from '../../createRenderChildNodes';
3
2
  export interface QuestionContext {
4
3
  answers: Element[];
5
4
  displayNumber: string;
@@ -11,5 +10,5 @@ export interface QuestionContext {
11
10
  questionLabelIds: string;
12
11
  }
13
12
  export declare const QuestionContext: React.Context<QuestionContext>;
14
- export declare const withQuestionContext: (Component: React.ComponentType<ExamComponentProps>) => React.ComponentType<ExamComponentProps>;
13
+ export declare const withQuestionContext: (Component: React.ComponentType<any>) => React.ComponentType<any>;
15
14
  //# sourceMappingURL=QuestionContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/QuestionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGjE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,OAAO,EAAE,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,eAAO,MAAM,eAAe,gCAA8D,CAAA;AAE1F,eAAO,MAAM,mBAAmB,iGAsB9B,CAAA"}
1
+ {"version":3,"file":"QuestionContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/QuestionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,OAAO,EAAE,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,eAAO,MAAM,eAAe,gCAA8D,CAAA;AAE1F,eAAO,MAAM,mBAAmB,mEAsB9B,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ChoiceGroupChoice, ExamAnswer, GradingStructure, QuestionId, Score } from '../../index';
3
- import { ResultsProps } from '../results/Results';
4
3
  export interface ResultsContext {
5
4
  answersByQuestionId: Record<QuestionId, ExamAnswer>;
6
5
  gradingStructure: GradingStructure;
@@ -10,7 +9,7 @@ export interface ResultsContext {
10
9
  singleGrading?: boolean;
11
10
  }
12
11
  export declare const ResultsContext: React.Context<ResultsContext>;
13
- export declare const withResultsContext: (Component: React.ComponentType<ResultsProps>) => React.ComponentType<ResultsProps>;
12
+ export declare const withResultsContext: (Component: React.ComponentType<any>) => React.ComponentType<any>;
14
13
  export declare function findMultiChoiceFromGradingStructure(gradingStructure: GradingStructure, id: number): ChoiceGroupChoice | undefined;
15
14
  export declare function findScore(scores: Score[], questionId: number): Score | undefined;
16
15
  export declare function calculateQuestionsTotalSumScore(topLevelQuestions: Element[], gradingStructure: GradingStructure, scores: Score[], answersByQuestionId: Record<QuestionId, ExamAnswer>): number;
@@ -1 +1 @@
1
- {"version":3,"file":"ResultsContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ResultsContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAEL,iBAAiB,EAEjB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,KAAK,EACN,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,WAAW,cAAc;IAC7B,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;IACnD,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,qFAgB9B,CAAA;AAED,wBAAgB,mCAAmC,CACjD,gBAAgB,EAAE,gBAAgB,EAClC,EAAE,EAAE,MAAM,GACT,iBAAiB,GAAG,SAAS,CAY/B;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAEhF;AAED,wBAAgB,+BAA+B,CAC7C,iBAAiB,EAAE,OAAO,EAAE,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,KAAK,EAAE,EACf,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAClD,MAAM,CAMR;AAED,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,OAAO,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,KAAK,EAAE,EACf,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAC1C,MAAM,CAgCR"}
1
+ {"version":3,"file":"ResultsContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ResultsContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAEL,iBAAiB,EAEjB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,KAAK,EACN,MAAM,aAAa,CAAA;AAIpB,MAAM,WAAW,cAAc;IAC7B,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;IACnD,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,mEAgB9B,CAAA;AAED,wBAAgB,mCAAmC,CACjD,gBAAgB,EAAE,gBAAgB,EAClC,EAAE,EAAE,MAAM,GACT,iBAAiB,GAAG,SAAS,CAY/B;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAEhF;AAED,wBAAgB,+BAA+B,CAC7C,iBAAiB,EAAE,OAAO,EAAE,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,KAAK,EAAE,EACf,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAClD,MAAM,CAMR;AAED,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,OAAO,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,KAAK,EAAE,EACf,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAC1C,MAAM,CAgCR"}
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ExamComponentProps } from '../../createRenderChildNodes';
3
2
  export interface SectionContext {
4
3
  casForbidden: boolean;
5
4
  displayNumber: string;
@@ -9,5 +8,5 @@ export interface SectionContext {
9
8
  childQuestions: Element[];
10
9
  }
11
10
  export declare const SectionContext: React.Context<SectionContext>;
12
- export declare const withSectionContext: (Component: React.ComponentType<ExamComponentProps>) => React.ComponentType<ExamComponentProps>;
11
+ export declare const withSectionContext: (Component: React.ComponentType<any>) => React.ComponentType<any>;
13
12
  //# sourceMappingURL=SectionContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEjE,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,iGAkB7B,CAAA"}
1
+ {"version":3,"file":"SectionContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,mEAkB7B,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- export declare const withContext: <T, P>(Context: React.Context<T>, parse: (p: P) => T) => (Component: React.ComponentType<P>) => React.ComponentType<P>;
2
+ export declare const withContext: <T, P>(Context: React.Context<T>, parse: (p: P) => T) => (Component: React.ComponentType<any>) => React.ComponentType<any>;
3
3
  //# sourceMappingURL=withContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/withContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,WAAW,wHAarB,CAAA"}
1
+ {"version":3,"file":"withContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/withContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,WAAW,uEAEV,MAAM,aAAa,CAAC,GAAG,CAAC,KAAG,MAAM,aAAa,CAAC,GAAG,CAW7D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"withContext.js","sourceRoot":"","sources":["../../../src/components/context/withContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,CAAC,MAAM,WAAW,GACtB,CAAO,OAAyB,EAAE,KAAkB,EAAE,EAAE,CACxD,CAAC,SAAiC,EAA0B,EAAE;IAC5D,MAAM,OAAO,GAAG,CAAC,KAAQ,EAAE,EAAE;QAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;QACxB,OAAO,CACL,oBAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG;YAC1B,oBAAC,SAAS,OAAK,KAAK,GAAI,CACP,CACpB,CAAA;IACH,CAAC,CAAA;IACD,OAAO,CAAC,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG,GAAG,CAAA;IACtE,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
1
+ {"version":3,"file":"withContext.js","sourceRoot":"","sources":["../../../src/components/context/withContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,CAAC,MAAM,WAAW,GACtB,CAAO,OAAyB,EAAE,KAAkB,EAAE,EAAE,CACxD,CAAC,SAAmC,EAA4B,EAAE;IAChE,MAAM,OAAO,GAAG,CAAC,KAAQ,EAAE,EAAE;QAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;QACxB,OAAO,CACL,oBAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG;YAC1B,oBAAC,SAAS,OAAK,KAAK,GAAI,CACP,CACpB,CAAA;IACH,CAAC,CAAA;IACD,OAAO,CAAC,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG,GAAG,CAAA;IACtE,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ExamComponentProps } from '../../createRenderChildNodes';
3
- declare const _default: React.MemoExoticComponent<React.ComponentType<ExamComponentProps>>;
2
+ declare const _default: React.MemoExoticComponent<React.ComponentType<any>>;
4
3
  export default _default;
5
4
  //# sourceMappingURL=Attachment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAOjE,wBAA4D"}
1
+ {"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;;AASzC,wBAA4D"}
@@ -27,6 +27,6 @@ export interface ExamProps extends CommonExamProps {
27
27
  /** Exam Server API implementation */
28
28
  examServerApi: ExamServerAPI;
29
29
  }
30
- declare const _default: React.MemoExoticComponent<React.ComponentType<ExamProps>>;
30
+ declare const _default: React.MemoExoticComponent<React.ComponentType<any>>;
31
31
  export default _default;
32
32
  //# sourceMappingURL=Exam.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ExamComponentProps } from '../../createRenderChildNodes';
3
- declare const _default: React.MemoExoticComponent<React.ComponentType<ExamComponentProps>>;
2
+ declare const _default: React.MemoExoticComponent<React.ComponentType<any>>;
4
3
  export default _default;
5
4
  //# sourceMappingURL=Question.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Question.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAqBjE,wBAAwD"}
1
+ {"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Question.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;;AAyBzC,wBAAwD"}
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ExamComponentProps } from '../../createRenderChildNodes';
3
- declare const _default: React.MemoExoticComponent<React.ComponentType<ExamComponentProps>>;
2
+ declare const _default: React.MemoExoticComponent<React.ComponentType<any>>;
4
3
  export default _default;
5
4
  //# sourceMappingURL=Section.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAqFjE,wBAAsD"}
1
+ {"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;;AAuFzC,wBAAsD"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../../createRenderChildNodes';
3
+ declare function ChoiceAnswer({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof ChoiceAnswer>;
5
+ export default _default;
6
+ //# sourceMappingURL=ChoiceAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/ChoiceAnswer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAuEjE,iBAAS,YAAY,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAyCtE;;AAED,wBAAuC"}
@@ -0,0 +1,57 @@
1
+ import classNames from 'classnames';
2
+ import React, { useContext } from 'react';
3
+ import { getNumericAttribute, mapChildElements, query } from '../../dom-utils';
4
+ import { useExamTranslation } from '../../i18n';
5
+ import { ScreenReaderOnly } from '../ScreenReaderOnly';
6
+ import { findMultiChoiceFromGradingStructure, ResultsContext } from '../context/ResultsContext';
7
+ import ResultsExamQuestionAutoScore from './internal/QuestionAutoScore';
8
+ function ChoiceAnswerOption({ renderChildNodes, selected, element, questionId, direction, isCorrect, }) {
9
+ const { t } = useExamTranslation();
10
+ const className = element.getAttribute('class');
11
+ const optionId = element.getAttribute('option-id');
12
+ const content = (React.createElement("div", { className: classNames('e-choice-answer-option e-column', className, {
13
+ 'e-choice-answer-option--selected': selected,
14
+ }) }, renderChildNodes(element)));
15
+ const Content = ({ narrow = false }) => (React.createElement(React.Fragment, null,
16
+ React.createElement("input", { type: "radio", className: classNames('e-radio-button', { 'e-column e-column--narrow': narrow }), name: String(questionId), value: optionId, checked: selected, readOnly: true }),
17
+ content,
18
+ isCorrect && React.createElement(ScreenReaderOnly, null, t('screen-reader.correct-answer'))));
19
+ return direction === 'vertical' ? (React.createElement("div", { className: "e-mrg-b-1" },
20
+ React.createElement("label", { className: classNames('e-columns', {
21
+ 'e-correct-answer-left': isCorrect,
22
+ 'e-columns--inline': query(element, ['image', 'video']) == null /* Force full width for options containing responsive media */,
23
+ }) },
24
+ React.createElement(Content, { narrow: true })))) : (React.createElement("div", { className: "e-column e-mrg-b-1" },
25
+ React.createElement("label", { className: classNames('e-block e-text-center', { 'e-correct-answer-bottom': isCorrect }) },
26
+ React.createElement(Content, null))));
27
+ }
28
+ function ChoiceAnswer({ element, renderChildNodes }) {
29
+ const { answersByQuestionId, gradingStructure } = useContext(ResultsContext);
30
+ const questionId = getNumericAttribute(element, 'question-id');
31
+ const answer = answersByQuestionId[questionId];
32
+ const direction = element.getAttribute('direction') || 'vertical';
33
+ const className = element.getAttribute('class');
34
+ const choice = findMultiChoiceFromGradingStructure(gradingStructure, questionId);
35
+ const scoreValue = answer && choice.options.find((option) => option.id === Number(answer.value)).score;
36
+ const maxScore = getNumericAttribute(element, 'max-score');
37
+ return (React.createElement(React.Fragment, null,
38
+ scoreValue !== undefined && React.createElement(ResultsExamQuestionAutoScore, { score: scoreValue, maxScore: maxScore }),
39
+ React.createElement("div", { className: classNames('e-choice-answer', className, {
40
+ 'e-columns': direction === 'horizontal',
41
+ }) }, mapChildElements(element, (childElement) => {
42
+ const optionId = getNumericAttribute(childElement, 'option-id');
43
+ const selected = answer != null && Number(answer.value) === optionId;
44
+ const grading = choice.options.find((option) => option.id === optionId);
45
+ return (React.createElement(ChoiceAnswerOption, { ...{
46
+ element: childElement,
47
+ renderChildNodes,
48
+ questionId,
49
+ key: optionId,
50
+ direction,
51
+ selected,
52
+ isCorrect: grading.correct,
53
+ } }));
54
+ }))));
55
+ }
56
+ export default React.memo(ChoiceAnswer);
57
+ //# sourceMappingURL=ChoiceAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/ChoiceAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,mCAAmC,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/F,OAAO,4BAA4B,MAAM,8BAA8B,CAAA;AASvE,SAAS,kBAAkB,CAAC,EAC1B,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,GACe;IACxB,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;IAC/C,MAAM,QAAQ,GAAG,OAAO,C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QAAQ,CAAE,CAAA;YACxE,OAAO,CACL,oBAAC,kBAAkB,OACb;oBACF,OAAO,EAAE,YAAY;oBACrB,gBAAgB;oBAChB,UAAU;oBACV,GAAG,EAAE,QAAQ;oBACb,SAAS;oBACT,QAAQ;oBACR,SAAS,EAAE,OAAO,CAAC,OAAO;iBAC3B,GACD,CACH,CAAA;QACH,CAAC,CAAC,CACE,CACL,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../../createRenderChildNodes';
3
+ declare function DropdownAnswer({ element, renderChildNodes }: ExamComponentProps): JSX.Element | null;
4
+ declare const _default: React.MemoExoticComponent<typeof DropdownAnswer>;
5
+ export default _default;
6
+ //# sourceMappingURL=DropdownAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/DropdownAnswer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AASjE,iBAAS,cAAc,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,sBA2DxE;;AAED,wBAAyC"}
@@ -0,0 +1,43 @@
1
+ import classNames from 'classnames';
2
+ import React, { useContext } from 'react';
3
+ import { findChildElement, getNumericAttribute } from '../../dom-utils';
4
+ import { useExamTranslation } from '../../i18n';
5
+ import { shortDisplayNumber } from '../../shortDisplayNumber';
6
+ import { QuestionContext } from '../context/QuestionContext';
7
+ import { ScreenReaderOnly } from '../ScreenReaderOnly';
8
+ import { findMultiChoiceFromGradingStructure, ResultsContext } from '../context/ResultsContext';
9
+ import ResultsExamQuestionAutoScore from './internal/QuestionAutoScore';
10
+ function DropdownAnswer({ element, renderChildNodes }) {
11
+ const { t } = useExamTranslation();
12
+ const { answersByQuestionId, gradingStructure } = useContext(ResultsContext);
13
+ const { answers } = useContext(QuestionContext);
14
+ const questionId = getNumericAttribute(element, 'question-id');
15
+ const answer = answersByQuestionId[questionId];
16
+ const selectedOption = findChildElement(element, (childElement) => (answer === null || answer === void 0 ? void 0 : answer.value) === childElement.getAttribute('option-id'));
17
+ const choice = findMultiChoiceFromGradingStructure(gradingStructure, questionId);
18
+ if (selectedOption) {
19
+ const correctIds = choice.options.filter((o) => o.correct).map((o) => o.id);
20
+ const correctOptions = Array.from(element.children).filter((childElement) => correctIds.includes(getNumericAttribute(childElement, 'option-id')));
21
+ const isAnswerCorrect = correctIds.includes(getNumericAttribute(selectedOption, 'option-id'));
22
+ const displayNumber = shortDisplayNumber(element.getAttribute('display-number'));
23
+ const scoreValue = answer && choice.options.find((option) => option.id === Number(answer.value)).score;
24
+ const maxScore = getNumericAttribute(element, 'max-score');
25
+ return (React.createElement(React.Fragment, null,
26
+ answers.length > 1 && React.createElement("sup", null, displayNumber),
27
+ React.createElement("span", { className: classNames('e-dropdown-answer__answered', {
28
+ 'e-dropdown-answer__answered--correct': isAnswerCorrect,
29
+ 'e-dropdown-answer__answered--wrong': !isAnswerCorrect,
30
+ }) },
31
+ React.createElement(ScreenReaderOnly, null, t('screen-reader.answer-begin')),
32
+ renderChildNodes(selectedOption),
33
+ React.createElement(ScreenReaderOnly, null, t('screen-reader.answer-end')),
34
+ isAnswerCorrect && React.createElement(ScreenReaderOnly, null, t('screen-reader.correct-answer'))),
35
+ !isAnswerCorrect && (React.createElement("span", { className: "e-dropdown-answer__correct", "aria-hidden": true }, correctOptions.map((correctOption, i) => (React.createElement(React.Fragment, { key: i },
36
+ renderChildNodes(correctOption),
37
+ i < correctOptions.length - 1 && ', '))))),
38
+ scoreValue != null && (React.createElement(ResultsExamQuestionAutoScore, { score: scoreValue, maxScore: maxScore, displayNumber: displayNumber }))));
39
+ }
40
+ return null;
41
+ }
42
+ export default React.memo(DropdownAnswer);
43
+ //# sourceMappingURL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0BAA0B,CAAC,CAAoB;gBACnE,eAAe,IAAI,oBAAC,gBAAgB,QAAE,CAAC,CAAC,8BAA8B,CAAC,CAAoB,CACvF;YACN,CAAC,eAAe,IAAI,CACnB,8BAAM,SAAS,EAAC,4BAA4B,iBAAc,IAAI,IAC3D,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC,CACxC,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,CAAC;gBACnB,gBAAgB,CAAC,aAAa,CAAC;gBAC/B,CAAC,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CACvB,CAClB,CAAC,CACG,CACR;YACA,UAAU,IAAI,IAAI,IAAI,CACrB,oBAAC,4BAA4B,IAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,GAAI,CACtG,CACA,CACJ,CAAA;KACF;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { GradingStructure, Score } from '../..';
3
+ import { CommonExamProps } from '../exam/Exam';
4
+ export interface ResultsProps extends CommonExamProps {
5
+ /** Contains grading structure for the exam, and in addition scores and metadata (comments and annotations) */
6
+ gradingStructure: GradingStructure;
7
+ /** Custom grading text to be displayed for the whole exam. For example total grade for the exam. */
8
+ gradingText?: string;
9
+ /** Scores for exam answers */
10
+ scores: Score[];
11
+ singleGrading?: boolean;
12
+ }
13
+ declare const _default: React.MemoExoticComponent<React.ComponentType<import("../results/Results").ResultsProps>>;
14
+ export default _default;
15
+ //# sourceMappingURL=Grading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grading.d.ts","sourceRoot":"","sources":["../../../src/components/grading/Grading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAEpD,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAU/C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAY9C,MAAM,WAAW,YAAa,SAAQ,eAAe;IACnD,8GAA8G;IAC9G,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,oGAAoG;IACpG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8BAA8B;IAC9B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;;AA0ED,wBAA6E"}
@@ -0,0 +1,69 @@
1
+ import React, { useContext, useEffect } from 'react';
2
+ import { I18nextProvider } from 'react-i18next';
3
+ import { createRenderChildNodes } from '../../createRenderChildNodes';
4
+ import { findChildElement, queryAncestors } from '../../dom-utils';
5
+ import { changeLanguage, initI18n, useExamTranslation } from '../../i18n';
6
+ import { scrollToHash } from '../../scrollToHash';
7
+ import { useCached } from '../../useCached';
8
+ import mkAttachmentLink from '../shared/AttachmentLink';
9
+ import mkAttachmentLinks from '../shared/AttachmentLinks';
10
+ import { CommonExamContext, withCommonExamContext } from '../context/CommonExamContext';
11
+ import DocumentTitle from '../DocumentTitle';
12
+ import ExamSectionTitle from '../exam/SectionTitle';
13
+ import Formula from '../shared/Formula';
14
+ import Image from '../shared/Image';
15
+ import RenderChildNodes from '../RenderChildNodes';
16
+ import { renderIf } from '../RenderIf';
17
+ import { ResultsContext, withResultsContext } from '../context/ResultsContext';
18
+ import Question from './Question';
19
+ import QuestionTitle from './QuestionTitle';
20
+ import Section from './Section';
21
+ import TextAnswer from './TextAnswer';
22
+ const renderChildNodes = createRenderChildNodes({
23
+ attachment: RenderChildNodes,
24
+ 'attachment-link': mkAttachmentLink('plain'),
25
+ 'attachment-links': mkAttachmentLinks('plain'),
26
+ 'audio-group': RenderChildNodes,
27
+ formula: Formula,
28
+ question: Question,
29
+ hints: RenderChildNodes,
30
+ image: renderIf(({ element }) => queryAncestors(element, 'choice-answer') != null)(Image),
31
+ 'question-title': QuestionTitle,
32
+ section: Section,
33
+ 'section-title': ExamSectionTitle,
34
+ 'text-answer': TextAnswer,
35
+ });
36
+ const Grading = () => {
37
+ const { date, dateTimeFormatter, dayCode, examCode, language, resolveAttachment, root, subjectLanguage } = useContext(CommonExamContext);
38
+ const examTitle = findChildElement(root, 'exam-title');
39
+ const examStylesheet = root.getAttribute('exam-stylesheet');
40
+ const i18n = useCached(() => initI18n(language, examCode, dayCode));
41
+ useEffect(changeLanguage(i18n, language));
42
+ useEffect(scrollToHash, []);
43
+ return (React.createElement(I18nextProvider, { i18n: i18n },
44
+ React.createElement("main", { className: "e-exam", lang: subjectLanguage },
45
+ React.createElement(React.StrictMode, null),
46
+ examStylesheet && React.createElement("link", { rel: "stylesheet", href: resolveAttachment(examStylesheet) }),
47
+ "LOL",
48
+ React.createElement("div", { className: "e-columns e-columns--bottom-v e-mrg-b-4" },
49
+ examTitle && (React.createElement(DocumentTitle, { id: "title", className: "e-column e-mrg-b-0" },
50
+ renderChildNodes(examTitle),
51
+ date && ', ' + dateTimeFormatter.format(date))),
52
+ React.createElement(ScoresAndFinalGrade, null)),
53
+ renderChildNodes(root))));
54
+ };
55
+ function ScoresAndFinalGrade() {
56
+ const { gradingText, totalScore } = useContext(ResultsContext);
57
+ const { t } = useExamTranslation();
58
+ return (React.createElement("div", { className: "e-column--narrow" },
59
+ React.createElement("table", { className: "e-table e-table--borderless e-mrg-b-0" },
60
+ React.createElement("tbody", null,
61
+ React.createElement("tr", null,
62
+ React.createElement("th", { className: "e-pad-y-0 e-normal" }, t('grading-total')),
63
+ React.createElement("td", { className: "e-pad-y-0 e-semibold e-text-right" }, t('points', { count: totalScore }))),
64
+ gradingText && (React.createElement("tr", null,
65
+ React.createElement("th", { className: "e-pad-y-0 e-normal" }, t('grade')),
66
+ React.createElement("td", { className: "e-pad-y-0 e-semibold e-text-right" }, gradingText)))))));
67
+ }
68
+ export default React.memo(withResultsContext(withCommonExamContext(Grading)));
69
+ //# sour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,iBAAiB,CAAC,cAAc,CAAC,GAAI;;YAErF,6BAAK,SAAS,EAAC,yCAAyC;gBACrD,SAAS,IAAI,CACZ,oBAAC,aAAa,IAAC,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,oBAAoB;oBACrD,gBAAgB,CAAC,SAAS,CAAC;oBAC3B,IAAI,IAAI,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAChC,CACjB;gBACD,oBAAC,mBAAmB,OAAG,CACnB;YACL,gBAAgB,CAAC,IAAI,CAAC,CAClB,CACS,CACnB,CAAA;AACH,CAAC,CAAA;AAED,SAAS,mBAAmB;IAC1B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC9D,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAElC,OAAO,CACL,6BAAK,SAAS,EAAC,kBAAkB;QAC/B,+BAAO,SAAS,EAAC,uCAAuC;YACtD;gBACE;oBACE,4BAAI,SAAS,EAAC,oBAAoB,IAAE,CAAC,CAAC,eAAe,CAAC,CAAM;oBAC5D,4BAAI,SAAS,EAAC,mCAAmC,IAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAM,CACxF;gBACJ,WAAW,IAAI,CACd;oBACE,4BAAI,SAAS,EAAC,oBAAoB,IAAE,CAAC,CAAC,OAAO,CAAC,CAAM;oBACpD,4BAAI,SAAS,EAAC,mCAAmC,IAAE,WAAW,CAAM,CACjE,CACN,CACK,CACF,CACJ,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Score } from '../..';
3
+ export declare const MultiLineAnswer: React.FunctionComponent<{
4
+ type: 'rich-text' | 'multi-line';
5
+ value?: string;
6
+ score?: Score;
7
+ }>;
8
+ //# sourceMappingURL=MultiLineAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiLineAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/MultiLineAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAM7B,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACpD,IAAI,EAAE,WAAW,GAAG,YAAY,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAwBA,CAAA"}
@@ -0,0 +1,21 @@
1
+ import React, { useLayoutEffect, useRef } from 'react';
2
+ import { useExamTranslation } from '../../i18n';
3
+ import { renderAnnotations } from '../../renderAnnotations';
4
+ import { setupAnnotationEditing } from '../../editAnnotations';
5
+ import { ScreenReaderOnly } from '../ScreenReaderOnly';
6
+ export const MultiLineAnswer = ({ type, score, value }) => {
7
+ const { t } = useExamTranslation();
8
+ const answerRef = useRef(null);
9
+ useLayoutEffect(() => {
10
+ var _a, _b, _c, _d;
11
+ if (answerRef.current) {
12
+ renderAnnotations(answerRef.current, (_b = (_a = score === null || score === void 0 ? void 0 : score.pregrading) === null || _a === void 0 ? void 0 : _a.annotations) !== null && _b !== void 0 ? _b : [], (_d = (_c = score === null || score === void 0 ? void 0 : score.censoring) === null || _c === void 0 ? void 0 : _c.annotations) !== null && _d !== void 0 ? _d : []);
13
+ setupAnnotationEditing(answerRef.current);
14
+ }
15
+ });
16
+ return (React.createElement("div", { className: "e-multiline-results-text-answer e-line-height-l e-pad-l-2 e-mrg-b-1" },
17
+ React.createElement(ScreenReaderOnly, null, t('screen-reader.answer-begin')),
18
+ type === 'rich-text' ? (React.createElement("div", { dangerouslySetInnerHTML: { __html: value || '' }, ref: answerRef })) : (React.createElement("div", { className: "e-pre-wrap", ref: answerRef }, value)),
19
+ React.createElement(ScreenReaderOnly, null, t('screen-reader.answer-end'))));
20
+ };
21
+ //# sourceMappingURL=MultiLineAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiLineAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/MultiLineAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,CAAC,MAAM,eAAe,GAIvB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9B,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAE9C,eAAe,CAAC,GAAG,EAAE;;QACnB,IAAI,SAAS,CAAC,OAAO,EAAE;YACrB,iBAAiB,CAAC,SAAS,CAAC,OAAO,EAAE,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,0CAAE,WAAW,mCAAI,EAAE,EAAE,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,0CAAE,WAAW,mCAAI,EAAE,CAAC,CAAA;YAC/G,sBAAsB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;SAC1C;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,qEAAqE;QAClF,oBAAC,gBAAgB,QAAE,CAAC,CAAC,4BAA4B,CAAC,CAAoB;QACrE,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CACtB,6BAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,GAAI,CAC1E,CAAC,CAAC,CAAC,CACF,6BAAK,SAAS,EAAC,YAAY,EAAC,GAAG,EAAE,SAAS,IACvC,KAAK,CACF,CACP;QACD,oBAAC,gBAAgB,QAAE,CAAC,CAAC,0BAA0B,CAAC,CAAoB,CAChE,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../../createRenderChildNodes';
3
+ declare const _default: React.MemoExoticComponent<React.ComponentType<ExamComponentProps>>;
4
+ export default _default;
5
+ //# sourceMappingURL=Question.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../src/components/grading/Question.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AA2BjE,wBAAwD"}
@@ -0,0 +1,23 @@
1
+ import classNames from 'classnames';
2
+ import React, { useContext } from 'react';
3
+ import { findChildrenAnswers, getNumericAttribute } from '../../dom-utils';
4
+ import { QuestionContext, withQuestionContext } from '../context/QuestionContext';
5
+ import AnnotationList from './internal/AnnotationList';
6
+ import { ResultsContext } from '../context/ResultsContext';
7
+ function Question({ element, renderChildNodes }) {
8
+ const { answersByQuestionId } = useContext(ResultsContext);
9
+ const { displayNumber, level } = useContext(QuestionContext);
10
+ const hasAnswers = questionHasAnswers(element, answersByQuestionId);
11
+ return hasAnswers ? (React.createElement("div", { className: classNames('exam-question', {
12
+ 'e-mrg-b-8 e-clearfix': level === 0,
13
+ 'e-mrg-l-8 e-mrg-y-4': level > 0,
14
+ }), id: displayNumber },
15
+ renderChildNodes(element),
16
+ React.createElement(AnnotationList, null))) : null;
17
+ }
18
+ function questionHasAnswers(element, answers) {
19
+ const answerElems = findChildrenAnswers(element);
20
+ return answerElems.some((e) => answers[getNumericAttribute(e, 'question-id')]);
21
+ }
22
+ export default React.memo(withQuestionContext(Question));
23
+ //# sourceMappingURL=Question.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Question.js","sourceRoot":"","sources":["../../../src/components/grading/Question.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACjF,OAAO,cAAc,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAI1D,SAAS,QAAQ,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACjE,MAAM,EAAE,mBAAmB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC1D,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC5D,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAA;IAEnE,OAAO,UAAU,CAAC,CAAC,CAAC,CAClB,6BACE,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE;YACrC,sBAAsB,EAAE,KAAK,KAAK,CAAC;YACnC,qBAAqB,EAAE,KAAK,GAAG,CAAC;SACjC,CAAC,EACF,EAAE,EAAE,aAAa;QAEhB,gBAAgB,CAAC,OAAO,CAAC;QAC1B,oBAAC,cAAc,OAAG,CACd,CACP,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAgB,EAAE,OAAmC;IAC/E,MAAM,WAAW,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAChD,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,EAAE,aAAa,CAAE,CAAC,CAAC,CAAA;AACjF,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../../createRenderChildNodes';
3
+ declare function QuestionTitle({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof QuestionTitle>;
5
+ export default _default;
6
+ //# sourceMappingURL=QuestionTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuestionTitle.d.ts","sourceRoot":"","sources":["../../../src/components/grading/QuestionTitle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGjE,iBAAS,aAAa,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAwBvE;;AAED,wBAAwC"}
@@ -0,0 +1,21 @@
1
+ import classNames from 'classnames';
2
+ import React, { useContext } from 'react';
3
+ import AnsweringInstructions from '../AnsweringInstructions';
4
+ import NotificationIcon from '../NotificationIcon';
5
+ import { QuestionContext } from '../context/QuestionContext';
6
+ import { formatQuestionDisplayNumber } from '../../formatting';
7
+ function QuestionTitle({ element, renderChildNodes }) {
8
+ const { displayNumber, level, maxAnswers, childQuestions } = useContext(QuestionContext);
9
+ const Tag = `h${Math.min(3 + level, 6)}`;
10
+ return (React.createElement(React.Fragment, null,
11
+ React.createElement(Tag, { className: classNames('exam-question-title', { 'e-normal e-font-size-m': level > 0 }) },
12
+ React.createElement("strong", { className: classNames('exam-question-title__display-number', {
13
+ 'exam-question-title__display-number--indented': level > 0,
14
+ }) }, formatQuestionDisplayNumber(displayNumber) + ' '),
15
+ renderChildNodes(element)),
16
+ maxAnswers != null && childQuestions.length > 0 && (React.createElement("p", { className: "e-italic" },
17
+ React.createElement(NotificationIcon, null),
18
+ React.createElement(AnsweringInstructions, { ...{ maxAnswers, childQuestions, elementType: 'question' } })))));
19
+ }
20
+ export default React.memo(QuestionTitle);
21
+ //# sourceMappingURL=QuestionTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuestionTitle.js","sourceRoot":"","sources":["../../../src/components/grading/QuestionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,qBAAqB,MAAM,0BAA0B,CAAA;AAC5D,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAE9D,SAAS,aAAa,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACtE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IACxF,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,EAA+B,CAAA;IAErE,OAAO,CACL;QACE,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,EAAE,wBAAwB,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;YACxF,gCACE,SAAS,EAAE,UAAU,CAAC,qCAAqC,EAAE;oBAC3D,+CAA+C,EAAE,KAAK,GAAG,CAAC;iBAC3D,CAAC,IAED,2BAA2B,CAAC,aAAa,CAAC,GAAG,GAAG,CAC1C;YACR,gBAAgB,CAAC,OAAO,CAAC,CACtB;QACL,UAAU,IAAI,IAAI,IAAI,cAAc,CAAC,MA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