Gen dummy questions
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<ion-card class="bg_white connect-card" >
|
||||
<ion-card class="bg_white connect-card" *ngIf="cardLevel==100" >
|
||||
<ion-card-header>
|
||||
<!-- <ion-card-title>Card Title</ion-card-title>-->
|
||||
<ion-card-subtitle>Select Activity</ion-card-subtitle>
|
||||
</ion-card-header>
|
||||
|
||||
@@ -19,12 +18,50 @@
|
||||
<ion-button
|
||||
shape="round"
|
||||
[disabled]="isDisabled"
|
||||
(click)="startSeletecdGame()"
|
||||
size="small"
|
||||
fill="solid">Next</ion-button>
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-card class="bg_white connect-card" *ngIf="cardLevel==200" >
|
||||
<ion-card-header>
|
||||
<ion-card-subtitle>Math Quiz - 1</ion-card-subtitle>
|
||||
</ion-card-header>
|
||||
|
||||
<ion-card-content>
|
||||
<div class="select_box" >
|
||||
<div style="font-weight: bolder; margin: 10px 0px 5px 0px">Question.</div>
|
||||
<div> {{myNextQuestion.question}}</div>
|
||||
<div style="font-weight: bolder; margin: 10px 0px 5px 0px">Answer</div>
|
||||
<ion-list>
|
||||
<ion-radio-group [(ngModel)]="selected_ans" (ionChange)="checkAnsVAl()">
|
||||
<ion-item *ngFor="let item of myNextQuestion.option; let i = index">
|
||||
<ion-label>{{item}} </ion-label>
|
||||
<ion-radio slot="start" value="{{item}}"></ion-radio>
|
||||
</ion-item>
|
||||
</ion-radio-group>
|
||||
</ion-list>
|
||||
</div>
|
||||
<div style="width: 100%; text-align: right; margin-top: 10px; display: flex;">
|
||||
<div style="width: 50%; text-align: left;">
|
||||
<ion-button fill="clear" size="small" (click)="resetQuestion()" >
|
||||
<ion-icon slot="icon-only" color="danger" name="close-circle-outline"></ion-icon>
|
||||
</ion-button>
|
||||
</div>
|
||||
<div style="width: 50%; text-align: right;">
|
||||
<ion-button
|
||||
shape="round"
|
||||
[disabled]="isAnsDisabled"
|
||||
(click)="confirmAns()"
|
||||
size="small"
|
||||
fill="solid">Confirm</ion-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<!--<ion-card class="bg_white connect-card" >-->
|
||||
<!-- <ion-card-header>-->
|
||||
|
||||
@@ -2,6 +2,7 @@ import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import {SocketToolsService} from "../../services/socket-tools.service";
|
||||
import {LoadingController} from "@ionic/angular";
|
||||
|
||||
@Component({
|
||||
selector: 'app-generative-activity',
|
||||
@@ -11,11 +12,19 @@ import {SocketToolsService} from "../../services/socket-tools.service";
|
||||
export class GenerativeActivityComponent implements OnInit {
|
||||
generativeOptions:any=[];
|
||||
@ViewChild('select_gen') select_gen;
|
||||
@ViewChild('selected_ans') selected_ans;
|
||||
|
||||
isDisabled:boolean=true;
|
||||
isAnsDisabled:boolean=true;
|
||||
cardLevel:number=100;
|
||||
curr_session:string;
|
||||
session_image_server:string;
|
||||
|
||||
|
||||
constructor(
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private loadingCtrl: LoadingController,
|
||||
public socketToolsService:SocketToolsService
|
||||
) {
|
||||
this.generativeOptions = this.sessionDataProviderService.generative_types;
|
||||
@@ -25,5 +34,60 @@ isDisabled:boolean=true;
|
||||
genChange(){
|
||||
this.isDisabled = this.select_gen == '';
|
||||
}
|
||||
checkAnsVAl(){
|
||||
this.isAnsDisabled = this.selected_ans == '';
|
||||
}
|
||||
resetQuestion(){
|
||||
this.cardLevel= 100;
|
||||
this.selected_ans='';
|
||||
this.select_gen='';
|
||||
this.checkAnsVAl();
|
||||
this.genChange();
|
||||
}
|
||||
startSeletecdGame(){
|
||||
this.getGenerativeQuestion();
|
||||
this.cardLevel= 200;
|
||||
}
|
||||
|
||||
usrData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
select_gen:string,
|
||||
page:number,
|
||||
offset:number
|
||||
};
|
||||
total_offers:number = 0;
|
||||
myNextQuestion:any;
|
||||
myOffersData: [];
|
||||
async getGenerativeQuestion( page:number =1 ){
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Getting next Question',
|
||||
duration: 5000,
|
||||
});
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
this.usrData = {
|
||||
action:0,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
select_gen:this.select_gen,
|
||||
page:page,
|
||||
offset: 0
|
||||
}
|
||||
await loading.present();
|
||||
this.wrenchService.getGenerative(this.usrData).subscribe(
|
||||
myNextQuestion => {
|
||||
loading.dismiss();
|
||||
this.myNextQuestion = myNextQuestion.next_question;
|
||||
console.log("myNextQuestion RETURN->", this.myNextQuestion);
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
confirmAns(){
|
||||
this.isAnsDisabled = true;
|
||||
this.getGenerativeQuestion();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +258,7 @@ export class WrenchService {
|
||||
return this.getPostData("paymenthx", usrData);
|
||||
}
|
||||
getJobsData(usrData) {
|
||||
//if (usrData.sessionid == '' || usrData.member_id == 0 ) return [];
|
||||
return this.getPostData("getjobsdata", usrData);
|
||||
}
|
||||
|
||||
@@ -295,6 +296,10 @@ export class WrenchService {
|
||||
return this.getPostData("offerslist", usrData);
|
||||
}
|
||||
|
||||
getGenerative(usrData){
|
||||
return this.getPostData("generatives", usrData);
|
||||
}
|
||||
|
||||
requestDelete(usrData){
|
||||
return this.getPostData("reqdel", usrData);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,12 @@ export class MarketDataService {
|
||||
jobsTotalData:any;
|
||||
jobsData: [];
|
||||
getJobsData(){
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
if (
|
||||
this.sessionDataProviderService.session == '' ||
|
||||
this.sessionDataProviderService.member_id == 0
|
||||
) return;
|
||||
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , limit:20, page:1}
|
||||
this.wrenchService.getJobsData(this.usrData).subscribe(
|
||||
jobsTotalData => {
|
||||
@@ -27,10 +31,7 @@ export class MarketDataService {
|
||||
console.log("PAH HX RETURN->", this.jobsTotalData);
|
||||
this.jobsData = this.jobsTotalData.result_list;
|
||||
this.session_image_server = this.jobsTotalData.session_image_server;
|
||||
|
||||
// debugger;
|
||||
console.log("JOBS RETURN DATA->", this.jobsData);
|
||||
// this.blogDataService.setBlogData(this.blogResult.blog_data);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user