WikiEducationFoundation / WikiEduDashboard

Wiki Education Foundation's Wikipedia course dashboard system
https://dashboard.wikiedu.org
MIT License
386 stars 600 forks source link

In Article Viewer, add option to show the last student revision #5729

Closed ragesoss closed 3 months ago

ragesoss commented 3 months ago

Current Behavior:

The Article Viewer always loads the current version of an article, and then fetches authorship highlighting data for the current version. However, sometimes it is more useful to see the last version that one of the students edited, rather than the current version (for example, if the student work was reverted).

Desired Behavior:

Add a button in Article Viewer to switch to the latest revision by one of the students in the course, and load authorship highlighting data for that version.

Additional context:

This is simple to describe, but likely somewhat complex to implement.

omChauhanDev commented 3 months ago

Working on this

omChauhanDev commented 3 months ago

@ragesoss sir, kindly see this Link Am I getting it right or missing anything?

omChauhanDev commented 3 months ago

Sir, we can easily get any edited article's last revision_id and page_id. Is there any way/API to fetch the article data based on a particular revision ID? Eg : image

ragesoss commented 3 months ago

I think your diagram conveys the right idea.

For the base article, we can get the article HTML at a particular ID using the same 'parse' API action, by supplying the oldid parameter instead of the page parameter.

For example...

Current version: https://en.wikipedia.org/w/api.php?action=parse&disableeditsection=true&format=json&page=China%20National%20Center%20for%20the%20Performing%20Arts%20Orchestra&origin= Old version: https://en.wikipedia.org/w/api.php?action=parse&oldid=745586211&disableeditsection=true&format=json&origin=

Similarly, for the wikiwho-api that provides the authorship highlighting markup...

Current version is requested by using 0 as the revision ID: https://wikiwho-api.wmcloud.org/en/whocolor/v1.0.0-beta/China%20National%20Center%20for%20the%20Performing%20Arts%20Orchestra/0/?origin=*

Old version replaces 0 with the ID: https://wikiwho-api.wmcloud.org/en/whocolor/v1.0.0-beta/China%20National%20Center%20for%20the%20Performing%20Arts%20Orchestra/745586211/?origin=*