Gitlab CSE Unil

index.html 9.96 KB
Newer Older
M. Chardon's avatar
M. Chardon committed
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>@lea</title>
        <meta name="author" content="Marion CHARDON for ESC/RISET - University of Lausanne" />
        <meta name="description" content="Free Web tool for guess data" />
        <meta name="keywords" content="Cipher, Bigdata, Guess" />
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="../node_modules/bootstrap3/dist/css/bootstrap.min.css" /> 
        <link rel="stylesheet" href="css/dashboard.css" />
        <link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" />
        <link rel="stylesheet" href="../css/logo_unil.css" />
        <link rel="stylesheet" href="../css/main.css" />
        <script src="../node_modules/jquery/dist/jquery.min.js"></script>
        <script src="../node_modules/bootstrap3/dist/js/bootstrap.min.js"></script>
        <script src="js/crypto/asmcrypto.js"></script>
        <script src="js/controleur.js"></script>
        <script src="js/entities/global.js"></script>
        <script src="js/entities/modeleTwo.js"></script>
        <script src="js/entities/modeleThree.js"></script>
        <script src="js/entities/modeleFour.js"></script>
        <script src="js/entities/modeleMaskEight.js"></script>
        <script src="js/entities/resultat.js"></script>
        <script src="js/graph/d3.v4.min.js"></script>
        <script src="js/graph.js"></script>        
        <script src="../js/jquery.i18n/libs/CLDRPluralRuleParser/src/CLDRPluralRuleParser.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.messagestore.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.fallbacks.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.parser.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.emitter.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.language.js"></script>
        <script src="js/languages.js"></script>
    </head>
    <body>
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="../index.html"><img src="../img/g3761.png" alt="" style="height:28px;display: inline;"/>Cryptex - @lea</a>
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li><a onclick="initLang('en');"><img style="background: white; height:25px;" alt="English" src="../img/flags/english.png"/></a></li>
                        <li><a onclick="initLang('fr');"><img style="background: white;height:25px;" alt="Français" src="../img/flags/french.png"/></a></li>
                        <li><a href="help.html">Help</a></li>
                    </ul>
                </div>
            </div>
        </nav> 
        <div class="container" style="margin-bottom: 70px; margin-top: 20px;">
            <div class="row">
                <div class="col-sm-3">
                    <ul class="nav nav-pills nav-stacked">
                        <li class="active"><a href="index.html">Step 1: test your sequence</a></li>
                        <li><a href="pasapas.html">Step 2: test the computeur</a></li>
                        <li><a href="understand.html">Step 3: understand</a></li>
                        <li><a href="games.html">Game</a></li>
                    </ul>
                </div>
                <div class="col-sm-9" style="padding-left: 20px;">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="alert alert-info alert-dismissable">
                                <strong>Info!</strong>
                                <p>
                                    Write by hand a sequence of 100 one and zero and transcribe
                                    them into the box below. The computer will record the
                                    first ten numbers and use them to predict the next number.
                                    Correct guess will be put in blue, wrong one in orange.
                                </p>
                            </div>

                            Insert your sequence and valid.
                            <div class="row" style="padding-bottom: 10px;padding-top: 10px;">
                                <div class="col-sm-10">
                                    <button class="btn btn-default" onclick="reset();">Reset</button>
                                    <button class="btn btn-success" onclick="valide();$(this).hide();">Valid</button>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <textarea class="form-control" id="userinput" style="font-size: large;"></textarea>
                                    <div id="userinputdiv" style="width: 100%;"></div>
                                </div>
                            </div>

                            <div id='propositionPanel' style="display:none;padding-top: 20px;">
                                <div class="row">
                                    <div class="col-sm-12">
                                        <ul>
                                            <li><span style="color:orange;">Orange: wrong guess</span></li>
                                            <li><span style="color:blue;">Blue: right guess</span></li>
                                        </ul>
                                        <div class="panel panel-primary">
                                            <div class="panel-heading">Percent correct answers</div>
                                            <div class="panel-body">
                                                <div class="row">
                                                    <div class="col-sm-6">
                                                        Total of right guesses:
                                                        <input class="form-control" readonly="readonly" id="guessValueCorrect" />
                                                    </div>
                                                    <div class="col-sm-6">
                                                        About the last 10 results:
                                                        <input class="form-control" readonly="readonly" id="guessValueCorrect10" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="alert alert-warning alert-dismissable" style="margin-top: 50px;">
                                <p>
                                    Form more info see <a href="help.html">Help</a>.
                                </p>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div id="contacts" class="modal fade" role="dialog"></div>
        <div id="credits" class="modal fade" role="dialog"></div>
        <footer class="footer"></footer>

        <script>

            var controleur = new Controleur("brute");

            function insertVal(val) {
                $("#userinput").val($("#userinput").val() + val);
                controleur.registerVal(val);
                var res = controleur.guestNextValue();
                if (res) {
                    $("#guessValue").val(res.valeur);
                    var controlelastValue = controleur.getControlelastValue();
                    if (controlelastValue !== null) {
                        if (controlelastValue > 0)
                            $('#userinputdiv').append('<span style="color:blue;">' + val + '</span> ');
                        else
                            $('#userinputdiv').append('<span style="color:orange;">' + val + '</span> ');
                    }
                }
                controleur.majIndices();
                $("#propositionPanel").show();
            }

            function valide() {
                var suiteTotal = $("#userinput").val();
                $("#userinput").hide();
                for (var i = 0; i < suiteTotal.length; i++) {
                    if (i === delaiRentention) {
                        $("#userinputdiv").html("");
                        for (var j = 0; j < controleur.suite.length; j++) {
                            $("#userinputdiv").append(controleur.suite[j] + " ");
                        }
                    }
                    insertVal(suiteTotal[i]);
                }
            }

            function reset() {
                controleur.resetApi();
                $("input").each(function () {
                    $(this).val("");
                });
                $("textarea").each(function () {
                    $(this).val("");
                });
                $("#propositionPanel").hide();
                $("#userinput").show();
                $("#userinputdiv").html("");
                $("button").show();
            }
        </script>

        <script src="../js/main.js"></script>

    </body>
</html>