Commit 39ec6214ec89785f5aa6b403e0860f2710b567ef

Authored by r-ujihara
1 parent d9c676c3

1.0版向け修正2回目

Showing 66 changed files with 540 additions and 375 deletions

9.23 KB | W: | H:

9.35 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

3.24 KB | W: | H:

3.25 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

5.02 KB | W: | H:

5.06 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

13.9 KB | W: | H:

14.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

25.2 KB | W: | H:

25.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

34.4 KB | W: | H:

35.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

18.2 KB | W: | H:

4.65 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.67 KB | W: | H:

2.27 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

10.5 KB | W: | H:

3.08 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

30.2 KB | W: | H:

16.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

39.6 KB | W: | H:

22.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

51.9 KB | W: | H:

29.1 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

18.8 KB | W: | H:

4.58 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.83 KB | W: | H:

2.26 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

10.8 KB | W: | H:

3.07 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

31.4 KB | W: | H:

17.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

40.7 KB | W: | H:

23.4 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

53.2 KB | W: | H:

30.4 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

31 KB | W: | H:

31.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

3.79 KB | W: | H:

3.82 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

10.8 KB | W: | H:

10.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

19.3 KB | W: | H:

19.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

5.34 KB | W: | H:

5.38 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

14.8 KB | W: | H:

15.1 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

7.03 KB | W: | H:

7.09 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

19.3 KB | W: | H:

19.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

34.8 KB | W: | H:

35.5 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

9.23 KB | W: | H:

9.35 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

25.2 KB | W: | H:

25.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

9.92 KB | W: | H:

10.1 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

27.3 KB | W: | H:

27.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

31.2 KB | W: | H:

31.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.35 KB | W: | H:

2.35 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.58 KB | W: | H:

6.64 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

12 KB | W: | H:

12.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.47 KB | W: | H:

6.54 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

17.9 KB | W: | H:

18.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

27.8 KB | W: | H:

15.5 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

32.5 KB | W: | H:

18.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.92 KB | W: | H:

7.07 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

7.1 KB | W: | H:

7.19 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

57 KB | W: | H:

33.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

25.6 KB | W: | H:

14.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

57.9 KB | W: | H:

34.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

26.1 KB | W: | H:

14.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

23.9 KB | W: | H:

13.4 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

10.8 KB | W: | H:

3.07 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

27.5 KB | W: | H:

9.96 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -89,11 +89,11 @@ @@ -89,11 +89,11 @@
89 第7条 アプリのアップデート、変更等<br /> 89 第7条 アプリのアップデート、変更等<br />
90  (1) メディアテックは、いつでもお客様への通知なく、アプリのアップデートを行うことができます。ただし、メディアテックはアップデートを行う義務を負うものではなく、特定のサポート等の提供を決定した場合でも、いつでもお客様への通知なく当該サポート等の提供を終了することができます。<br /> 90  (1) メディアテックは、いつでもお客様への通知なく、アプリのアップデートを行うことができます。ただし、メディアテックはアップデートを行う義務を負うものではなく、特定のサポート等の提供を決定した場合でも、いつでもお客様への通知なく当該サポート等の提供を終了することができます。<br />
91  (2) メディアテックは、いつでもお客様への通知なく、アプリが操作不可能となるよう同アプリを改変することで、お客様の同アプリ又はモバイルサービスを使用する権利の全部又は一部を変更、中断、中止又は終了することができます。メディアテックは、この権利を行使したことによりお客様に対して損害が発生した場合であっても、一切これを賠償する責を負いません。<br /> 91  (2) メディアテックは、いつでもお客様への通知なく、アプリが操作不可能となるよう同アプリを改変することで、お客様の同アプリ又はモバイルサービスを使用する権利の全部又は一部を変更、中断、中止又は終了することができます。メディアテックは、この権利を行使したことによりお客様に対して損害が発生した場合であっても、一切これを賠償する責を負いません。<br />
92 -  (3)前2項の対象とするお客様とは、不特定多数のお客様であると、任意に選んだ特定の一部のお客様であるとを問わないもので、いずれの場合でもメディアテックは一切の責任を負いません。 92 +  (3)前2項の対象とするお客様とは、不特定多数のお客様であると、任意に選んだ特定の一部のお客様であるとを問わないもので、いずれの場合でもメディアテックは一切の責任を負いません。<br />
93 </p> 93 </p>
94 <p> 94 <p>
95 第8条 利用終了等及びお客様のお立場<br /> 95 第8条 利用終了等及びお客様のお立場<br />
96 -  (1)お客様は、ご自身の対応端末にインストールされているアプリの全てのコピーをアンインストール又は削除することで、いつでもその使用を終了することができます。 96 +  (1)お客様は、ご自身の対応端末にインストールされているアプリの全てのコピーをアンインストール又は削除することで、いつでもその使用を終了することができます。<br />
97  (2) お客様が本規約に違反した場合には、メディアテックからの通知なく、本規約に基づくお客様の権利は自動的に消滅するものとし、お客様はアプリの一切の使用を中断すると共に同アプリの全てのコピーを削除するものとします。この場合、メディアテックはいつでもお客様への通知なく直ちにお客様によるモバイルサービスへのアクセスを無効にする権限を有します。また、メディアテックはお客様の同アプリを使用する権利を終了させる権利を有し、この場合には、同アプリが操作不可能となるよう同アプリを改変する権利を有します。メディアテックは、これらの権利を行使したことによりお客様に損害が発生した場合であっても一切これを賠償する責を負いません。<br /> 97  (2) お客様が本規約に違反した場合には、メディアテックからの通知なく、本規約に基づくお客様の権利は自動的に消滅するものとし、お客様はアプリの一切の使用を中断すると共に同アプリの全てのコピーを削除するものとします。この場合、メディアテックはいつでもお客様への通知なく直ちにお客様によるモバイルサービスへのアクセスを無効にする権限を有します。また、メディアテックはお客様の同アプリを使用する権利を終了させる権利を有し、この場合には、同アプリが操作不可能となるよう同アプリを改変する権利を有します。メディアテックは、これらの権利を行使したことによりお客様に損害が発生した場合であっても一切これを賠償する責を負いません。<br />
98  (3)メディアテックが、お客様に対し、本規約に定める処置を直ちに取らずに、本規約を遵守するよう要求したり又は本規約に基づく権利の行使をしなかった場合であっても、本規約に基づく権利を放棄しまたは行使の猶予をすることを、何ら意味するものではありません。<br /> 98  (3)メディアテックが、お客様に対し、本規約に定める処置を直ちに取らずに、本規約を遵守するよう要求したり又は本規約に基づく権利の行使をしなかった場合であっても、本規約に基づく権利を放棄しまたは行使の猶予をすることを、何ら意味するものではありません。<br />
99 </p> 99 </p>
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <ion-buttons end> 11 <ion-buttons end>
12 <button ion-button icon-left (click)="backToTop()"> 12 <button ion-button icon-left (click)="backToTop()">
13 <ion-icon name="home"></ion-icon> 13 <ion-icon name="home"></ion-icon>
14 - <div class="qa-header">Top</div> 14 + <div class="qa-header">Top</div>
15 </button> 15 </button>
16 </ion-buttons> 16 </ion-buttons>
17 17
@@ -21,23 +21,46 @@ @@ -21,23 +21,46 @@
21 <ion-content padding class="qa-page"> 21 <ion-content padding class="qa-page">
22 <ion-card class="question-card"> 22 <ion-card class="question-card">
23 <ion-card-content class="question-content"> 23 <ion-card-content class="question-content">
24 - <p>  
25 - 問題 {{index+1}} / 全 {{qaList.length}} 問  
26 - </p><br /> 24 + <ion-row>
  25 + <ion-col>
  26 + <p>
  27 + 問題 {{index+1}} / 全 {{qaList.length}} 問
  28 + </p>
  29 + </ion-col>
  30 + <ion-col text-right>
  31 + <ion-badge *ngIf="qaInfoList[index] != null && qaInfoList[index].positiveFlg == 1">
  32 + 過去の結果:正解
  33 + </ion-badge>
  34 + <ion-badge *ngIf="qaInfoList[index] != null && qaInfoList[index].positiveFlg == 0">
  35 + 過去の結果:不正解
  36 + </ion-badge>
  37 + <ion-badge *ngIf="qaInfoList[index] != null && qaInfoList[index].positiveFlg == 2">
  38 + 過去の結果:未解答
  39 + </ion-badge>
  40 + </ion-col>
  41 + </ion-row>
  42 + <br />
