Code Monkey home page Code Monkey logo

dotfiles's People

Contributors

1e0ng avatar alal avatar clashthebunny avatar fastfm avatar ibayer avatar rcarmo avatar sontek avatar yann2192 avatar

Watchers

 avatar  avatar

dotfiles's Issues

org-drill save history

Summary

Org-Drill is an extension for Org mode. Org-Drill uses a spaced repetition algorithm to conduct interactive "drill sessions", using org files as sources of facts to be memorised. I want to track the progress made for each drill session by saving some counts together with a timestamp to a seperate file drill-stats.csv.

This is a simple example how to save a timestamp after each drill session.

  (setq my-drill-stats-file "/tmp/drill-stats.csv")

  (defun my-save-final-report ()
    (write-region (format "%s\n" (current-time-string))
        nil my-drill-stats-file 'append))
     
  (advice-add 'org-drill-final-report :before 'my-save-final-report)

This is an example file that contains org-drill drawers.

* first                                                               :drill:
  SCHEDULED: <2017-05-14 So>
  :PROPERTIES:
  :ID:       4e74e88d-b9c2-4c7e-b8a2-db3369d563b6
  :DRILL_LAST_INTERVAL: 4.14
  :DRILL_REPEATS_SINCE_FAIL: 2
  :DRILL_TOTAL_REPEATS: 1
  :DRILL_FAILURE_COUNT: 0
  :DRILL_AVERAGE_QUALITY: 5.0
  :DRILL_EASE: 2.6
  :DRILL_LAST_QUALITY: 5
  :DRILL_LAST_REVIEWED: [2017-05-10 Mi 22:59]
  :END:
 question
** result
   bla
* first 2                                                             :drill:
  SCHEDULED: <2017-05-14 So>
  :PROPERTIES:
  :ID:       a39f420f-a1f4-4350-af63-828423472df1
  :DRILL_LAST_INTERVAL: 3.86
  :DRILL_REPEATS_SINCE_FAIL: 2
  :DRILL_TOTAL_REPEATS: 1
  :DRILL_FAILURE_COUNT: 0
  :DRILL_AVERAGE_QUALITY: 3.0
  :DRILL_EASE: 2.36
  :DRILL_LAST_QUALITY: 3
  :DRILL_LAST_REVIEWED: [2017-05-10 Mi 22:59]
  :END:
  question
** result
   bla

The problem I want to solve is to extend the function my-save-final-report (see above and https://github.com/ibayer/dotfiles/blob/emacs/_emacs.d/lisp/init-org.el#L387) to append the count for each possible DRILL_LAST_QUALITY (0:5) to the file drill-stats.csv for each entry with the :drill: tag.
The correct entry for the example given above would be:

drill-stats.csv (only values 3 and 5 are in the file)

Wed May 10 22:59:40 2017, 0, 0, 0, 1, 0, 1

I would appreciate any ideas on how to solve this task.

References that might be useful:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.