Skip to content

Commit

Permalink
UserService: add extra skip check for review mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dezhidki committed Feb 26, 2025
1 parent 8c3b721 commit 85e3469
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions timApp/static/scripts/tim/document/IDocSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface IDocSettings {
parAuthorOnlyEdit?: boolean;
pollDocumentViewInfo?: number;
pollDocumentViewInfoJitter?: number;
disable_answer?: string;
}

export interface ISlideDocSettings extends IDocSettings {
Expand Down
10 changes: 9 additions & 1 deletion timApp/static/scripts/tim/user/userService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {showMessageDialog} from "tim/ui/showMessageDialog";
import type {Locale} from "tim/util/globals";
import {isDocumentGlobals} from "tim/util/globals";
import {genericglobals} from "tim/util/globals";
import {$http} from "tim/util/ngimport";
import type {ToReturn} from "tim/util/utils";
Expand Down Expand Up @@ -141,7 +142,14 @@ export class UserService {
}

private getIsInAnswerReviewImpl() {
const curr_item = genericglobals().curr_item;
const g = genericglobals();
if (
isDocumentGlobals(g) &&
g.docSettings.disable_answer !== "answer_review"
) {
return false;
}
const curr_item = g.curr_item;
if (!curr_item || !isTaggedItem(curr_item)) {
return false;
}
Expand Down

0 comments on commit 85e3469

Please sign in to comment.