Compare commits
6 Commits
exercise-r
...
page-conte
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9caf44cdbd | ||
|
|
67708325ae | ||
|
|
3e99577401 | ||
|
|
621d01d502 | ||
|
|
f8948ac2ef | ||
|
|
8b1576a028 |
@@ -2,7 +2,47 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Lesson', {
|
frappe.ui.form.on('Lesson', {
|
||||||
// refresh: function(frm) {
|
setup: function (frm) {
|
||||||
|
frm.trigger('setup_help');
|
||||||
|
},
|
||||||
|
setup_help(frm) {
|
||||||
|
frm.get_field('help').html(`
|
||||||
|
<p>You can add some more additional content to the lesson using a special syntax. The table below mentions all types of dynamic content that you can add to the lessons and the syntax for the same.</p>
|
||||||
|
<div class="row font-weight-bold mb-3">
|
||||||
|
<div class="col-sm-4">
|
||||||
|
Content Type
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
Syntax
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
// }
|
<div class="row mb-3">
|
||||||
|
<div class="col-sm-4">
|
||||||
|
YouTube Video
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
{{ YouTubeVideo("unique_embed_id") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-sm-4">
|
||||||
|
Exercise
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
{{ Exercise("exercise_name") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-sm-4">
|
||||||
|
Quiz
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
{{ Quiz("lms_quiz_name") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,7 +13,9 @@
|
|||||||
"index_",
|
"index_",
|
||||||
"index_label",
|
"index_label",
|
||||||
"section_break_6",
|
"section_break_6",
|
||||||
"body"
|
"body",
|
||||||
|
"help_section",
|
||||||
|
"help"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -60,11 +62,20 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "column_break_4",
|
"fieldname": "column_break_4",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "help_section",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Help"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "help",
|
||||||
|
"fieldtype": "HTML"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-06-23 17:59:52.946515",
|
"modified": "2021-06-29 13:34:49.077363",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Lesson",
|
"name": "Lesson",
|
||||||
|
|||||||
160
community/lms/workspace/lms/lms.json
Normal file
160
community/lms/workspace/lms/lms.json
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
{
|
||||||
|
"category": "Modules",
|
||||||
|
"charts": [],
|
||||||
|
"creation": "2021-06-29 13:05:28.741459",
|
||||||
|
"developer_mode_only": 0,
|
||||||
|
"disable_user_customization": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Workspace",
|
||||||
|
"extends_another_page": 0,
|
||||||
|
"hide_custom": 0,
|
||||||
|
"icon": "education",
|
||||||
|
"idx": 0,
|
||||||
|
"is_default": 0,
|
||||||
|
"is_standard": 1,
|
||||||
|
"label": "LMS",
|
||||||
|
"links": [
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "LMS",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Card Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "LMS Course",
|
||||||
|
"link_to": "LMS Course",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "LMS Batch",
|
||||||
|
"link_to": "LMS Batch",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "LMS Batch Membership",
|
||||||
|
"link_to": "LMS Batch Membership",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "LMS Course Mentor Mapping",
|
||||||
|
"link_to": "LMS Course Mentor Mapping",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "Content",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Card Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "Chapter",
|
||||||
|
"link_to": "Chapter",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "Lesson",
|
||||||
|
"link_to": "Lesson",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "Exercise",
|
||||||
|
"link_to": "Exercise",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "Exercise Submission",
|
||||||
|
"link_to": "Exercise Submission",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "LMS Quiz",
|
||||||
|
"link_to": "LMS Quiz",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": 0,
|
||||||
|
"is_query_report": 0,
|
||||||
|
"label": "LMS Quiz Submission",
|
||||||
|
"link_to": "LMS Quiz Submission",
|
||||||
|
"link_type": "DocType",
|
||||||
|
"onboard": 0,
|
||||||
|
"type": "Link"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"modified": "2021-06-29 15:11:07.324651",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "LMS",
|
||||||
|
"name": "LMS",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"pin_to_bottom": 0,
|
||||||
|
"pin_to_top": 1,
|
||||||
|
"shortcuts": [
|
||||||
|
{
|
||||||
|
"color": "#29CD42",
|
||||||
|
"doc_view": "List",
|
||||||
|
"format": "{} Published",
|
||||||
|
"label": "Courses",
|
||||||
|
"link_to": "LMS Course",
|
||||||
|
"stats_filter": "{\"is_published\": 1}",
|
||||||
|
"type": "DocType"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "#29CD42",
|
||||||
|
"doc_view": "List",
|
||||||
|
"format": "{} Active ",
|
||||||
|
"label": "Batches",
|
||||||
|
"link_to": "LMS Batch",
|
||||||
|
"stats_filter": "{\"status\": \"Active\"}",
|
||||||
|
"type": "DocType"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "#39E4A5",
|
||||||
|
"doc_view": "List",
|
||||||
|
"format": "{} Students",
|
||||||
|
"label": "Memberships",
|
||||||
|
"link_to": "LMS Batch Membership",
|
||||||
|
"stats_filter": "{\"member_type\": \"Student\"}",
|
||||||
|
"type": "DocType"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -61,6 +61,11 @@
|
|||||||
|
|
||||||
{%- block script %}
|
{%- block script %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var page_context = {{ page_context | tojson }};
|
||||||
|
</script>
|
||||||
|
|
||||||
{% for ext in page_extensions %}
|
{% for ext in page_extensions %}
|
||||||
{{ ext.render_footer() }}
|
{{ ext.render_footer() }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -30,11 +30,17 @@ def get_context(context):
|
|||||||
next_ = outline.get_next(lesson_number)
|
next_ = outline.get_next(lesson_number)
|
||||||
context.prev_chap = get_chapter_title(course_name, prev_)
|
context.prev_chap = get_chapter_title(course_name, prev_)
|
||||||
context.next_chap = get_chapter_title(course_name, next_)
|
context.next_chap = get_chapter_title(course_name, next_)
|
||||||
context.next_url = context.course.get_learn_url(next_) + context.course.query_parameter
|
context.next_url = context.course.get_learn_url(next_) and context.course.get_learn_url(next_) + context.course.query_parameter
|
||||||
context.prev_url = context.course.get_learn_url(prev_) + context.course.query_parameter
|
context.prev_url = context.course.get_learn_url(prev_) and context.course.get_learn_url(prev_) + context.course.query_parameter
|
||||||
|
|
||||||
context.page_extensions = get_page_extensions()
|
context.page_extensions = get_page_extensions()
|
||||||
|
|
||||||
|
context.page_context = {
|
||||||
|
"course": context.course.name,
|
||||||
|
"batch": context.get("batch") and context.batch.name,
|
||||||
|
"lesson": context.lesson.name
|
||||||
|
}
|
||||||
|
|
||||||
def get_chapter_title(course_name, lesson_number):
|
def get_chapter_title(course_name, lesson_number):
|
||||||
if not lesson_number:
|
if not lesson_number:
|
||||||
return
|
return
|
||||||
@@ -49,7 +55,7 @@ def get_lesson_index(course, batch, user):
|
|||||||
return lesson and course.get_lesson_index(lesson)
|
return lesson and course.get_lesson_index(lesson)
|
||||||
|
|
||||||
def get_page_extensions():
|
def get_page_extensions():
|
||||||
default_value = ["community.community.plugins.PageExtension"]
|
default_value = ["community.plugins.PageExtension"]
|
||||||
classnames = frappe.get_hooks("community_lesson_page_extensions") or default_value
|
classnames = frappe.get_hooks("community_lesson_page_extensions") or default_value
|
||||||
extensions = [frappe.get_attr(name)() for name in classnames]
|
extensions = [frappe.get_attr(name)() for name in classnames]
|
||||||
return extensions
|
return extensions
|
||||||
|
|||||||
Reference in New Issue
Block a user