Skip to content

Show both course id and the archive file when they differ when listing course archives in the admin course. (hotfix of #3116) - #3117

Merged
Alex-Jordan merged 2 commits into
openwebwork:mainfrom
drgrice1:course-archive-list-filename-alt-hotfix
Aug 6, 2026
Merged

Show both course id and the archive file when they differ when listing course archives in the admin course. (hotfix of #3116)#3117
Alex-Jordan merged 2 commits into
openwebwork:mainfrom
drgrice1:course-archive-list-filename-alt-hotfix

Conversation

@drgrice1

@drgrice1 drgrice1 commented Aug 6, 2026

Copy link
Copy Markdown
Member

This is an alternate for #3115.

…ives in the admin course.

The previous setup did not take into account what would happen if
multiple archive files contained the same course id.  So instead of the
`listArchivedCourse` method returning a hash of the form

```perl
{
    myTestCourse => {
        filename => 'myTestCourse.tar.gz',
        size     => '605 KB'
    }
}
```

it now returns a hash of the form

```perl
{
    'myTestCourse.tar.gz' => {
        courseID     => 'myTestCourse',
        size         => '605 KB',
  	lastModified => 1778667472
    }
}
```

Note that the `lastModified` key is only included because that is what
is saved in the cache file, and that is just directly returned if the
archive file has not been modified. Although, at this point it is not
used elsewhere.

Both the courseID and the filename are then displayed.  The format
displayed is `myTestCourse (myTestCourse.tar.gz, 605 KB)`.

If there is also an archive file `myTestCourseAlt.tar.gz` then it will
also be listed as something like`myTestCourse (myTestCourseAlt.tar.gz, 1.6 MB)`.
@Alex-Jordan
Alex-Jordan merged commit da18622 into openwebwork:main Aug 6, 2026
2 checks passed
@drgrice1
drgrice1 deleted the course-archive-list-filename-alt-hotfix branch August 6, 2026 10:21
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.

3 participants