refactor: member field in lms quiz submission

This commit is contained in:
Jannat Patel
2022-06-20 17:44:14 +05:30
parent 6ccb5e8dbf
commit 5e875b6d71
4 changed files with 46 additions and 5 deletions

View File

@@ -5,9 +5,10 @@
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"member",
"quiz",
"result",
"score"
"score",
"result"
],
"fields": [
{
@@ -29,11 +30,20 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "Score"
},
{
"fieldname": "member",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Member",
"options": "User"
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-08-26 12:24:15.973829",
"modified": "2022-06-20 10:13:23.013802",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Quiz Submission",
@@ -54,5 +64,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -22,6 +22,16 @@
"onboard": 0,
"type": "Card Break"
},
{
"hidden": 0,
"is_query_report": 0,
"label": "Course",
"link_count": 0,
"link_to": "LMS Course",
"link_type": "DocType",
"onboard": 0,
"type": "Link"
},
{
"hidden": 0,
"is_query_report": 0,
@@ -52,6 +62,16 @@
"onboard": 0,
"type": "Link"
},
{
"hidden": 0,
"is_query_report": 0,
"label": "Quiz Submission",
"link_count": 0,
"link_to": "LMS Quiz Submission",
"link_type": "DocType",
"onboard": 0,
"type": "Link"
},
{
"hidden": 0,
"is_query_report": 0,
@@ -81,13 +101,14 @@
"type": "Link"
}
],
"modified": "2022-03-28 16:21:13.704961",
"modified": "2022-06-20 09:46:31.407249",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS",
"owner": "Administrator",
"parent_page": "",
"public": 1,
"quick_lists": [],
"roles": [],
"sequence_id": 1.0,
"shortcuts": [

View File

@@ -25,5 +25,6 @@ school.patches.v0_0.multiple_instructors #11-02-2022
school.patches.v0_0.set_course_in_lesson #21-03-2022
school.patches.v0_0.set_status_in_course #21-03-2022
lms.patches.v0_0.change_published_field_data #25-03-2022
execute:frappe.delete_doc("Workspace", "School", ignore_missing=True, force=True)
execute:frappe.delete_doc("Workspace", "School", ignore_mi ssing=True, force=True)
lms.patches.v0_0.move_certification_to_certificate
lms.patches.v0_0.quiz_submission_member

View File

@@ -0,0 +1,8 @@
import frappe
def execute():
frappe.reload_doc("lms", "doctype", "lms_quiz_submission")
submissions = frappe.db.get_all("LMS Quiz Submission", fields=["name", "owner"])
for submission in submissions:
frappe.db.set_value("LMS Quiz Submission", submission.name, "member", submission.owner)