Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-ces
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
wisdom-ces
Commits
e47f4bdd
Commit
e47f4bdd
authored
Apr 08, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载附件
parent
680b51fc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
29 deletions
+52
-29
config.xml
config.xml
+1
-1
learning-do.html
src/pages/home/learning/learning-do/learning-do.html
+2
-2
learning-do.scss
src/pages/home/learning/learning-do/learning-do.scss
+3
-2
learning-do.ts
src/pages/home/learning/learning-do/learning-do.ts
+9
-9
review-learn.html
src/pages/home/learning/review-learn/review-learn.html
+10
-14
review-learn.ts
src/pages/home/learning/review-learn/review-learn.ts
+11
-1
common.service.ts
src/service/common.service.ts
+16
-0
No files found.
config.xml
View file @
e47f4bdd
<?xml version='1.0' encoding='utf-8'?>
<widget
id=
"io.ionic.smart19.starter.test"
version=
"4.0.
3
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<widget
id=
"io.ionic.smart19.starter.test"
version=
"4.0.
4
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<name>
党建云平台(测试)
</name>
<description>
An awesome Ionic/Cordova app.
</description>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
...
...
src/pages/home/learning/learning-do/learning-do.html
View file @
e47f4bdd
...
...
@@ -61,14 +61,14 @@
<ng-container
*
ngIf=
"item.questionType == 4"
>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answer
"
[
name
]="
item
.
question
QueId
"
value=
"A
"
type=
"radio"
>
<input
[(
ngModel
)]="
item
.
answer
"
[
name
]="
item
.
question
Id
"
value=
"1
"
type=
"radio"
>
<span
class=
" selectIndex"
>
A
</span>
是
</label>
</p>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answer
"
[
name
]="
item
.
question
QueId
"
value=
"B
"
type=
"radio"
>
<input
[(
ngModel
)]="
item
.
answer
"
[
name
]="
item
.
question
Id
"
value=
"0
"
type=
"radio"
>
<span
class=
" selectIndex"
>
B
</span>
否
</label>
...
...
src/pages/home/learning/learning-do/learning-do.scss
View file @
e47f4bdd
...
...
@@ -38,8 +38,9 @@ page-learning-do {
font-size
:
1
.6rem
;
div
{
p
{
margin-bottom
:
.8rem
;
margin-left
:
.8rem
;
margin-bottom
:
1rem
;
margin-left
:
1rem
;
line-height
:
1
.5rem
;
}
}
}
...
...
src/pages/home/learning/learning-do/learning-do.ts
View file @
e47f4bdd
...
...
@@ -31,9 +31,9 @@ export class LearningDoPage {
public
toastCtrl
:
ToastController
,
public
appService
:
AppService
,
public
datePipe
:
DatePipe
)
{
}
ionViewDidLoad
(){
this
.
navbar
.
backButtonClick
=
()
=>
{
this
.
appService
.
alert
(
"是否退出当前测试,中途退出直接交卷?"
),
()
=>
{
ionViewDidLoad
()
{
this
.
navbar
.
backButtonClick
=
()
=>
{
this
.
appService
.
alert
(
"是否退出当前测试,中途退出直接交卷?"
),
()
=>
{
this
.
submit
();
}
};
...
...
@@ -101,7 +101,7 @@ export class LearningDoPage {
//下一题
next
()
{
if
(
this
.
index
==
this
.
list
.
length
-
1
)
{
if
(
this
.
index
==
this
.
list
.
length
-
1
)
{
const
toast
=
this
.
toastCtrl
.
create
(
message
);
toast
.
setMessage
(
'已经是最后一题了哦'
);
toast
.
present
();
...
...
@@ -112,7 +112,7 @@ export class LearningDoPage {
}
//左划右划
slideChanged
(){
slideChanged
()
{
this
.
index
=
this
.
slides
.
getActiveIndex
();
}
...
...
@@ -154,9 +154,9 @@ export class LearningDoPage {
submit
()
{
const
data
=
{
listMap
:
this
.
list
.
map
(
e
=>
{
if
(
e
.
answer
.
length
>
1
)
{
if
(
e
.
answer
.
length
>
1
&&
e
.
questionType
==
2
)
{
e
.
answer
=
e
.
answer
.
substr
(
0
,
e
.
answer
.
length
-
1
);
e
.
answer
=
e
.
answer
.
split
(
";"
).
sort
();
e
.
answer
=
e
.
answer
.
split
(
";"
).
sort
()
.
join
(
";"
)
;
}
const
d
=
{
questionId
:
e
.
questionId
,
...
...
@@ -171,12 +171,12 @@ export class LearningDoPage {
this
.
learnSer
.
submitPaper
(
data
).
subscribe
(
(
res
)
=>
{
this
.
commonSer
.
toast
(
"提交成功"
);
if
(
this
.
type
==
'reset'
)
{
if
(
this
.
type
==
'reset'
)
{
this
.
navCtrl
.
push
(
"ReviewResultPage"
,
{
result
:
res
.
data
,
title
:
this
.
title
})
}
else
{
}
else
{
this
.
navCtrl
.
push
(
"LearningResultPage"
,
{
testId
:
this
.
testId
,
title
:
this
.
title
...
...
src/pages/home/learning/review-learn/review-learn.html
View file @
e47f4bdd
...
...
@@ -67,20 +67,16 @@
</ng-container>
<!--判断题-->
<ng-container
*
ngIf=
"item.questionType == 4"
>
<p>
<label>
<input
disabled
[(
ngModel
)]="
item
.
answer
"
[
name
]="
item
.
questionQueId
"
value=
"A"
type=
"radio"
>
<span
class=
" selectIndex"
>
A
</span>
是
</label>
</p>
<p>
<label>
<input
disabled
[(
ngModel
)]="
item
.
answer
"
[
name
]="
item
.
questionQueId
"
value=
"B"
type=
"radio"
>
<span
class=
" selectIndex"
>
B
</span>
否
</label>
</p>
<ng-container
*
ngFor=
" let option4 of item.options;let opindex4 = index;"
>
<p>
<label>
<input
disabled
[(
ngModel
)]="
item
.
answer
"
[
name
]="
item
.
questionId
"
value=
"A"
type=
"radio"
>
<span
class=
"selectIndex"
[
ngClass
]="{'
select-right
'
:
option4
.
answer =
=
'
right
',
'
select-error
'
:option4
.
answer =
=
'
error
'}"
>
{{option4.option}}
</span>
{{option4.comment}}
</label>
</p>
</ng-container>
</ng-container>
<!--问答-->
<ng-container
*
ngIf=
"item.questionType == 5"
>
...
...
src/pages/home/learning/review-learn/review-learn.ts
View file @
e47f4bdd
...
...
@@ -32,7 +32,15 @@ export class ReviewLearnPage {
(
res
)
=>
{
this
.
list
=
res
.
data
;
this
.
list
.
forEach
(
e
=>
{
if
(
e
.
questionType
==
1
||
e
.
questionType
==
2
){
if
(
e
.
questionType
==
4
){
e
.
options
=
[
{
option
:
'A'
,
comment
:
'是'
},
{
option
:
'B'
,
comment
:
'否'
},
];
e
.
myAnswer
=
e
.
myAnswer
==
'1'
?
'A'
:
'B'
;
e
.
correctAnswer
=
e
.
correctAnswer
==
'1'
?
'A'
:
'B'
;
}
if
(
e
.
questionType
==
1
||
e
.
questionType
==
2
||
e
.
questionType
==
4
){
e
.
options
.
forEach
(
s
=>
{
if
(
e
.
correctAnswer
.
includes
(
s
.
option
)){
s
.
answer
=
'right'
;
...
...
@@ -44,6 +52,8 @@ export class ReviewLearnPage {
})
}
})
console
.
log
(
this
.
list
)
}
)
}
...
...
src/service/common.service.ts
View file @
e47f4bdd
...
...
@@ -81,4 +81,19 @@ export class CommonService{
alert
.
present
();
}
}
/**
* 下载文件
* @param url 文件URL
*/
downloadFile
(
title
,
data
:
Response
)
{
const
blob
=
new
Blob
([
data
],
{
type
:
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;"
});
const
url
=
window
.
URL
.
createObjectURL
(
blob
);
let
link
=
document
.
createElement
(
"a"
);
link
.
setAttribute
(
"href"
,
url
);
link
.
setAttribute
(
"download"
,
title
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
document
.
body
.
removeChild
(
link
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment