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
use WeBWorK::Utils::DateTime qw(between);

sub new ($class) {
sub new ($class, $c) {
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 don't think that $c needs to be passed in anymore, since you reverted the maketext call.

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.

The controller was added for the extension achievements to have access to the course environment for this new setting to compute extension time. I only started translating because I had the controller and didn't think about efficiency concerns.

Though this does mean a similar computation gets used a few times, it was most straight forward to add that computation to the new method, but I guess I could compute the times and time text once then pass it to the new methods.

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 forgot you needed it to get the new setting. That is fine.

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