fix: progress view
This commit is contained in:
@@ -75,7 +75,7 @@ body {
|
||||
|
||||
.field-label {
|
||||
color: var(--gray-900);
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-input {
|
||||
@@ -117,7 +117,7 @@ body {
|
||||
.image-preview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
border-radius: var(--border-radius-md);
|
||||
}
|
||||
|
||||
.file-source-preview {
|
||||
@@ -1913,15 +1913,9 @@ li {
|
||||
|
||||
.modal-footer {
|
||||
padding: 0.75rem 1.5rem !important;
|
||||
border-top: none !important;
|
||||
background-color: var(--gray-50) !important;
|
||||
justify-content: flex-end !important;
|
||||
}
|
||||
|
||||
.modal-footer .btn:first-child {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
.modal-header .modal-title {
|
||||
color: var(--gray-900);
|
||||
line-height: 1.5rem;
|
||||
|
||||
@@ -44,29 +44,38 @@
|
||||
<article class="field-parent">
|
||||
<div class="field-group">
|
||||
<div class="field-label">
|
||||
{{ _("Question")}}
|
||||
{{ _("Student") }}
|
||||
</div>
|
||||
{{ submission.member_name }}
|
||||
</div>
|
||||
|
||||
<div class="field-group">
|
||||
<!-- <div class="field-label">
|
||||
{{ _("Question")}}
|
||||
</div> -->
|
||||
{{ assignment.question }}
|
||||
</div>
|
||||
|
||||
<div class="field-group">
|
||||
<div class="field-label">
|
||||
{{ _("Submit your assignment")}}
|
||||
{{ _("Submit")}}
|
||||
</div>
|
||||
<div class="field-description">
|
||||
{{ _("Upload assignment as {0}").format(assignment.type) }}
|
||||
</div>
|
||||
|
||||
<div class="file-source-preview">
|
||||
{% if submission.status == "Not Graded" %}
|
||||
{% if submission.status == "Not Graded" and submission.member == frappe.session.user %}
|
||||
<span class="btn btn-default btn-sm btn-close">
|
||||
{{ _("Clear") }}
|
||||
</span>
|
||||
{% endif %}
|
||||
<div class="btn-upload clickable {% if submission.assignment_attachment %} hide {% endif %}" data-type="{{ assignment.type }}">
|
||||
{{ _("Upload a {0}").format(assignment.type) }}
|
||||
{{ _("Browse").format(assignment.type) }}
|
||||
</div>
|
||||
<iframe class="image-preview {% if not submission.assignment_attachment %} hide {% endif %}" {% if submission.assignment_attachment %} src="{{ submission.assignment_attachment }}" {% endif %}></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</article>
|
||||
{% endmacro %}
|
||||
@@ -1,11 +1,14 @@
|
||||
import frappe
|
||||
from frappe import _
|
||||
from lms.lms.utils import has_course_moderator_role
|
||||
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = 1
|
||||
context.is_moderator = has_course_moderator_role()
|
||||
submission = frappe.form_dict["submission"]
|
||||
assignment = frappe.form_dict["assignment"]
|
||||
|
||||
context.assignment = frappe.db.get_value(
|
||||
"LMS Assignment", assignment, ["title", "name", "type", "question"], as_dict=1
|
||||
)
|
||||
@@ -16,9 +19,11 @@ def get_context(context):
|
||||
context.submission = frappe.db.get_value(
|
||||
"LMS Assignment Submission",
|
||||
submission,
|
||||
["name", "assignment_attachment", "comments", "status"],
|
||||
["name", "assignment_attachment", "comments", "status", "member", "member_name"],
|
||||
as_dict=True,
|
||||
)
|
||||
if not context.is_moderator and frappe.session.user != context.submission.member:
|
||||
raise frappe.PermissionError(_("You don't have permission to access this page."))
|
||||
|
||||
if not context.assignment or not context.submission:
|
||||
raise frappe.PermissionError(_("Invalid Submission URL"))
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
<div class="field-input flex align-center">
|
||||
<select class="form-control" id="type">
|
||||
{% set types = ["Document", "PDF", "URL", "Image"] %}
|
||||
{% set types = ["Document", "PDF", "Image"] %}
|
||||
{% for type in types %}
|
||||
<option value="{{ type }}" {% if assignment.type == type %} selected {% endif %}>
|
||||
{{ type }}
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% if class_students | length and (is_moderator or is_student) %}
|
||||
{% if is_moderator %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#assessments">
|
||||
{{ _("Assessments") }}
|
||||
@@ -96,7 +96,9 @@
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if class_students | length and (is_moderator or is_student) %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#live-class">
|
||||
{{ _("Live Class") }}
|
||||
@@ -120,11 +122,13 @@
|
||||
{{ StudentsSection(class_info, class_students) }}
|
||||
</div>
|
||||
|
||||
{% if class_students | length and (is_moderator or is_student) %}
|
||||
{% if is_moderator %}
|
||||
<div class="tab-pane" id="assessments" role="tabpanel" aria-labelledby="assessments">
|
||||
{{ AssessmentsSection(class_info) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if class_students | length and (is_moderator or is_student) %}
|
||||
<div class="tab-pane" id="live-class" role="tabpanel" aria-labelledby="live-class">
|
||||
{{ LiveClassSection(class_info, live_classes) }}
|
||||
</div>
|
||||
@@ -154,9 +158,9 @@
|
||||
<div>
|
||||
{% for course in class_courses %}
|
||||
<div class="list-row level">
|
||||
<div {% if is_moderator %} class="clickable" {% endif %}>
|
||||
<a class="clickable" href="/courses/{{ course.course }}">
|
||||
{{ course.title }}
|
||||
</div>
|
||||
</a>
|
||||
{% if is_moderator %}
|
||||
<div type="button" class="btn-remove-course" data-course="{{ course.course }}">
|
||||
<svg class="icon icon-sm">
|
||||
@@ -251,15 +255,29 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p class="alert alert-info">
|
||||
{{ _("Please select the assignments you wish to include for the assessment of this class. Your selections will be automatically saved upon clicking. If you decide to remove an item from the list, simply uncheck it.") }}
|
||||
</p>
|
||||
<form class="profile-column-grid" id="assessment-form">
|
||||
<div class="mb-5">
|
||||
<div class="field-label">
|
||||
{{ _("Create New") }}
|
||||
</div>
|
||||
<p class="field-description">
|
||||
{{ _("To create a new assignment for this class, click on the create assignment button. Once you have created the new assignment you can come back to the class and add the assignment from here.") }}
|
||||
</p>
|
||||
<div>
|
||||
<a class="btn btn-default btn-sm" href="/assignments/new-assignment" target="_blank">
|
||||
{{ _("Create Assignment") }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class="" id="assessment-form">
|
||||
{% if all_assignments | length %}
|
||||
<div>
|
||||
<div class="field-label mb-2">
|
||||
{{ _("Assignments") }}
|
||||
</div>
|
||||
<p class="field-description">
|
||||
{{ _("Select the assignments you wish to include for the assessment of this class. Your selections will be automatically saved upon clicking. If you decide to remove an item from the list, simply uncheck it.") }}
|
||||
</p>
|
||||
{% for assignment in all_assignments %}
|
||||
<div>
|
||||
<label class="vertically-center">
|
||||
@@ -286,13 +304,11 @@
|
||||
</div>
|
||||
{% endif %} -->
|
||||
</form>
|
||||
<div class="field-label">
|
||||
{{ _("Create New") }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary btn-sm mr-2 btn-assessment-close" data-dismiss="modal" aria-label="Close">
|
||||
<button class="btn btn-primary btn-sm btn-assessment-close" data-dismiss="modal" aria-label="Close">
|
||||
{{ _("Done") }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -316,7 +332,7 @@
|
||||
{% for assessment in assessments %}
|
||||
<div class="list-row level level-left">
|
||||
<div class="w-50">
|
||||
<a class="clickable" href="{{ assessment.url }}">
|
||||
<a class="clickable" href="{{ assessment.edit_url }}">
|
||||
{{ assessment.title }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
</div>
|
||||
|
||||
<div class="align-self-center">
|
||||
<a class="btn btn-secondary btn-sm btn-evaluate" href=/evaluation/new?member={{student.name}}&date={{frappe.utils.getdate()}}&class={{class_info.name}}">
|
||||
{{ _("Save") }}
|
||||
<a class="btn btn-primary btn-sm btn-evaluate" href=/evaluation/new?member={{student.name}}&date={{frappe.utils.getdate()}}&class={{class_info.name}}">
|
||||
{{ _("Evaluate") }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -50,9 +50,9 @@
|
||||
<div>
|
||||
{% for assessment in assessments %}
|
||||
<div class="list-row level">
|
||||
<div>
|
||||
<a {% if assessment.submission %} class="clickable" href="{{ assessment.url }}" {% endif %}>
|
||||
{{ assessment.title }}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{% if assessment.submission %}
|
||||
{% set status = assessment.submission.status %}
|
||||
@@ -61,9 +61,10 @@
|
||||
<div class="indicator-pill {{ color }}">
|
||||
{{ assessment.submission.status }}
|
||||
</div>
|
||||
<a class="btn btn-secondary btn-sm" href="{{ assessment.url }}">
|
||||
{{ _("Grade") }}
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="indicator-pill red">
|
||||
{{ _("Not Attempted") }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -59,7 +59,7 @@ def get_current_lesson_details(lesson_number, context, is_edit=False):
|
||||
return lesson_info
|
||||
|
||||
|
||||
def get_assessments(is_moderator, class_name, member):
|
||||
def get_assessments(is_moderator, class_name, member=None):
|
||||
if not member:
|
||||
member = frappe.session.user
|
||||
|
||||
|
||||
Reference in New Issue
Block a user