Skip to content

Commit

Permalink
💻 Disable the teachers' survey (#6147)
Browse files Browse the repository at this point in the history
This PR temporarily disables the survey presented to teachers on the class overview page. This is the first step from the survey redesign process. This is why most of the code is not deleted but commented out. Ideally, it will be used again soon, when the redesign is done.

Fixes #6143

**How to test**
- Run Hedy locally and log in as a teacher.
- Go to For-Teachers and click on an existing class. When the class overview page opens, there should be no Survey link in the upper right corner (on the left of the 'Customize class' green button)
- Create a new class and check that the Survey link is not displayed.
  • Loading branch information
boryanagoncharenko authored Feb 7, 2025
1 parent 126b753 commit 26a4f4d
Show file tree
Hide file tree
Showing 71 changed files with 425 additions and 564 deletions.
6 changes: 0 additions & 6 deletions messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1658,12 +1658,6 @@ msgstr ""
msgid "surname"
msgstr ""

msgid "survey"
msgstr ""

msgid "survey_completed"
msgstr ""

msgid "survey_skip"
msgstr ""

Expand Down
8 changes: 0 additions & 8 deletions static/css/generated.full.css
Original file line number Diff line number Diff line change
Expand Up @@ -346956,14 +346956,6 @@ div[class^="ace_incorrect_hedy_code"] {
margin-bottom: 0px;
}

.md\:ml-4 {
margin-left: 1rem;
}

.md\:mr-4 {
margin-right: 1rem;
}

.md\:block {
display: block;
}
Expand Down
15 changes: 0 additions & 15 deletions templates/class-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,10 @@
<span class="fa fa-arrow-{% if g.dir == " ltr" %}right{% else %}left{% endif %}">&nbsp;</span>
{{_('go_back')}}
</button>
<div id="survey" data-cy="survey" class="hidden"></div>
{% if second_teacher %}<h1>{{_('role')}}: {{role}}</h1>{% endif %}
<div class="flex flex-col md:flex-row items-left md:items-center justify-between">
<h1>{{ class_info.name }}</h1>
<div class="flex flex-col md:flex-row gap-2">
<div class="items-center gap-2 md:ml-4 md:mr-4 align-middle">
{% if class_info.students > 0 %}
<h2 id="survey_status_button" class="hidden md:block" data-cy="survey_status_button">
{% if questions|length == 0 %}
{{_('survey_completed')}} ✅
{% else %}
<a class="cursor-pointer" hx-post="/for-teachers/load-survey/{{class_info.id}}" hx-target="#survey"
hx-swap="outerHTML">
{{_('survey')}} {{total_questions - questions|length}}/{{total_questions}}
</a>
{% endif %}
</h2>
{% endif %}
</div>
<button class="green-btn w-fit" id="customize_class_button" data-cy="customize_class_button"
onclick="window.location.href = '/for-teachers/customize-class/{{class_info.id}}'">
{{_('customize_class')}}
Expand Down
51 changes: 26 additions & 25 deletions tests/cypress/e2e/for-teacher_page/class_page/other_buttons.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,30 @@ teachers.forEach((teacher) => {
.should('eq', Cypress.config('baseUrl') + Cypress.env('teachers_page'));
})

it('Is able to click on survey button, cancel it, respond to 1 question, then 3 to finish', () => {
// cancel survey
cy.getDataCy('survey_status_button').click();
cy.getDataCy('survey').should("be.visible");
cy.getDataCy('cancel_survey').click();
cy.getDataCy('survey').should("not.be.visible");
// respond to 1 question
cy.getDataCy('survey_status_button').click();
cy.getDataCy('survey').should("be.visible");
cy.getDataCy('input_1').type("test");
cy.getDataCy('submit').click();
// respond to last 3 questions
cy.getDataCy('survey_status_button').click();
const surveyInputs = Array.from({length:3},(v, k)=> k+1)
cy.wrap(surveyInputs).each((index) => {
cy.getDataCy("input_" + index)
.type("test")
.invoke("val").then((text) => {
expect("test").to.equal(text);
});
});
cy.getDataCy('submit').click();
cy.getDataCy('survey_status_button').contains("complete");
})
// Disabling the survey test because it should be used again after the redesign
// it('Is able to click on survey button, cancel it, respond to 1 question, then 3 to finish', () => {
// // cancel survey
// cy.getDataCy('survey_status_button').click();
// cy.getDataCy('survey').should("be.visible");
// cy.getDataCy('cancel_survey').click();
// cy.getDataCy('survey').should("not.be.visible");
// // respond to 1 question
// cy.getDataCy('survey_status_button').click();
// cy.getDataCy('survey').should("be.visible");
// cy.getDataCy('input_1').type("test");
// cy.getDataCy('submit').click();
// // respond to last 3 questions
// cy.getDataCy('survey_status_button').click();
// const surveyInputs = Array.from({length:3},(v, k)=> k+1)
// cy.wrap(surveyInputs).each((index) => {
// cy.getDataCy("input_" + index)
// .type("test")
// .invoke("val").then((text) => {
// expect("test").to.equal(text);
// });
// });
// cy.getDataCy('submit').click();
// cy.getDataCy('survey_status_button').contains("complete");
// })
});
});
});
14 changes: 6 additions & 8 deletions translations/ar/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1936,14 +1936,6 @@ msgstr ""
msgid "surname"
msgstr "الاسم الأول"

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -2714,3 +2706,9 @@ msgstr ""
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

