-
Notifications
You must be signed in to change notification settings - Fork 788
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
adds notice for quizzes created pre-0.17.x #13045
base: develop
Are you sure you want to change the base?
adds notice for quizzes created pre-0.17.x #13045
Conversation
Build Artifacts
|
@@ -41,7 +41,7 @@ | |||
}, | |||
{ label: this.coreString('deleteAction'), value: 'DELETE' }, | |||
]; | |||
if (!this.exam?.archive) { | |||
if (this.exam?.data_model_version > 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@radinamatic @marcellamaki @nucleogenesis . I think we should disabled the edit details all together if the data_modal_version < 3
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sort of crossed my mind too, when I was considering the string... 🤔
But Edit details
(quiz title and description, not the resources) should still be available, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm- I think no- You have to first make a copy to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that hiding it is a good call. This is a very unlikely case for someone to be in and the solution is clearly shown to the user w/ the changes here
7f086c1
to
7a96110
Compare
@@ -41,7 +41,7 @@ | |||
}, | |||
{ label: this.coreString('deleteAction'), value: 'DELETE' }, | |||
]; | |||
if (!this.exam?.archive) { | |||
if (this.exam?.data_model_version > 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that hiding it is a good call. This is a very unlikely case for someone to be in and the solution is clearly shown to the user w/ the changes here
@@ -72,6 +86,9 @@ | |||
resource() { | |||
return this.examOrLesson === 'lesson' ? this.lesson : this.exam; | |||
}, | |||
isFromOldKolibiri() { | |||
return this.exam.data_model_version < 3 && this.exam.draft && !this.exam.active; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the notice and I believe it's because of the this.exam.draft
which is only set on DraftExam models.
Because the quiz was created before DraftExam models existed, they're not going to be marked as a draft here.
I made the change locally and see the banner as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments below that I think can be updated. You might want to check directly w/ @radinamatic or @marcellamaki tomorrow re: the color of the notice.
One other thing to add is that there should probably be a half-em of margin above the UiAlert so that there's some room between it and the title+buttons when shown.
@@ -27,6 +27,11 @@ | |||
</div> | |||
</div> | |||
<MissingResourceAlert v-if="resource.missing_resource" /> | |||
<UiAlert v-if="isFromOldKolibiri"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add type="warning"
here - thoughts @radinamatic ?
The default "info" type results in a blue section w/ an info (i)
icon, but warning
is yellow w/ the /!\
triangle exclamation icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on both accounts @nucleogenesis (re: margin and), yellow color for the notice/alert may be better suited for this case 👍🏽
@@ -72,6 +86,9 @@ | |||
resource() { | |||
return this.examOrLesson === 'lesson' ? this.lesson : this.exam; | |||
}, | |||
isFromOldKolibiri() { | |||
return this.exam.data_model_version < 3 && this.exam.draft && !this.exam.active; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could refactor this into several props instead for better clarity, testability and maintainability;
isOldDataModelVersion() {
return this.exam.data_model_version < 3;
}
isDraft() {
return this.exam.draft;
}
isActive() {
return this.exam.active;
}
isFromOldKolibiri() {
return this.isOldDataModelVersion() && this.isDraft() && !this.isActive();
}
And in the alert, it would now be;
<UiAlert v-if="isFromOldKolibiri">
.....
</UiAlert>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should take into consideration @nucleogenesis's feedback here and here
@@ -41,7 +41,7 @@ | |||
}, | |||
{ label: this.coreString('deleteAction'), value: 'DELETE' }, | |||
]; | |||
if (!this.exam?.archive) { | |||
if (this.exam?.data_model_version > 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would 3
represent our most current exam?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and it would means it comes after DraftExam existed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AllanOXDi! I think this is looking great already. I left you a thought and question. I also think we could easily write up tests for the newly added notice based on the different scenarios described in the isFromOldKolibiri
.
Thank you both @akolson and @nucleogenesis . I will wait for the final thought from @radinamatic and @marcellamaki. |
Hmmm, thats strange , could you help me share the kolibri home folder that you used. Because it seems to be working on my end. |
@AllanOXDi I'll upload the whole home folder if you need it, but you already have the DB and logs attached in my previous comment (maybe all you would require is to import the QA channel...?) |
f4637f5
to
485a60a
Compare
@radinamatic this should be fixed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AllanOXDi - I'll let @radinamatic follow up on the QA side here, but I have two small requests in terms of variable naming that would help with readability. Let me know if you have any questions!
isOldDataModelVersion() { | ||
return this.exam.data_model_version < 3; | ||
}, | ||
isFromOldKolibiri() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a small typo here - it's consistent, but let's update isFromOldKolibiri
to isFromOldKolibri
v-if="isFromOldKolibiri && hideAlert" | ||
type="warning" | ||
class="old-kolibri-banner" | ||
@dismiss="hideAlert = false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding the hideAlert
here a little bit confusing. When I see that variable name, I would assume that it means that the UiAlert is not visible. However, since isFromOldKolibiri && hideAlert
would have to be true for this to render, it means that hideAlert
would be true for this to show. And, the @dismiss
setting hideAlert
to false.
I think having this be showAlert
would be clearer.
Progress with the notification, but we're not there yet... After the upgrade to 0.18:
Seems as if the option to manage resources in quizzes that have not been started was disabled altogether 🤨 |
@@ -41,7 +41,7 @@ | |||
}, | |||
{ label: this.coreString('deleteAction'), value: 'DELETE' }, | |||
]; | |||
if (!this.exam?.archive) { | |||
if (!this.exam?.data_model_version > 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the !
here is making for the condition being the opposite of what is expected as we only want the editAction
to show when the quiz is data_model_version > 2
.
I think this is the cause of @radinamatic 's last report
Summary
In version 0.17, the
question_sources
field structure was updated, introducing theDraftExam
andExam
models. Quizzes created in versions ≥0.17.x start asDraftExam
and convert toExam
. However, quizzes created prior to 0.17.x (withoutDraftExam
) may exist in an uneditable state if the user upgraded Kolibri without starting the quiz. This PRadd notice for legacy quiz created pre-0.17.x) should not be uneditable but should see
"This quiz was created using an older version of Kolibri and cannot be edited directly. Create a copy of it to edit the resources."
closes #12954
References
#12954
Reviewer guidance