aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ComparisonBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/ComparisonBox.tsx')
-rw-r--r--src/client/views/nodes/ComparisonBox.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx
index f8cf0f464..b2a717c3c 100644
--- a/src/client/views/nodes/ComparisonBox.tsx
+++ b/src/client/views/nodes/ComparisonBox.tsx
@@ -117,7 +117,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
"Ask GPT to create an answer on the back side of the flashcard based on your question on the front"}
</div> // prettier-ignore
}>
- <div className="comparisonBox-button" onPointerDown={() => (this._frontSide ? this.findImageTags() : null)}>
+ <div className="comparisonBox-button" onPointerDown={() => (this._frontSide ? this.askGPT(GPTCallType.CHATCARD) : null)}>
<FontAwesomeIcon icon="lightbulb" size="xl" />
</div>
</Tooltip>
@@ -476,8 +476,8 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
*/
askGPT = async (callType: GPTCallType): Promise<string | undefined> => {
const questionText = 'Question: ' + StrCast(RTFCast(DocCast(this.dataDoc[this.fieldKey + '_1']).text)?.Text);
- // const rubricText = ' Rubric: ' + StrCast(RTFCast(DocCast(this.dataDoc[this.fieldKey + '_0']).text)?.Text);
- // const queryText = questionText + ' UserAnswer: ' + this._inputValue + '. ' + rubricText;
+ const rubricText = ' Rubric: ' + StrCast(RTFCast(DocCast(this.dataDoc[this.fieldKey + '_0']).text)?.Text);
+ const queryText = questionText + ' UserAnswer: ' + this._inputValue + '. ' + rubricText;
this._loading = true;
if (callType == GPTCallType.CHATCARD) {
@@ -487,7 +487,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
}
}
try {
- const res = await gptAPICall(questionText, GPTCallType.FLASHCARD);
+ const res = await gptAPICall(callType == GPTCallType.QUIZ ? queryText : questionText, callType);
runInAction(() => {
if (!res) {
console.error('GPT call failed');