Merge pull request #432 from pateljannat/class-evaluations
This commit is contained in:
@@ -6,15 +6,17 @@
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"course",
|
||||
"member",
|
||||
"member_name",
|
||||
"column_break_5",
|
||||
"course",
|
||||
"status",
|
||||
"section_break_6",
|
||||
"date",
|
||||
"start_time",
|
||||
"end_time",
|
||||
"column_break_5",
|
||||
"column_break_10",
|
||||
"rating",
|
||||
"status",
|
||||
"summary"
|
||||
],
|
||||
"fields": [
|
||||
@@ -48,7 +50,7 @@
|
||||
},
|
||||
{
|
||||
"fieldname": "summary",
|
||||
"fieldtype": "Text",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Summary"
|
||||
},
|
||||
{
|
||||
@@ -83,11 +85,19 @@
|
||||
"label": "Status",
|
||||
"options": "Pass\nFail",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_6",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_10",
|
||||
"fieldtype": "Column Break"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2022-04-28 10:24:09.832428",
|
||||
"modified": "2022-11-23 11:49:01.400292",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Certificate Evaluation",
|
||||
|
||||
0
lms/lms/web_form/evaluation/__init__.py
Normal file
0
lms/lms/web_form/evaluation/__init__.py
Normal file
7
lms/lms/web_form/evaluation/evaluation.js
Normal file
7
lms/lms/web_form/evaluation/evaluation.js
Normal file
@@ -0,0 +1,7 @@
|
||||
frappe.ready(function () {
|
||||
frappe.web_form.after_save = () => {
|
||||
setTimeout(() => {
|
||||
window.history.back();
|
||||
});
|
||||
};
|
||||
});
|
||||
149
lms/lms/web_form/evaluation/evaluation.json
Normal file
149
lms/lms/web_form/evaluation/evaluation.json
Normal file
@@ -0,0 +1,149 @@
|
||||
{
|
||||
"accept_payment": 0,
|
||||
"allow_comments": 0,
|
||||
"allow_delete": 0,
|
||||
"allow_edit": 0,
|
||||
"allow_incomplete": 0,
|
||||
"allow_multiple": 1,
|
||||
"allow_print": 0,
|
||||
"amount": 0.0,
|
||||
"amount_based_on_field": 0,
|
||||
"apply_document_permissions": 0,
|
||||
"button_label": "Save",
|
||||
"creation": "2022-11-23 11:59:33.533053",
|
||||
"doc_type": "LMS Certificate Evaluation",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"introduction_text": "",
|
||||
"is_standard": 1,
|
||||
"list_columns": [],
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2022-11-23 14:57:47.700695",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "evaluation",
|
||||
"owner": "Administrator",
|
||||
"payment_button_label": "Buy Now",
|
||||
"published": 1,
|
||||
"route": "evaluation",
|
||||
"show_attachments": 0,
|
||||
"show_list": 1,
|
||||
"show_sidebar": 0,
|
||||
"title": "Evaluation",
|
||||
"web_form_fields": [
|
||||
{
|
||||
"allow_read_on_all_link_options": 1,
|
||||
"fieldname": "member",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Member",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "User",
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 1,
|
||||
"fieldname": "course",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Course",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "LMS Course",
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"label": "Date",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "start_time",
|
||||
"fieldtype": "Time",
|
||||
"hidden": 0,
|
||||
"label": "Start Time",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "end_time",
|
||||
"fieldtype": "Time",
|
||||
"hidden": 0,
|
||||
"label": "End Time",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"label": "",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "",
|
||||
"read_only": 0,
|
||||
"reqd": 0,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "rating",
|
||||
"fieldtype": "Rating",
|
||||
"hidden": 0,
|
||||
"label": "Rating",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"label": "Status",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Pass\nFail",
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "summary",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"label": "Summary",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0,
|
||||
"show_in_filter": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
13
lms/lms/web_form/evaluation/evaluation.py
Normal file
13
lms/lms/web_form/evaluation/evaluation.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import frappe
|
||||
from frappe import _
|
||||
from lms.lms.utils import has_course_moderator_role
|
||||
|
||||
|
||||
def get_context(context):
|
||||
|
||||
if not has_course_moderator_role():
|
||||
message = "Only Moderators have access to this page."
|
||||
if frappe.session.user == "Guest":
|
||||
message = "Please login to access this page."
|
||||
|
||||
raise frappe.PermissionError(_(message))
|
||||
@@ -1876,3 +1876,7 @@ select {
|
||||
padding-right: 2.5rem;
|
||||
-webkit-print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.clickable-row {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -4,14 +4,24 @@
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
{{ BreadCrumb(class_info, student) }}
|
||||
<div class="common-card-style column-card">
|
||||
<div class="mb-5">
|
||||
<div class="medium pull-right">
|
||||
<div class="medium d-flex align-items-center pull-right">
|
||||
<span>
|
||||
{{ frappe.utils.format_datetime(student.last_active, "medium") }}
|
||||
</span>
|
||||
<a class="btn btn-secondary btn-sm ml-3" href="/evaluation/new?member={{student.name}}&date={{frappe.utils.getdate()}}">
|
||||
{{ _("Evaluate") }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="course-home-headings">
|
||||
{{ student.full_name }}
|
||||
@@ -49,12 +59,12 @@
|
||||
<div class="my-5">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th style="width: 40%;">
|
||||
{{ _("Activity") }}
|
||||
</th>
|
||||
<th style="width: 20%;">
|
||||
{{ _("Type") }}
|
||||
</th>
|
||||
<th style="width: 40%;">
|
||||
{{ _("Title") }}
|
||||
</th>
|
||||
<th style="width: 20%;">
|
||||
{{ _("Score/Status") }}
|
||||
</th>
|
||||
@@ -70,23 +80,18 @@
|
||||
{% set total_questions = frappe.db.count("LMS Quiz Question", {"parent": quiz.name}) %}
|
||||
|
||||
<tr class="">
|
||||
<td>
|
||||
{{ quiz.title }}
|
||||
</td>
|
||||
<td>
|
||||
<td class="subheading vertically-center">
|
||||
<svg class="icon icon-sm">
|
||||
<use href="#icon-quiz"></use>
|
||||
</svg>
|
||||
{{ _("Quiz") }}
|
||||
</td>
|
||||
<td>{{ quiz.title }}</td>
|
||||
{% if has_submitted %}
|
||||
<td>
|
||||
{{ submission.score }}/{{ total_questions }}
|
||||
</td>
|
||||
<td>
|
||||
{{ frappe.utils.format_date(submission.creation, "medium") }}
|
||||
</td>
|
||||
<td>{{ submission.score }}/{{ total_questions }}</td>
|
||||
<td>{{ frappe.utils.format_date(submission.creation, "medium") }}</td>
|
||||
{% else %}
|
||||
<td>
|
||||
-
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<div class="indicator-pill red">
|
||||
{{ _("Not Attempted") }}
|
||||
@@ -97,7 +102,6 @@
|
||||
{% endfor %}
|
||||
|
||||
{% for assignment in course.assignments %}
|
||||
|
||||
{% set filters = { "member": student.name, "course": course.course, "lesson": assignment.name } %}
|
||||
{% set has_submitted = frappe.db.exists("Lesson Assignment", filters) %}
|
||||
{% set submission = frappe.db.get_value("Lesson Assignment", filters, ["assignment", "creation", "status"], as_dict=True) %}
|
||||
@@ -105,12 +109,12 @@
|
||||
{% set color = "green" if status == "Pass" else "red" if status == "Fail" else "orange" %}
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
{{ assignment.title }}
|
||||
</td>
|
||||
<td>
|
||||
{{ _("Assignment") }}
|
||||
</td>
|
||||
<td class="subheading vertically-center">
|
||||
<svg class="icon icon-md">
|
||||
<use href="#icon-file"></use>
|
||||
</svg>
|
||||
{{ _("Assignment") }}</td>
|
||||
<td>{{ assignment.title }}</td>
|
||||
{% if has_submitted %}
|
||||
<td>
|
||||
{% if status == "Not Graded" %}
|
||||
@@ -121,13 +125,9 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ frappe.utils.format_date(submission.creation, "medium") }}
|
||||
</td>
|
||||
<td>{{ frappe.utils.format_date(submission.creation, "medium") }}</td>
|
||||
{% else %}
|
||||
<td>
|
||||
-
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<div class="indicator-pill red">
|
||||
{{ _("Not Attempted") }}
|
||||
@@ -136,6 +136,25 @@
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
{% for evaluation in course.evaluations %}
|
||||
{% set color = "green" if evaluation.status == "Pass" else "red" %}
|
||||
<tr class="clickable-row" data-href="/evaluation/{{evaluation.name}}">
|
||||
<td class="subheading vertically-center">
|
||||
<svg class="icon icon-md">
|
||||
<use href="#icon-quality"></use>
|
||||
</svg>
|
||||
{{ _("Evaluation") }}
|
||||
</td>
|
||||
<td> - </td>
|
||||
<td>
|
||||
<div class="indicator-pill {{ color }}">
|
||||
{{ evaluation.status }}
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ frappe.utils.format_date(evaluation.creation, "medium") }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
5
lms/www/classes/progress.js
Normal file
5
lms/www/classes/progress.js
Normal file
@@ -0,0 +1,5 @@
|
||||
frappe.ready(() => {
|
||||
$(".clickable-row").click((e) => {
|
||||
window.location.href = $(e.currentTarget).data("href");
|
||||
});
|
||||
});
|
||||
@@ -45,5 +45,10 @@ def get_context(context):
|
||||
{"course": course.course, "question": ["is", "set"]},
|
||||
["name", "title"],
|
||||
)
|
||||
course.evaluations = frappe.get_all(
|
||||
"LMS Certificate Evaluation",
|
||||
{"course": course.course, "member": context.student.name},
|
||||
["rating", "status", "creation", "name"],
|
||||
)
|
||||
|
||||
context.class_courses = class_courses
|
||||
|
||||
Reference in New Issue
Block a user