File

src/app/modules/sourcing/components/mcq-template-selection/mcq-template-selection.component.ts

Metadata

selector app-mcq-template-selection
styleUrls mcq-template-selection.component.scss
templateUrl mcq-template-selection.component.html

Inputs

questionMetaData

Type: any

sessionContext

Type: any

telemetryEventsInput

Type: any

Outputs

templateSelection $event type: EventEmitter

Constructor

constructor(configService: any, programTelemetryService: ProgramTelemetryService)

Methods

handleSubmit
handleSubmit()
Returns: void
getTelemetryInteractObject
getTelemetryInteractObject(id: string, type: string)
Returns: void

Properties

configService
configService: any
mcqTemplateConfig
mcqTemplateConfig: { 'id': number; 'url': string; 'templateClass': string; 'templateDescription': string; }[]
Private modal
modal: any
programTelemetryService
programTelemetryService: ProgramTelemetryService
showButton
showButton: boolean
Default value: false
templateSelected
templateSelected: any
import { ConfigService } from '@sunbird/shared';
import { Component, OnInit, ViewChild, OnDestroy, Output, EventEmitter, Input } from '@angular/core';
import { mcqTemplateConfig } from './mcq-template-data';
import { ProgramTelemetryService } from '../../../program/services';

@Component({
  selector: 'app-mcq-template-selection',
  templateUrl: './mcq-template-selection.component.html',
  styleUrls: ['./mcq-template-selection.component.scss']
})
export class McqTemplateSelectionComponent implements OnInit, OnDestroy {

  showButton = false;
  templateSelected;
  @Input() questionMetaData: any;
  @Input() sessionContext: any;
  @Input() telemetryEventsInput: any;
  @ViewChild('modal') private modal;
  @Output() templateSelection = new EventEmitter<any>();
  mcqTemplateConfig = mcqTemplateConfig.templateConfig;
  constructor(public configService: ConfigService, public programTelemetryService: ProgramTelemetryService) { }

  ngOnInit() {
  }
  handleSubmit() {
    this.templateSelection.emit({ type: 'submit', template: this.templateSelected });
  }
  ngOnDestroy() {
    if (this.modal && this.modal.deny) {
      this.modal.deny();
    }
  }

  getTelemetryInteractObject(id: string, type: string) {
    return this.programTelemetryService.getTelemetryInteractObject(id, type, '1.0',
    { l1: this.sessionContext.collection, l2: this.sessionContext.textBookUnitIdentifier, l3: this.sessionContext.resourceIdentifier});
  }

}

results matching ""

    No results matching ""