27 <font size=4 [innerHTML] = "qa1.questionString"></font> 43 <font size=4 [innerHTML] = "qa1.questionString"></font>
  44 + <br /><br />
28 45
29 <img src="assets/img/q/{{qa1.questionImage}}" *ngIf="qa1.questionImage != ''" /> 46 <img src="assets/img/q/{{qa1.questionImage}}" *ngIf="qa1.questionImage != ''" />
  47 + <br />
  48 +
  49 + <ion-row *ngFor="let choice of qa1.choicesId">
  50 + <ion-col col-auto><font size=4 [innerHTML] = "selection[choice] + '.'"></font></ion-col>
  51 + <ion-col><font size=3 [innerHTML] = "qa1.choicesString[choice]"></font></ion-col>
  52 + </ion-row>
30 53
31 </ion-card-content> 54 </ion-card-content>
32 <br /><br /> 55 <br /><br />
33 <p *ngFor="let choice of qa1.choicesId"> 56 <p *ngFor="let choice of qa1.choicesId">
34 - <button ion-button full color="secondary" (click)="itemSelected(choice)" [outline]="selectstate[choice]" [disabled]="buttonDisabled" large>  
35 - {{qa1.choicesString[choice]}} 57 + <button ion-button full color="secondary" (click)="itemSelected(choice)" [outline]="selectstate[choice]" [disabled]="buttonDisabled" large>
  58 + {{selection[choice]}}
36 </button> 59 </button>
37 </p> 60 </p>
38 61
39 <ion-buttons end padding class="question-button"> 62 <ion-buttons end padding class="question-button">
40 - <button ion-button icon-left (click)="openAnswer()" [disabled]="buttonDisabled"> 63 + <button ion-button icon-left (click)="openAnswer(0)" [disabled]="buttonDisabled">
41 <ion-icon name="redo"></ion-icon> 64 <ion-icon name="redo"></ion-icon>
42 解説へ 65 解説へ
43 </button> 66 </button>
@@ -50,7 +73,7 @@ @@ -50,7 +73,7 @@
50 <ion-row align-items-center> 73 <ion-row align-items-center>
51 <ion-col> 74 <ion-col>
52 <img src="assets/img/ok.png" *ngIf="result == '正解'"> 75 <img src="assets/img/ok.png" *ngIf="result == '正解'">
53 - <img src="assets/img/ng.png" *ngIf="result != '正解'"> 76 + <img src="assets/img/ng.png" *ngIf="result == '不正解'">
54 </ion-col> 77 </ion-col>
55 <ion-col col-auto><font size=5 [innerHTML] = "result" [color]="result != '正解' ? 'blue' : 'red'"></font></ion-col> 78 <ion-col col-auto><font size=5 [innerHTML] = "result" [color]="result != '正解' ? 'blue' : 'red'"></font></ion-col>
56 <ion-col> 79 <ion-col>
@@ -58,7 +81,8 @@ @@ -58,7 +81,8 @@
58 </ion-row> 81 </ion-row>
59 </ion-grid> 82 </ion-grid>
60 83
61 - <p><br>解答</p> 84 + <p><br>正解:<font size=5 [innerHTML] = "selection[qa1.answerId]"></font></p>
  85 + <br /><br />
62 <font size=4 [innerHTML] = "qa1.answerString"></font> 86 <font size=4 [innerHTML] = "qa1.answerString"></font>
63 <br /><br /> 87 <br /><br />
64 <img src="assets/img/a/{{qa1.answerImage}}" *ngIf="qa1.answerImage != ''" /> 88 <img src="assets/img/a/{{qa1.answerImage}}" *ngIf="qa1.answerImage != ''" />
@@ -81,12 +105,14 @@ @@ -81,12 +105,14 @@
81 <ion-toolbar color="primary"> 105 <ion-toolbar color="primary">
82 106
83 <ion-buttons > 107 <ion-buttons >
84 - <button ion-button icon-only (click)="goToPrev()" *ngIf="index > 0"> 108 + <button ion-button icon-left (click)="goToPrev()" *ngIf="index > 0">
85 <ion-icon name="skip-backward"></ion-icon> 109 <ion-icon name="skip-backward"></ion-icon>
  110 + 戻る
86 </button> 111 </button>
87 </ion-buttons> 112 </ion-buttons>
88 <ion-buttons end> 113 <ion-buttons end>
89 - <button ion-button icon-only (click)="goToNext()" *ngIf="index < (qaList.length-1)"> 114 + <button ion-button icon-right (click)="goToNext()" *ngIf="index < (qaList.length-1)">
  115 + 進む
