aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ComparisonBox.tsx
diff options
context:
space:
mode:
authoralyssaf16 <alyssa_feinberg@brown.edu>2024-09-04 22:40:19 -0400
committeralyssaf16 <alyssa_feinberg@brown.edu>2024-09-04 22:40:19 -0400
commit180e775d4a0bbfa211410727ddd13553f30ecf97 (patch)
tree39329270971d8dcd1c642525db0002e375c132a2 /src/client/views/nodes/ComparisonBox.tsx
parent80a9bb161cda4a361d9626047869e7acbe845414 (diff)
fix bug
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 9e1c1b7be..2d4bba8d1 100644
--- a/src/client/views/nodes/ComparisonBox.tsx
+++ b/src/client/views/nodes/ComparisonBox.tsx
@@ -169,8 +169,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
};
@action handleRenderGPTClick = async () => {
- console.log('Phonetic transcription: ' + DocCast(this.Document.audio).phoneticTranscription);
- const phonTrans = DocCast(this.Document.audio).phoneticTranscription;
+ const phonTrans = DocCast(this.Document.audio) ? DocCast(this.Document.audio).phoneticTranscription : undefined;
if (phonTrans) {
this._inputValue = StrCast(phonTrans);
console.log('INPUT:' + this._inputValue);
@@ -471,6 +470,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
DocCast(this.dataDoc[this.props.fieldKey + '_0'])[DocData].text = res;
} else if (callType == GPTCallType.QUIZ) {
console.log(this._inputValue);
+ this.frontSide = true;
this._outputValue = res.replace(/UserAnswer/g, "user's answer").replace(/Rubric/g, 'rubric');
} else if (callType === GPTCallType.FLASHCARD) {
this._loading = false;
@@ -614,7 +614,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
};
hoverFlip = (side: boolean) => {
- if (this.revealOp === 'hover') this.layoutDoc[`_${this._props.fieldKey}_usePath`] = side;
+ if (this.revealOp === 'hover') this.frontSide = side;
};
testForTextFields = (whichSlot: string) => {
@@ -775,7 +775,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
Evaluate Pronunciation
</button>
- {this.frontSide ? (
+ {!this.frontSide ? (
<button className="submit-buttonsubmit" type="button" onClick={this.handleRenderGPTClick} style={{ borderRadius: '2px', marginBottom: '3px', width: '100%' }}>
Submit
</button>