Skip to content

Commit 7969787

Browse files
committed
Fix placeholders for choices
Signed-off-by: Bhavya Aggarwal <bhavyaaggarwal1209@gmail.com>
1 parent 8a5aba7 commit 7969787

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

app/pods/components/choice-editor/component.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { inject as service } from '@ember/service';
88
export default Component.extend({
99
notify: service(),
1010
isEditing: false,
11+
init () {
12+
this._super(...arguments)
13+
this.set('isEditing', !!this.get('choice.isNew'))
14+
},
1115
actions: {
1216
toggleEditing () {
1317
this.toggleProperty('isEditing')

app/pods/components/choice-editor/template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<label>Choice Title:</label>
77
</div>
88
<div class="col-5 input-group">
9-
<h3> {{input type="text" class="input-text" value=choice.title}} </h3>
9+
<h3> {{input type="text" class="input-text" placeholder="*New Choice, EDIT ME" value=choice.title}} </h3>
1010
</div>
1111
<div class="col-5">
1212
{{markdown-to-html choice.title extensions='katex'}}
@@ -18,7 +18,7 @@
1818
</div>
1919
<div class="col-5 input-group">
2020
<p>
21-
{{textarea type="text" class="input-text py-4" value=choice.description}}
21+
{{textarea type="text" class="input-text py-4" placeholder="EDIT ME" value=choice.description}}
2222
</p>
2323
</div>
2424
<div class="col-5">

app/pods/components/question-editor/component.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ export default Component.extend({
1111
this.toggleProperty('isEditing')
1212
},
1313
addChoice () {
14-
const newChoice = this.get('store').createRecord('choice', {
15-
title: '*New Choice, EDIT ME',
16-
description: 'EDIT ME'
17-
})
14+
const newChoice = this.get('store').createRecord('choice', {})
1815
newChoice.set('question', this.get('question'))
1916

2017
this.get('question.choices').addObject(newChoice)

app/pods/components/question-editor/template.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
choice=choice
4545
isCorrect=(includes correctChoices choice.id)
4646
onFlagChange=(action 'markChoice')
47+
isNew=true
4748
}}
4849
</li>
4950
{{/each}}

0 commit comments

Comments
 (0)