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

Development: Utilize server endpoint for getting longest working time in exam assessment #8749

Merged

Conversation

iyannsch
Copy link
Contributor

@iyannsch iyannsch commented Jun 6, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I strictly followed the server coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types on a test server configured with Gitlab and Jenkins.

Motivation and Context

Fixes #8673

The server offers a new endpoint that allows to reduce the computational load on the client. This PR implements the changes in the client side.

Description

I removed getting all exams and calculating the longest working time iteratively by a simple call to the new endpoint.

Steps for Testing

Exam Mode Testing

Prerequisites:

  • 1 Instructor
  • 1 Students
  • 1 Exam with a Programming Exercise
  1. Log in to Artemis
  2. Participate in the exam as a student
  3. Switch to a instructor account during the working time and open the Assessment tab of the exam.
  4. Verify that the following buttons are visible
image 5. Verify that only the `Grading Key` is accessible during the exam time. 6. Verify that all buttons are accessible after the exam.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked






Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Test Coverage

Screenshots

@iyannsch iyannsch requested a review from a team as a code owner June 6, 2024 11:04
@iyannsch iyannsch linked an issue Jun 6, 2024 that may be closed by this pull request
Copy link

coderabbitai bot commented Jun 6, 2024

Walkthrough

The ExamAssessmentButtonsComponent in the TypeScript file has been refactored to enhance efficiency and clarity. Key changes include reorganizing the handling of working time and exam data observables, optimizing loading processes, and improving the calculation of exam status. Additionally, the test file has been updated to align with these changes, ensuring accurate testing of the new logic.

Changes

File Path Change Summary
src/main/webapp/.../exam-assessment-buttons.component.ts Refactored to reorganize working time and exam data observables, optimize loading processes, and improve exam status calculation.
src/test/javascript/.../exam-assessment-buttons.component.spec.ts Updated test setup to reflect changes in the component, including method replacements and removal of obsolete initializations.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant ExamAssessmentButtonsComponent
    participant Server

    User ->> ExamAssessmentButtonsComponent: Load Component
    ExamAssessmentButtonsComponent ->> Server: getLongestWorkingTimeForExam
    Server -->> ExamAssessmentButtonsComponent: Return Longest Working Time
    ExamAssessmentButtonsComponent ->> ExamAssessmentButtonsComponent: Set Exam Data & Recalculate Status
    ExamAssessmentButtonsComponent -->> User: Display Updated Exam Status
Loading

Assessment against linked issues

