Skip to content

Add extension time factor setting.#2965

Open
somiaj wants to merge 1 commit intoopenwebwork:WeBWorK-2.21from
somiaj:add-extension-time-setting
Open

Add extension time factor setting.#2965
somiaj wants to merge 1 commit intoopenwebwork:WeBWorK-2.21from
somiaj:add-extension-time-setting

Conversation

@somiaj
Copy link
Copy Markdown
Contributor

@somiaj somiaj commented May 3, 2026

Add $achievementExtensionFactor setting that is used to configure the length of extensions. This works as a multiplicative factor, by multiplying the base time (either 24 or 48 hours) by the factor. The extension time is always rounded to the nearest hour, and cannot be less than a single hour (two hours for the super extensions).

This affects all items that have an extension time.

  • ExtendDueDate
  • ExtendDueDateGW
  • ExtendReducedDate
  • ReducedCred
  • RessurectGW
  • RessurectHW
  • SuperExtendDueDate
  • SuperExtendReducedDate

@somiaj somiaj force-pushed the add-extension-time-setting branch 3 times, most recently from 65fc09c to adbe683 Compare May 3, 2026 19:24
Comment thread lib/WeBWorK/AchievementItems/AddNewTestGW.pm Outdated
Add `$achievementExtensionFactor` setting that is used to configure
the length of extensions. This works as a multiplicative factor, by
multiplying the base time (either 24 or 48 hours) by the factor. The
extension time is always rounded to the nearest hour, and cannot be
less than a single hour (two hours for the super extensions).

This affects all items that have an extension time.

* ExtendDueDate
* ExtendDueDateGW
* ExtendReducedDate
* ReducedCred
* RessurectGW
* RessurectHW
* SuperExtendDueDate
* SuperExtendReducedDate
@somiaj somiaj force-pushed the add-extension-time-setting branch from adbe683 to 70f35e1 Compare May 5, 2026 15:23
Comment thread lib/WeBWorK/AchievementItems/AddNewTestGW.pm
Copy link
Copy Markdown
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

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

This looks good to me.

It is nice that the new time setting allows the SuperExtendDueDate.pm and SuperExtendReducedDate.pm packages to extend the ExtendDueDate.pm and ExtendReducedDate.pm package, respectively. Nice code refactor!


Returns an array consisting of the extension time in seconds and a translated
string stating the length of the extension. The translated string will state
the number of days and hours if greater than or equal to 3 days, otherwise
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should be

Suggested change
the number of days and hours if greater than or equal to 3 days, otherwise
the number of days and hours if greater than or equal to 2 days, otherwise

based on the code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did consider that, but went with "greater than equal to 3 days", because "2 days and 12 hours" will actually print as "60 hours".

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