fix: progress access by students

This commit is contained in:
Jannat Patel
2023-08-09 10:13:02 +05:30
5 changed files with 7 additions and 2615 deletions

View File

@@ -21,7 +21,8 @@ class LMSCertificateRequest(Document):
)
for req in existing_requests:
if req.date == getdate(self.date) or getdate() <= getdate(self.date):
if req.date == getdate(self.date) or getdate() <= getdate(req.date):
course_title = frappe.db.get_value("LMS Course", req.course, "title")
frappe.throw(
_("You already have an evaluation on {0} at {1} for the course {2}.").format(

View File

@@ -328,10 +328,10 @@
</div>
</div>
{% for student in class_students %}
{% set allow_progress = is_moderator or student.student == frappe.session.user or is_evaluator %}
{% set allow_progress = is_moderator or is_evaluator %}
<div class="grid-row">
<div class="data-row row">
<a class="col grid-static-col {% if allow_progress %} clickable {% endif %}" {% if allow_progress %} href="/classes/{{ class_info.name }}/students/{{ student.username }}" {% endif %}>
<a class="col grid-static-col button-links {% if allow_progress %} clickable {% endif %}" {% if allow_progress %} href="/classes/{{ class_info.name }}/students/{{ student.username }}" {% endif %}>
{{ student.student_name }}
</a>
<div class="col grid-static-col col-xs-2 text-right">

View File

@@ -648,7 +648,6 @@ const submit_evaluation_form = (values) => {
frappe.throw(__("Please select a slot"));
}
this.eval_form.hide();
frappe.call({
method: "lms.lms.doctype.lms_certificate_request.lms_certificate_request.create_certificate_request",
args: {
@@ -660,6 +659,7 @@ const submit_evaluation_form = (values) => {
class_name: $(".class-details").data("class"),
},
callback: (r) => {
this.eval_form.hide();
frappe.show_alert({
message: __("Evaluation scheduled successfully"),
indicator: "green",