'update'
[qomet.git] / public / javascripts / course.js
index 65b6ab7..781424a 100644 (file)
@@ -1,4 +1,5 @@
 /*Draft format (compiled to json)
+ * TODO: separate questions and answers in Evaluation object
 
 <some html question (or/+ exercise intro)>
 
                + choix 3
                - choix4
 
-               <another sub sub>
+               <another sub sub> with params interpolation £ (tout simplement)
+               / params: javascript parameter generator (another function, body only)
                * answer 2 (which can
                be on
                several lines)
 
 <Some second question>
 * With answer
-*/
+
+       dans le cas de parametetrized, answer est une fonction javascript !! qui prend en arg le(s) param(s)
+       coté serveur on stock parameterized question + body func
+       une fois côté client, extra work first to 1) execute each func 2) replace (and store!!!) all params
+https://stackoverflow.com/questions/7650071/is-there-a-way-to-create-a-function-from-a-string-with-javascript
+
+       */
 
 new Vue({
        el: '#course',
        data: {
-               display: "evaluations", //or "students", or "grades" (admin mode)
+               display: "evaluations", //or "students" (in admin mode)
                course: course,
                monitorPwd: "",
                newEvaluation: { name: "" },
@@ -36,23 +44,8 @@ new Vue({
                questionsText: "", //questions in an evaluation, in text format
        },
        mounted: function() {
-               
-               
-               
-               $('.modal').each( (i,elem) => {
-                       if (elem.id != "evaluationEdit")
-                               $(elem).modal();
-               });
-               $('ul.tabs').tabs(); //--> migrate to grade.js
-               
-               
-               
-               $('#evaluationEdit').modal({
-                       complete: () => {
-                               this.parseEvaluation();
-                               Vue.nextTick(statementsLibsRefresh);
-                       },
-               });
+               $('.modal').modal();
+               Materialize.updateTextFields(); //textareas, time field...
        },
        methods: {
                // GENERAL:
@@ -137,10 +130,6 @@ new Vue({
                                }
                        );
                },
-               materialOpenModal: function(id) {
-                       $("#" + id).modal("open");
-                       Materialize.updateTextFields(); //textareas, time field...
-               },
                updateEvaluation: function() {
                        $.ajax("/evaluations", {
                                method: "PUT",