Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing:TAGrading] Demo rubric testing #14

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions site/cypress/e2e/Cypress-TAGrading/rubric_grading.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
describe('Test cases for TA grading page', () => {
it('Grader should be able to add and remove overall comments', () => {
cy.login('instructor');
cy.visit(['sample', 'gradeable', 'grading_homework', 'grading', 'grade?who_id=jKjodWaRdEV9pBb&sort=id&direction=ASC']);
cy.get('body').type('{A}');
cy.get('body').type('{G}');
cy.get('[data-testid="grading-rubric"]').should('contain', 'Grading Rubric');
cy.get('[data-testid="component-container"]').its('length').should('eq', 4);
cy.get('[data-testid="component-container"]').eq(0).should('contain', 'Read Me');
cy.get('[data-testid="component-container"]').eq(1).should('contain', 'Coding Style');
cy.get('[data-testid="component-container"]').eq(2).should('contain', 'Documentation');
cy.get('[data-testid="component-container"]').eq(3).should('contain', 'Extra Credit');
cy.get('[data-testid="component-64"]').should('contain', 'Read Me');
cy.get('[data-testid="component-64"]').click();
cy.get('[data-testid="component-64"]')
.should('contain', 'Full Credit')
.should('contain', 'Minor errors in Read Me')
.should('contain', 'Major errors in Read Me or Read Me missing');
cy.get('body').type('{0}');
cy.get('[data-testid="grading-total"]').eq(0).should('contain', '2 / 2');
cy.get('[data-testid="save-tools-save"]').should('contain', 'Save');
cy.get('[data-testid="save-tools-save"]').click();
cy.get('[data-testid="component-65"]').should('contain', 'Coding Style');
cy.get('[data-testid="component-65"]').click();
cy.get('[data-testid="component-65"]')
.should('contain', 'Full Credit')
.should('contain', 'Code is unreadable')
.should('contain', 'Code is very difficult to understand')
.should('contain', 'Code is difficult to understand');
cy.get('body').type('{3}');
cy.get('[data-testid="grading-total"]').eq(1).should('contain', '4 / 5');
cy.get('[data-testid="save-tools-save"]').should('contain', 'Save');
cy.get('[data-testid="save-tools-save"]').click();
cy.get('[data-testid="component-66"]').should('contain', 'Documentation');
cy.get('[data-testid="component-66"]').click();
cy.get('[data-testid="component-66"]')
.should('contain', 'Full Credit')
.should('contain', 'No documentation')
.should('contain', 'Very little documentation or documentation makes no sense')
.should('contain', 'Way too much documentation and/or documentation makes no sense');
cy.get('body').type('{2}');
cy.get('[data-testid="grading-total"]').eq(2).should('contain', '2 / 5');
cy.get('[data-testid="save-tools-save"]').should('contain', 'Save');
cy.get('[data-testid="save-tools-save"]').click();
cy.get('[data-testid="component-67"]').should('contain', 'Extra Credit');
cy.get('[data-testid="component-67"]').click();
cy.get('[data-testid="component-67"]')
.should('contain', 'Full Credit')
.should('contain', 'Extra credit done poorly')
.should('contain', 'Extra credit is acceptable');
cy.get('body').type('{0}');
cy.get('[data-testid="grading-total"]').eq(3).should('contain', '0 / 0');
cy.get('[data-testid="save-tools-save"]').should('contain', 'Save');
cy.get('[data-testid="save-tools-save"]').click();
cy.get('[data-testid="grading-total"]').eq(0).should('contain', '2 / 2');
cy.get('[data-testid="grading-total"]').eq(1).should('contain', '4 / 5');
cy.get('[data-testid="grading-total"]').eq(2).should('contain', '2 / 5');
cy.get('[data-testid="grading-total"]').eq(3).should('contain', '0 / 0');
cy.get('[data-testid="grading-total"]').eq(4).should('contain', '6 / 12');
});
});
3 changes: 2 additions & 1 deletion site/public/templates/grading/Component.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Required Input:
<div id="peer-component-{{ component.id }}"
class="box peer-score">
{% else %}
<div id="component-{{ component.id }}"
<div id="component-{{ component.id }}" data-testid="component-{{ component.id }}"
{% if peer_component %}
class="box peer-component component peer-border"
{% else %}
Expand Down Expand Up @@ -64,3 +64,4 @@ Required Input:
{% block mark_list_footer %}
{% endblock %}
</div>
</div>
2 changes: 1 addition & 1 deletion site/public/templates/grading/GradingComponentHeader.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{# Note: the ternery operator cannot consistently be used to insert the result of a macro into the output,
so we need to use the long-form {% if <condition> %}{{ call_macro() }}{% endif %} #}
<span class="col-no-gutters badge-container">
<strong id="grading_total"
<strong id="grading_total" data-testid="grading-total"
class="badge {% if graded_component is defined %} {{ functions.getBadgeStyle(graded_component.total_score, component.max_value) }} {% endif %}">
{{ graded_component.total_score is defined ? graded_component.total_score|round(decimal_precision) : '&minus;' }} / {{ component.max_value|round(decimal_precision) }}
</strong>
Expand Down
2 changes: 1 addition & 1 deletion site/public/templates/grading/GradingGradeable.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{% block components_block %}
{% for component in gradeable.components %}
<div class="component-container">
<div class="component-container" data-testid="component-container">
{% set graded_component = graded_gradeable.graded_components[component.id] %}
{% include "GradingComponent.twig" with {
'precision': gradeable.precision,
Expand Down
2 changes: 1 addition & 1 deletion site/public/templates/grading/RubricTotalBox.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Required Parameters:

#}
<div class="box-title badge-container">
<strong id="score_total" class="badge green-background">
<strong id="score_total" class="badge green-background" data-testid="score-total">
{{ total|round(decimal_precision) }} ({{ extra_credit|round(decimal_precision) }})
</strong>
<strong>Total Points (Extra Credit Points)</strong>
Expand Down
2 changes: 1 addition & 1 deletion site/public/templates/grading/TotalScoreBox.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ l
{% endif %}
{% if ta_grading_earned is defined %}
<div class="box-title badge-container">
<strong id="grading_total" class="badge {{ functions.getBadgeStyle(ta_grading_earned, ta_grading_total) }}">
<strong id="grading_total" class="badge {{ functions.getBadgeStyle(ta_grading_earned, ta_grading_total) }}" data-testid="grading-total">
{{ ta_grading_earned is defined ? ta_grading_earned|round(decimal_precision) : '&minus;' }} / {{ ta_grading_total|round(decimal_precision) }}
</strong>
{% if peer_gradeable == true %}
Expand Down
Loading