Skip to content

Show both course id and the archive file when they differ when listing course archives in the admin course. - #3116

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

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

Conversation

@drgrice1

@drgrice1 drgrice1 commented Aug 6, 2026

Copy link
Copy Markdown
Member

This is an alternate to #3114.

…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)`.
@somiaj

somiaj commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Would adding some help to describe when the filename is listed be helpful for those who may not understand why sometimes the filename is there and others it isn't?

@drgrice1

drgrice1 commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

I don't know. I think that most of the time the file names will not be shown at all. Those that do should be able to figure it out.

@drgrice1

drgrice1 commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Also, there isn't really a good way to add help here. There is not a help for the course listings page, and I wouldn't want the popover help here.

@Alex-Jordan
Alex-Jordan merged commit 12454cf into openwebwork:develop Aug 6, 2026
1 check passed
Alex-Jordan added a commit that referenced this pull request Aug 6, 2026
…lt-hotfix

Show both course id and the archive file when they differ when listing course archives in the admin course. (hotfix of #3116)
@drgrice1
drgrice1 deleted the course-archive-list-filename-alt 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