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

Survey modality #9000

Merged
merged 12 commits into from
Jan 25, 2022
Merged

Conversation

nucleogenesis
Copy link
Member

@nucleogenesis nucleogenesis commented Jan 14, 2022

Summary

Introduces Survey modality support by adding some display logic based on whether the content is a Survey or not.

  • No "correct" / "incorrect" iconography on the answering or reporting
  • Simplified CurrentTryOverview - only use that for surveys because TriesOverview summarizes multiple attempts which we don't need here.

It's not super complex logic there in CurrentTryOverview, but I wanted to be sure it was covered and started writing tests for the bits I was going to change and I figured that since I was there I should cover all of the props and display logic.

survey.mp4

References

Figma

Reviewer guidance

I tried to make the video cover everything so you don't have to do all this but I think it'd be good if someone spun this up.

Setup

  • Be sure to yarn install and pip install requirements.txt so you have the latest LE Utils & Kolibri constants.
  • Make sure you have the latest Kolibri QA Channel
  • Go to Exercises -> Channel based quizzes
  • Pick a piece of content from there that you want to update and update it's options: { modality: SURVEY } value. I do this in SQLite Browser, but you can probably do it in the Kolibri Shell getting the content node by id, updating it's extra_fields JSON accordingly.

Actually testing

  • Review the Figma
  • Check mobile
  • Take multiple tries
  • Test while not logged in

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@nucleogenesis nucleogenesis added TODO: needs review Waiting for review changelog Important user-facing changes labels Jan 14, 2022
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Spotted 1 potential regression in code review. Have not manually tested yet.

},
computed: {
...mapGetters(['currentUserId']),
// QUESTION: Why? Wouldn't anything else fail validation? Why not just call tryValidator here?
Copy link
Member

Choose a reason for hiding this comment

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

Validators don't run in production, only in development. This value can still be undefined, so we need to handle that case. Could swap it out for tryValidator instead, which might be more robust.

Copy link
Member Author

Choose a reason for hiding this comment

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

If the component defines a prop as required and validates it then I think it should be able to operate under the assumption that it won't be used incorrectly. The parent component should (and I think in all/most cases do - can confirm in a bit) guard rendering CurrentTryOverview w/ v-if

Copy link
Member

Choose a reason for hiding this comment

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

I don't disagree - but it's not how Vue handles it, so better to be defensive, I think.

@@ -171,7 +175,9 @@
return this.currentTryDefined && !isUndefined(this.currentTry.correct);
},
score() {
return this.currentTryDefined ? this.currentTry.correct / this.totalQuestions : 0;
Copy link
Member

Choose a reason for hiding this comment

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

Have lost the division here in the small refactor.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will update the test scenario to be more robust thank you!

@@ -403,6 +421,7 @@
return;
}
this.loading = true;
console.log(this.getParams());
Copy link
Member

Choose a reason for hiding this comment

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

Spare console.log

@rtibbles rtibbles dismissed their stale review January 19, 2022 23:18

Changes addressed!

@pcenov
Copy link
Member

pcenov commented Jan 20, 2022

Hi @radinamatic and @nucleogenesis, I tried testing this PR with all of the Buildkite builds plus directly from the nucleogenesis:survey-modality branch but I am not able to see any of the changes.
I tested with all the available survey exercises and also updated the options: { modality: SURVEY } value of an exercise using the SQLite Browser and still I'm not seeing any of the new functionality. Wondering am I missing something? :)

@marcellamaki
Copy link
Member

@pcenov and @nucleogenesis -- I'm running into a similar problem after having updated an exercise to the SURVEY modality while trying to do some manual QA after a code read through this morning (which looks good!). One thing I did notice as I was troubleshooting is that Modalities.SURVEY coming from le-utils seems to be undefined when console logging it. I can't quite sort that out yet, since I've double checked and I have the new le-utils version and I checked the PR for the le-utils version and it all makes sense reading through. I will do a little more investigating and see if I can find anything else!

@rtibbles
Copy link
Member

@nucleogenesis looks like you updated the version of le-utils but not its corollary JS package kolibri-constants. Need to update both! (because of the jank in kolibri-core, will need to update the version in both places it appears in two separate package.jsons)

@radinamatic
Copy link
Member

radinamatic commented Jan 21, 2022

Tested running from source (@pcenov please re-test with DEB and EXE assets), and seeing various issues in Firefox on Linux.

when looking at reports, (surveys) should not display any correct/incorrect information, any scores, or completion criteria.

  1. Not seeing any completion criteria, but scores are visible in the Attempts dropdown when surveys are submitted multiple times.
  2. When survey resources are browsed in their original channel (gutuf-potuv token), all questions display correctly. However, when I try to browse those same resources that are imported in the Kolibri QA channel, the first question (Teacher ID?) never loads properly, but the rest of them do. At one time I caught a glimpse of the Firefox can’t establish a connection to the server at ws://127.0.0.1:3016/sockjs-node/889/0vwz1pqo/websocket error that I never saw before 😕
