Skip to content

Commit

Permalink
Insert chosen grade into grade text input.
Browse files Browse the repository at this point in the history
  • Loading branch information
charlon committed Aug 14, 2024
1 parent 285648c commit c4f0550
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion course_grader_vue/components/graderoster/grade/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
@input="gradeChanged($event.target.value)"
/>
<ul class="dropdown-menu m-0 small overflow-y-auto" style="max-height: 400px;">
<li v-for="g in choices"><a class="dropdown-item small" type="button">{{ g }}</a></li>
<li v-for="g in choices">
<button class="dropdown-item small" :value="g" type="button" @click="insertGradeChoice(`grade-${student.item_id}`, g)">{{ g }}</button>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -124,6 +126,7 @@ export default {
incomplete: false,
writing: false,
errorText: null,
blah: null,
};
},
computed: {
Expand All @@ -145,6 +148,13 @@ export default {
},
},
methods: {
insertGradeChoice: function (a, b) {
// get the correct text input by id
let input = document.getElementById(a);
// set the input value to whatever choice was clicked
let choice = b
input.value = choice;
},
updateGradeChoices: function () {
var i,
len,
Expand Down

0 comments on commit c4f0550

Please sign in to comment.