Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add voting timestamp log #1900

Merged
merged 17 commits into from
Jul 24, 2023

Conversation

FSadrieh
Copy link
Collaborator

@janno42 janno42 linked an issue Mar 20, 2023 that may be closed by this pull request
@janno42 janno42 marked this pull request as draft March 20, 2023 16:14
Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking mostly good so far 👍

evap/evaluation/models.py Outdated Show resolved Hide resolved
evap/evaluation/models.py Outdated Show resolved Hide resolved
evap/staff/tests/test_views.py Outdated Show resolved Hide resolved
evap/staff/views.py Outdated Show resolved Hide resolved
evap/student/tests/test_views.py Outdated Show resolved Hide resolved
evap/student/tests/test_views.py Outdated Show resolved Hide resolved
@janno42 janno42 changed the title Resolves 1857 Add voting timestamp log May 6, 2023
evap/student/tests/test_views.py Outdated Show resolved Hide resolved
evap/evaluation/models.py Outdated Show resolved Hide resolved
@richardebeling richardebeling marked this pull request as ready for review May 22, 2023 16:51
@FSadrieh FSadrieh force-pushed the 1857Log.voting.timestamps branch from 1c6aa4c to fc6f1f2 Compare May 22, 2023 16:53
Copy link
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️ Meets requirements
✔️ UI functionality checked

@janno42 janno42 requested a review from richardebeling June 5, 2023 16:21
evap/development/fixtures/test_data.json Outdated Show resolved Hide resolved
evap/evaluation/migrations/0134_votetimestamp.py Outdated Show resolved Hide resolved
evap/staff/views.py Outdated Show resolved Hide resolved
evap/student/tests/test_views.py Outdated Show resolved Hide resolved
@richardebeling richardebeling self-requested a review June 5, 2023 19:59
@FSadrieh FSadrieh force-pushed the 1857Log.voting.timestamps branch from 5da8217 to 455f47a Compare June 12, 2023 19:12
@niklasmohrin
Copy link
Member

niklasmohrin commented Jun 12, 2023

Uff, this is not reviewable, we first need to untangle the git history here (I think you have some evil merge commits in there) - we can do it next week

@FSadrieh FSadrieh force-pushed the 1857Log.voting.timestamps branch from 455f47a to 3009ce8 Compare June 26, 2023 16:24
@FSadrieh
Copy link
Collaborator Author

import datetime
from random import randrange

for evaluation in Evaluation.objects.filter(state__gte=50, course__semester__is_active=True):
    voter_count = evaluation.voters.count()
    for i in range(voter_count):
        start = evaluation.vote_start_datetime
        end = datetime.datetime.combine(evaluation.vote_end_date, datetime.time())
        delta = min(end, datetime.datetime.now()) - start
        int_delta = (delta.days * 24 * 60 * 60) + delta.seconds
        random_second = randrange(int_delta)
        timestamp = start + datetime.timedelta(seconds=random_second)
        VoteTimestamp.objects.create(evaluation=evaluation, timestamp=timestamp)

Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor things left:

evap/staff/tests/test_views.py Outdated Show resolved Hide resolved
evap/staff/tests/test_views.py Outdated Show resolved Hide resolved
evap/staff/views.py Outdated Show resolved Hide resolved
evap/staff/views.py Outdated Show resolved Hide resolved
evap/staff/views.py Outdated Show resolved Hide resolved
@FSadrieh FSadrieh force-pushed the 1857Log.voting.timestamps branch from 0d1f6d0 to 314d7d7 Compare July 17, 2023 18:14
Copy link
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️ Meets requirements
✔️ UI functionality checked

@janno42 janno42 requested a review from niklasmohrin July 17, 2023 19:47
Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the comment about the testdata is resolved, we can merge

@niklasmohrin niklasmohrin merged commit 4bdfc7c into e-valuation:main Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Log voting timestamps
4 participants