Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
env:
# Only lint changed files in PR
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
DEFAULT_BRANCH: ${{ github.base_ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# File handling
Expand Down
7 changes: 7 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ This file is meant as an easy way for us to collate notes and change logs across
#### Important Bug Fixes

- Fixed an issue where recovering a PersonalID account via backup code could result in the account being stored without a pin, causing authentication to fail after recovery.
- Fixed an issue where a worker who passed the learning assessment before completing all learn modules was shown as ready to claim the opportunity, and then hit a failure when trying to claim it. They are now directed back to finish the remaining modules first.

### QA Notes

- On an opportunity where the assessment can be reached before all learn modules are done, pass the assessment with modules still outstanding and confirm the app keeps directing you to the remaining learning rather than offering to claim the job.
- With all modules completed and the assessment passed, confirm claiming the opportunity and downloading the delivery app still works as before.
- Confirm a worker who passed the assessment with modules still outstanding now sees their module progress on the learning screen rather than a blank progress area.

## CommCare 2.63.5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,14 @@ public boolean passedAssessment() {
|| getAssessmentScore() >= getLearnAppInfo().getPassingScore();
}

/**
* Whether the user has finished everything requiresd before claiming the job:

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.

Typo here: "requiresd"

* every learn module submitted, and a passing assessment score
*/
public boolean isLearningComplete() {
return getLearningPercentComplete(false) >= 100 && passedAssessment();

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.

Would getLearningPercentComplete(true) >= 100 also work here? (to simplify this logic)

}

public int getAssessmentScore() {
int mostRecentFailingScore = 0;
int firstPassingScore = -1;
Expand Down Expand Up @@ -644,7 +652,7 @@ public void setPaymentUnits(List<ConnectPaymentUnitRecord> units) {
}

public boolean readyToTransitionToDelivery() {
return status == STATUS_LEARNING && passedAssessment();
return status == STATUS_LEARNING && isLearningComplete();
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void handleProgressBarUI(ConnectJobRecord job) {
R.drawable.ic_disabled_learn
);

boolean reviewEnabled = job.passedAssessment();
boolean reviewEnabled = job.isLearningComplete();
setProgressIconState(
binding.includeJobProgress.pbReview,
binding.includeJobProgress.ivReview,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ private void launchAppForJob(ConnectJobRecord job, boolean isLearning) {

if (job.deliveryComplete()) {
navigateToDeliveryProgress();
} else if (!job.passedAssessment()) {
} else if (!job.isLearningComplete()) {
navigateToLearnProgress();
} else if (isLearning && job.passedAssessment()) {
} else if (isLearning) {
navigateToDeliveryDetails();
} else if (AppUtils.isAppInstalled(appId)) {
new ConnectAppLaunchController(this).launchApp(appId, isLearning);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ private void updateLearningUI() {

updateProgressViews(
job.getLearningPercentComplete(true),
passedAssessment
job.isLearningComplete()
);
updateCertificateView(learningComplete, passedAssessment);
updateButtons(learningComplete, passedAssessment);
updateCertificateView();
updateButtons(learningComplete);
updateLearningStatus(learningComplete, passedAssessment, attemptedAssessment);
}

Expand All @@ -130,12 +130,13 @@ private void updateProgressViews(int learningProgressPercent, boolean hideProgre
}
}

private void updateCertificateView(boolean learningComplete, boolean passedAssessment) {
private void updateCertificateView() {
boolean showCertificate = job.isLearningComplete();
getBinding().connectLearningCertificateContainer.setVisibility(
learningComplete && passedAssessment ? View.VISIBLE : View.GONE
showCertificate ? View.VISIBLE : View.GONE
);

if (learningComplete && passedAssessment) {
if (showCertificate) {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
getBinding().connectLearnCertSubject.setText(job.getTitle());
getBinding().connectLearnCertPerson.setText(
ConnectUserDatabaseUtil.getUser(requireContext()).getName()
Expand Down Expand Up @@ -172,12 +173,12 @@ private Date getLatestCompletionDate() {
return latestDate != null ? latestDate : new Date();
}

private void updateButtons(boolean learningComplete, boolean passedAssessment) {
private void updateButtons(boolean learningComplete) {
getBinding().connectLearningReviewButton.setVisibility(View.GONE); // reserved for future logic
getBinding().connectLearningButton.setVisibility(showAppLaunch ? View.VISIBLE : View.GONE);

if (showAppLaunch) {
if (learningComplete && passedAssessment) {
if (job.isLearningComplete()) {
configureJobDetailsButton();
} else if (!AppUtils.isAppInstalled(job.getLearnAppInfo().getAppId())) {
// This case needs to come before any that would launch the learn app
Expand Down
Loading