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

Timed Assessment: Timer starts only when user click "Start" while initiating Attempt #7548

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bivanalhar
Copy link
Contributor

No description provided.

@bivanalhar bivanalhar force-pushed the bivan/timed-assessment-fix branch 8 times, most recently from 6c79d3b to 181cb3b Compare September 12, 2024 09:58
Comment on lines 76 to 95
submission.workflowState === 'attempting' &&
(submission.timerStartedAt ? (
<TimeLimitBanner submissionTimeLimitAt={submissionTimeLimitAt} />
)
) : (
<Banner
className="bg-red-700 text-white border-only-b-fuchsia-200 fixed top-0 right-0"
icon={<HourglassTop />}
>
<FormattedMessage
{...translations.remainingTime}
values={{
timeLimit: (
<RemainingTimeTranslations
remainingTime={assessment.timeLimit * 60 * 1000}
/>
),
}}
/>
</Banner>
))
Copy link
Contributor

Choose a reason for hiding this comment

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

TimeLimitBanner already has some logic inside it, shouldn't you also include the additional .timerStartedAt check inside TimeLimitBanner, instead of bringing the logic out here in the SubmissionEditIndex page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.. at first I don't really keen to couple the logic of not-yet-starting timer with when the timer already started. But I found a way to elegantly implement this component so that it includes both cases while keeping the code clean inside

db/schema.rb Show resolved Hide resolved
- timer starts only after student click "Start" when start attempting the exam
- if user attempts to change the time limit, we impose warning
- that it will create inconsistencies for submissions in progress
- if submission already has timer started at, we won't allow to re-configure it
- add test cases regarding this API
- refactor the TimeLimitBanner to accommodate when timer not started yet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants