mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Add note to assistantSpace
This commit is contained in:
parent
e1411e87a0
commit
9d0073d940
2 changed files with 50 additions and 1 deletions
|
@ -2,7 +2,8 @@ from flask import flash
|
|||
from flask_admin import expose
|
||||
from flask_security import admin_change_password, current_user
|
||||
from wtforms import Form
|
||||
from wtforms.fields import BooleanField, IntegerField, StringField
|
||||
from wtforms.fields import TextAreaField
|
||||
from wtforms.validators import Optional
|
||||
|
||||
from . import assistantSpace, db
|
||||
from .advlabdb_independent_funs import (
|
||||
|
@ -33,6 +34,39 @@ from .models import (
|
|||
)
|
||||
|
||||
|
||||
class AssistantGroupExperimentView(SecureAssistantModelView):
|
||||
class EditForm(Form):
|
||||
note = TextAreaField(
|
||||
"Note",
|
||||
validators=[Optional()],
|
||||
description="This note is optional and can be seen and edited by admins and assistants that are responsible for this semester experiment. This note is for information related to the experiment and group. Examples: Protocol received, submission until ..., etc.",
|
||||
)
|
||||
|
||||
can_edit = True
|
||||
column_display_actions = True
|
||||
|
||||
column_list = [
|
||||
"semester_experiment.experiment",
|
||||
"group.number",
|
||||
"note",
|
||||
]
|
||||
column_labels = {
|
||||
"semester_experiment.experiment": "Experiment",
|
||||
"group.number": "Group number",
|
||||
}
|
||||
column_formatters = {
|
||||
"semester_experiment.experiment": str_formatter,
|
||||
}
|
||||
|
||||
def query_modifier(self, query):
|
||||
return (
|
||||
query.join(SemesterExperiment)
|
||||
.where(SemesterExperiment.semester == current_user.active_semester)
|
||||
.join(SemesterExperiment.assistants)
|
||||
.where(Assistant.user == current_user)
|
||||
)
|
||||
|
||||
|
||||
class AssistantAppointmentView(SecureAssistantModelView):
|
||||
can_edit = True
|
||||
|
||||
|
@ -199,6 +233,11 @@ class AssistantDocsView(SecureAssistantBaseView):
|
|||
return self.render("docs/docs.html", role="assistant")
|
||||
|
||||
|
||||
assistantSpace.add_view(
|
||||
AssistantGroupExperimentView(
|
||||
GroupExperiment, db.session, endpoint="assistant_groupexperiment", url="group_experiment"
|
||||
)
|
||||
)
|
||||
assistantSpace.add_view(
|
||||
AssistantAppointmentView(Appointment, db.session, endpoint="assistant_appointment", url="appointment")
|
||||
)
|
||||
|
|
|
@ -9,6 +9,16 @@ In this section, you will find explanations to each menu item on the upper navig
|
|||
=== Home
|
||||
This is your home page. Here, you currently only find the number of *missing* final experiment marks for the experiments that you are assigned to. At the latest at the end of the semester, this number should be 0. A number higher than 0 means that some oral and/or protocol marks are missing. The final experiment mark is calculated automatically after the oral and protocol marks of an experiment are set.
|
||||
|
||||
=== Group Experiment
|
||||
Here, you will find all the experiments you are responsible for paired with the groups that are doing these experiments in this semester. You can add an optional note specific to a pair of group and experiment. Examples for such a note:
|
||||
* Protocol received
|
||||
* Submission until ...
|
||||
* etc.
|
||||
|
||||
This note can be **seen and edited** by admins and assistants that are responsible for this semester experiment (if you are not the only one who is responsible for this experiment and group pair).
|
||||
|
||||
To edit the note, click on the pen on the left of a row.
|
||||
|
||||
=== Appointment
|
||||
Here, you will find all the appointments you have for the experiments you are assigned to. You can only edit the _Date_ of an appointment. You should do so after writing with the students doing the experiment corresponding to the appointment. The initial date you find before editing it is only a suggestion in the week where the appointment should take place. If _Special_ is checked, then the date should be chosen in the semester break.
|
||||
|
||||
|
|
Loading…
Reference in a new issue