@digabi/exam-engine-core 19.2.0 → 19.2.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/grading/AnnotationPopup.d.ts +11 -0
- package/dist/components/grading/AnnotationPopup.d.ts.map +1 -0
- package/dist/components/grading/AnnotationPopup.js +20 -0
- package/dist/components/grading/AnnotationPopup.js.map +1 -0
- package/dist/components/grading/AnswerWithAnnotations.d.ts +11 -0
- package/dist/components/grading/AnswerWithAnnotations.d.ts.map +1 -0
- package/dist/components/grading/AnswerWithAnnotations.js +15 -0
- package/dist/components/grading/AnswerWithAnnotations.js.map +1 -0
- package/dist/components/grading/ChoiceAnswer.d.ts +6 -0
- package/dist/components/grading/ChoiceAnswer.d.ts.map +1 -0
- package/dist/components/grading/ChoiceAnswer.js +57 -0
- package/dist/components/grading/ChoiceAnswer.js.map +1 -0
- package/dist/components/grading/DropdownAnswer.d.ts +6 -0
- package/dist/components/grading/DropdownAnswer.d.ts.map +1 -0
- package/dist/components/grading/DropdownAnswer.js +43 -0
- package/dist/components/grading/DropdownAnswer.js.map +1 -0
- package/dist/components/grading/Grading.d.ts +4 -0
- package/dist/components/grading/Grading.d.ts.map +1 -0
- package/dist/components/grading/Grading.js +81 -0
- package/dist/components/grading/Grading.js.map +1 -0
- package/dist/components/grading/GradingAnswer.d.ts.map +1 -1
- package/dist/components/grading/GradingAnswer.js +1 -0
- package/dist/components/grading/GradingAnswer.js.map +1 -1
- package/dist/components/grading/MultiLineAnswer.d.ts +14 -0
- package/dist/components/grading/MultiLineAnswer.d.ts.map +1 -0
- package/dist/components/grading/MultiLineAnswer.js +61 -0
- package/dist/components/grading/MultiLineAnswer.js.map +1 -0
- package/dist/components/grading/Question.d.ts +5 -0
- package/dist/components/grading/Question.d.ts.map +1 -0
- package/dist/components/grading/Question.js +23 -0
- package/dist/components/grading/Question.js.map +1 -0
- package/dist/components/grading/QuestionTitle.d.ts +6 -0
- package/dist/components/grading/QuestionTitle.d.ts.map +1 -0
- package/dist/components/grading/QuestionTitle.js +21 -0
- package/dist/components/grading/QuestionTitle.js.map +1 -0
- package/dist/components/grading/Results.d.ts +15 -0
- package/dist/components/grading/Results.d.ts.map +1 -0
- package/dist/components/grading/Results.js +77 -0
- package/dist/components/grading/Results.js.map +1 -0
- package/dist/components/grading/ScoredTextAnswer.d.ts +6 -0
- package/dist/components/grading/ScoredTextAnswer.d.ts.map +1 -0
- package/dist/components/grading/ScoredTextAnswer.js +22 -0
- package/dist/components/grading/ScoredTextAnswer.js.map +1 -0
- package/dist/components/grading/Section.d.ts +5 -0
- package/dist/components/grading/Section.d.ts.map +1 -0
- package/dist/components/grading/Section.js +18 -0
- package/dist/components/grading/Section.js.map +1 -0
- package/dist/components/grading/SingleLineAnswer.d.ts +12 -0
- package/dist/components/grading/SingleLineAnswer.d.ts.map +1 -0
- package/dist/components/grading/SingleLineAnswer.js +23 -0
- package/dist/components/grading/SingleLineAnswer.js.map +1 -0
- package/dist/components/grading/TextAnswer.d.ts +7 -0
- package/dist/components/grading/TextAnswer.d.ts.map +1 -0
- package/dist/components/grading/TextAnswer.js +53 -0
- package/dist/components/grading/TextAnswer.js.map +1 -0
- package/dist/components/grading/editAnnotations.d.ts.map +1 -1
- package/dist/components/grading/editAnnotations.js +1 -2
- package/dist/components/grading/editAnnotations.js.map +1 -1
- package/dist/components/grading/internal/AnnotationList.d.ts +5 -0
- package/dist/components/grading/internal/AnnotationList.d.ts.map +1 -0
- package/dist/components/grading/internal/AnnotationList.js +43 -0
- package/dist/components/grading/internal/AnnotationList.js.map +1 -0
- package/dist/components/grading/internal/QuestionAutoScore.d.ts +10 -0
- package/dist/components/grading/internal/QuestionAutoScore.d.ts.map +1 -0
- package/dist/components/grading/internal/QuestionAutoScore.js +17 -0
- package/dist/components/grading/internal/QuestionAutoScore.js.map +1 -0
- package/dist/components/grading/internal/QuestionManualScore.d.ts +12 -0
- package/dist/components/grading/internal/QuestionManualScore.d.ts.map +1 -0
- package/dist/components/grading/internal/QuestionManualScore.js +61 -0
- package/dist/components/grading/internal/QuestionManualScore.js.map +1 -0
- package/dist/components/grading/internal/QuestionScoresContainer.d.ts +10 -0
- package/dist/components/grading/internal/QuestionScoresContainer.d.ts.map +1 -0
- package/dist/components/grading/internal/QuestionScoresContainer.js +12 -0
- package/dist/components/grading/internal/QuestionScoresContainer.js.map +1 -0
- package/dist/components/grading/largeImageDetector.js +1 -1
- package/dist/components/grading/largeImageDetector.js.map +1 -1
- package/dist/components/grading/largeImageResizer.d.ts +2 -0
- package/dist/components/grading/largeImageResizer.d.ts.map +1 -0
- package/dist/components/grading/largeImageResizer.js +33 -0
- package/dist/components/grading/largeImageResizer.js.map +1 -0
- package/dist/components/results/Results2.d.ts +15 -0
- package/dist/components/results/Results2.d.ts.map +1 -0
- package/dist/components/results/Results2.js +79 -0
- package/dist/components/results/Results2.js.map +1 -0
- package/dist/components/shared/AnnotationListComponent.d.ts +1 -0
- package/dist/components/shared/AnnotationListComponent.d.ts.map +1 -0
- package/dist/components/shared/AnnotationListComponent.js +2 -0
- package/dist/components/shared/AnnotationListComponent.js.map +1 -0
- package/dist/editAnnotations.d.ts +2 -0
- package/dist/editAnnotations.d.ts.map +1 -0
- package/dist/editAnnotations.js +8 -0
- package/dist/editAnnotations.js.map +1 -0
- package/dist/editAnnotationsOld.d.ts +3 -0
- package/dist/editAnnotationsOld.d.ts.map +1 -0
- package/dist/editAnnotationsOld.js +340 -0
- package/dist/editAnnotationsOld.js.map +1 -0
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +1 -1
- package/dist/renderAnnotations.d.ts.map +1 -1
- package/dist/renderAnnotations.js +22 -18
- package/dist/renderAnnotations.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/grading-instructions/GradingInstructionsElements.d.ts +0 -3
- package/dist/components/grading-instructions/GradingInstructionsElements.d.ts.map +0 -1
- package/dist/components/grading-instructions/GradingInstructionsElements.js +0 -14
- package/dist/components/grading-instructions/GradingInstructionsElements.js.map +0 -1
- package/dist/gradingInstructionsElements.d.ts +0 -3
- package/dist/gradingInstructionsElements.d.ts.map +0 -1
- package/dist/gradingInstructionsElements.js +0 -14
- package/dist/gradingInstructionsElements.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"largeImageResizer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/largeImageResizer.ts"],"names":[],"mappings":"AAAA,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,QAWvD"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
export function updateLargeImageWarnings(answer) {
|
2
|
+
console.log('updateWarnings');
|
3
|
+
const images = answer.querySelectorAll('img');
|
4
|
+
images.forEach((img) => {
|
5
|
+
console.log('img', img, img.complete);
|
6
|
+
if (img.complete) {
|
7
|
+
setTimeout(() => updateImageStatus(img), 0);
|
8
|
+
}
|
9
|
+
else {
|
10
|
+
img.addEventListener('load', () => updateImageStatus(img));
|
11
|
+
}
|
12
|
+
});
|
13
|
+
}
|
14
|
+
function updateImageStatus(img) {
|
15
|
+
const wrapper = img.parentElement;
|
16
|
+
console.log('wrapper', wrapper);
|
17
|
+
const nextSibling = wrapper.nextSibling;
|
18
|
+
console.log(nextSibling, '\n=== nextSibling');
|
19
|
+
const hasFullSizeLink = nextSibling instanceof HTMLElement && nextSibling.classList.contains('full-size-image');
|
20
|
+
console.log(hasFullSizeLink, '\n=== hasFullSizeLink');
|
21
|
+
if (img.naturalWidth > img.width) {
|
22
|
+
if (!hasFullSizeLink) {
|
23
|
+
console.log('insert...');
|
24
|
+
wrapper.insertAdjacentHTML('afterend', `<div class="full-size-image"><a target="_blank" href="${img.src}"></a>`);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
if (hasFullSizeLink) {
|
29
|
+
nextSibling.remove();
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
//# sourceMappingURL=largeImageResizer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"largeImageResizer.js","sourceRoot":"","sources":["../../../src/components/grading/largeImageResizer.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AQ,CAAC,CAAA;SACjH;KACF;SAAM;QACL,IAAI,eAAe,EAAE;YACnB,WAAW,CAAC,MAAM,EAAE,CAAA;SACrB;KACF;AACH,CAAC"}
|
@@ -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<any>>;
|
14
|
+
export default _default;
|
15
|
+
//# sourceMappingURL=Results2.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Results2.d.ts","sourceRoot":"","sources":["../../../src/components/results/Results2.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;AAgB9C,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;;AAgFD,wBAA8E"}
|
@@ -0,0 +1,79 @@
|
|
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 ExamQuestionInstruction from '../exam/QuestionInstruction';
|
13
|
+
import ExamSectionTitle from '../exam/SectionTitle';
|
14
|
+
import Formula from '../shared/Formula';
|
15
|
+
import Image from '../shared/Image';
|
16
|
+
import RenderChildNodes from '../RenderChildNodes';
|
17
|
+
import { renderIf } from '../RenderIf';
|
18
|
+
import ResultsChoiceAnswer from './ChoiceAnswer';
|
19
|
+
import { ResultsContext, withResultsContext } from '../context/ResultsContext';
|
20
|
+
import DropdownAnswer from './DropdownAnswer';
|
21
|
+
import Question from './Question';
|
22
|
+
import QuestionTitle from './QuestionTitle';
|
23
|
+
import Section from './Section';
|
24
|
+
import ScoredTextAnswer from './ScoredTextAnswer';
|
25
|
+
import TextAnswer from './TextAnswer';
|
26
|
+
const renderChildNodes = createRenderChildNodes({
|
27
|
+
attachment: RenderChildNodes,
|
28
|
+
'attachment-link': mkAttachmentLink('plain'),
|
29
|
+
'attachment-links': mkAttachmentLinks('plain'),
|
30
|
+
'audio-group': RenderChildNodes,
|
31
|
+
'choice-answer': ResultsChoiceAnswer,
|
32
|
+
'dropdown-answer': DropdownAnswer,
|
33
|
+
formula: Formula,
|
34
|
+
question: Question,
|
35
|
+
hints: RenderChildNodes,
|
36
|
+
image: renderIf(({ element }) => queryAncestors(element, 'choice-answer') != null)(Image),
|
37
|
+
'question-instruction': ExamQuestionInstruction,
|
38
|
+
'question-title': QuestionTitle,
|
39
|
+
section: Section,
|
40
|
+
'section-title': ExamSectionTitle,
|
41
|
+
'text-answer': TextAnswer,
|
42
|
+
'scored-text-answer': ScoredTextAnswer,
|
43
|
+
'scored-text-answers': RenderChildNodes,
|
44
|
+
});
|
45
|
+
const Results2 = () => {
|
46
|
+
const { date, dateTimeFormatter, dayCode, examCode, language, resolveAttachment, root, subjectLanguage } = useContext(CommonExamContext);
|
47
|
+
const examTitle = findChildElement(root, 'exam-title');
|
48
|
+
const examStylesheet = root.getAttribute('exam-stylesheet');
|
49
|
+
const i18n = useCached(() => initI18n(language, examCode, dayCode));
|
50
|
+
useEffect(changeLanguage(i18n, language));
|
51
|
+
useEffect(scrollToHash, []);
|
52
|
+
return (React.createElement(I18nextProvider, { i18n: i18n },
|
53
|
+
"LOLBAL",
|
54
|
+
React.createElement("main", { className: "e-exam", lang: subjectLanguage },
|
55
|
+
React.createElement(React.StrictMode, null),
|
56
|
+
examStylesheet && React.createElement("link", { rel: "stylesheet", href: resolveAttachment(examStylesheet) }),
|
57
|
+
React.createElement("div", { className: "e-columns e-columns--bottom-v e-mrg-b-4" },
|
58
|
+
"OTSIKKO",
|
59
|
+
examTitle && (React.createElement(DocumentTitle, { id: "title", className: "e-column e-mrg-b-0" },
|
60
|
+
renderChildNodes(examTitle),
|
61
|
+
date && ', ' + dateTimeFormatter.format(date))),
|
62
|
+
React.createElement(ScoresAndFinalGrade, null)),
|
63
|
+
renderChildNodes(root))));
|
64
|
+
};
|
65
|
+
function ScoresAndFinalGrade() {
|
66
|
+
const { gradingText, totalScore } = useContext(ResultsContext);
|
67
|
+
const { t } = useExamTranslation();
|
68
|
+
return (React.createElement("div", { className: "e-column--narrow" },
|
69
|
+
React.createElement("table", { className: "e-table e-table--borderless e-mrg-b-0" },
|
70
|
+
React.createElement("tbody", null,
|
71
|
+
React.createElement("tr", null,
|
72
|
+
React.createElement("th", { className: "e-pad-y-0 e-normal" }, t('grading-total')),
|
73
|
+
React.createElement("td", { className: "e-pad-y-0 e-semibold e-text-right" }, t('points', { count: totalScore }))),
|
74
|
+
gradingText && (React.createElement("tr", null,
|
75
|
+
React.createElement("th", { className: "e-pad-y-0 e-normal" }, t('grade')),
|
76
|
+
React.createElement("td", { className: "e-pad-y-0 e-semibold e-text-right" }, gradingText)))))));
|
77
|
+
}
|
78
|
+
export default React.memo(withResultsContext(withCommonExamContext(Results2)));
|
79
|
+
//# sourceMappingURL=Results2.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Results2.js","sourceRoot":"","sources":["../../../src/components/results/Results2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,gBAAgB,MAAM,0BAA0B,CAAA;AACvD,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACvF,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAE5C,OAAO,uBAAuB,MAAM,6BAA6B,CAAA;AACjE,OAAO,gBAAgB,MAAM,sBAAsB,CAAA;AACnD,OAAO,OAAO,MAAM,mBAAmB,CAAA;AACvC,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,mBAAmB,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,c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AC,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,QAAQ,CAAC,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
//# sourceMappingURL=AnnotationListComponent.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AnnotationListComponent.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnnotationListComponent.tsx"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AnnotationListComponent.js","sourceRoot":"","sources":["../../../src/components/shared/AnnotationListComponent.tsx"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"editAnnotations.d.ts","sourceRoot":"","sources":["../src/editAnnotations.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,OAAO,QAM5D"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export function setupAnnotationEditing(answerElement) {
|
2
|
+
answerElement.addEventListener('mouseup', (e) => {
|
3
|
+
console.log('target', e.target);
|
4
|
+
const selection = window.getSelection();
|
5
|
+
console.log(selection);
|
6
|
+
});
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=editAnnotations.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"editAnnotations.js","sourceRoot":"","sources":["../src/editAnnotations.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,sBAAsB,CAAC,aAAsB;IAC3D,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;QAC9C,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;QAC/B,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAA;QACvC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACxB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"editAnnotationsOld.d.ts","sourceRoot":"","sources":["../src/editAnnotationsOld.js"],"names":[],"mappings":"AAUA,wHA6PC;AAED,8EAqGC"}
|
@@ -0,0 +1,340 @@
|
|
1
|
+
import $ from 'jquery';
|
2
|
+
import * as _ from 'lodash-es';
|
3
|
+
import * as Bacon from 'baconjs';
|
4
|
+
import * as answerAnnotationsRendering from './annotations-rendering';
|
5
|
+
$.fn.asEventStream = Bacon.$.asEventStream;
|
6
|
+
const ESC = 27;
|
7
|
+
const ENTER = 13;
|
8
|
+
let isMouseDown = false;
|
9
|
+
export function setupAnnotationEditing($containerElement, saveAnnotation, localize, isCensor) {
|
10
|
+
setupAnnotationAddition($containerElement);
|
11
|
+
setupAnnotationRemoval($containerElement);
|
12
|
+
function setupAnnotationRemoval($answers) {
|
13
|
+
$answers.on('mousedown', '.remove-annotation-area', (event) => {
|
14
|
+
removeAnnotation($(event.target).closest('.answerAnnotation'));
|
15
|
+
return false;
|
16
|
+
});
|
17
|
+
function removeAnnotation($annotationElem) {
|
18
|
+
// eslint-disable-line no-shadow
|
19
|
+
const $answerText = $annotationElem.closest('.answerText');
|
20
|
+
const annotationIndex = Number($annotationElem.data('index'));
|
21
|
+
const annotations = answerAnnotationsRendering.get($answerText);
|
22
|
+
const updatedAnnotations = _.without(annotations, annotations[annotationIndex]);
|
23
|
+
saveAnnotation(getAnswerId($answerText), updatedAnnotations);
|
24
|
+
answerAnnotationsRendering.renderAnnotationsForElement($answerText, updatedAnnotations);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
function setupAnnotationAddition($containerElement) {
|
28
|
+
preventDragSelectionFromOverlappingCensorAnswerText($containerElement);
|
29
|
+
$containerElement
|
30
|
+
.asEventStream('mouseup')
|
31
|
+
.filter(hasTextSelectedInAnswerText)
|
32
|
+
.map(() => {
|
33
|
+
$('.remove-annotation-popup').remove();
|
34
|
+
return getBrowserTextSelection().getRangeAt(0);
|
35
|
+
})
|
36
|
+
.filter((range) => {
|
37
|
+
if (selectionHasNothingToUnderline(range)) {
|
38
|
+
return false;
|
39
|
+
}
|
40
|
+
const $container = $(range.commonAncestorContainer);
|
41
|
+
return (!$container.hasClass('add-annotation-popup') &&
|
42
|
+
($container.hasClass('answerText') || $container.parents('div.answerText').toArray().length > 0) &&
|
43
|
+
!$container.parents('.answer').hasClass('autograded'));
|
44
|
+
})
|
45
|
+
.flatMapLatest(openPopupFromRange)
|
46
|
+
.onValue(addAnnotation);
|
47
|
+
$containerElement
|
48
|
+
.asEventStream('mousedown')
|
49
|
+
.filter((e) => !$(e.target).closest('.add-annotation-text').length && !$(e.target).closest('.annotation-message').length)
|
50
|
+
.merge($containerElement.asEventStream('keyup').filter((e) => e.keyCode === ESC))
|
51
|
+
.onValue(() => {
|
52
|
+
getBrowserTextSelection().removeAllRanges();
|
53
|
+
// Render annotations for all answers that have popup open. This clears the popup and annotation that was merged for rendering before opening popup.
|
54
|
+
$('.add-annotation-popup').each((index, popup) => {
|
55
|
+
answerAnnotationsRendering.renderAnnotationsForElement($(popup).closest('.answerText'));
|
56
|
+
});
|
57
|
+
});
|
58
|
+
$containerElement
|
59
|
+
.asEventStream('mousedown', 'img, .attachmentWrapper')
|
60
|
+
.filter((e) => e.button === 0)
|
61
|
+
.doAction(() => {
|
62
|
+
isMouseDown = true;
|
63
|
+
return false;
|
64
|
+
})
|
65
|
+
.flatMapLatest((se) => {
|
66
|
+
const $target = $(se.currentTarget);
|
67
|
+
// We have attached `mousedown` to `.attachmentWrapper` as well, so
|
68
|
+
// the target isn't necessarily the image itself.
|
69
|
+
const $image = $target.is('img') ? $target : $target.find('img');
|
70
|
+
const $targetAnswerText = $image.on('dragstart', false).closest('.answerText');
|
71
|
+
const attachmentIndex = $targetAnswerText.find('img').index($image);
|
72
|
+
// The event will come from the topmost `.answerText`, which isn't
|
73
|
+
// necessarily the correct one. So we need to find the correct
|
74
|
+
// `.answerText` to add the annotation to.
|
75
|
+
const $answerText = $targetAnswerText
|
76
|
+
.parent()
|
77
|
+
.children('.answerText' + (isCensor ? '.is_censor' : '.is_pregrading'));
|
78
|
+
const $attachmentWrapper = answerAnnotationsRendering.wrapAttachment($answerText.find(`img:eq(${attachmentIndex})`));
|
79
|
+
let $shape;
|
80
|
+
const bbox = $attachmentWrapper[0].getBoundingClientRect();
|
81
|
+
const startX = clamp((se.clientX - bbox.left) / bbox.width);
|
82
|
+
const startY = clamp((se.clientY - bbox.top) / bbox.height);
|
83
|
+
const lineThresholdPx = 10;
|
84
|
+
const mouseUpE = $(window)
|
85
|
+
.asEventStream('mouseup')
|
86
|
+
.doAction(() => {
|
87
|
+
isMouseDown = false;
|
88
|
+
});
|
89
|
+
return $(window)
|
90
|
+
.asEventStream('mousemove')
|
91
|
+
.takeUntil(mouseUpE)
|
92
|
+
.flatMapLatest((e) => {
|
93
|
+
const currentX = clamp((e.clientX - bbox.left) / bbox.width);
|
94
|
+
const currentY = clamp((e.clientY - bbox.top) / bbox.height);
|
95
|
+
const isVerticalLine = Math.abs(se.clientX - e.clientX) <= lineThresholdPx;
|
96
|
+
const isHorizontalLine = Math.abs(se.clientY - e.clientY) <= lineThresholdPx;
|
97
|
+
const type = isVerticalLine || isHorizontalLine ? 'line' : 'rect';
|
98
|
+
switch (type) {
|
99
|
+
case 'rect': {
|
100
|
+
return {
|
101
|
+
type: 'rect',
|
102
|
+
attachmentIndex,
|
103
|
+
x: Math.min(startX, currentX),
|
104
|
+
y: Math.min(startY, currentY),
|
105
|
+
width: Math.abs(currentX - startX),
|
106
|
+
height: Math.abs(currentY - startY),
|
107
|
+
};
|
108
|
+
}
|
109
|
+
case 'line': {
|
110
|
+
return {
|
111
|
+
type: 'line',
|
112
|
+
attachmentIndex,
|
113
|
+
x1: isVerticalLine ? startX : Math.min(startX, currentX),
|
114
|
+
y1: isHorizontalLine ? startY : Math.min(startY, currentY),
|
115
|
+
x2: isVerticalLine ? startX : Math.max(startX, currentX),
|
116
|
+
y2: isHorizontalLine ? startY : Math.max(startY, currentY),
|
117
|
+
};
|
118
|
+
}
|
119
|
+
}
|
120
|
+
})
|
121
|
+
.doAction((shape) => {
|
122
|
+
const doAppend = $shape == null;
|
123
|
+
$shape = answerAnnotationsRendering.renderShape(shape, $shape);
|
124
|
+
if (doAppend) {
|
125
|
+
$attachmentWrapper.append($shape);
|
126
|
+
}
|
127
|
+
})
|
128
|
+
.last()
|
129
|
+
.flatMapLatest((shape) => {
|
130
|
+
const $answerText = $attachmentWrapper.closest('.answerText');
|
131
|
+
const attachmentWrapperPosition = $attachmentWrapper.position();
|
132
|
+
const shapePosition = $shape.position();
|
133
|
+
const popupCss = {
|
134
|
+
position: 'absolute',
|
135
|
+
top: attachmentWrapperPosition.top + shapePosition.top + $shape.height() + 4,
|
136
|
+
left: attachmentWrapperPosition.left + shapePosition.left,
|
137
|
+
};
|
138
|
+
return openPopup($answerText, shape, '', popupCss);
|
139
|
+
});
|
140
|
+
})
|
141
|
+
.onValue(addAnnotation);
|
142
|
+
function clamp(n) {
|
143
|
+
return _.clamp(n, 0, 1);
|
144
|
+
}
|
145
|
+
function selectionHasNothingToUnderline(range) {
|
146
|
+
const contents = range.cloneContents();
|
147
|
+
let hasImages = _.includes(_.toArray(contents.childNodes).map((x) => x.tagName), 'IMG');
|
148
|
+
return contents.textContent.length === 0 && !hasImages;
|
149
|
+
}
|
150
|
+
function preventDragSelectionFromOverlappingCensorAnswerText($containerElem) {
|
151
|
+
if (isCensor) {
|
152
|
+
$containerElem.on('mousedown mouseup', (e) => {
|
153
|
+
$('.answerText.is_censor .answerAnnotation').toggleClass('no-mouse', e.type === 'mousedown');
|
154
|
+
});
|
155
|
+
}
|
156
|
+
}
|
157
|
+
function getPopupCss(range) {
|
158
|
+
const container = $(range.startContainer).closest('.answer-text-container').get(0);
|
159
|
+
const boundingRect = range.getBoundingClientRect();
|
160
|
+
if (container) {
|
161
|
+
const containerRect = container.getBoundingClientRect();
|
162
|
+
return {
|
163
|
+
position: 'absolute',
|
164
|
+
top: boundingRect.bottom - containerRect.top + 10,
|
165
|
+
left: boundingRect.left - containerRect.left,
|
166
|
+
};
|
167
|
+
}
|
168
|
+
else {
|
169
|
+
return {
|
170
|
+
position: 'absolute',
|
171
|
+
top: 0,
|
172
|
+
left: 0,
|
173
|
+
};
|
174
|
+
}
|
175
|
+
}
|
176
|
+
function openPopupFromRange(range) {
|
177
|
+
const popupCss = getPopupCss(range);
|
178
|
+
let $answerText = $(range.startContainer).closest('.answerText');
|
179
|
+
const annotationPos = answerAnnotationsRendering.calculatePosition($answerText, range);
|
180
|
+
if (isCensor && !$answerText.hasClass('is_censor')) {
|
181
|
+
// render annotations to censor answer text element even if event cought via double click
|
182
|
+
$answerText = $(range.startContainer).closest('.answer').find('.answerText.is_censor');
|
183
|
+
}
|
184
|
+
const messages = answerAnnotationsRendering.getOverlappingMessages($answerText, annotationPos.startIndex, annotationPos.length);
|
185
|
+
const renderedMessages = messages.reduceRight((msg, str) => `${str} / ${msg}`, '');
|
186
|
+
getBrowserTextSelection().removeAllRanges();
|
187
|
+
// Merge and render annotation to show what range it will contain if annotation gets added
|
188
|
+
// Merged annotation not saved yet, so on cancel previous state is rendered
|
189
|
+
const mergedAnnotations = answerAnnotationsRendering.mergeAnnotation($answerText, annotationPos);
|
190
|
+
answerAnnotationsRendering.renderGivenAnnotations($answerText, mergedAnnotations);
|
191
|
+
return openPopup($answerText, annotationPos, renderedMessages, popupCss);
|
192
|
+
}
|
193
|
+
function openPopup($answerText, annotation, message, popupCss) {
|
194
|
+
const $popup = localize($('<div class="popup add-annotation-popup"><input class="add-annotation-text" type="text" value=""/><i class="fa fa-comment"></i><button data-i18n="arpa.annotate">Merkitse</button></div>'));
|
195
|
+
$popup.get(0).firstChild.value = message;
|
196
|
+
$answerText.append($popup);
|
197
|
+
$popup.css(popupCss);
|
198
|
+
$popup.find('input').focus();
|
199
|
+
return $popup
|
200
|
+
.find('button')
|
201
|
+
.asEventStream('mousedown')
|
202
|
+
.merge($popup.asEventStream('keyup').filter((e) => e.keyCode === ENTER))
|
203
|
+
.map(() => {
|
204
|
+
const message = $('.add-annotation-text').val().trim();
|
205
|
+
return {
|
206
|
+
$answerText,
|
207
|
+
annotation: _.assign({}, annotation, { message }),
|
208
|
+
};
|
209
|
+
});
|
210
|
+
}
|
211
|
+
function addAnnotation(annotationData) {
|
212
|
+
if (annotationData.annotation.length > 0 || annotationData.annotation.type != null) {
|
213
|
+
const data = answerAnnotationsRendering.get(annotationData.$answerText);
|
214
|
+
const annotations = data
|
215
|
+
? answerAnnotationsRendering.mergeAnnotation(annotationData.$answerText, annotationData.annotation)
|
216
|
+
: [annotationData.annotation];
|
217
|
+
saveAnnotation(getAnswerId(annotationData.$answerText), annotations);
|
218
|
+
answerAnnotationsRendering.renderAnnotationsForElement(annotationData.$answerText, annotations);
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
}
|
223
|
+
export function setupAnnotationDisplaying($answers, isCensor) {
|
224
|
+
let fadeOutDelayTimeout = void 0;
|
225
|
+
$answers.on('mouseenter', '.answerAnnotation', (event) => {
|
226
|
+
const $annotation = $(event.target);
|
227
|
+
if (isMouseDown || addAnnotationPopupIsVisible() || hasTextSelectedInAnswerText()) {
|
228
|
+
return;
|
229
|
+
}
|
230
|
+
clearTimeout(fadeOutDelayTimeout);
|
231
|
+
if (popupAlreadyShownForCurrentAnnotation(event)) {
|
232
|
+
$annotation.find('.remove-annotation-popup').stop().show().css({ opacity: 1 });
|
233
|
+
}
|
234
|
+
else {
|
235
|
+
clearAllRemovePopups();
|
236
|
+
renderRemovePopup(event);
|
237
|
+
}
|
238
|
+
});
|
239
|
+
$answers.on('mouseleave', '.answerAnnotation', (event) => {
|
240
|
+
fadeOutDelayTimeout = setTimeout(() => {
|
241
|
+
removeRemovePopup(event);
|
242
|
+
}, 400);
|
243
|
+
});
|
244
|
+
function popupAlreadyShownForCurrentAnnotation(event) {
|
245
|
+
const mouseOverAnnotationElem = $(event.target).closest('.answerAnnotation')[0];
|
246
|
+
const popupsCurrentAnnotationElem = $('.remove-annotation-popup:visible').closest('.answerAnnotation')[0];
|
247
|
+
return (event &&
|
248
|
+
mouseOverAnnotationElem &&
|
249
|
+
popupsCurrentAnnotationElem &&
|
250
|
+
mouseOverAnnotationElem.isEqualNode(popupsCurrentAnnotationElem));
|
251
|
+
}
|
252
|
+
function addAnnotationPopupIsVisible() {
|
253
|
+
return $('.add-annotation-popup').is(':visible');
|
254
|
+
}
|
255
|
+
function clearAllRemovePopups() {
|
256
|
+
$('.remove-annotation-popup').remove();
|
257
|
+
}
|
258
|
+
function renderRemovePopup(event) {
|
259
|
+
const $annotation = $(event.currentTarget);
|
260
|
+
const $popup = popupWithMessage($annotation, $annotation.attr('data-message'));
|
261
|
+
$annotation.append($popup);
|
262
|
+
// Calculate limits for preventing overflow on either side
|
263
|
+
const left = inlineLeftOffset(event.currentTarget);
|
264
|
+
const pageMargin = 8;
|
265
|
+
const leftLimit = -left + pageMargin;
|
266
|
+
const rightLimit = $(window).width() - left - $popup.outerWidth() - pageMargin;
|
267
|
+
const css = {
|
268
|
+
left: Math.min(Math.max(mouseOffsetLeft(event) - $popup.outerWidth() / 2, leftLimit), rightLimit),
|
269
|
+
};
|
270
|
+
$popup.css(css);
|
271
|
+
$popup.fadeIn();
|
272
|
+
}
|
273
|
+
function removeRemovePopup(event) {
|
274
|
+
const $annotation = $(event.target).closest('.answerAnnotation');
|
275
|
+
const popup = $annotation.find('.remove-annotation-popup');
|
276
|
+
popup.fadeOut(100, () => {
|
277
|
+
popup.remove();
|
278
|
+
});
|
279
|
+
}
|
280
|
+
function popupWithMessage($annotation, message) {
|
281
|
+
const $messageContainer = $('<span class="popup remove-annotation-popup"><span class="annotation-message"></span></span>');
|
282
|
+
$messageContainer.find('.annotation-message').text(message || '-');
|
283
|
+
if (isAllowedToRemoveAnnotation($annotation)) {
|
284
|
+
$messageContainer.append('<i class="fa fa-times-circle remove-annotation-area"></i>');
|
285
|
+
}
|
286
|
+
return $messageContainer;
|
287
|
+
}
|
288
|
+
function isAllowedToRemoveAnnotation($annotation) {
|
289
|
+
return isPregradingAndScoringEnabled() || isCensorAndOwnAnnotation();
|
290
|
+
function isPregradingAndScoringEnabled() {
|
291
|
+
const $body = $('body');
|
292
|
+
return $body.hasClass('is_pregrading') && !$body.hasClass('preview');
|
293
|
+
}
|
294
|
+
function isCensorAndOwnAnnotation() {
|
295
|
+
return isCensor && $annotation.closest('.answerText').hasClass('is_censor');
|
296
|
+
}
|
297
|
+
}
|
298
|
+
function inlineLeftOffset(element) {
|
299
|
+
return $(element).offsetParent().offset().left + element.offsetLeft;
|
300
|
+
}
|
301
|
+
function mouseOffsetLeft(mousemove) {
|
302
|
+
const annotation = mousemove.target;
|
303
|
+
const annotationLeftOffsetFromPageEdge = inlineLeftOffset(annotation);
|
304
|
+
return mousemove.pageX - annotationLeftOffsetFromPageEdge;
|
305
|
+
}
|
306
|
+
}
|
307
|
+
function getAnswerId($answerText) {
|
308
|
+
return $answerText.closest('.answer').attr('data-answer-id');
|
309
|
+
}
|
310
|
+
function getBrowserTextSelection() {
|
311
|
+
return typeof window.getSelection !== 'undefined'
|
312
|
+
? window.getSelection()
|
313
|
+
: typeof document.selection !== 'undefined' && document.selection.type === 'Text'
|
314
|
+
? document.selection
|
315
|
+
: undefined;
|
316
|
+
}
|
317
|
+
function hasTextSelectedInAnswerText() {
|
318
|
+
const selection = getBrowserTextSelection();
|
319
|
+
return (selection && selectionInAnswerText(selection) && (isRangeSelection(selection) || textSelectedInRange(selection)));
|
320
|
+
function selectionInAnswerText(sel) {
|
321
|
+
if (sel.type === 'None' || sel.type === 'Caret' || sel.rangeCount === 0)
|
322
|
+
return false;
|
323
|
+
const $startContainer = $(sel.getRangeAt(0).startContainer);
|
324
|
+
return (sel.rangeCount &&
|
325
|
+
$startContainer.closest('.answerText').length === 1 &&
|
326
|
+
$startContainer.closest('.remove-annotation-popup').length === 0);
|
327
|
+
}
|
328
|
+
function isRangeSelection(sel) {
|
329
|
+
return _.get(sel, 'type', '') === 'Range';
|
330
|
+
}
|
331
|
+
function textSelectedInRange(sel) {
|
332
|
+
const range = sel.getRangeAt(0);
|
333
|
+
return (_.get(sel, 'rangeCount', 0) > 0 &&
|
334
|
+
(range.toString().length > 0 || isParentContainer(range.startContainer) || isParentContainer(range.endContainer)));
|
335
|
+
}
|
336
|
+
function isParentContainer(container) {
|
337
|
+
return container && container.classList && container.classList.contains('answerText');
|
338
|
+
}
|
339
|
+
}
|
340
|
+
//# sourceMappingURL=editAnnotationsOld.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"editAnnotationsOld.js","sourceRoot":"","sources":["../src/editAnnotationsOld.js"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,0BAA0B,MAAM,yBAAyB,CAAA;AAErE,CAAC,CAAC,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,aAAa,CAAA;AAC1C,MAAM,GAAG,GAAG,EAAE,CAAA;AACd,MAAM,KAAK,GAAG,EAAE,CAAA;AAChB,IAAI,WAAW,GAAG,KAAK,CAAA;AAEvB,MAAM,UAAU,sBAAsB,CAAC,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ;IAC1F,uBAAuB,CAAC,iBAAiB,CAAC,CAAA;IAC1C,sBAAsB,CAAC,iBAAiB,CAAC,CAAA;IAEzC,SA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