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

Pr to inquiry v2 #65

Conversation

pavankumar0408
Copy link
Contributor

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

Please choose appropriate options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes in the below checkboxes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Ran Test A
  • Ran Test B

Test Configuration:

  • Software versions:
  • Hardware versions:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@@ -58,7 +58,7 @@ export class ViewerService {
this.isSectionsAvailable = parentConfig?.isSectionsAvailable;
this.src = config.metadata.artifactUrl || '';
this.questionSetId = config.metadata.identifier;
this.questionSetEvaluable = this.serverValidationCheck(config.metadata?.eval);
this.questionSetEvaluable = this.serverValidationCheck(config.metadata?.evalMode);
Copy link
Contributor

Choose a reason for hiding this comment

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

@pavankumar0408 Can you set the default value of questionSetEvaluable to false instead of type any and in serverValidationCheck method re-assign the value to true based on condition check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

serverValidationCheck(mode: any) {
if(mode == 'server') {
this.questionSetEvaluable = true;
return this.questionSetEvaluable;
Copy link
Contributor

Choose a reason for hiding this comment

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

@pavankumar0408 Instead of returning the true / false from this method can you just re-assign the value of questionSetEvaluable and use the value in all other places in components. So this way we can reduce the call of same method in multiple places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -216,7 +216,7 @@ export class SectionPlayerComponent implements OnChanges, AfterViewInit {
this.showTimer = this.sectionConfig.metadata?.showTimer;

//server-level-validation
this.questionSetEvaluable = this.viewerService.serverValidationCheck(this.sectionConfig.metadata?.eval);
this.questionSetEvaluable = this.viewerService.serverValidationCheck(this.sectionConfig.metadata?.evalMode);
Copy link
Contributor

Choose a reason for hiding this comment

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

@pavankumar0408 Instead of calling this.viewerService.serverValidationCheck method can you set the value of questionSetEvaluable in viewerService one time and use it like this.viewerService.questionSetEvaluable in all the components

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link

@pavankumar0408
Copy link
Contributor Author

@rajnishdargan, comments are addressed

@pavankumar0408
Copy link
Contributor Author

Another PR has been raised

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants