From 84a49d5ea778e5c8c9bc70ea79c5ff5408d2d29d Mon Sep 17 00:00:00 2001 From: scmmishra Date: Mon, 1 Oct 2018 16:19:40 +0530 Subject: [PATCH] Modified Content doctype, added question child table for quiz --- .../education/doctype/content/content.json | 12 +- .../education/doctype/question/__init__.py | 0 .../education/doctype/question/question.json | 235 ++++++++++++++++++ .../education/doctype/question/question.py | 10 + 4 files changed, 252 insertions(+), 5 deletions(-) create mode 100644 erpnext/education/doctype/question/__init__.py create mode 100644 erpnext/education/doctype/question/question.json create mode 100644 erpnext/education/doctype/question/question.py diff --git a/erpnext/education/doctype/content/content.json b/erpnext/education/doctype/content/content.json index e80a7f723e..c3840a45db 100644 --- a/erpnext/education/doctype/content/content.json +++ b/erpnext/education/doctype/content/content.json @@ -42,7 +42,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, - "set_only_once": 0, + "set_only_once": 1, "translatable": 0, "unique": 0 }, @@ -53,7 +53,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "content_type", + "depends_on": "", "fieldname": "details_section", "fieldtype": "Section Break", "hidden": 0, @@ -183,6 +183,7 @@ "collapsible": 0, "columns": 0, "default": "Today", + "depends_on": "eval:doc.content_type != \"Quiz\" ", "fieldname": "content_publish_date", "fieldtype": "Date", "hidden": 0, @@ -249,7 +250,7 @@ "collapsible": 0, "columns": 0, "fieldname": "quiz", - "fieldtype": "Data", + "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -257,9 +258,10 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Quiz", + "label": "Questions", "length": 0, "no_copy": 0, + "options": "Question", "permlevel": 0, "precision": "", "print_hide": 0, @@ -478,7 +480,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-10-01 15:36:14.509871", + "modified": "2018-10-01 16:09:29.505488", "modified_by": "Administrator", "module": "Education", "name": "Content", diff --git a/erpnext/education/doctype/question/__init__.py b/erpnext/education/doctype/question/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/education/doctype/question/question.json b/erpnext/education/doctype/question/question.json new file mode 100644 index 0000000000..28cbb5f976 --- /dev/null +++ b/erpnext/education/doctype/question/question.json @@ -0,0 +1,235 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-10-01 15:58:00.696815", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "question", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Question", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "option_1", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Option 1", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "option_2", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Option 2", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "option_3", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Option 3", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "option_4", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Option 4", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "For multiple correct options, write each option number separated by comma (Example: 1,3)", + "fieldname": "correct_options", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Correct Options", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-10-01 16:17:14.877309", + "modified_by": "Administrator", + "module": "Education", + "name": "Question", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/erpnext/education/doctype/question/question.py b/erpnext/education/doctype/question/question.py new file mode 100644 index 0000000000..1608fddd8b --- /dev/null +++ b/erpnext/education/doctype/question/question.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class Question(Document): + pass