Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,8 @@ export class ActivityDesktopPage {
// display review rating modal
return await this.notificationsService.popUpReviewRating(
this.review.id,
false
false,
this.assessmentService.assessment?.hasReviewRating
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ export class AssessmentMobilePage implements OnInit, OnDestroy {

try {
// display review rating modal
return await this.notificationsService.popUpReviewRating(this.review.id, false);
return await this.notificationsService.popUpReviewRating(
this.review.id,
false,
this.assessment?.hasReviewRating
);
} catch (err) {
const header = $localize`Can not get review rating information`;
await this.notificationsService.alert({
Expand Down
8 changes: 7 additions & 1 deletion projects/v3/src/app/services/assessment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface Assessment {
isOverdue?: boolean;
groups: Array<Group>;
pulseCheck: boolean;
hasReviewRating: boolean; // assessment level setting to enable review rating
allowResubmit?: boolean; // indicator to show resubmit button
}

Expand Down Expand Up @@ -138,7 +139,11 @@ export class AssessmentService {
.graphQLFetch(
`query getAssessment($assessmentId: Int!, $reviewer: Boolean!, $activityId: Int, $contextId: Int!, $submissionId: Int) {
assessment(id:$assessmentId, reviewer:$reviewer, activityId:$activityId, submissionId:$submissionId) {
id name type description dueDate isTeam pulseCheck allowResubmit
id name type
description dueDate isTeam
pulseCheck
hasReviewRating
allowResubmit
groups {
name description
questions{
Expand Down Expand Up @@ -265,6 +270,7 @@ export class AssessmentService {
? this.utils.timeComparer(data.assessment.dueDate) < 0
: false,
pulseCheck: data.assessment.pulseCheck,
hasReviewRating: data.assessment.hasReviewRating,
allowResubmit: data.assessment.allowResubmit,
groups: [],
};
Expand Down
10 changes: 9 additions & 1 deletion projects/v3/src/app/services/notifications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,21 @@ export class NotificationsService {
* @param {number} reviewId submission review record id
* @param {string[]<void>} redirect array: routeUrl, boolean: disable
* routing (stay at same component)
* @param {boolean} hasReviewRating optional flag from assessment to
* skip popup when disabled
*
* @return {Promise<void>} deferred ionic modal
*/
async popUpReviewRating(
reviewId,
redirect: string[] | boolean
redirect: string[] | boolean,
hasReviewRating?: boolean
): Promise<void> {
// skip popup if assessment-level review rating is disabled
if (hasReviewRating === false) {
return;
}

return this.modalOnly(
ReviewRatingComponent,
{
Expand Down
2 changes: 1 addition & 1 deletion projects/v3/src/app/services/storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface User {
userHash?: string;
colors?: Colors;
activityCardImage?: string; // default activity card image
hasReviewRating?: boolean;
hasReviewRating?: boolean; // from experience settings (enable/disable entirely from global setting)
truncateDescription?: boolean;
enrolment?: any;
activityCompleteMessage?: string;
Expand Down