1 2
survey4 LEDev2111 (start)  Running  - Oracle VM VirtualBox_005

There is also a bit of weirdness in displaying the question area when changing browsing width, and hint appearance seems to be affecting the width of the paragraph (shifting may be affecting readability), but those could be issues with the channel/ricecooker, and not this PR.

1 2
survey2 survey3

@pcenov
Copy link
Member

pcenov commented Jan 21, 2022

In addition to the issues observed by @radinamatic I've reported separately the following issues: #9020, #9021, #9022, #9023
I didn't find any regressions for the learner facing practice quiz scenarios.

@rtibbles
Copy link
Member

I think we need to fix #9020 and #9023 - before merging the PR. The other two are intended behaviour at the moment as far as I can tell.

@nucleogenesis
Copy link
Member Author

@pcenov @radinamatic

The following fixes have been pushed here:

  • Questions ordering in report is now correct
  • Infinite loader on submission without answers - now the user sees the dropdown to look through past submissions only
  • (Unreported) the "submit" button was not visible so I added some padding on the bottom for small screens. It was getting hidden under the arrow icons at the bottom of the screen
  • Squished renderer of the content
  • % removed from list of attempts

I could not replicate the issue where the first question stopped working when accessed through the QA channel because I cannot upgrade my channel. I'll see if I can get it working later on.

@radinamatic
Copy link
Member

    • Questions ordering in report is now correct ✔️
    • Infinite loader on submission without answers - now the user sees the dropdown to look through past submissions only ✔️
    • (Unreported) the "submit" button was not visible so I added some padding on the bottom for small screens. It was getting hidden under the arrow icons at the bottom of the screen ✔️
    • % removed from list of attempts ✔️
  1. Squished renderer of the content 🔴

    Mobile view looks OK, but the issue is still present while resizing on wider screens, or on tablet sizes in landscape mode:

    Firefox Chrome
    Selection_112 Selection_113
    squished.mp4
  2. Hints

    Are still appearing, are those going away? And I did notice that the ID fields are not counting answers that contain letters as answered. Did we agree with partners that the student and teachers IDs can contain only numbers @rtibbles?

    hint.mp4
  3. Last thing: seems possible to open the survey even if the user is not signed in (c/p URL), oversight or meant to be...? 🤔

@rtibbles
Copy link
Member

Are still appearing, are those going away? And I did notice that the ID fields are not counting answers that contain letters as answered. Did we agree with partners that the student and teachers IDs can contain only numbers @rtibbles?

Tooltips are not hints. There's nothing that should be stopping the tooltips from appearing, so this is expected behaviour.
It is a numeric input box, so it can only contain numbers - we have communicated this.

Last thing: seems possible to open the survey even if the user is not signed in (c/p URL), oversight or meant to be...? thinking

Users can take surveys anonymously - I'd say this is intended behaviour for now (even if potentially undesirable in some contexts).

@radinamatic
Copy link
Member

Installed the APK asset on an Android tablet very similar to the one partner will be using, and content is rendering fine (no squishing), as are apparently all the other survey features 💯

The only doubt remains why the resources in this channel are not displaying correctly when imported in other channels...? 🤔
To recap:

When survey resources are browsed in their original channel (gutuf-potuv token), all questions display correctly. However, when I try to browse those same resources that are imported in the Kolibri QA channel, most of the time I get just the loader spinning

To exclude this being a QA channel quirk, I created a brand new channel (jotuh-mojop token) and imported only the 4 survey resources from the source channel, but no change. I even thought this might be because the Allow as channel quiz option (which is present in the source channel) is not automatically set up when the resources are imported in another channel, and went to check and apply them manually on my new channel, but in Kolibri the only result was to have the counter appear (as it should with channel quizzes), and the resources still do not display correctly.

The frustrating part is that hardly anything appears as error in the console... 😒

Source channel New channel
greece-full-cok greece-cok

If we are sure that the partner will only be using the gutuf-potuv token to view these resources on their tablets, this might not be a blocker, but if they are creating derivative channels, trouble... 😕

@rtibbles
Copy link
Member

The error looks like an issue with loading the next question inside Perseus - so it is probably being passed a question identifier that does not exist inside the perseus file.

@radinamatic
Copy link
Member

Ok, since we decided this is not a blocker, let's merge this in! 👍🏽

Copy link
Member

@radinamatic radinamatic left a comment

Choose a reason for hiding this comment

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

Manual QA cleared up, good to go! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Important user-facing changes TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants