<commit_before>function initTask() {
   var difficulty;
   var intervalId = -1;
   var side = 6;
   var instructions = [
      "Prends le crayon rouge", 
      "Prends le crayon noir",   
      "Avance d'une case",    
      "Avance de 2 cases",  
      "Avance de 3 cases",  
      "Tourne à gauche",
      "Tourne à droite"
      ];
   var solution;
   var targetColors;
   var maxSequenceLength = 12;
   var drawing1;
   var drawing2;
   var curSimulation;
   var dragAndDrop;
   var instructionDefs;
   var width = 440;
   var height = 300;
   var widthLabel = 180;
   var heightLabel = (height - 16) / maxSequenceLength;
   var simulationSpeeds = { easy: 400, hard: 300 };
   var simulationSpeed; 
   var paper;
   var states = {
      initial: 0,
      animating: 1,
      stopped: 2 };
   var state = states.initial;

   task.load = function(views, callback) {
      platform.getTaskParams(null, null, function(taskParams) {
         difficulty = taskParams.options.difficulty ? taskParams.options.difficulty : "hard";
         // LATER: vérifier que difficulty est easy ou hard
         solution = task.solutions[difficulty];
         simulationSpeed = simulationSpeeds[difficulty];

         var dimension1 = 150;
         drawing1 = buildGrid("drawing1", dimension1);
         var solSimulation = simulateAll(solution);
         updateGrid(drawing1, solSimulation.colors);
         targetColors = solSimulation.colors;

         var dimension2 = 200;
         drawing2 = buildGrid("drawing2", dimension2);
         var robotSize = 15;
         drawing2.robot = drawing2.paper.image("robot.png", 0, 0, robotSize, robotSize);
         drawing2.robot.size = robotSize;

         buildInstructions();
         clearDisplay();

         if (views.solution) {
            $.each(task.solutions[difficulty], function(iStep, iInstr) {
              $("#textSolution").append("<li>" + instructions[iInstr] + "</li>");
            });
         }

         if (taskParams.showSolutionOnLoad == 1) {
            task.reloadAnswer(JSON.stringify(solution), callback);
            return;
         } 
         
         callback();
      };
   };

   var getInstructionObject = function(iInstr) {
      var label = paper.rect(-widthLabel/2, -heightLabel/2, widthLabel, heightLabel, heightLabel/5)
                      .attr({'fill': '#E0E0F8'});
      var text = paper.text(0, 0, instructions[iInstr])
                      .attr({'font-size' : 15, 'font-weight' : 'bold'});
      $(text.node).css({<commit_msg>fix missing )<commit_after>function initTask() {
   var difficulty;
   var intervalId = -1;
   var side = 6;
   var instructions = [
      "Prends le crayon rouge", 
      "Prends le crayon noir",   
      "Avance d'une case",    
      "Avance de 2 cases",  
      "Avance de 3 cases",  
      "Tourne à gauche",
      "Tourne à droite"
      ];
   var solution;
   var targetColors;
   var maxSequenceLength = 12;
   var drawing1;
   var drawing2;
   var curSimulation;
   var dragAndDrop;
   var instructionDefs;
   var width = 440;
   var height = 300;
   var widthLabel = 180;
   var heightLabel = (height - 16) / maxSequenceLength;
   var simulationSpeeds = { easy: 400, hard: 300 };
   var simulationSpeed; 
   var paper;
   var states = {
      initial: 0,
      animating: 1,
      stopped: 2 };
   var state = states.initial;

   task.load = function(views, callback) {
      platform.getTaskParams(null, null, function(taskParams) {
         difficulty = taskParams.options.difficulty ? taskParams.options.difficulty : "hard";
         // LATER: vérifier que difficulty est easy ou hard
         solution = task.solutions[difficulty];
         simulationSpeed = simulationSpeeds[difficulty];

         var dimension1 = 150;
         drawing1 = buildGrid("drawing1", dimension1);
         var solSimulation = simulateAll(solution);
         updateGrid(drawing1, solSimulation.colors);
         targetColors = solSimulation.colors;

         var dimension2 = 200;
         drawing2 = buildGrid("drawing2", dimension2);
         var robotSize = 15;
         drawing2.robot = drawing2.paper.image("robot.png", 0, 0, robotSize, robotSize);
         drawing2.robot.size = robotSize;

         buildInstructions();
         clearDisplay();

         if (views.solution) {
            $.each(task.solutions[difficulty], function(iStep, iInstr) {
              $("#textSolution").append("<li>" + instructions[iInstr] + "</li>");
            });
         }

         if (taskParams.showSolutionOnLoad == 1) {
            task.reloadAnswer(JSON.stringify(solution), callback);
            return;
         } 
         
         callback();
      });
   };

   var getInstructionObject = function(iInstr) {
      var label = paper.rect(-widthLabel/2, -heightLabel/2, widthLabel, heightLabel, heightLabel/5)
                      .attr({'fill': '#E0E0F8'});
      var text = paper.text(0, 0, instructions[iInstr])
                      .attr({'font-size' : 15, 'font-weight' : 'bold'});
      $(text.node).css({
{'fraction_non_alphanumeric': 0.11839744867450668, 'fraction_numerical': 0.02431732110823201, 'mean_word_length': 2.252106286454958, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1863673', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1478, 'n_words': 361}