[Feature:TAGrading] Frontend for submission clustering by GarvitKhandelwal31 · Pull Request #12966 · Submitty/Submitty · GitHub
Skip to content

[Feature:TAGrading] Frontend for submission clustering#12966

Open
GarvitKhandelwal31 wants to merge 61 commits into
mainfrom
frontend-clustering
Open

[Feature:TAGrading] Frontend for submission clustering#12966
GarvitKhandelwal31 wants to merge 61 commits into
mainfrom
frontend-clustering

Conversation

@GarvitKhandelwal31

@GarvitKhandelwal31 GarvitKhandelwal31 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Note- This PR is built on top of #12886.
This PR implements the frontend interface for the new Grading Clustering Mode.

What is the New Behavior?

Currently this PR introduces a new toggle button to activate the clustering mode, a dropdown button (only in clustering mode) to select the algorithms available. Currently after that it just clusters the student submissions.

What steps should a reviewer take to reproduce or test the bug or new feature?

Go to any gradeable -

  1. As a "full access grader" you would be able to see a toggle button "Go to clustering mode"
image
  1. Click on the button, if you are making clusters the first time on a gradeable you would see a warning banner-
image
  1. Click agree, you move to the clustering mode, verify that now the toggle button changes to "exit clustering mode".

  2. If clustering was not created before you would an orange banner that guides you to make the clusters

image
  1. When you make the clusters you would see students in different table cluster by cluster
image image
  1. Currently the mass grading is not supported, so once you try to grade a student, you will grade them according to the normal procedure that we have nothing different.

Automated Testing & Documentation

Added a component and E2E test.

Other information

No migrations added.

@automateprojectmangement automateprojectmangement Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jun 29, 2026
@GarvitKhandelwal31 GarvitKhandelwal31 changed the title Frontend clustering [Feature:TAGrading] Frontend for submission clustering Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

@GarvitKhandelwal31 GarvitKhandelwal31 marked this pull request as ready for review July 2, 2026 10:52
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to Seeking Reviewer in Submitty Development Jul 2, 2026
Comment thread site/app/repositories/grading_cluster/GradingClusterConfigRepository.php Outdated
Comment on lines +31 to +34
cy.intercept('POST', '**').as('createClustering');
cy.get('select').select('dummy_split');
cy.get('select').trigger('change');
cy.wait('@createClustering');

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.

Is there a cleaner way to do this?

Comment thread site/public/js/details.js
function showClusteringWarningMessage(callback) {
clusteringWarningCallback = callback;
const message = $('#clustering-warning-popup');
message.css('display', 'block');

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.

You can use jQuery's .show() method for this.

Comment thread site/public/js/details.js
sessionStorage.setItem(`clusteringWarningAccepted_${dataElement.dataset.gradeable}`, 'true');
}
const message = $('#clustering-warning-popup');
message.css('display', 'none');

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.

Similar to the above, you can use .hide() here instead. Apply throughout.

method: 'POST',
body: formData,
});
document.body.setAttribute('data-clustering-status', 'done');

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.

Is there a way to go about doing this without interacting with the DOM outside the component? @jndlansh may have suggestions based on the new emit infrastructure he has written.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, ('data-clustering-status', 'done') should be emitted and handled in twig (Vue mount)
Just like :

  1. emit('clustering-status', 'done'); - //replace the doc.body.attr(...)

  2. 'events': {
    'clustering-status': '(status) => { document.body.setAttribute("data-clustering-status", status); }'
    } - // add in Vue mount definition

v-if="isClusteringMode && Object.keys(algorithms).length > 0 && canCreateClustering"
v-model="selectedAlgorithm"
class="form-control"
style="width: auto; margin: 0;"

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.

Please keep all styles in a <style> block within this component so they can be linted properly.

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jul 4, 2026

@jndlansh jndlansh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have flagged a few issues and it's solution, in the Vue file. These should be really simple to apply. You can also take reference from PR #12941

method: 'POST',
body: formData,
});
document.body.setAttribute('data-clustering-status', 'done');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, ('data-clustering-status', 'done') should be emitted and handled in twig (Vue mount)
Just like :

  1. emit('clustering-status', 'done'); - //replace the doc.body.attr(...)

  2. 'events': {
    'clustering-status': '(status) => { document.body.setAttribute("data-clustering-status", status); }'
    } - // add in Vue mount definition


const selectedAlgorithm = ref(props.currentAlgorithm || '');

function toggleClusteringMode() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here also just emit the 'toggle-clustering-mode' with payload

function toggleClusteringMode() {
    emit('toggle-clustering-mode', {
        isClusteringMode: props.isClusteringMode,
        gradeableId: props.gradeableId,
    });
}

In Details.twig events dictionary, just copy paste this entire functions body or simply use an arbritary JS function there instead

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I also believe we can add a data-testid on select

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Work in Progress

Development

Successfully merging this pull request may close these issues.

3 participants