Commit 85018f98 authored by liujiaxin's avatar liujiaxin

jm 12

parent 232b08da
...@@ -284,7 +284,14 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -284,7 +284,14 @@ export class PlayComponent implements OnInit, OnDestroy {
reportUserJson(json: any) { reportUserJson(json: any) {
// @ts-ignore // @ts-ignore
// window.courseware.sendAnswer(json); // window.courseware.sendAnswer(json);
window.parent.postMessage({ action: 'temp_send_result', data: JSON.stringify(json), key: this.saveKey}, '*'); const s = 100 / json.questions.length;
let score = 0;
json.questions.forEach(q => {
if (q.questionAnswer === q.userAnswer) {
score += s;
}
});
window.parent.postMessage({ action: 'temp_send_result', score, data: JSON.stringify(json), key: this.saveKey}, '*');
} }
submitPress = (event) => { submitPress = (event) => {
event.stopPropagation(); event.stopPropagation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment