<commit_before>#
# TODO: Move to service
#
update_task_stats = (student, new_stats_str) ->
  for i, value of new_stats_str.split("|")
    if i < student.task_stats.length
      student.task_stats[i].value = Math.round(100 * value)
    else
      student.progress_stats[i - student.task_stats.length].value = 100 * value
  student.progress_sort = 0
  for i, stat of student.progress_stats
    student.progress_sort = Math.round(student.progress_sort + stat.value * 1000000 / (Math.pow(100, i)))

angular.module('doubtfire.units.partials.contexts', ['doubtfire.units.partials.modals'])

.filter('startFrom', ->
  (input, start) ->
    start = +start # parse to int
    if input
      input.slice(start)
    else
      input
)
#
# Student Unit Tasks
# - display the tasks associated with a student in a unit<commit_msg>fix rounding on progress stats<commit_after>#
# TODO: Move to service
#
update_task_stats = (student, new_stats_str) ->
  for i, value of new_stats_str.split("|")
    if i < student.task_stats.length
      student.task_stats[i].value = Math.round(100 * value)
    else
      student.progress_stats[i - student.task_stats.length].value = Math.round(100 * value)
  student.progress_sort = 0
  for i, stat of student.progress_stats
    student.progress_sort = Math.round(student.progress_sort + stat.value * 1000000 / (Math.pow(100, i)))

angular.module('doubtfire.units.partials.contexts', ['doubtfire.units.partials.modals'])

.filter('startFrom', ->
  (input, start) ->
    start = +start # parse to int
    if input
      input.slice(start)
    else
      input
)
#
# Student Unit Tasks
# - display the tasks associated with a student in a unit
{'fraction_non_alphanumeric': 0.12221553281155931, 'fraction_numerical': 0.020469596628537028, 'mean_word_length': 3.591160220994475, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4328910', 'n_tokens_mistral': 566, 'n_tokens_neox': 535, 'n_words': 133}