90 <ion-icon name="skip-forward"></ion-icon> 116 <ion-icon name="skip-forward"></ion-icon>
91 </button> 117 </button>
92 </ion-buttons> 118 </ion-buttons>
@@ -8,5 +8,6 @@ page-qa { @@ -8,5 +8,6 @@ page-qa {
8 .button-md { 8 .button-md {
9 text-transform: none; 9 text-transform: none;
10 } 10 }
  11 +
11 } 12 }
12 } 13 }
@@ -5,7 +5,7 @@ import { Qa } from '../../providers/define-qa'; @@ -5,7 +5,7 @@ import { Qa } from '../../providers/define-qa';
5 import { Content } from 'ionic-angular'; 5 import { Content } from 'ionic-angular';
6 import { ViewChild } from '@angular/core'; 6 import { ViewChild } from '@angular/core';
7 import { Observable } from 'rxjs/Rx'; 7 import { Observable } from 'rxjs/Rx';
8 - 8 +import { QaInfo } from '../../providers/define-qainfo';
9 /* 9 /*
10 Generated class for the Qa page. 10 Generated class for the Qa page.
11 11
@@ -26,7 +26,6 @@ export class QaPage { @@ -26,7 +26,6 @@ export class QaPage {
26 index: number; 26 index: number;
27 title:string; 27 title:string;
28 buttonDisabled: boolean; 28 buttonDisabled: boolean;
29 - ds: DataService;  
30 nv: NavController; 29 nv: NavController;
31 selected: number; 30 selected: number;
32 result: string; 31 result: string;
@@ -34,6 +33,8 @@ export class QaPage { @@ -34,6 +33,8 @@ export class QaPage {
34 subscription; 33 subscription;
35 screenHeight:number; 34 screenHeight:number;
36 positiveCnt: number; 35 positiveCnt: number;
  36 + qaInfoList: Array<QaInfo> = new Array();
  37 + selection:String[] = ["ア","イ","ウ","エ","オ"];
37 38
38 constructor(public navCtrl: NavController, public navParams: NavParams, private dataSevice: DataService) { 39 constructor(public navCtrl: NavController, public navParams: NavParams, private dataSevice: DataService) {
39 this.menuId = navParams.get("menuId"); 40 this.menuId = navParams.get("menuId");
@@ -44,13 +45,13 @@ export class QaPage { @@ -44,13 +45,13 @@ export class QaPage {
44 this.qaList = dataSevice.getQa(this.menuId, this.unitId); 45 this.qaList = dataSevice.getQa(this.menuId, this.unitId);
45 this.qa1 = this.qaList[this.index]; 46 this.qa1 = this.qaList[this.index];
46 this.buttonDisabled = null; 47 this.buttonDisabled = null;
47 - this.ds = dataSevice;  
48 this.nv = navCtrl; 48 this.nv = navCtrl;
49 this.selected = -1; 49 this.selected = -1;
50 this.positiveCnt = 0; 50 this.positiveCnt = 0;
51 for (var i = 0; i < this.qa1.choicesId.length; i++) { 51 for (var i = 0; i < this.qa1.choicesId.length; i++) {
52 this.selectstate.push(false); 52 this.selectstate.push(false);
53 } 53 }
  54 + this.readStatus();
54 55
55 } 56 }
56 57
@@ -58,6 +59,11 @@ export class QaPage { @@ -58,6 +59,11 @@ export class QaPage {
58 console.log('ionViewDidLoad QaPage'); 59 console.log('ionViewDidLoad QaPage');
59 } 60 }
60 61
  62 + ionViewWillLeave(){
  63 +
  64 + this.writeStatus();
  65 + }
  66 +
61 itemSelected(id: number) { 67 itemSelected(id: number) {
62 68
63 for (var i = 0; i < this.qa1.choicesId.length; i++) { 69 for (var i = 0; i < this.qa1.choicesId.length; i++) {
@@ -68,42 +74,71 @@ export class QaPage { @@ -68,42 +74,71 @@ export class QaPage {
68 this.selectstate[id] = true; 74 this.selectstate[id] = true;
69 this.selected = id; 75 this.selected = id;
70 // this.content.scrollToBottom(300); 76 // this.content.scrollToBottom(300);
71 - this.openAnswer(); 77 + this.openAnswer(1);
72 } 78 }
73 79
74 - openAnswer() { 80 + openAnswer(selected: number) {
75 if (this.buttonDisabled == null) 81 if (this.buttonDisabled == null)
76 { 82 {
77 this.result = "解答"; 83 this.result = "解答";
78 84
79 - if (this.selected === this.qa1.answerId) { //正解  
80 - this.result = "正解";  
81 - this.positiveCnt++;  
82 - }  
83 - else {  
84 - this.result = "不正解"; 85 + this.qaInfoList[this.index].isDone = 1;
  86 + if(selected == 1)
  87 + {
  88 + this.qaInfoList[this.index].challengeCnt++;
  89 +
  90 + if (this.selected === this.qa1.answerId) { //正解
  91 + this.result = "正解";
  92 + this.qaInfoList[this.index].positiveFlg_now = 1;
  93 + this.qaInfoList[this.index].answer = 1;
  94 + }
  95 + else {
  96 + this.result = "不正解";
  97 + if(this.qaInfoList[this.index].positiveFlg != 1)
  98 + {
  99 + this.qaInfoList[this.index].positiveFlg_now = 0;
  100 + this.qaInfoList[this.index].answer = 0;
  101 + }
  102 + }
85 } 103 }
86 104
87 this.buttonDisabled = true; 105 this.buttonDisabled = true;
88 if (this.index >= (this.qaList.length - 1)) 106 if (this.index >= (this.qaList.length - 1))
89 { 107 {
90 - var key: string;  
91 - var value: string;  
92 - key = this.qa1.menuId + ":" + this.qa1.unitId;  
93 - value = this.positiveCnt + ":" + this.qaList.length;  
94 - this.dataSevice.saveInfo(key, value); 108 +
95 } 109 }
96 110
97 var element = document.getElementsByClassName('question-card'); 111 var element = document.getElementsByClassName('question-card');
98 this.screenHeight = element[0].clientHeight; 112 this.screenHeight = element[0].clientHeight;
99 this.subscription = Observable.timer(300) 113 this.subscription = Observable.timer(300)
100 - .subscribe(x => { 114 + .subscribe(x => {
101 this.content.scrollTo(0, this.screenHeight, 300); 115 this.content.scrollTo(0, this.screenHeight, 300);
102 } 116 }
103 ); 117 );
104 } 118 }
105 } 119 }
106 120
  121 + showAnswer(res: number) {
  122 + if (this.buttonDisabled == null)
  123 + {
  124 + if(res == -1)
  125 + {
  126 + this.result = "解答";
  127 + }
  128 + else
  129 + {
  130 + if (res == 1) { //正解
  131 + this.result = "正解";
  132 + }
  133 + else {
  134 + this.result = "不正解";
  135 + }
  136 + }
  137 +
  138 + this.buttonDisabled = true;
  139 + }
  140 + }
  141 +
107 goToNext() { 142 goToNext() {
108 if(this.index < this.qaList.length-1) 143 if(this.index < this.qaList.length-1)
109 { 144 {
@@ -115,6 +150,11 @@ export class QaPage { @@ -115,6 +150,11 @@ export class QaPage {
115 for (var i = 0; i < this.qa1.choicesId.length; i++) { 150 for (var i = 0; i < this.qa1.choicesId.length; i++) {
116 this.selectstate.push(false); 151 this.selectstate.push(false);
117 } 152 }
  153 + if(this.qaInfoList[this.index].isDone != 0)
  154 + {
  155 + this.showAnswer(this.qaInfoList[this.index].answer);
  156 + }
  157 +
118 this.content.scrollToTop(300); 158 this.content.scrollToTop(300);
119 } 159 }
120 } 160 }
@@ -130,6 +170,10 @@ export class QaPage { @@ -130,6 +170,10 @@ export class QaPage {
130 for (var i = 0; i < this.qa1.choicesId.length; i++) { 170 for (var i = 0; i < this.qa1.choicesId.length; i++) {
131 this.selectstate.push(false); 171 this.selectstate.push(false);
132 } 172 }
  173 + if(this.qaInfoList[this.index].isDone != 0)
  174 + {
  175 + this.showAnswer(this.qaInfoList[this.index].answer);
  176 + }
133 this.content.scrollToTop(300); 177 this.content.scrollToTop(300);
134 } 178 }
135 } 179 }
@@ -141,4 +185,75 @@ export class QaPage { @@ -141,4 +185,75 @@ export class QaPage {
141 backToTop() { 185 backToTop() {
142 this.nv.popToRoot(); 186 this.nv.popToRoot();
143 } 187 }
  188 +
  189 + readStatus()
  190 + {
  191 + var promiseArray1 = new Array();
  192 + for (var i = 0; i < this.qaList.length; i++) {
  193 + var key: string;
  194 + key = this.menuId + ":" + this.unitId + ":" + this.qaList[i].qaId;
  195 + promiseArray1.push(this.dataSevice.getInfo(key));
  196 + }
  197 +
  198 + Promise.all(promiseArray1)
  199 + .then(val =>
  200 + {
  201 + for(var i = 0; i< this.qaList.length; i++)
  202 + {
  203 + var item: QaInfo = new QaInfo();
  204 + item.challengeCnt = 0;
  205 + item.positiveFlg = 2;
  206 + item.positiveFlg_now = 2;
  207 + item.isDone = 0;
  208 + item.answer = -1;
  209 + if(val[i] != null)
  210 + {
  211 + var svdata = val[i].toString().split(":");
  212 + item.challengeCnt = +svdata[0];
  213 + item.positiveFlg = +svdata[1];
  214 + item.positiveFlg_now = +svdata[1];
  215 + if(item.positiveFlg == 1)
  216 + {
  217 + this.positiveCnt++;
  218 + }
  219 + }
  220 + this.qaInfoList.push(item);
  221 + }
  222 + });
  223 + }
  224 +
  225 + writeStatus()
  226 + {
  227 + var cnt:number = 0;
  228 + var startFlg:number = 0;
  229 + for (var i = 0; i < this.qaList.length; i++) {
  230 + var key: string;
  231 + var value: string;
  232 + key = this.menuId + ":" + this.unitId + ":" + this.qaList[i].qaId;
  233 + value = this.qaInfoList[i].challengeCnt + ":" + this.qaInfoList[i].positiveFlg_now;
  234 + if(this.qaInfoList[i].positiveFlg_now == 1)
  235 + {
  236 + cnt++;
  237 + }
  238 + if(this.qaInfoList[i].isDone == 1) //解答したまたは解説を開いたら着手
  239 + {
  240 + startFlg = 1;
  241 + }
  242 + this.dataSevice.saveInfo(key, value);
  243 + }
  244 +
  245 + if(startFlg == 1)
  246 + {
  247 + if(cnt >= this.positiveCnt)
  248 + {
  249 + var key: string;
  250 + var value: string;
  251 + key = this.qa1.menuId + ":" + this.qa1.unitId;
  252 + value = cnt.toString();
  253 + this.dataSevice.saveInfo(key, value);
  254 + }
  255 + }
  256 +
  257 + }
  258 +
144 } 259 }
@@ -66,4 +66,19 @@ @@ -66,4 +66,19 @@
66 </ion-item-divider> 66 </ion-item-divider>
67 <canvas #baseChart7 height="70" class="status-canvas"></canvas> 67 <canvas #baseChart7 height="70" class="status-canvas"></canvas>
68 </ion-item-group> 68 </ion-item-group>
  69 +
  70 + <ion-item-group>
  71 + <ion-item-divider color="light">>
  72 + {{list_f[8].title}}
  73 + </ion-item-divider>
  74 + <canvas #baseChart8 height="70" class="status-canvas"></canvas>
  75 + </ion-item-group>
  76 +
  77 + <ion-item-group>
  78 + <ion-item-divider color="light">>
  79 + {{list_f[9].title}}
  80 + </ion-item-divider>
  81 + <canvas #baseChart9 height="70" class="status-canvas"></canvas>
  82 + </ion-item-group>
  83 +
69 </ion-content> 84 </ion-content>
@@ -24,6 +24,8 @@ export class StatusPage { @@ -24,6 +24,8 @@ export class StatusPage {
24 @ViewChild('baseChart5') barCanvas5; 24 @ViewChild('baseChart5') barCanvas5;
25 @ViewChild('baseChart6') barCanvas6; 25 @ViewChild('baseChart6') barCanvas6;
26 @ViewChild('baseChart7') barCanvas7; 26 @ViewChild('baseChart7') barCanvas7;
  27 + @ViewChild('baseChart8') barCanvas8;
  28 + @ViewChild('baseChart9') barCanvas9;
27 29
28 list_f: Menu[]; 30 list_f: Menu[];
29 31
@@ -155,6 +157,10 @@ export class StatusPage { @@ -155,6 +157,10 @@ export class StatusPage {
155 return this.barCanvas6; 157 return this.barCanvas6;
156 case 7: 158 case 7:
157 return this.barCanvas7; 159 return this.barCanvas7;
  160 + case 8:
  161 + return this.barCanvas8;
  162 + case 9:
  163 + return this.barCanvas9;
158 } 164 }
159 } 165 }
160 } 166 }
@@ -15,15 +15,18 @@ @@ -15,15 +15,18 @@
15 15
16 <ion-content padding class="unit-page"> 16 <ion-content padding class="unit-page">
17 17
18 - <ion-card *ngFor="let ptn1 of list1; let i = index;" class="unit-card" (click)="itemSelected(ptn1)">  
19 - <h2 padding class="unit-card-header"> 18 + <ion-card *ngFor="let ptn1 of list1; let i = index;" [ngClass]="totallist[i] == list1state[i] ? 'unit-card-done' : 'unit-card'" (click)="itemSelected(ptn1,i)">
  19 + <ion-item>
  20 + <div class="unit-card-header">
20 学習{{i+1}} 21 学習{{i+1}}
21 - </h2> 22 + </div>
  23 + </ion-item>
22 <ion-item> 24 <ion-item>
23 - <ion-icon name='ribbon' item-left [color]="list1state[i] != done ? 'secondary' : 'dark'" large></ion-icon>  
24 - <h2 padding>{{ptn1.unitName}}</h2>  
25 - <p *ngIf="list1state[i] != done">{{list1state[i]}}</p>  
26 - <p *ngIf="list1state[i] == done">未実施</p> 25 + <ion-icon *ngIf="totallist[i] != list1state[i]" name='ribbon' item-left [color]="list1state[i] != done ? 'secondary' : 'dark'" large></ion-icon>
  26 + <ion-icon *ngIf="totallist[i] == list1state[i]" name='trophy' item-left class="done-icon" large></ion-icon>
  27 + <h2 >{{ptn1.unitName}}</h2>
  28 + <p *ngIf="list1state[i] != null">{{totallist[i]}}問中{{list1state[i]}}問正解!</p>
  29 + <p *ngIf="list1state[i] == null">未実施</p>
27 </ion-item> 30 </ion-item>
28 </ion-card> 31 </ion-card>
29 32
@@ -2,13 +2,37 @@ page-unit { @@ -2,13 +2,37 @@ page-unit {
2 .unit-page { 2 .unit-page {
3 background-image: url('../assets/img/unitbackground.png'); 3 background-image: url('../assets/img/unitbackground.png');
4 4
5 - .card { 5 + .unit-card{
6 background: #EEE; 6 background: #EEE;
7 .item { 7 .item {
8 background: #EEE; 8 background: #EEE;
9 } 9 }
  10 +
  11 + .unit-card-header {
  12 + font-weight: bold;
  13 + color: black
  14 + }
  15 +
  16 + .label {
  17 + color: black
  18 + }
  19 +
  20 + h2 {
  21 + margin-top: 10px;
  22 + color: black
  23 + }
  24 +
  25 + p {
  26 + color: #FF4F50
  27 + }
  28 +
10 } 29 }
11 - .unit-card{ 30 +
  31 + .unit-card-done{
  32 + background: #FC9;
  33 + .item {
  34 + background: #FC9;
  35 + }
12 36
13 .unit-card-header { 37 .unit-card-header {
14 font-weight: bold; 38 font-weight: bold;
@@ -20,14 +44,20 @@ page-unit { @@ -20,14 +44,20 @@ page-unit {
20 } 44 }
21 45
22 h2 { 46 h2 {
  47 + margin-top: 10px;
23 color: black 48 color: black
24 } 49 }
25 50
26 p { 51 p {
27 - color: #808080 52 + color: #FFF
28 } 53 }
29 54
30 } 55 }
31 56
  57 + .done-icon{
  58 + color : yellow;
  59 + }
  60 +
  61 +
32 } 62 }
33 } 63 }
@@ -20,36 +20,42 @@ export class UnitPage { @@ -20,36 +20,42 @@ export class UnitPage {
20 title:string; 20 title:string;
21 21
22 list1: Unit[]; 22 list1: Unit[];
23 - list1state: Array<String> = new Array(); 23 + list1state: Array<string> = new Array();
24 list1num: number; 24 list1num: number;
  25 + totallist: Array<string> = new Array();
25 26
  27 + currentIndex: number;
26 currentItem: Unit; 28 currentItem: Unit;
27 - positiveCnt: number;  
28 29
29 constructor(public navCtrl: NavController, private navParams: NavParams, private dataSevice: DataService) { 30 constructor(public navCtrl: NavController, private navParams: NavParams, private dataSevice: DataService) {
30 31
31 this.menuId = navParams.get("menuId"); 32 this.menuId = navParams.get("menuId");
32 this.title = navParams.get("title"); 33 this.title = navParams.get("title");
33 34
  35 + this.currentIndex = 0;
34 this.currentItem = null; 36 this.currentItem = null;
35 37
36 this.list1 = dataSevice.getUnit(this.menuId); 38 this.list1 = dataSevice.getUnit(this.menuId);
37 this.list1num = this.list1.length; 39 this.list1num = this.list1.length;
38 40
  41 + for (var i = 0; i < this.list1num; i++) {
  42 + this.totallist.push(dataSevice.getUnitQaCnt(this.menuId, this.list1[i].unitId).toString());
  43 + }
  44 +
39 this.updateStatus(); 45 this.updateStatus();
40 46
41 } 47 }
42 48
43 - ionViewWillEnter() { 49 + ionViewDidEnter() {
44 if(this.currentItem != null) 50 if(this.currentItem != null)
45 { 51 {
46 var key: string; 52 var key: string;
47 key = this.menuId + ":" + this.currentItem.unitId; 53 key = this.menuId + ":" + this.currentItem.unitId;
48 this.dataSevice.getInfo(key) 54 this.dataSevice.getInfo(key)
49 - .then(data => {  
50 - this.updateStatus();  
51 - });  
52 - } 55 + .then(data => {
  56 + this.list1state[this.currentIndex] = data;
  57 + });
  58 + }
53 } 59 }
54 60
55 ionViewDidLoad() { 61 ionViewDidLoad() {
@@ -58,21 +64,28 @@ export class UnitPage { @@ -58,21 +64,28 @@ export class UnitPage {
58 64
59 ionViewWillLeave(){ 65 ionViewWillLeave(){
60 var key: string; 66 var key: string;
61 - var value: string; 67 + var value: number;
62 key = this.menuId.toString(); 68 key = this.menuId.toString();
63 - value = this.positiveCnt.toString();  
64 - this.dataSevice.savePositiveInfo(key, value); 69 +
  70 + value = 0;
  71 + for(var i = 0; i< this.list1num; i++)
  72 + {
  73 + if(this.list1state[i] != null)
  74 + {
  75 + value += +this.list1state[i];
  76 + }
  77 + }
  78 + this.dataSevice.saveInfo(key, value.toString());
65 } 79 }
66 80
67 - itemSelected(item: Unit) { 81 + itemSelected(item: Unit, index: number) {
  82 + this.currentIndex = index;
68 this.currentItem = item; 83 this.currentItem = item;
69 this.navCtrl.push(QaPage,{menuId: this.menuId, unitId: item.unitId, title: item.unitName}); 84 this.navCtrl.push(QaPage,{menuId: this.menuId, unitId: item.unitId, title: item.unitName});
70 } 85 }
71 86
72 updateStatus() 87 updateStatus()
73 { 88 {
74 - this.positiveCnt = 0;  
75 -  
76 var promiseArray1 = new Array(); 89 var promiseArray1 = new Array();
77 for (var i = 0; i < this.list1num; i++) { 90 for (var i = 0; i < this.list1num; i++) {
78 var key: string; 91 var key: string;
@@ -86,13 +99,8 @@ export class UnitPage { @@ -86,13 +99,8 @@ export class UnitPage {
86 for(var i = 0; i< this.list1num; i++) 99 for(var i = 0; i< this.list1num; i++)
87 { 100 {
88 this.list1state[i] = val[i]; 101 this.list1state[i] = val[i];
89 - if(val[i] != null)  
90 - {  
91 - var svdata = val[i].toString().split(":");  
92 - this.list1state[i] = svdata[1] + "問中" + svdata[0] + "問正解!";  
93 - this.positiveCnt += +svdata[0];  
94 - }  
95 } 102 }
  103 +
96 }); 104 });
97 } 105 }
98 106
@@ -16,40 +16,58 @@ export class ContentsMenu { @@ -16,40 +16,58 @@ export class ContentsMenu {
16 16
17 17
18 private createMenu(): Menu[] { 18 private createMenu(): Menu[] {
19 - var menu = [{  
20 - menuId: 0,  
21 - grade: '1',  
22 - title: '身のまわりの現象'  
23 - }, {  
24 - menuId: 1,  
25 - grade: '1',  
26 - title: '身のまわりの物質'  
27 - }, {  
28 - menuId: 2,  
29 - grade: '1',  
30 - title: '電流とその利用(1)'  
31 - }, {  
32 - menuId: 3,  
33 - grade: '1',  
34 - title: '電流とその利用(2)'  
35 - }, {  
36 - menuId: 4,  
37 - grade: '1',  
38 - title: '化学変化と原子・分子(1)'  
39 - }, {  
40 - menuId: 5,  
41 - grade: '1',  
42 - title: '化学変化と原子・分子(2)'  
43 - }, {  
44 - menuId: 6,  
45 - grade: '1',  
46 - title: '植物の生活と種類'  
47 - }, {  
48 - menuId: 7,  
49 - grade: '1',  
50 - title: '大地の変化'  
51 - }];  
52 - 19 +var menu = [
  20 +{
  21 + menuId: 0,
  22 + grade: '1',
  23 + title: '模擬試験第1回'
  24 +} ,
  25 +{
  26 + menuId: 1,
  27 + grade: '1',
  28 + title: '模擬試験第2回'
  29 +} ,
  30 +{
  31 + menuId: 2,
  32 + grade: '1',
  33 + title: '模擬試験第3回'
  34 +} ,
  35 +{
  36 + menuId: 3,
  37 + grade: '1',
  38 + title: '模擬試験第4回'
  39 +} ,
  40 +{
  41 + menuId: 4,
  42 + grade: '1',
  43 + title: '模擬試験第5回'
  44 +} ,
  45 +{
  46 + menuId: 5,
  47 + grade: '1',
  48 + title: '模擬試験第6回'
  49 +} ,
  50 +{
  51 + menuId: 6,
  52 + grade: '1',
  53 + title: '模擬試験第7回'
  54 +} ,
  55 +{
  56 + menuId: 7,
  57 + grade: '1',
  58 + title: '模擬試験第8回'
  59 +} ,
  60 +{
  61 + menuId: 8,
  62 + grade: '1',
  63 + title: '模擬試験第9回'
  64 +} ,
  65 +{
  66 + menuId: 9,
  67 + grade: '1',
  68 + title: '模擬試験第10回'
  69 +} ,
  70 +];
53 return menu; 71 return menu;
54 } 72 }
55 73
This diff could not be displayed because it is too large.
@@ -15,257 +15,209 @@ export class ContentsUnit { @@ -15,257 +15,209 @@ export class ContentsUnit {
15 } 15 }
16 16
17 private createUnit(): Unit[] { 17 private createUnit(): Unit[] {
18 - var unit = [{  
19 - menuId: 0,  
20 - unitId: 0,  
21 - level: '1',  
22 - unitName: '光の反射'  
23 - }, {  
24 - menuId: 0,  
25 - unitId: 1,  
26 - level: '1',  
27 - unitName: '光の屈折'  
28 - }, {  
29 - menuId: 0,  
30 - unitId: 2,  
31 - level: '1',  
32 - unitName: '凸レンズと像'  
33 - }, {  
34 - menuId: 0,  
35 - unitId: 3,  
36 - level: '1',  
37 - unitName: '音の性質と速さ'  
38 - }, {  
39 - menuId: 0,  
40 - unitId: 4,  
41 - level: '1',  
42 - unitName: '力とばねののび'  
43 - }, {  
44 - menuId: 0,  
45 - unitId: 5,  
46 - level: '1',  
47 - unitName: '圧力・浮力'  
48 - }, {  
49 - menuId: 1,  
50 - unitId: 0,  
51 - level: '2',  
52 - unitName: '物質の性質'  
53 - }, {  
54 - menuId: 1,  
55 - unitId: 1,  
56 - level: '2',  
57 - unitName: '物質の状態変化'  
58 - }, {  
59 - menuId: 1,  
60 - unitId: 2,  
61 - level: '2',  
62 - unitName: '気体の性質'  
63 - }, {  
64 - menuId: 1,  
65 - unitId: 3,  
66 - level: '2',  
67 - unitName: '融点と沸点'  
68 - }, {  
69 - menuId: 1,  
70 - unitId: 4,  
71 - level: '2',  
72 - unitName: '水溶液の性質'  
73 - }, {  
74 - menuId: 1,  
75 - unitId: 5,  
76 - level: '2',  
77 - unitName: '水溶液の濃度'  
78 - }, {  
79 - menuId: 1,  
80 - unitId: 6,  
81 - level: '2',  
82 - unitName: '溶解度'  
83 - }, {  
84 - menuId: 2,  
85 - unitId: 0,  
86 - level: '3',  
87 - unitName: '回路'  
88 - }, {  
89 - menuId: 2,  
90 - unitId: 1,  
91 - level: '3',  
92 - unitName: '直列回路と電流・電圧'  
93 - }, {  
94 - menuId: 2,  
95 - unitId: 2,  
96 - level: '3',  
97 - unitName: '並列回路と電流・電圧'  
98 - }, {  
99 - menuId: 2,  
100 - unitId: 3,  
101 - level: '3',  
102 - unitName: '電流と電圧の関係'  
103 - }, {  
104 - menuId: 2,  
105 - unitId: 4,  
106 - level: '3',  
107 - unitName: '全体の抵抗'  
108 - }, {  
109 - menuId: 2,  
110 - unitId: 5,  
111 - level: '3',  
112 - unitName: '電力量・電流による発熱'  
113 - }, {  
114 - menuId: 2,  
115 - unitId: 6,  
116 - level: '3',  
117 - unitName: '静電気・電流の正体'  
118 - }, {  
119 - menuId: 3,  
120 - unitId: 0,  
121 - level: '3',  
122 - unitName: '磁石の磁界'  
123 - }, {  
124 - menuId: 3,  
125 - unitId: 1,  
126 - level: '3',  
127 - unitName: '電流(導線)のまわりの磁界'  
128 - }, {  
129 - menuId: 3,  
130 - unitId: 2,  
131 - level: '3',  
132 - unitName: 'コイルのまわりの磁界'  
133 - }, {  
134 - menuId: 3,  
135 - unitId: 3,  
136 - level: '3',  
137 - unitName: '電流が磁界から受ける力'  
138 - }, {  
139 - menuId: 3,  
140 - unitId: 4,  
141 - level: '3',  
142 - unitName: '電磁誘導'  
143 - }, {  
144 - menuId: 3,  
145 - unitId: 5,  
146 - level: '3',  
147 - unitName: '直流と交流'  
148 - }, {  
149 - menuId: 4,  
150 - unitId: 0,  
151 - level: '3',  
152 - unitName: '分解'  
153 - }, {  
154 - menuId: 4,  
155 - unitId: 1,  
156 - level: '3',  
157 - unitName: '水の電気分解'  
158 - }, {  
159 - menuId: 4,  
160 - unitId: 2,  
161 - level: '3',  
162 - unitName: '原子と分子'  
163 - }, {  
164 - menuId: 4,  
165 - unitId: 3,  
166 - level: '3',  
167 - unitName: '化合・化学式'  
168 - }, {  
169 - menuId: 4,  
170 - unitId: 4,  
171 - level: '3',  
172 - unitName: '化学反応式'  
173 - }, {  
174 - menuId: 5,  
175 - unitId: 0,  
176 - level: '3',  
177 - unitName: '酸化'  
178 - }, {  
179 - menuId: 5,  
180 - unitId: 1,  
181 - level: '3',  
182 - unitName: '還元'  
183 - }, {  
184 - menuId: 5,  
185 - unitId: 2,  
186 - level: '3',  
187 - unitName: '化学変化の前後の質量'  
188 - }, {  
189 - menuId: 5,  
190 - unitId: 3,  
191 - level: '3',  
192 - unitName: '質量保存の法則'  
193 - }, {  
194 - menuId: 5,  
195 - unitId: 4,  
196 - level: '3',  
197 - unitName: '金属と化合する酸素の質量'  
198 - }, {  
199 - menuId: 5,  
200 - unitId: 5,  
201 - level: '3',  
202 - unitName: '化合する物質の質量の割合'  
203 - }, {  
204 - menuId: 5,  
205 - unitId: 6,  
206 - level: '3',  
207 - unitName: '化学変化と熱'  
208 - }, {  
209 - menuId: 6,  
210 - unitId: 0,  
211 - level: '3',  
212 - unitName: '身近な生物の観察'  
213 - }, {  
214 - menuId: 6,  
215 - unitId: 1,  
216 - level: '3',  
217 - unitName: '水中の小さな生物と顕微鏡'  
218 - }, {  
219 - menuId: 6,  
220 - unitId: 2,  
221 - level: '3',  
222 - unitName: '花のつくり'  
223 - }, {  
224 - menuId: 6,  
225 - unitId: 3,  
226 - level: '3',  
227 - unitName: '根・茎・葉のつくり'  
228 - }, {  
229 - menuId: 6,  
230 - unitId: 4,  
231 - level: '3',  
232 - unitName: '光合成と呼吸'  
233 - }, {  
234 - menuId: 6,  
235 - unitId: 5,  
236 - level: '3',  
237 - unitName: '植物のなかま'  
238 - }, {  
239 - menuId: 7,  
240 - unitId: 0,  
241 - level: '3',  
242 - unitName: '地層のでき方'  
243 - }, {  
244 - menuId: 7,  
245 - unitId: 1,  
246 - level: '3',  
247 - unitName: '堆積岩と化石'  
248 - }, {  
249 - menuId: 7,  
250 - unitId: 2,  
251 - level: '3',  
252 - unitName: '火山とマグマ'  
253 - }, {  
254 - menuId: 7,  
255 - unitId: 3,  
256 - level: '3',  
257 - unitName: '火成岩と鉱物'  
258 - }, {  
259 - menuId: 7,  
260 - unitId: 4,  
261 - level: '3',  
262 - unitName: '地震のゆれと伝わり方'  
263 - }, {  
264 - menuId: 7,  
265 - unitId: 5,  
266 - level: '3',  
267 - unitName: '震度とマグニチュード、地震の原因、地層の変形'  
268 - }]; 18 +var unit = [
  19 +{
  20 + menuId: 0,
  21 + unitId: 0,
  22 + level: '1',
  23 + unitName: '必要とされる資質(理論)'
  24 +},{
  25 + menuId: 0,
  26 + unitId: 1,
  27 + level: '1',
  28 + unitName: '企業実務(理論)'
  29 +},{
  30 + menuId: 0,
  31 + unitId: 2,
  32 + level: '1',
  33 + unitName: '対人関係(実技)'
  34 +},{
  35 + menuId: 0,
  36 + unitId: 3,
  37 + level: '1',
  38 + unitName: '技能(実技)'
  39 +},{
  40 + menuId: 1,
  41 + unitId: 0,
  42 + level: '1',
  43 + unitName: '必要とされる資質(理論)'
  44 +},{
  45 + menuId: 1,
  46 + unitId: 1,
  47 + level: '1',
  48 + unitName: '企業実務(理論)'
  49 +},{
  50 + menuId: 1,
  51 + unitId: 2,
  52 + level: '1',
  53 + unitName: '対人関係(実技)'
  54 +},{
  55 + menuId: 1,
  56 + unitId: 3,
  57 + level: '1',
  58 + unitName: '技能(実技)'
  59 +},{
  60 + menuId: 2,
  61 + unitId: 0,
  62 + level: '1',
  63 + unitName: '必要とされる資質(理論)'
  64 +},{
  65 + menuId: 2,
  66 + unitId: 1,
  67 + level: '1',
  68 + unitName: '企業実務(理論)'
  69 +},{
  70 + menuId: 2,
  71 + unitId: 2,
  72 + level: '1',
  73 + unitName: '対人関係(実技)'
  74 +},{
  75 + menuId: 2,
  76 + unitId: 3,
  77 + level: '1',
  78 + unitName: '技能(実技)'
  79 +},{
  80 + menuId: 3,
  81 + unitId: 0,
  82 + level: '1',
  83 + unitName: '必要とされる資質(理論)'
  84 +},{
  85 + menuId: 3,
  86 + unitId: 1,
  87 + level: '1',
  88 + unitName: '企業実務(理論)'
  89 +},{
  90 + menuId: 3,
  91 + unitId: 2,
  92 + level: '1',
  93 + unitName: '対人関係(実技)'
  94 +},{
  95 + menuId: 3,
  96 + unitId: 3,
  97 + level: '1',
  98 + unitName: '技能(実技)'
  99 +},{
  100 + menuId: 4,
  101 + unitId: 0,
  102 + level: '1',
  103 + unitName: '必要とされる資質(理論)'
  104 +},{
  105 + menuId: 4,
  106 + unitId: 1,
  107 + level: '1',
  108 + unitName: '企業実務(理論)'
  109 +},{
  110 + menuId: 4,
  111 + unitId: 2,
  112 + level: '1',
  113 + unitName: '対人関係(実技)'
  114 +},{
  115 + menuId: 4,
  116 + unitId: 3,
  117 + level: '1',
  118 + unitName: '技能(実技)'
  119 +},{
  120 + menuId: 5,
  121 + unitId: 0,
  122 + level: '1',
  123 + unitName: '必要とされる資質(理論)'
  124 +},{
  125 + menuId: 5,
  126 + unitId: 1,
  127 + level: '1',
  128 + unitName: '企業実務(理論)'
  129 +},{
  130 + menuId: 5,
  131 + unitId: 2,
  132 + level: '1',
  133 + unitName: '対人関係(実技)'
  134 +},{
  135 + menuId: 5,
  136 + unitId: 3,
  137 + level: '1',
  138 + unitName: '技能(実技)'
  139 +},{
  140 + menuId: 6,
  141 + unitId: 0,
  142 + level: '1',
  143 + unitName: '必要とされる資質(理論)'
  144 +},{
  145 + menuId: 6,
  146 + unitId: 1,
  147 + level: '1',
  148 + unitName: '企業実務(理論)'
  149 +},{
  150 + menuId: 6,
  151 + unitId: 2,
  152 + level: '1',
  153 + unitName: '対人関係(実技)'
  154 +},{
  155 + menuId: 6,
  156 + unitId: 3,
  157 + level: '1',
  158 + unitName: '技能(実技)'
  159 +},{
  160 + menuId: 7,
  161 + unitId: 0,
  162 + level: '1',
  163 + unitName: '必要とされる資質(理論)'
  164 +},{
  165 + menuId: 7,
  166 + unitId: 1,
  167 + level: '1',
  168 + unitName: '企業実務(理論)'
  169 +},{
  170 + menuId: 7,
  171 + unitId: 2,
  172 + level: '1',
  173 + unitName: '対人関係(実技)'
  174 +},{
  175 + menuId: 7,
  176 + unitId: 3,
  177 + level: '1',
  178 + unitName: '技能(実技)'
  179 +},{
  180 + menuId: 8,
  181 + unitId: 0,
  182 + level: '1',
  183 + unitName: '必要とされる資質(理論)'
  184 +},{
  185 + menuId: 8,
  186 + unitId: 1,
  187 + level: '1',
  188 + unitName: '企業実務(理論)'
  189 +},{
  190 + menuId: 8,
  191 + unitId: 2,
  192 + level: '1',
  193 + unitName: '対人関係(実技)'
  194 +},{
  195 + menuId: 8,
  196 + unitId: 3,
  197 + level: '1',
  198 + unitName: '技能(実技)'
  199 +},{
  200 + menuId: 9,
  201 + unitId: 0,
  202 + level: '1',
  203 + unitName: '必要とされる資質(理論)'
  204 +},{
  205 + menuId: 9,
  206 + unitId: 1,
  207 + level: '1',
  208 + unitName: '企業実務(理論)'
  209 +},{
  210 + menuId: 9,
  211 + unitId: 2,
  212 + level: '1',
  213 + unitName: '対人関係(実技)'
  214 +},{
  215 + menuId: 9,
  216 + unitId: 3,
  217 + level: '1',
  218 + unitName: '技能(実技)'
  219 +}];
  220 +
269 return unit; 221 return unit;
270 } 222 }
271 223
@@ -93,6 +93,16 @@ export class DataService { @@ -93,6 +93,16 @@ export class DataService {
93 return num; 93 return num;
94 } 94 }
95 95
  96 + public getUnitQaCnt(menuId:number,unitId:number): number {
  97 + var num = 0;
  98 + for (var i = 0; i < this.subject.length; i++) {
  99 + if ((this.subject[i].menuId === menuId) && (this.subject[i].unitId == unitId)) {
  100 + num++;
  101 + }
  102 + }
  103 + return num;
  104 + }
  105 +
96 public getQa(menuId: number, unitId: number): Qa[] { 106 public getQa(menuId: number, unitId: number): Qa[] {
97 var qaItem: Qa[] = new Array(); 107 var qaItem: Qa[] = new Array();
98 for (var i = 0; i < this.subject.length; i++) { 108 for (var i = 0; i < this.subject.length; i++) {
@@ -132,34 +142,8 @@ export class DataService { @@ -132,34 +142,8 @@ export class DataService {
132 return qaItem; 142 return qaItem;
133 } 143 }
134 144
135 - public saveDone(key: string) {  
136 - this.st.get(key).then(val => {  
137 - if (val == "done") {  
138 - } else {  
139 - this.st.set(key, "done");  
140 - }  
141 - });  
142 - }  
143 -  
144 public saveInfo(key: string, value: string) { 145 public saveInfo(key: string, value: string) {
145 - this.st.get(key).then(val => {  
146 - if (val == null) {  
147 - this.st.set(key, value);  
148 - } else {  
149 - var svdata = val.toString().split(":");  
150 - var nwdata = value.split(":");  
151 - if(+svdata[0] < +nwdata[0])  
152 - {  
153 - this.st.set(key, value);  
154 - }  
155 - }  
156 - });  
157 - }  
158 -  
159 - public savePositiveInfo(key: string, value: string) {  
160 - this.st.get(key).then(val => {  
161 - this.st.set(key, value);  
162 - }); 146 + this.st.set(key, value);
163 } 147 }
164 148
165 public getInfo(key: string): any { 149 public getInfo(key: string): any {
1 -export interface  ChartData { 1 +export class  ChartData {
2 data: number[]; 2 data: number[];
3 label: string; 3 label: string;
4 backgroundColor: string[]; 4 backgroundColor: string[];
1 -export interface Menu { 1 +export class Menu {
2 menuId: number; 2 menuId: number;
3 grade: string; 3 grade: string;
4 title: string; 4 title: string;
1 -export interface Qa { 1 +export class Qa {
2 menuId: number; 2 menuId: number;
3 unitId: number; 3 unitId: number;
4 qaId: number; 4 qaId: number;
  1 +export class QaInfo {
  2 + challengeCnt: number;
  3 + positiveFlg: number;
  4 + positiveFlg_now: number;
  5 + isDone: number;
  6 + answer: number;
  7 +}
1 -export interface Unit { 1 +export class Unit {
2 menuId: number; 2 menuId: number;
3 unitId: number; 3 unitId: number;
4 level: string; 4 level: string;
Please register or login to post a comment