HGustavs / LenaSYS

Code Viewer and Course Organization System used in some courses at University of Skövde
57 stars 31 forks source link

Introduce relative deadlines for dugga #11525

Open a97marbr opened 2 years ago

a97marbr commented 2 years ago

I would like to have the option to state deadlines relative to a course starting date.

A course that is given for half a semester is roughly 10 weeks long. Having the option to state that a deadline for a dugga to be for example course week 3, Friday, 17:00 would be great.

When displaying the deadline to students this should be translated to the actual date if a course start date is given. If no start date is given it should say course week 3, Friday, 17:00.

The introduction of these relative deadlines must not break current dugga deadline functionality.

Please provide a mockup on how the dugga configuration form could look with this new feature.

I'm guessing that the deadline overview image would be effected by the introduction of relative deadlines.

a20kimar commented 2 years ago

The introduction of these relative deadlines must not break current dugga deadline functionality.

@a97marbr

Does this mean that the current way of setting deadlines should be kept as is currently and the relative deadlines will introduce an additional way of setting deadlines? I made a quick mockup with how this could look.

unknown

What concerns me might be how these deadlines possibly could come in conflict. I get the impression that a relative deadline alone would do a good job of both having concise deadlines regardless of when a course is started and also to alleviate the teachers having to re-set deadlines when a course is started. My assumption is that you would use the current deadlines as a way to change deadlines if need be during the course but once the course starts again anew it would fall back onto the relative deadlines again. Is this correct?

a97marbr commented 2 years ago

Yes, the benefits of having relative deadlines is as you mention that we would not need to reset deadlines every time a new course version is created.

The following rules I would imagine holds:

Also, I seem to recall that changing deadlines in the mentioned dialog above does nothing. Dugga deadlines are set in the duggaed service using the cogwheel menu.

I would love to be able to change the deeadline at both places.

a97marbr commented 2 years ago

A comment on the layout of the dialog.

I would like to see a grouping of some sort around the area that deals with deadlines. Perhaps use some kind of switch to grey out the deadline type that is not used?

The area heading could then be Deadline and the respective sub-labels Absolute (with a datepicker) and Relative. The relative deadline could perhaps be in amount - unit - time

2 week 10:00 12 day 17:00 1 month 13:00

Also, the relative deadline could benefit from having a preview of what the selected relative deadline would be for the specific course version being edited.

a20kimar commented 2 years ago

Okay I got it. I'll set research on this and spend some time familiarize myself with how the different parts communicate with each other.

a20kimar commented 2 years ago

@a97marbr

I have now spent some time implementing relative deadlines and their functionality so I thought a update would be nice. It took a while because I've been quite badly sick.

In the old system you would pick a deadline by choosing a date in a datepicker and a time of the day.

In the new system there's a choice of either picking a deadline through a datepicker and picking a deadline which is relative to the course start date. This new relative deadline is picked by choosing a type of time (days, weeks, months) and an amount of that type as shown in the picture below.

image

The relative deadline will always be stored and loaded when you click the save button. The absolute deadline will be altered depending on whether the checkbox next to the absolute deadline is checked or not. If it is checked, the deadline in the datepicker will be stored as a absolute deadline. If it's not checked then a calculation will be made to calculate what date the relative deadline will end up on and that date will become the absolute deadline.

When deadlines are loaded, they are compared as to figure out if a absolute deadline is set. This is mostly to make sure to check the checkbox again if a absolute deadline is loaded. It will, generally, always show the absolute deadline as the old system did since the absolute deadline will always be either a saved version of the relative deadline or a set absolute deadline. In the case of deadline being null then we show a calculated date from the relative deadline.

This means that when the deadline is loaded anywhere on the website, it will always load the correct deadline since we're still saving the absolute deadline as we did in the old system(even if it's saving the relative deadline). We're simply calculating and changing the relative deadline into a absolute deadline before we save it to the database.

The issue I've had for the last days is how to incorporate the functionality for when a course is copied. My idea is that I would like it to reset all absolute deadlines and use only relative deadlines. Currently, I implemented the most simple way of doing this which is to set all absolute deadlines to null when a course is copies. I figured that the old deadlines are invalid either way since they would be set in the past but a part of me feel like I should be cautious of saving deadlines as null as to not mess with the integrity of the old systems which might use deadlines elsewhere(although I did look around and couldn't find any). I did notice that the swimlanes did break with having the absolute deadlines as null but since I've added the functionality to calculate relative deadlines I'm sure it's a easy fix.

My current implementation handles null deadlines and displays the relative deadline unless both are null in which case it displays the day after course start. However, I will not include the change of storing deadlines as null in my next pull request as I wanted to run it by you first.

Do you know of any problems off the top of your head if this method would be used?

a20kimar commented 2 years ago

@a97marbr

It seems that I must have misunderstood which menu you mentioned above to use when implementing relative deadlines. I have been working in sectioned rather than duggaed. This is my bad and I apologize. However, since you asked to be able to change the deadline at both places this isn't really a setback and none of my work is for nothing. I think the core functionality and how the relative deadlines work is applicable and work for both places. Obviously, the input in duggaed will need to be altered and that's why I thought to ask you some questions.

Here's how duggaed menu to change dugga deadlines and so on looks right now.

image

First off I'd like to know whether the system with 3 deadlines shown in the picture is something you'd like to keep? If so, do you want multiple relative deadlines to be applied x amount of days after the first one or should relative deadlines only have 1 date? I couldn't find a place where these multiple deadlines are used as they're only changed and shown in duggaed but maybe I've missed something.

The above picture is showing a start date, I presume this is the start date for the dugga. Should the relative deadlines be relative to the start of the course or the start of the dugga?

Below is a image of two mockups I've made which takes the current duggaed design and incorporate the design I have been using in sectioned. The one to the left will keep the deadline format where you can insert 3 different deadlines and add on the functionality of being able to choose to use relative deadline instead. The right side is how I did it in sectioned where you can choose to use a absolute deadline and if it's not being used it will use the relative deadlines. Would either one of these fit the way you'd like to have it?

image

Currently the relative deadline is only saved as a string with four numbers split up with colons (5:3:15:50) where each number represents either amount, type and what time of the day the relative deadline should land upon (days:amount:hour:minute). When the save button is pressed, we check whether the checkbox of absolute deadline is checked and if it is the relative deadline will be calculated and saved as a regular deadline is saved previously. This means that there's no new necessary changes to all of the currently functional deadline systems. The relative deadline string will always be saved and will be carried over when you create a new version of the same course. Furthermore, absolute(or regular) deadlines are deleted when a new version of the course is copied as to prioritize relative deadlines. In an ideal implementation the relative deadlines will overwrite the absolute deadlines and then copy the course. This would, however, interfere in case students have more assignments to turn in after the deadline so I have not yet implemented this change.

I understand that my messages might be a tad long but I'm trying to keep documentation for future reference and hopefully someone can make use of it. Sorry for the long read.

a20kimar commented 2 years ago

I removed waiting for merge label since this issue will still be open for a while.