diff --git a/school/lms/doctype/course_chapter/course_chapter.json b/school/lms/doctype/course_chapter/course_chapter.json index 7ebf90b4..7dca741a 100644 --- a/school/lms/doctype/course_chapter/course_chapter.json +++ b/school/lms/doctype/course_chapter/course_chapter.json @@ -1,5 +1,6 @@ { "actions": [], + "allow_import": 1, "allow_rename": 1, "autoname": "format:{####} {title}", "creation": "2021-05-03 05:49:08.383058", @@ -58,7 +59,7 @@ "link_fieldname": "chapter" } ], - "modified": "2021-09-29 15:33:44.611228", + "modified": "2021-09-29 15:33:44.611229", "modified_by": "Administrator", "module": "LMS", "name": "Course Chapter", diff --git a/school/lms/doctype/course_lesson/course_lesson.json b/school/lms/doctype/course_lesson/course_lesson.json index c154c620..d63eb69b 100644 --- a/school/lms/doctype/course_lesson/course_lesson.json +++ b/school/lms/doctype/course_lesson/course_lesson.json @@ -1,5 +1,6 @@ { "actions": [], + "allow_import": 1, "allow_rename": 1, "autoname": "format:{####} {title}", "creation": "2021-05-03 06:21:12.995984", @@ -56,6 +57,7 @@ { "fieldname": "body", "fieldtype": "Markdown Editor", + "ignore_xss_filter": 1, "label": "Body", "reqd": 1 }, @@ -71,7 +73,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-09-29 15:28:51.418015", + "modified": "2021-10-11 15:07:38.134808", "modified_by": "Administrator", "module": "LMS", "name": "Course Lesson", diff --git a/school/lms/doctype/lms_course/lms_course.json b/school/lms/doctype/lms_course/lms_course.json index 2dda3d5b..86b7e5d1 100644 --- a/school/lms/doctype/lms_course/lms_course.json +++ b/school/lms/doctype/lms_course/lms_course.json @@ -8,6 +8,7 @@ } ], "allow_guest_to_view": 1, + "allow_import": 1, "allow_rename": 1, "creation": "2021-03-01 16:49:33.622422", "doctype": "DocType", @@ -167,7 +168,7 @@ "link_fieldname": "course" } ], - "modified": "2021-09-30 10:36:48.759994", + "modified": "2021-09-30 10:36:48.759995", "modified_by": "Administrator", "module": "LMS", "name": "LMS Course", diff --git a/school/lms/doctype/lms_course/lms_course.py b/school/lms/doctype/lms_course/lms_course.py index 2f90e02f..c63b5664 100644 --- a/school/lms/doctype/lms_course/lms_course.py +++ b/school/lms/doctype/lms_course/lms_course.py @@ -225,17 +225,14 @@ class LMSCourse(Document): def reindex_exercises(self): for i, c in enumerate(self.get_chapters(), start=1): - if c.index_ != i: - c.index_ = i - c.save() - self._reindex_exercises_in_chapter(c) + self._reindex_exercises_in_chapter(c, i) - def _reindex_exercises_in_chapter(self, c): + def _reindex_exercises_in_chapter(self, c, index): i = 1 for lesson in self.get_lessons(c): for exercise in lesson.get_exercises(): exercise.index_ = i - exercise.index_label = f"{c.index_}.{i}" + exercise.index_label = f"{index}.{i}" exercise.save() i += 1 diff --git a/school/lms/doctype/lms_quiz/lms_quiz.json b/school/lms/doctype/lms_quiz/lms_quiz.json index 837e8ead..129291a4 100644 --- a/school/lms/doctype/lms_quiz/lms_quiz.json +++ b/school/lms/doctype/lms_quiz/lms_quiz.json @@ -1,5 +1,6 @@ { "actions": [], + "allow_import": 1, "allow_rename": 1, "autoname": "field:title", "creation": "2021-06-07 10:50:17.893625", @@ -34,7 +35,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-09-30 13:10:06.929357", + "modified": "2021-09-30 13:10:06.929358", "modified_by": "Administrator", "module": "LMS", "name": "LMS Quiz", diff --git a/school/lms/doctype/lms_quiz_result/lms_quiz_result.json b/school/lms/doctype/lms_quiz_result/lms_quiz_result.json index 255b8a9a..113f0612 100644 --- a/school/lms/doctype/lms_quiz_result/lms_quiz_result.json +++ b/school/lms/doctype/lms_quiz_result/lms_quiz_result.json @@ -12,7 +12,7 @@ "fields": [ { "fieldname": "question", - "fieldtype": "Data", + "fieldtype": "Text", "in_list_view": 1, "label": "Question" }, @@ -33,7 +33,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2021-06-22 18:32:28.813159", + "modified": "2021-10-12 10:32:45.139121", "modified_by": "Administrator", "module": "LMS", "name": "LMS Quiz Result", diff --git a/school/lms/widgets/CourseCard.html b/school/lms/widgets/CourseCard.html index 273f13c4..5d8c53e1 100644 --- a/school/lms/widgets/CourseCard.html +++ b/school/lms/widgets/CourseCard.html @@ -10,9 +10,9 @@ {% endfor %} {% if membership and not read_only %} {% if progress < 100 %} -