Skip to content

Commit

Permalink
feat:assignment comments is now text editor
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Feb 17, 2025
1 parent 2af7040 commit 43117bc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
30 changes: 24 additions & 6 deletions frontend/src/components/Assignment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,23 @@
type="select"
:options="submissionStatusOptions"
/>
<FormControl
v-if="submissionResource.doc"
v-model="submissionResource.doc.comments"
:label="__('Comments')"
type="textarea"
/>
<div>
<div class="text-sm text-ink-gray-5 mb-1">
{{ __('Comments') }}
</div>
<TextEditor
:content="comments"
@change="
(val) => {
comments = val
isDirty = true
}
"
:editable="true"
:fixedMenu="true"
editorClass="prose-sm max-w-none border-b border-x bg-surface-gray-2 rounded-b-md py-1 px-2 min-h-[7rem]"
/>
</div>
</div>
</div>
</div>
Expand All @@ -184,6 +195,7 @@ import { useRouter } from 'vue-router'
const submissionFile = ref(null)
const answer = ref(null)
const comments = ref(null)
const router = useRouter()
const user = inject('$user')
const showTitle = router.currentRoute.value.name == 'AssignmentSubmission'
Expand Down Expand Up @@ -281,6 +293,9 @@ watch(submissionResource, () => {
if (submissionResource.doc.answer) {
answer.value = submissionResource.doc.answer
}
if (submissionResource.doc.comments) {
comments.value = submissionResource.doc.comments
}
if (submissionResource.isDirty) {
isDirty.value = true
} else if (showUploader() && !submissionFile.value) {
Expand All @@ -305,11 +320,14 @@ const submitAssignment = () => {
submissionResource.doc && submissionResource.doc.owner != user.data?.name
? user.data?.name
: null
submissionResource.setValue.submit(
{
...submissionResource.doc,
assignment_attachment: submissionFile.value?.file_url,
evaluator: evaluator,
comments: comments.value,
answer: answer.value,
},
{
onSuccess(data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
"column_break_3",
"member",
"member_name",
"evaluator",
"section_break_dlzh",
"assignment_attachment",
"answer",
"section_break_ydgh",
"column_break_oqqy",
"evaluator",
"status",
"comments",
"section_break_rqal",
Expand Down Expand Up @@ -80,7 +81,7 @@
},
{
"fieldname": "comments",
"fieldtype": "Small Text",
"fieldtype": "Text Editor",
"label": "Comments"
},
{
Expand Down Expand Up @@ -139,12 +140,16 @@
{
"fieldname": "column_break_oqqy",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_ydgh",
"fieldtype": "Section Break"
}
],
"index_web_pages_for_search": 1,
"links": [],
"make_attachments_public": 1,
"modified": "2024-12-24 21:22:35.212732",
"modified": "2025-02-17 18:40:53.374932",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Assignment Submission",
Expand Down

0 comments on commit 43117bc

Please sign in to comment.