Objective Addressed Explanation
Change longest working time method with server endpoint (#8673)
Avoid loading of all student exams by using the new endpoint (#8673)

Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between a61b350 and e33399e.

Files selected for processing (1)
  • src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts (3 hunks)
Additional context used
Path-based instructions (1)
src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

Biome
src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts

[error] 65-65: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


[error] 87-87: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


[error] 136-136: This variable's type is not allowed to evolve implicitly, leading to potential any types. (lint/nursery/noEvolvingAny)

The variable's type may evolve, leading to any. Use explicit type or initialization. Specifying an explicit type or initial value to avoid implicit type evolution.


[error] 136-136: This variable implicitly has the any type. (lint/suspicious/noImplicitAnyLet)

Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.


[error] 137-137: Change to an optional chain. (lint/complexity/useOptionalChain)

Unsafe fix: Change to an optional chain.


[error] 155-155: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


[error] 1-1: Some named imports are only used as types. (lint/style/useImportType)

This import is only used as a type.

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 1-2: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 2-3: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 3-4: Some named imports are only used as types. (lint/style/useImportType)

This import is only used as a type.

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 5-6: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 6-7: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 7-8: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 8-9: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 9-10: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 10-11: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 11-12: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 13-14: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.


[error] 15-16: All these imports are only used as types. (lint/style/useImportType)

Importing the types with import type ensures that they are removed by the transpilers and avoids loading unnecessary modules.
Safe fix: Use import type.

Additional comments not posted (1)
src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts (1)

68-72: The comments here are clear and useful for understanding the purpose of the observable. No changes needed.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@iyannsch iyannsch self-assigned this Jun 6, 2024
@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Jun 6, 2024
Strohgelaender
Strohgelaender previously approved these changes Jun 6, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Outside diff range comments (4)
src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts (2)

Line range hint 136-136: What's this? Implicit any? Are you trying to write JavaScript in TypeScript? Specify the type explicitly to avoid 'any' accidents.

- let errorDetail;
+ let errorDetail: string | undefined;
Tools
Biome

[error] 65-65: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


[error] 87-87: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


Line range hint 1-1: Why are you importing types like they're going out of fashion? Use import type to make it clear that these are only for type checking and to help tree shaking do its job.

- import { HttpErrorResponse } from '@angular/common/http';
+ import type { HttpErrorResponse } from '@angular/common/http';

Also applies to: 2-3, 3-4, 5-6, 6-7, 7-8, 8-9, 9-10, 10-11, 11-12, 13-14, 15-16

Tools
Biome

[error] 65-65: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


[error] 87-87: Forbidden non-null assertion. (lint/style/noNonNullAssertion)

src/test/javascript/spec/component/assessment-dashboard/exam-assessment-buttons.component.spec.ts (2)

Line range hint 137-137: Non-null assertion in a test? Are you testing your luck or your code? Remove it and handle the potential null properly.

- studentExamOne!.workingTime = 10;
+ if (!studentExamOne) throw new Error('studentExamOne is undefined');
+ studentExamOne.workingTime = 10;

Line range hint 157-157: Here we go again. Non-null assertions in tests are as useful as a chocolate teapot. Fix it before it melts down your entire test suite.

- jest.spyOn(examManagementService, 'evaluateQuizExercises').mockReturnValue(throwError(() => httpError));
+ if (!httpError) throw new Error('httpError is undefined');
+ jest.spyOn(examManagementService, 'evaluateQuizExercises').mockReturnValue(throwError(() => httpError));

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 6, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range comments (2)
src/test/javascript/spec/component/assessment-dashboard/exam-assessment-buttons.component.spec.ts (2)

Line range hint 135-135: Non-null assertions again? Are you trying to summon a demon? This is TypeScript, not the Wild West. You can't just assert things will be non-null without consequences. Either handle the possibility of nulls gracefully or ensure your data integrity better upstream.

- studentExamOne!.workingTime = 10;
+ if (!studentExamOne) throw new Error('Expected studentExamOne to be defined');
+ studentExamOne.workingTime = 10;

- jest.spyOn(examManagementService, 'assessUnsubmittedExamModelingAndTextParticipations').mockReturnValue(throwError(() => httpError));
+ if (!examManagementService) throw new Error('Expected examManagementService to be defined');
+ jest.spyOn(examManagementService, 'assessUnsubmittedExamModelingAndTextParticipations').mockReturnValue(throwError(() => httpError));

Also applies to: 155-155


Line range hint 1-1: Oh, the horror! Importing types as regular imports? That's like using a chainsaw to cut a birthday cake. Use import type to keep your bundle size down and your transpiler happy. It's not rocket science, it's basic hygiene!

- import { ComponentFixture, TestBed } from '@angular/core/testing';
+ import type { ComponentFixture } from '@angular/core/testing';
+ import { TestBed } from '@angular/core/testing';

- import { ActivatedRoute, Params, convertToParamMap } from '@angular/router';
+ import type { Params } from '@angular/router';
+ import { ActivatedRoute, convertToParamMap } from '@angular/router';

Also applies to: 1-2

Strohgelaender
Strohgelaender previously approved these changes Jun 6, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 6, 2024
@harjotgill
Copy link

@coderabbitai configuration

Copy link

coderabbitai bot commented Jun 6, 2024

CodeRabbit configuration
language: en-US
tone_instructions: ''
early_access: true
enable_free_tier: true
reviews:
  profile: assertive
  request_changes_workflow: true
  high_level_summary: false
  high_level_summary_placeholder: '@coderabbitai summary'
  auto_title_placeholder: '@coderabbitai title'
  poem: false
  review_status: false
  collapse_walkthrough: false
  path_filters:
    - '!dist/**'
    - '!**/*.app'
    - '!**/*.bin'
    - '!**/*.bz2'
    - '!**/*.class'
    - '!**/*.db'
    - '!**/*.csv'
    - '!**/*.tsv'
    - '!**/*.dat'
    - '!**/*.dll'
    - '!**/*.dylib'
    - '!**/*.egg'
    - '!**/*.glif'
    - '!**/*.gz'
    - '!**/*.xz'
    - '!**/*.zip'
    - '!**/*.7z'
    - '!**/*.rar'
    - '!**/*.zst'
    - '!**/*.ico'
    - '!**/*.jar'
    - '!**/*.tar'
    - '!**/*.war'
    - '!**/*.lo'
    - '!**/*.log'
    - '!**/*.mp3'
    - '!**/*.wav'
    - '!**/*.wma'
    - '!**/*.mp4'
    - '!**/*.avi'
    - '!**/*.mkv'
    - '!**/*.wmv'
    - '!**/*.m4a'
    - '!**/*.m4v'
    - '!**/*.3gp'
    - '!**/*.3g2'
    - '!**/*.rm'
    - '!**/*.mov'
    - '!**/*.flv'
    - '!**/*.iso'
    - '!**/*.swf'
    - '!**/*.flac'
    - '!**/*.nar'
    - '!**/*.o'
    - '!**/*.ogg'
    - '!**/*.otf'
    - '!**/*.p'
    - '!**/*.pdf'
    - '!**/*.doc'
    - '!**/*.docx'
    - '!**/*.xls'
    - '!**/*.xlsx'
    - '!**/*.map'
    - '!**/*.out'
    - '!**/*.ppt'
    - '!**/*.pptx'
    - '!**/*.pkl'
    - '!**/*.pickle'
    - '!**/*.pyc'
    - '!**/*.pyd'
    - '!**/*.pyo'
    - '!**/*.pub'
    - '!**/*.pem'
    - '!**/*.rkt'
    - '!**/*.so'
    - '!**/*.ss'
    - '!**/*.eot'
    - '!**/*.exe'
    - '!**/*.pb.go'
    - '!**/*.pb.gw.go'
    - '!**/*.lock'
    - '!**/*.ttf'
    - '!**/*.yaml'
    - '!**/*.yml'
    - '!**/*.xml'
    - '!**/*.cfg'
    - '!**/*.toml'
    - '!**/*.ini'
    - '!**/*.mod'
    - '!**/*.sum'
    - '!**/*.work'
    - '!**/*.mmd'
    - '!**/*.svg'
    - '!**/*.jpeg'
    - '!**/*.jpg'
    - '!**/*.png'
    - '!**/*.gif'
    - '!**/*.bmp'
    - '!**/*.tiff'
    - '!**/*.webm'
    - '!**/*.woff'
    - '!**/*.woff2'
    - '!**/*.dot'
    - '!**/*.md5sum'
    - '!**/*.wasm'
    - '!**/*.snap'
    - '!**/*.parquet'
    - '!**/gen/**'
    - '!**/_gen/**'
    - '!**/generated/**'
    - '!**/@generated/**'
    - '!**/vendor/**'
    - '!**/*.min.js'
    - '!**/*.min.js.map'
    - '!**/*.min.js.css'
    - '!**/*.tfstate'
    - '!**/*.tfstate.backup'
  path_instructions:
    - path: src/main/webapp/**/*.ts
      instructions: >-
        angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true
    - path: src/main/java/**/*.java
      instructions: >-
        naming:CamelCase;
        principles:{single_responsibility,small_methods,no_duplication};
        db:{perf_queries,datetime_not_timestamp};
        rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos};
        dtos:{java_records,no_entities,min_data,single_resp};
        di:constructor_injection; kiss:simple_code;
        file_handling:os_indep_paths;
        practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives};
        sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports
    - path: src/test/javascript/spec/**/*.ts
      instructions: >-
        jest: true; mock: NgMocks; bad_practices: avoid_full_module_import;
        perf_improvements: mock_irrelevant_deps; service_testing:
        mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA;
        expectation_specificity: true; solutions: {boolean: toBeTrue/False,
        reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined,
        class_obj: toContainEntries/toEqual, spy_calls: {not_called:
        not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value:
        toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}
    - path: src/test/java/**/*.java
      instructions: >-
        test_naming: descriptive; test_size: small_specific; fixed_data: true;
        junit5_features: true; assert_use: assertThat; assert_specificity: true;
        archunit_use: enforce_package_rules; db_query_count_tests:
        track_performance; util_service_factory_pattern: true; avoid_db_access:
        true; mock_strategy: static_mocks; context_restart_minimize: true
    - path: src/main/webapp/**/*.html
      instructions: >-
        @if and @for are new and valid Angular syntax replacing *ngIf and
        *ngFor. They should always be used over the old style.
    - path: src/main/webapp/i18n/de/**/*.json
      instructions: >-
        German language translations should be informal (dutzen) and should
        never be formal (sietzen). So the user should always be addressed with
        "du/dein" and never with "sie/ihr".
  auto_review:
    enabled: true
    auto_incremental_review: true
    ignore_title_keywords: []
    labels: []
    drafts: false
    base_branches: []
  tools:
    shellcheck:
      enabled: true
    ruff:
      enabled: true
    markdownlint:
      enabled: true
    github-checks:
      enabled: true
      timeout_ms: 90000
    languagetool:
      enabled: true
      disabled_rules:
        - EN_UNPAIRED_BRACKETS
      disabled_categories:
        - TYPOS
        - TYPOGRAPHY
        - CASING
      enabled_only: false
      level: picky
      enabled_rules: []
      enabled_categories: []
    biome:
      enabled: true
    hadolint:
      enabled: true
    swiftlint:
      enabled: true
    phpstan:
      enabled: true
      level: '5'
    golangci-lint:
      enabled: true
    ast-grep:
      packages: []
      rule_dirs: []
      util_dirs: []
      essential_rules: true
chat:
  auto_reply: true
knowledge_base:
  learnings:
    scope: auto
  issues:
    scope: auto
  jira:
    project_keys: []
  linear:
    team_keys: []

marlon-luca-bu
marlon-luca-bu previously approved these changes Jun 6, 2024
Copy link
Contributor

@marlon-luca-bu marlon-luca-bu left a comment

Choose a reason for hiding this comment

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

Code 👍

Copy link
Contributor

@florian-glombik florian-glombik left a comment

Choose a reason for hiding this comment

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

I think it would be better to remove the javadoc comments. I do not think that they add value here and are most likely to get outdated with the actual code, which might lead to misleading assumptions.

Co-authored-by: Florian Glombik <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Outside diff range comments (3)
src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts (3)

Line range hint 136-136: Specify an explicit type for this variable to avoid implicit 'any' type.

let errorDetail: string | undefined;
Tools
Biome

[error] 65-65: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


[error] 87-87: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


Line range hint 137-137: Use optional chaining to safely access nested properties.

- if (err?.error && err.error.errorKey) {
+ if (err?.error?.errorKey) {
Tools
Biome

[error] 65-65: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


[error] 87-87: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


Line range hint 1-1: Convert these imports to use 'import type' since they are only used as types. This will ensure they are removed by the transpiler, optimizing the module loading.

import type { ActivatedRoute } from '@angular/router';
import type { Subscription, Observable } from 'rxjs';
import type { StudentExam } from 'app/entities/student-exam.model';
import type { CourseManagementService } from 'app/course/manage/course-management.service';
import type { Course } from 'app/entities/course.model';
import type { ExamManagementService } from 'app/exam/manage/exam-management.service';
import type { AlertService } from 'app/core/util/alert.service';
import type { HttpErrorResponse } from '@angular/common/http';
import type { Exam } from 'app/entities/exam.model';
import type { AccountService } from 'app/core/auth/account.service';
import type { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe';
import type { faClipboard } from '@fortawesome/free-solid-svg-icons';

Also applies to: 2-3, 3-4, 5-6, 6-7, 7-8, 8-9, 9-10, 10-11, 11-12, 13-14, 15-16

Tools
Biome

[error] 65-65: Forbidden non-null assertion. (lint/style/noNonNullAssertion)


[error] 87-87: Forbidden non-null assertion. (lint/style/noNonNullAssertion)

Copy link
Contributor

@marlon-luca-bu marlon-luca-bu left a comment

Choose a reason for hiding this comment

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

Reapprove

Copy link
Contributor

@sarpsahinalp sarpsahinalp left a comment

Choose a reason for hiding this comment

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

code lgtm

@krusche krusche changed the title Exam Mode: Utilize server endpoint for getting longest working time in exam assessment Development: Utilize server endpoint for getting longest working time in exam assessment Jun 7, 2024
@krusche krusche added this to the 7.2.0 milestone Jun 7, 2024
@krusche krusche merged commit 6ff38d2 into develop Jun 7, 2024
36 of 41 checks passed
@krusche krusche deleted the chore/exam-mode/utilize-longest-working-time-server-endpoint branch June 7, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) ready for review ready to merge tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Change longest working time method with server endpoint
8 participants