fix: show evaluation in read only mode

This commit is contained in:
Jannat Patel
2022-11-23 15:12:57 +05:30
parent f691ebd146
commit 91e71091ef
5 changed files with 23 additions and 12 deletions

View File

@@ -4,7 +4,7 @@
"allow_delete": 0,
"allow_edit": 0,
"allow_incomplete": 0,
"allow_multiple": 0,
"allow_multiple": 1,
"allow_print": 0,
"amount": 0.0,
"amount_based_on_field": 0,
@@ -18,9 +18,9 @@
"introduction_text": "",
"is_standard": 1,
"list_columns": [],
"login_required": 0,
"login_required": 1,
"max_attachment_size": 0,
"modified": "2022-11-23 12:08:15.978899",
"modified": "2022-11-23 14:57:47.700695",
"modified_by": "Administrator",
"module": "LMS",
"name": "evaluation",
@@ -29,12 +29,12 @@
"published": 1,
"route": "evaluation",
"show_attachments": 0,
"show_list": 0,
"show_list": 1,
"show_sidebar": 0,
"title": "Evaluation",
"web_form_fields": [
{
"allow_read_on_all_link_options": 0,
"allow_read_on_all_link_options": 1,
"fieldname": "member",
"fieldtype": "Link",
"hidden": 0,
@@ -47,7 +47,7 @@
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"allow_read_on_all_link_options": 1,
"fieldname": "course",
"fieldtype": "Link",
"hidden": 0,
@@ -146,4 +146,4 @@
"show_in_filter": 0
}
]
}
}

View File

@@ -1876,3 +1876,7 @@ select {
padding-right: 2.5rem;
-webkit-print-color-adjust: exact;
}
.clickable-row {
cursor: pointer;
}

View File

@@ -80,7 +80,7 @@
{% set total_questions = frappe.db.count("LMS Quiz Question", {"parent": quiz.name}) %}
<tr class="">
<td class="vertically-center">
<td class="subheading vertically-center">
<svg class="icon icon-sm">
<use href="#icon-quiz"></use>
</svg>
@@ -109,7 +109,7 @@
{% set color = "green" if status == "Pass" else "red" if status == "Fail" else "orange" %}
<tr>
<td class="vertically-center">
<td class="subheading vertically-center">
<svg class="icon icon-md">
<use href="#icon-file"></use>
</svg>
@@ -139,8 +139,8 @@
{% for evaluation in course.evaluations %}
{% set color = "green" if evaluation.status == "Pass" else "red" %}
<tr>
<td class="vertically-center">
<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>

View File

@@ -0,0 +1,7 @@
frappe.ready(() => {
$(".clickable-row").click((e) => {
window.location.href = $(e.currentTarget).data("href");
});
})

View File

@@ -48,7 +48,7 @@ def get_context(context):
course.evaluations = frappe.get_all(
"LMS Certificate Evaluation",
{"course": course.course, "member": context.student.name},
["rating", "status", "creation"]
["rating", "status", "creation", "name"]
)
context.class_courses = class_courses