forked from rhcad/geogebra_euclid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0.js
48 lines (43 loc) · 1.17 KB
/
0.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import "euclid.js";
function ggbOnInit() {
euclidInit('newObjectListener');
$('#tasks li span').hide();
if (ggbUtil.getNickname()) {
$('.visible-notuser').hide();
}
}
function newObjectListener(obj) {
var base = euclidNewObjectListener(obj, {levelName: 'tutorial'});
if (!base) {
return;
}
base.checkObject('ray1', 0.5, 0);
base.checkObject('circle1', -1, 0);
base.checkObject('circle2', 0.5, 0);
base.checkObject('intersect1', 0.5, 0);
base.checkSegment('segment1', 0.5, 0);
var step = base.drawn('segment1') + base.drawn('ray1') +
base.drawn('circle1') + base.drawn('circle2') + base.drawn('intersect1');
if (step > 0 && step < 5) {
Command('progress = ' + (20 * step));
}
base.levelCompleted(step === 5, 4);
if (step === 5) {
Command('Complete2 = Text["点击绿色框进入第一关。", ' + AbsPos('0.15', '-0.35') + ']');
}
if (base.drawn('ray1')) {
$('#ray').show();
}
if (base.drawn('circle1')) {
$('#circle1').show();
}
if (base.drawn('circle2')) {
$('#circle2').show();
}
if (base.drawn('intersect1')) {
$('#point').show();
}
if (base.drawn('segment1')) {
$('#segment').show();
}
}