14 changes: 6 additions & 8 deletions translations/bg/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2110,14 +2110,6 @@ msgstr ""
msgid "surname"
msgstr ""

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -2922,3 +2914,9 @@ msgstr ""
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

14 changes: 6 additions & 8 deletions translations/bn/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2199,14 +2199,6 @@ msgstr ""
msgid "surname"
msgstr "Username"

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -3040,3 +3032,9 @@ msgstr ""
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

12 changes: 6 additions & 6 deletions translations/ca/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1690,12 +1690,6 @@ msgstr "Prova de canviar els valors perquè siguin tots text o tots números"
msgid "surname"
msgstr "Nom"

msgid "survey"
msgstr "Enquesta"

msgid "survey_completed"
msgstr "Enquesta completada"

msgid "survey_skip"
msgstr "No ho tornis a mostrar"

Expand Down Expand Up @@ -2397,3 +2391,9 @@ msgstr "El teu programa"
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr "Enquesta"

#~ msgid "survey_completed"
#~ msgstr "Enquesta completada"

14 changes: 6 additions & 8 deletions translations/cs/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2111,14 +2111,6 @@ msgstr ""
msgid "surname"
msgstr "Jméno"

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -2934,3 +2926,9 @@ msgstr ""
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

14 changes: 6 additions & 8 deletions translations/cy/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2187,14 +2187,6 @@ msgstr ""
msgid "surname"
msgstr ""

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -3022,3 +3014,9 @@ msgstr ""
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

14 changes: 6 additions & 8 deletions translations/da/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2182,14 +2182,6 @@ msgstr ""
msgid "surname"
msgstr ""

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -3005,3 +2997,9 @@ msgstr ""
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

14 changes: 6 additions & 8 deletions translations/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1843,14 +1843,6 @@ msgstr ""
msgid "surname"
msgstr "Vorname"

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -2597,3 +2589,9 @@ msgstr "Dein Programm"
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

14 changes: 6 additions & 8 deletions translations/el/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1973,14 +1973,6 @@ msgstr ""
msgid "surname"
msgstr "Μικρό Όνομα"

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -2795,3 +2787,9 @@ msgstr ""
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

12 changes: 6 additions & 6 deletions translations/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1687,12 +1687,6 @@ msgstr "Try changing the values to be all text or all numbers"
msgid "surname"
msgstr "First Name"

msgid "survey"
msgstr "Survey"

msgid "survey_completed"
msgstr "Survey completed"

msgid "survey_skip"
msgstr "Don't show this again"

Expand Down Expand Up @@ -2464,3 +2458,9 @@ msgstr "Your program"
#~ msgid "Delete"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr "Survey"

#~ msgid "survey_completed"
#~ msgstr "Survey completed"

14 changes: 6 additions & 8 deletions translations/eo/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1995,14 +1995,6 @@ msgstr ""
msgid "surname"
msgstr "Antaŭnomo"

#, fuzzy
msgid "survey"
msgstr ""

#, fuzzy
msgid "survey_completed"
msgstr ""

#, fuzzy
msgid "survey_skip"
msgstr ""
Expand Down Expand Up @@ -2784,3 +2776,9 @@ msgstr ""
#~ msgid "select_class"
#~ msgstr ""

#~ msgid "survey"
#~ msgstr ""

#~ msgid "survey_completed"
#~ msgstr ""

Loading

0 comments on commit 26a4f4d

Please sign in to comment.