<commit_before>/**
* Module that contains support for TRAKLA2-type exercises.
* Depends on core.js, anim.js, datastructures.js
*/
(function($) {
  if (typeof JSAV === "undefined") { return; }
  
  var Exercise = function(jsav, options) {
    this.jsav = jsav;
    this.options = jQuery.extend({}, options, {});
  };
  var exerproto = Exercise.prototype;
  exerproto.grade = function() {
    // behavior in a nutshell:
    // 1. get the student's solution
    // 2. get the model answer
    // 3. get the selector for the structures to compare
    // 4. rewind both
    // 5. compare the states in the visualizations
    // 6. scale the points
    // 7. show result to student
    // 8. show comparison of own and model side by side (??)
  };
  exerproto.modelanswer = function() {
    var model = this.options.model;
    if ($.isFunction(model)) {
      // behavior in a nutshell:
      // 1. create a new JSAV (and the HTML required for it)
      var modelav = undefined;
      // 2. run the model function on it
      model(modelav);
    } else if (typeof model === "string") {
      // if a string, assume it is a URL of an AV
      // behavior in a nutshell:
      // 1. complete the URL with initial data configuration as query params
      // 2. open a new window for the model answer
    }
  };
  exerproto.reset = function() {};
  
  JSAV.ext.exercise = function(options) {
    return new Exercise(this, options);
    // options:
    //  - model: specify how the model answer is generated (function or URL as a string)
    //  - pointScale: single number for max points OR array of min and max range OR
    //                a function that is given the correct states and total states
  };
})();<commit_msg>Small improvements<commit_after>/**
* Module that contains support for TRAKLA2-type exercises.
* Depends on core.js, anim.js, datastructures.js
*/
(function($) {
  if (typeof JSAV === "undefined") { return; }
  
  var Exercise = function(jsav, options) {
    this.jsav = jsav;
    this.options = jQuery.extend({}, {reset: function() { }}, options);
    this.reset = this.options.reset;
  };
  var exerproto = Exercise.prototype;
  exerproto.grade = function() {
    // behavior in a nutshell:
    // 1. get the student's solution
    // 2. get the model answer
    // 3. get the selector for the structures to compare
    // 4. rewind both
    // 5. compare the states in the visualizations
    // 6. scale the points
    // 7. show result to student
    // 8. show comparison of own and model side by side (??)
  };
  exerproto.modelanswer = function() {
    var model = this.options.model;
    if ($.isFunction(model)) {
      // behavior in a nutshell:
      // 1. create a new JSAV (and the HTML required for it)
      var modelav = new JSAV();
      console.log(modelav);
      // 2. run the model function on it
      model(modelav);
    } else if (typeof model === "string") {
      // if a string, assume it is a URL of an AV
      // behavior in a nutshell:
      // 1. complete the URL with initial data configuration as query params
      // 2. open a new window for the model answer
    }
  };
  exerproto.reset = function() {};
  
  JSAV.ext.exercise = function(options) {
    return new Exercise(this, options);
    // options:
    //  - model: specify how the model answer is generated (function or URL as a string)
    //  - pointScale: single number for max points OR array of min and max range OR
    //                a function that is given the correct states and total states
  };
})(jQuery);
{'fraction_non_alphanumeric': 0.11274787535410764, 'fraction_numerical': 0.0073654390934844195, 'mean_word_length': 2.362857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3255398', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1022, 'n_words': 420}