Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-10 Thread Eric S Fraga
On Friday,  7 Aug 2015 at 16:41, Pip Cet wrote:

[...]

> Headline properties are simply about setting properties in the
> headline: no properties drawer, potentially nicer syntax (I'm
> currently using :property=value: to emphasize that properties behave

Interesting possible extension to org tags syntax... it would probably
break existing files in some cases but it would be quite nice for the
OP's initial requirement for viewing grades...

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.1-34-gb911f1



Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-07 Thread Pip Cet
I hesitate to share this code (it's not very pretty right now), but I
have been working on two ideas that I think combine to solve problems
like this in a nicer (and lazier) fashion than the current approach:
headline properties and reverse inheritance.

Headline properties are simply about setting properties in the
headline: no properties drawer, potentially nicer syntax (I'm
currently using :property=value: to emphasize that properties behave
like tags, but I'm thinking of moving to [property: value] (I'm
worried about collisions with other org syntax, but since this would
be effective only at the end of a headline, I think the only collision
is with footnotes, and the solution to that is "don't have a property
called FN")), and easier transition from tags to properties and back.
The problem, of course, is what happens when you try to set more than
one short property in a headline.

This is where the second idea comes in: reverse inheritance. *if* all
of a headline's children agree on what a property's value should be,
it's as though the property were specified in the master headline. In
particular, if there's only one child headline that sets a property,
it automatically migrates up a level:

* John Smith
** :email=johnsm...@example.com:

would migrate up the "email" property to apply to the top-level
headline, so columns view would look something like this:

ITEM | EMAIL |
* John Smith | johnsm...@example.com | 

(this example doesn't quite work yet in practice, with my current code).

If there are two conflicting values for a property, the property is
not set. This is so

* Students
** John Smith
*** email :email=johnsm...@example.com:
** Jane Miller
*** email :email=janemil...@example.org:

doesn't set an email property for the "Students" line (if there's just
one student, with just one email address, there's probably no harm in
having that property set for the Students line. Also, in that case,
you have an attendance problem.)

In combination, the syntax I currently have in mind would allow you to
set properties one at a time in sub-headlines of your data item:

* Chemicals
** water
*** [smiles: O]
According to Wikipedia.
*** [molarmass: 18.01528]
Also according to Wikipedia.
*** [safety: GRAS]
I think.

(Notice how that gives you a well-defined place to put comments and
footnotes, which I imagine is useful if you need to have citable
references for your properties. I think you can currently place such
comments in the PROPERTIES drawer, but then they probably won't be
exported.)

What if the master headline already sets the property? There are two
cases here: in case it's set to an ordinary value, the child headlines
are ignored. But if it's set to a special value signifying that a
"compactor" function is to be used, that function is called to produce
the property value for the headline based on the child nodes. In the
simplest case, that means the property is set to something like
"mean(^)" (again, that syntax is likely to change to something
prettier), and the result of

* calculate this for me :v=mean(^):
** 3 :v=3:
** 4 :v=4:
** 6 :v=6:

is as though you'd written

* calculate this for me :v=4.:
and so on

(It's possible to do something very much like this with the columns
property; I'm not claiming it's a new feature.)

Ordinary inheritance, reverse inheritance, and compaction can be combined:

#+COLUMNS: %ITEM %8GRADE %TAGS
* Document
** defaults
*** default to compacting with the arithmetic mean function :grade=mean(^):
*** student grades
 1999
* John Smith
** test paper 1 :grade=3:
** test paper 2 :grade=4:

will work, and with column mode produce the output attached as
students2.org.html. Note that "3.5" is John Smith's grade, the average
of all students' grades in 1999, and the average grade averaged over
all years. I've attached a more complete example as
students.org/students.org.html that demonstrates how the mean is
calculated.

I think people can imagine what the columns view would be with some of
the sub-headline levels hidden, but I'd like to point out both that it
does give you a really nice list of students with their grades and
that there's a potential problem with missing tests: there's no
default to a grade of 0 for them, so you have to be careful when
entering them to distinguish between a 0-graded missed test and a test
that's simply ignored for the average grade.

Currently the code for calculating the reverse inheritance is working,
but really slow (it doesn't cache calculations at all, so it's
probably something like O(n^3)); I don't have special code for
displaying the results yet, but columns mode followed by
org-htmlize-buffer produced the attached HTML files. At this point,
this is just to demonstrate the ideas; while I think the two ideas in
combination apply well to the student-grade problem set, I've actually
implemented them for use in a literate programming major mode.

I'd appreciate any comments (but I know the code isn't particularly
cle

Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Richard Lawrence
Hi Matt and all,

Matt Price  writes:

> On Thu, Aug 6, 2015 at 9:13 AM, John Kitchin 
> wrote:
>
>> How do you enter your grade? I use a function, bound to a convenient key
>> like s-s g, which sets the grade property. You could have that function
>> change the heading TODO state to DONE so you know it is done, and maybe
>> add a tag with the grade, or just append the grade on the end of the
>> headline.

> Adding the grade as a tag doesn't seem quite right, as I often change
> grades after a rewrite.  I'd need to get rid of the original tag.

Here's another idea for getting the grade into the headline: set the
grade as a priority, like

** [#A] John Doe

Pros: it's a simple hack that doesn't require you to do any additional
parsing; it's easy to change up or down either interactively or
programmatically (cf. org-priority* functions); and it's easy to sort
headlines by priority in a custom agenda view, to give you a quick
overall picture of your grade distribution.

Cons: this would only work for A/B/C/D/F grades, and even then, it
doesn't represent +/- variants.  So it's not very flexible or granular,
but it might be enough.  

Best,
Richard

P.S. Like others, I too have written my own grading system:

https://github.com/wyleyr/schoolutils

It stores grades and student data in a SQLite database, and allows you
to write end-of-term grade calculations in Python, instead of messing
with spreadsheets. (Overkill? Maybe so... :)

It currently only has a command line interface, but I have been thinking
about adding an Org interface that would do basic CRUD operations on
grades via Babel.  If anyone is interested in such a thing, let me
know...




Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread John Kitchin
You could do something with overlays like this:

#+BEGIN_SRC emacs-lisp
(require 'ov)

(org-map-entries
 (lambda ()
   (when (org-entry-get (point) "GRADE")
 (setq ov (make-overlay (+ 0 (line-end-position))
(+ 1 (line-end-position
 (overlay-put
  ov 'display
  (format  " grade: %s\n" (org-entry-get (point) "GRADE"))
#+END_SRC

#+RESULTS:
| nil | grade: 10\n | grade: 20\n | grade: 30\n | nil | grade: 40\n | grade: 
50\n | grade: 60\n |

#+BEGIN_SRC emacs-lisp
(ov-clear)
#+END_SRC


you need to run this to refresh the grades on the headlines when they
change. The TODO state is a good indication of which ones are done,
although they do not show the grades.


Eric S Fraga writes:

> On Thursday,  6 Aug 2015 at 07:24, Matt Price wrote:
>
> [...]
>
>> - I currently store my grades as properties of level-2 headlines. However,
>> I would really like to be able to see the grades when the headline is
>> folded, so I can have a quick visual sense of how many papers I've marked,
>
> I would like something like this as well.  The nearest I have found is
> to use column view.

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Matt Price
On Thu, Aug 6, 2015 at 10:06 AM, John Kitchin 
wrote:

> You could do something with overlays like this:
>
> #+BEGIN_SRC emacs-lisp
> (require 'ov)
>
> (org-map-entries
>  (lambda ()
>(when (org-entry-get (point) "GRADE")
>  (setq ov (make-overlay (+ 0 (line-end-position))
> (+ 1 (line-end-position
>  (overlay-put
>   ov 'display
>   (format  " grade: %s\n" (org-entry-get (point) "GRADE"))
> #+END_SRC
>
> #+RESULTS:
> | nil | grade: 10\n | grade: 20\n | grade: 30\n | nil | grade: 40\n |
> grade: 50\n | grade: 60\n |
>
> #+BEGIN_SRC emacs-lisp
> (ov-clear)
> #+END_SRC
>
>
>
The final \n in the overlay is a little irritating when the buffer is
folded, as it adds an extra line between the headlines.  I changed it this,
which doesn't seem perfect but so far works for me:

#+BEGIN_SRC emacs-lisp :results output
  (require 'ov)

  (org-map-entries
   (lambda ()
 (when (org-entry-get (point) "GRADE")
   (setq ov (make-overlay (- (line-end-position) 1)
  (+ 0 (line-end-position
   (setq character (buffer-substring (- (line-end-position) 1)
(line-end-position)))
   (overlay-put
ov 'display
(format  "%s  GRADE: %s" character (org-entry-get (point)
"GRADE"))
#+END_SRC

you need to run this to refresh the grades on the headlines when they
> change. The TODO state is a good indication of which ones are done,
> although they do not show the grades.
>

so I should probably make this into a function which can be called by the
function that writes grades...

>
>
> Eric S Fraga writes:
>
> > On Thursday,  6 Aug 2015 at 07:24, Matt Price wrote:
> >
> > [...]
> >
> >> - I currently store my grades as properties of level-2 headlines.
> However,
> >> I would really like to be able to see the grades when the headline is
> >> folded, so I can have a quick visual sense of how many papers I've
> marked,
> >
> > I would like something like this as well.  The nearest I have found is
> > to use column view.
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>


Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread John Kitchin

Matt Price writes:

> This is fantastic, but it turns out my use case is a little more complex
> than I thought & I've now bnaged my head against it for a hwile, might as
> well ask you for help!
>
> I have non-assignment level-1 headlines in my comments.org files:
>
> * Introduction
> let me explain how this system works... and here is some code to generate
> the grading templates
>
> * Assignment 1
> ** Student 1
> ** Student 2
> * Assignment 2
> ** Student 1
> ** Student 2
>
> ...etc.
>
You can limit the scope of org-map-entries to headlines that are tagged
or that have properties like this:

;; get assignments
(let ((org-use-tag-inheritance nil))
  (org-map-entries
   (lambda ()
 (add-to-list 'assignments (nth 4 (org-heading-components)) t))
   "assignment"))

;; get student names as list of cons cells
(let ((org-use-property-inheritance nil))
  (org-map-entries
   (lambda ()
 (add-to-list 'students (cons (nth 4 (org-heading-components)) '()) t))
 "MAIL_TO={edu}"))

here you rely on a headline being tagged an assignment, and a student
having a MAIL_TO property that has edu in it, and the level of each
headline is irrelevant now.

> Solution: add a tag to Assignment headlines :ASSIGNMENT and search that
> way:
>
>   (setq assignments '())
>   (setq students '())
>
>   ;; get assignments
>   (org-map-entries
>(lambda ()
>  (when  (member "ASSIGNMENT" (org-get-tags-at (point) 'local)) ;; (= 1
> (nth 0 (org-heading-components)))
>(add-to-list 'assignments (nth 4 (org-heading-components)) t
>
>
> But there are also level-2 headings that shouldn't be added to the student
> list, and I have trouble with that part:
>
>  (org-map-entries
>(lambda ()
>  (when (member "ASSIGNMENT" (org-element-property :tags
> (org-element-lineage (org-element-at-point) 'headline)))
>(add-to-list 'students (cons  (nth 4 (org-heading-components)) '())
> t
>
> does not work, for instance; nor does:
>
> (org-map-entries
>(lambda ()
>  (when (member "ASSIGNMENT" (org-get-tags-at (save-excursion
> (org-up-heading-safe)) 'local))
>(add-to-list 'students (cons  (nth 4 (org-heading-components)) '())
> t
>
> What's the best way to check the tags of the parents of a headline from
> withing org-map-entries?
>
> On Thu, Aug 6, 2015 at 9:52 AM, John Kitchin 
> wrote:
>
>> This gets you pretty close to what you want. I changed some grades to
>> make it easier to see it is doing the right thing.
>>
>> #+BEGIN_SRC emacs-lisp
>> (setq assignments '())
>> (setq students '())
>>
>> ;; get assignments
>> (org-map-entries
>>  (lambda ()
>>(when (= 1 (nth 0 (org-heading-components)))
>>  (add-to-list 'assignments (nth 4 (org-heading-components)) t
>>
>> ;; get student names as list of cons cells
>> (org-map-entries
>>  (lambda ()
>>(when (= 2 (nth 0 (org-heading-components)))
>>  (add-to-list 'students (cons  (nth 4 (org-heading-components)) '())
>> t
>>
>>
>> ;;loop over entries
>> (dolist (assignment assignments)
>>   (save-excursion
>> ;; jump to assignment
>> (org-open-link-from-string (format "[[*%s]]" assignment))
>> ;; map over entries
>> (org-map-entries
>>  (lambda ()
>>(let* ((student (car (assoc (nth 4 (org-heading-components))
>> students
>>  (when student
>>(setf (cdr (assoc student students))
>>  (append (cdr (assoc student students))
>>  (list (org-entry-get (point) "GRADE")))
>>  nil 'tree)))
>>
>> (setq gradebook
>>   (append (list  (append '("Student") assignments)
>>  'hline)
>>   students))
>>
>> (orgtbl-to-csv gradebook nil)
>> #+END_SRC
>>
>> #+RESULTS:
>> : Student,Definition,Darwin
>> : Student One,10,40
>> : Student Two,20,50
>> : Student Three,30,60
>>
>>
>>
>> Matt Price writes:
>>
>> > Hello eveyrone!
>> >
>> > I know the big guns are all working on last-minute 8.3 bugs (thank you!).
>> >
>> > I am hoping to get some guidance before heading off on vacation.  I have
>> > switched over to doing all grading for my courses in org.  My workflow:
>> >
>> > - export a csv file containing student names.
>> > - generate grading templates for each student, for each assignment
>> > - email comments back to students
>> > - enter marks in an official spreadsheet which can be used for final
>> grade
>> > submission
>> >
>> > A sample  "Comments.org" is at the bottom of this email (it was a little
>> > long).
>> >
>> > So, here are my questions:
>> >
>> > - I currently store my grades as properties of level-2 headlines.
>> However,
>> > I would really like to be able to see the grades when the headline is
>> > folded, so I can have a quick visual sense of how many papers I've
>> marked,
>> > how well the students are doing, and so forth.  THe best would be to be
>> > able to see the actual marks in the headlines; but if I could, say,
>> adjust
>> > the color of the healdine based on the property value, that would 

Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Matt Price
This is fantastic, but it turns out my use case is a little more complex
than I thought & I've now bnaged my head against it for a hwile, might as
well ask you for help!

I have non-assignment level-1 headlines in my comments.org files:

* Introduction
let me explain how this system works... and here is some code to generate
the grading templates

* Assignment 1
** Student 1
** Student 2
* Assignment 2
** Student 1
** Student 2

...etc.

Solution: add a tag to Assignment headlines :ASSIGNMENT and search that
way:

  (setq assignments '())
  (setq students '())

  ;; get assignments
  (org-map-entries
   (lambda ()
 (when  (member "ASSIGNMENT" (org-get-tags-at (point) 'local)) ;; (= 1
(nth 0 (org-heading-components)))
   (add-to-list 'assignments (nth 4 (org-heading-components)) t


But there are also level-2 headings that shouldn't be added to the student
list, and I have trouble with that part:

 (org-map-entries
   (lambda ()
 (when (member "ASSIGNMENT" (org-element-property :tags
(org-element-lineage (org-element-at-point) 'headline)))
   (add-to-list 'students (cons  (nth 4 (org-heading-components)) '())
t

does not work, for instance; nor does:

(org-map-entries
   (lambda ()
 (when (member "ASSIGNMENT" (org-get-tags-at (save-excursion
(org-up-heading-safe)) 'local))
   (add-to-list 'students (cons  (nth 4 (org-heading-components)) '())
t

What's the best way to check the tags of the parents of a headline from
withing org-map-entries?

On Thu, Aug 6, 2015 at 9:52 AM, John Kitchin 
wrote:

> This gets you pretty close to what you want. I changed some grades to
> make it easier to see it is doing the right thing.
>
> #+BEGIN_SRC emacs-lisp
> (setq assignments '())
> (setq students '())
>
> ;; get assignments
> (org-map-entries
>  (lambda ()
>(when (= 1 (nth 0 (org-heading-components)))
>  (add-to-list 'assignments (nth 4 (org-heading-components)) t
>
> ;; get student names as list of cons cells
> (org-map-entries
>  (lambda ()
>(when (= 2 (nth 0 (org-heading-components)))
>  (add-to-list 'students (cons  (nth 4 (org-heading-components)) '())
> t
>
>
> ;;loop over entries
> (dolist (assignment assignments)
>   (save-excursion
> ;; jump to assignment
> (org-open-link-from-string (format "[[*%s]]" assignment))
> ;; map over entries
> (org-map-entries
>  (lambda ()
>(let* ((student (car (assoc (nth 4 (org-heading-components))
> students
>  (when student
>(setf (cdr (assoc student students))
>  (append (cdr (assoc student students))
>  (list (org-entry-get (point) "GRADE")))
>  nil 'tree)))
>
> (setq gradebook
>   (append (list  (append '("Student") assignments)
>  'hline)
>   students))
>
> (orgtbl-to-csv gradebook nil)
> #+END_SRC
>
> #+RESULTS:
> : Student,Definition,Darwin
> : Student One,10,40
> : Student Two,20,50
> : Student Three,30,60
>
>
>
> Matt Price writes:
>
> > Hello eveyrone!
> >
> > I know the big guns are all working on last-minute 8.3 bugs (thank you!).
> >
> > I am hoping to get some guidance before heading off on vacation.  I have
> > switched over to doing all grading for my courses in org.  My workflow:
> >
> > - export a csv file containing student names.
> > - generate grading templates for each student, for each assignment
> > - email comments back to students
> > - enter marks in an official spreadsheet which can be used for final
> grade
> > submission
> >
> > A sample  "Comments.org" is at the bottom of this email (it was a little
> > long).
> >
> > So, here are my questions:
> >
> > - I currently store my grades as properties of level-2 headlines.
> However,
> > I would really like to be able to see the grades when the headline is
> > folded, so I can have a quick visual sense of how many papers I've
> marked,
> > how well the students are doing, and so forth.  THe best would be to be
> > able to see the actual marks in the headlines; but if I could, say,
> adjust
> > the color of the healdine based on the property value, that would be cool
> > too.
> >
> > - It seems silly to record the grades once in org, and then again in a
> > libreoffice spreadsheet.  Better would be to generate a table and/or csv
> > spreadsheet directly from the headlines and property values.  So, the
> > example below would give the table:
> > | Student   | Definition | Darwin |
> > | Student One   |  0 |  0 |
> > | Student Two   |  0 |  0 |
> > | Student Three |  0 | 0  |
> >
> > and from there I guess I could generate a CSV just with org-table-export.
> >
> > Had anyone done either of these tasks before? Any guidance on how to do
> > it?
> >
> > Thanks as always,
> > Matt
> >
> > --
> > * Definition
> > ** TODO Student One
> > :PROPERTIES:
> > :GRADE:0
> > :MAIL_TO:  student@utoronto.edu
> > :MAIL_CC:  matt.pr...@utoronto.c

Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Matt Price
I'm reading through gb-grade and grade.el, I see you do something
interesting with rubrics, could you provide a link to a syllabus document
with example rubrics?

On Thu, Aug 6, 2015 at 10:19 AM, John Kitchin 
wrote:

> All my gradebook related stuff is here:
> https://github.com/jkitchin/jmax/tree/master/techela, and there is a lot
> of it ;)
>
> I have a whole ecosystem built around using git through emacs and
> org-mode with my students, which at this point even I find complex!
>
> For grading, I grade directly in the student's turned in org-file using
> functions from here
> https://github.com/jkitchin/jmax/blob/master/techela/techela-grade.el. I
> define a minor-mode with a keymap to make grade entry, commenting,
> etc... relatively easy for me. The grades are weighted by different
> categories, and saved as a filetag (not a property). I tend to put one
> problem per file so the grade is just for the one problem, and assign
> 2-3 of these per week.
>
> For gradebook stuff, most of it is here:
> https://github.com/jkitchin/jmax/blob/master/techela/techela-gradebook.el
>
> The grades are stored in the student org-files which I return to them. I
> lookup all the assignments from the syllabus, and then map over the
> org-files for each student for each assignment getting the grades out.
>
> I will be using it again this fall, so /maybe/ the documentation will
> even improve ;)
>
> Matt Price writes:
>
> > On Thu, Aug 6, 2015 at 9:13 AM, John Kitchin 
> > wrote:
> >
> >> How do you enter your grade? I use a function, bound to a convenient key
> >> like s-s g, which sets the grade property. You could have that function
> >> change the heading TODO state to DONE so you know it is done, and maybe
> >> add a tag with the grade, or just append the grade on the end of the
> >> headline.
> >>
> >
> > I just set the grade with "C- C-x p GRADE", too slow!  I would love to
> see
> > your function though I can doubtless at least write THAT myself. Yeas,
> then
> > having that same function change the todo state (to "READY" in my case
> -- I
> > change to "DONE when I email out the comments), would make a lot of
> sense.
> >
> > Adding the grade as a tag doesn't seem quite right, as I often change
> > grades after a rewrite.  I'd need to get rid of the original tag.  Adding
> > to the headline might work, but I'd have to change some of my existing
> > functions which use the headline value as a proxy for the student name.
> > Could definitely be done.
>
> see previous email about using overlays
>
> >
> >>
> >> I also use a function that runs org-map-entries and constructs a
> >> temporary gradebook as an org-table in a new buffer.
> >>
> >
> > please please show us? Thank you!
> >
> >
> >
> >>
> >> Eric S Fraga writes:
> >>
> >> > On Thursday,  6 Aug 2015 at 07:24, Matt Price wrote:
> >> >
> >> > [...]
> >> >
> >> >> - I currently store my grades as properties of level-2 headlines.
> >> However,
> >> >> I would really like to be able to see the grades when the headline is
> >> >> folded, so I can have a quick visual sense of how many papers I've
> >> marked,
> >> >
> >> > I would like something like this as well.  The nearest I have found is
> >> > to use column view.
> >>
> >> --
> >> Professor John Kitchin
> >> Doherty Hall A207F
> >> Department of Chemical Engineering
> >> Carnegie Mellon University
> >> Pittsburgh, PA 15213
> >> 412-268-7803
> >> @johnkitchin
> >> http://kitchingroup.cheme.cmu.edu
> >>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>


Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread John Kitchin
Here is an example syllabus:
https://github.com/jkitchin/f15-06625/blob/master/syllabus.org

I probably misuse the word rubric a bit, it means an assignment grade is
determined by a few components, e.g. technical (70%) and presentation (30%)
which are given full letter grades independently, and a weighted average is
computed for the overall grade.

Some rubric definitions are listed here:

https://github.com/jkitchin/jmax/blob/master/techela/techela-admin.el#L49

The gb-grade function just prompts me for each grade and then computes the
weighted average.


John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Thu, Aug 6, 2015 at 12:39 PM, Matt Price  wrote:

> I'm reading through gb-grade and grade.el, I see you do something
> interesting with rubrics, could you provide a link to a syllabus document
> with example rubrics?
>
> On Thu, Aug 6, 2015 at 10:19 AM, John Kitchin 
> wrote:
>
>> All my gradebook related stuff is here:
>> https://github.com/jkitchin/jmax/tree/master/techela, and there is a lot
>> of it ;)
>>
>> I have a whole ecosystem built around using git through emacs and
>> org-mode with my students, which at this point even I find complex!
>>
>> For grading, I grade directly in the student's turned in org-file using
>> functions from here
>> https://github.com/jkitchin/jmax/blob/master/techela/techela-grade.el. I
>> define a minor-mode with a keymap to make grade entry, commenting,
>> etc... relatively easy for me. The grades are weighted by different
>> categories, and saved as a filetag (not a property). I tend to put one
>> problem per file so the grade is just for the one problem, and assign
>> 2-3 of these per week.
>>
>> For gradebook stuff, most of it is here:
>> https://github.com/jkitchin/jmax/blob/master/techela/techela-gradebook.el
>>
>> The grades are stored in the student org-files which I return to them. I
>> lookup all the assignments from the syllabus, and then map over the
>> org-files for each student for each assignment getting the grades out.
>>
>> I will be using it again this fall, so /maybe/ the documentation will
>> even improve ;)
>>
>> Matt Price writes:
>>
>> > On Thu, Aug 6, 2015 at 9:13 AM, John Kitchin 
>> > wrote:
>> >
>> >> How do you enter your grade? I use a function, bound to a convenient
>> key
>> >> like s-s g, which sets the grade property. You could have that function
>> >> change the heading TODO state to DONE so you know it is done, and maybe
>> >> add a tag with the grade, or just append the grade on the end of the
>> >> headline.
>> >>
>> >
>> > I just set the grade with "C- C-x p GRADE", too slow!  I would love to
>> see
>> > your function though I can doubtless at least write THAT myself. Yeas,
>> then
>> > having that same function change the todo state (to "READY" in my case
>> -- I
>> > change to "DONE when I email out the comments), would make a lot of
>> sense.
>> >
>> > Adding the grade as a tag doesn't seem quite right, as I often change
>> > grades after a rewrite.  I'd need to get rid of the original tag.
>> Adding
>> > to the headline might work, but I'd have to change some of my existing
>> > functions which use the headline value as a proxy for the student name.
>> > Could definitely be done.
>>
>> see previous email about using overlays
>>
>> >
>> >>
>> >> I also use a function that runs org-map-entries and constructs a
>> >> temporary gradebook as an org-table in a new buffer.
>> >>
>> >
>> > please please show us? Thank you!
>> >
>> >
>> >
>> >>
>> >> Eric S Fraga writes:
>> >>
>> >> > On Thursday,  6 Aug 2015 at 07:24, Matt Price wrote:
>> >> >
>> >> > [...]
>> >> >
>> >> >> - I currently store my grades as properties of level-2 headlines.
>> >> However,
>> >> >> I would really like to be able to see the grades when the headline
>> is
>> >> >> folded, so I can have a quick visual sense of how many papers I've
>> >> marked,
>> >> >
>> >> > I would like something like this as well.  The nearest I have found
>> is
>> >> > to use column view.
>> >>
>> >> --
>> >> Professor John Kitchin
>> >> Doherty Hall A207F
>> >> Department of Chemical Engineering
>> >> Carnegie Mellon University
>> >> Pittsburgh, PA 15213
>> >> 412-268-7803
>> >> @johnkitchin
>> >> http://kitchingroup.cheme.cmu.edu
>> >>
>>
>> --
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>
>


Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread John Kitchin
All my gradebook related stuff is here:
https://github.com/jkitchin/jmax/tree/master/techela, and there is a lot
of it ;)

I have a whole ecosystem built around using git through emacs and
org-mode with my students, which at this point even I find complex!

For grading, I grade directly in the student's turned in org-file using
functions from here
https://github.com/jkitchin/jmax/blob/master/techela/techela-grade.el. I
define a minor-mode with a keymap to make grade entry, commenting,
etc... relatively easy for me. The grades are weighted by different
categories, and saved as a filetag (not a property). I tend to put one
problem per file so the grade is just for the one problem, and assign
2-3 of these per week.

For gradebook stuff, most of it is here:
https://github.com/jkitchin/jmax/blob/master/techela/techela-gradebook.el

The grades are stored in the student org-files which I return to them. I
lookup all the assignments from the syllabus, and then map over the
org-files for each student for each assignment getting the grades out.

I will be using it again this fall, so /maybe/ the documentation will
even improve ;)

Matt Price writes:

> On Thu, Aug 6, 2015 at 9:13 AM, John Kitchin 
> wrote:
>
>> How do you enter your grade? I use a function, bound to a convenient key
>> like s-s g, which sets the grade property. You could have that function
>> change the heading TODO state to DONE so you know it is done, and maybe
>> add a tag with the grade, or just append the grade on the end of the
>> headline.
>>
>
> I just set the grade with "C- C-x p GRADE", too slow!  I would love to see
> your function though I can doubtless at least write THAT myself. Yeas, then
> having that same function change the todo state (to "READY" in my case -- I
> change to "DONE when I email out the comments), would make a lot of sense.
>
> Adding the grade as a tag doesn't seem quite right, as I often change
> grades after a rewrite.  I'd need to get rid of the original tag.  Adding
> to the headline might work, but I'd have to change some of my existing
> functions which use the headline value as a proxy for the student name.
> Could definitely be done.

see previous email about using overlays

>
>>
>> I also use a function that runs org-map-entries and constructs a
>> temporary gradebook as an org-table in a new buffer.
>>
>
> please please show us? Thank you!
>
>
>
>>
>> Eric S Fraga writes:
>>
>> > On Thursday,  6 Aug 2015 at 07:24, Matt Price wrote:
>> >
>> > [...]
>> >
>> >> - I currently store my grades as properties of level-2 headlines.
>> However,
>> >> I would really like to be able to see the grades when the headline is
>> >> folded, so I can have a quick visual sense of how many papers I've
>> marked,
>> >
>> > I would like something like this as well.  The nearest I have found is
>> > to use column view.
>>
>> --
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread John Kitchin
This gets you pretty close to what you want. I changed some grades to
make it easier to see it is doing the right thing.

#+BEGIN_SRC emacs-lisp
(setq assignments '())
(setq students '())

;; get assignments
(org-map-entries
 (lambda ()
   (when (= 1 (nth 0 (org-heading-components)))
 (add-to-list 'assignments (nth 4 (org-heading-components)) t

;; get student names as list of cons cells
(org-map-entries
 (lambda ()
   (when (= 2 (nth 0 (org-heading-components)))
 (add-to-list 'students (cons  (nth 4 (org-heading-components)) '()) t


;;loop over entries
(dolist (assignment assignments)
  (save-excursion
;; jump to assignment
(org-open-link-from-string (format "[[*%s]]" assignment))
;; map over entries
(org-map-entries
 (lambda ()
   (let* ((student (car (assoc (nth 4 (org-heading-components)) students
 (when student
   (setf (cdr (assoc student students))
 (append (cdr (assoc student students))
 (list (org-entry-get (point) "GRADE")))
 nil 'tree)))

(setq gradebook
  (append (list  (append '("Student") assignments)
 'hline)
  students))

(orgtbl-to-csv gradebook nil)
#+END_SRC

#+RESULTS:
: Student,Definition,Darwin
: Student One,10,40
: Student Two,20,50
: Student Three,30,60



Matt Price writes:

> Hello eveyrone!
>
> I know the big guns are all working on last-minute 8.3 bugs (thank you!).
>
> I am hoping to get some guidance before heading off on vacation.  I have
> switched over to doing all grading for my courses in org.  My workflow:
>
> - export a csv file containing student names.
> - generate grading templates for each student, for each assignment
> - email comments back to students
> - enter marks in an official spreadsheet which can be used for final grade
> submission
>
> A sample  "Comments.org" is at the bottom of this email (it was a little
> long).
>
> So, here are my questions:
>
> - I currently store my grades as properties of level-2 headlines. However,
> I would really like to be able to see the grades when the headline is
> folded, so I can have a quick visual sense of how many papers I've marked,
> how well the students are doing, and so forth.  THe best would be to be
> able to see the actual marks in the headlines; but if I could, say, adjust
> the color of the healdine based on the property value, that would be cool
> too.
>
> - It seems silly to record the grades once in org, and then again in a
> libreoffice spreadsheet.  Better would be to generate a table and/or csv
> spreadsheet directly from the headlines and property values.  So, the
> example below would give the table:
> | Student   | Definition | Darwin |
> | Student One   |  0 |  0 |
> | Student Two   |  0 |  0 |
> | Student Three |  0 | 0  |
>
> and from there I guess I could generate a CSV just with org-table-export.
>
> Had anyone done either of these tasks before? Any guidance on how to do
> it?
>
> Thanks as always,
> Matt
>
> --
> * Definition
> ** TODO Student One
> :PROPERTIES:
> :GRADE:0
> :MAIL_TO:  student@utoronto.edu
> :MAIL_CC:  matt.pr...@utoronto.ca
> :MAIL_REPLY: matt.pr...@utoronto.ca
> :MAIL_SUBJECT: Comments on Definition Assignment (Student One)
> :END:
> - Organization ::
> - Clarity of Thesis ::
> - Presentation of Evidence ::
> - Grammar and Spelling ::
> - Style ::
> - Citations ::
> - Further Comments ::
> - Grade ::
> ** TODO Student Two
> :PROPERTIES:
> :GRADE:0
> :MAIL_TO:  student@utoronto.edu
> :MAIL_CC:  matt.pr...@utoronto.ca
> :MAIL_REPLY: matt.pr...@utoronto.ca
> :MAIL_SUBJECT: Comments on Definition Assignment (Student Two)
> :END:
> - Organization ::
> - Clarity of Thesis ::
> - Presentation of Evidence ::
> - Grammar and Spelling ::
> - Style ::
> - Citations ::
> - Further Comments ::
> - Grade ::
> ** TODO Student Three
> :PROPERTIES:
> :GRADE:0
> :MAIL_TO:  student.th...@utoronto.edu
> :MAIL_CC:  matt.pr...@utoronto.ca
> :MAIL_REPLY: matt.pr...@utoronto.ca
> :MAIL_SUBJECT: Comments on Definition Assignment (Student Three)
> :END:
> - Organization ::
> - Clarity of Thesis ::
> - Presentation of Evidence ::
> - Grammar and Spelling ::
> - Style ::
> - Citations ::
> - Further Comments ::
> - Grade ::
>
>
> * Darwin
> ** TODO Student One
> :PROPERTIES:
> :GRADE:0
> :MAIL_TO:  student@utoronto.edu
> :MAIL_CC:  matt.pr...@utoronto.ca
> :MAIL_REPLY: matt.pr...@utoronto.ca
> :MAIL_SUBJECT: Comments on Darwin Assignment (Student One)
> :END:
> - Organization ::
> - Clarity of Thesis ::
> - Presentation of Evidence ::
> - Grammar and Spelling ::
> - Style ::
> - Citations ::
> - Further Comments ::
> - Grade ::
> ** TODO Student Two
> :PROPERTIES:
> :GRADE:0
> :MAIL_TO:  student@utoronto.edu
> :MAIL_CC:  matt.pr...@utoronto.ca
> :MAIL_REPLY: matt.pr...@utoronto.ca
> :MAIL_SUBJECT: Comments on Darwin Assignment (Student Two)
> :END:

Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Nicolas Goaziou
Matt Price  writes:

> However, it seems like I lose the color-coding for todo
> states, as well as bold for tags.  It's a shame to lose that, since I rely
> on those visual cues a fair bit.

That is now fixed in maint. Thank you.

Regards,



Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Matt Price
On Thu, Aug 6, 2015 at 9:13 AM, John Kitchin 
wrote:

> How do you enter your grade? I use a function, bound to a convenient key
> like s-s g, which sets the grade property. You could have that function
> change the heading TODO state to DONE so you know it is done, and maybe
> add a tag with the grade, or just append the grade on the end of the
> headline.
>

I just set the grade with "C- C-x p GRADE", too slow!  I would love to see
your function though I can doubtless at least write THAT myself. Yeas, then
having that same function change the todo state (to "READY" in my case -- I
change to "DONE when I email out the comments), would make a lot of sense.

Adding the grade as a tag doesn't seem quite right, as I often change
grades after a rewrite.  I'd need to get rid of the original tag.  Adding
to the headline might work, but I'd have to change some of my existing
functions which use the headline value as a proxy for the student name.
Could definitely be done.

>
> I also use a function that runs org-map-entries and constructs a
> temporary gradebook as an org-table in a new buffer.
>

please please show us? Thank you!



>
> Eric S Fraga writes:
>
> > On Thursday,  6 Aug 2015 at 07:24, Matt Price wrote:
> >
> > [...]
> >
> >> - I currently store my grades as properties of level-2 headlines.
> However,
> >> I would really like to be able to see the grades when the headline is
> >> folded, so I can have a quick visual sense of how many papers I've
> marked,
> >
> > I would like something like this as well.  The nearest I have found is
> > to use column view.
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>


Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread John Kitchin
How do you enter your grade? I use a function, bound to a convenient key
like s-s g, which sets the grade property. You could have that function
change the heading TODO state to DONE so you know it is done, and maybe
add a tag with the grade, or just append the grade on the end of the
headline.

I also use a function that runs org-map-entries and constructs a
temporary gradebook as an org-table in a new buffer.

Eric S Fraga writes:

> On Thursday,  6 Aug 2015 at 07:24, Matt Price wrote:
>
> [...]
>
>> - I currently store my grades as properties of level-2 headlines. However,
>> I would really like to be able to see the grades when the headline is
>> folded, so I can have a quick visual sense of how many papers I've marked,
>
> I would like something like this as well.  The nearest I have found is
> to use column view.

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Matt Price
On Thu, Aug 6, 2015 at 7:34 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> Eric S Fraga  writes:
>
> > I would like something like this as well.  The nearest I have found is
> > to use column view.
>
> Is there anything wrong with it?
>
I hadn't looked at column-view for years.  Yes, it does what I asked for,
which is great.  However, it seems like I lose the color-coding for todo
states, as well as bold for tags.  It's a shame to lose that, since I rely
on those visual cues a fair bit. I also miss indentation, but that's not as
serious.  Anyone know if it's possible to preserve those font attributes in
column-view?



>
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Eric S Fraga
On Thursday,  6 Aug 2015 at 13:34, Nicolas Goaziou wrote:
> Hello,
>
> Eric S Fraga  writes:
>
>> I would like something like this as well.  The nearest I have found is
>> to use column view.
>
> Is there anything wrong with it?

Nothing per se.  It's just that it's "another" mode of interaction as
opposed to simply presentation so gets in the way a little.  On the
other hand, it's a good mode for editing the properties...

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3beta-1315-ga3b2b7



Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> I would like something like this as well.  The nearest I have found is
> to use column view.

Is there anything wrong with it?


Regards,

-- 
Nicolas Goaziou



Re: [O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Eric S Fraga
On Thursday,  6 Aug 2015 at 07:24, Matt Price wrote:

[...]

> - I currently store my grades as properties of level-2 headlines. However,
> I would really like to be able to see the grades when the headline is
> folded, so I can have a quick visual sense of how many papers I've marked,

I would like something like this as well.  The nearest I have found is
to use column view.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3beta-1315-ga3b2b7



[O] Showing Property in headline; generating table from properties; exporting table to CSV

2015-08-06 Thread Matt Price
Hello eveyrone!

I know the big guns are all working on last-minute 8.3 bugs (thank you!).

I am hoping to get some guidance before heading off on vacation.  I have
switched over to doing all grading for my courses in org.  My workflow:

- export a csv file containing student names.
- generate grading templates for each student, for each assignment
- email comments back to students
- enter marks in an official spreadsheet which can be used for final grade
submission

A sample  "Comments.org" is at the bottom of this email (it was a little
long).

So, here are my questions:

- I currently store my grades as properties of level-2 headlines. However,
I would really like to be able to see the grades when the headline is
folded, so I can have a quick visual sense of how many papers I've marked,
how well the students are doing, and so forth.  THe best would be to be
able to see the actual marks in the headlines; but if I could, say, adjust
the color of the healdine based on the property value, that would be cool
too.

- It seems silly to record the grades once in org, and then again in a
libreoffice spreadsheet.  Better would be to generate a table and/or csv
spreadsheet directly from the headlines and property values.  So, the
example below would give the table:
| Student   | Definition | Darwin |
| Student One   |  0 |  0 |
| Student Two   |  0 |  0 |
| Student Three |  0 | 0  |

and from there I guess I could generate a CSV just with org-table-export.

Had anyone done either of these tasks before? Any guidance on how to do
it?

Thanks as always,
Matt

--
* Definition
** TODO Student One
:PROPERTIES:
:GRADE:0
:MAIL_TO:  student@utoronto.edu
:MAIL_CC:  matt.pr...@utoronto.ca
:MAIL_REPLY: matt.pr...@utoronto.ca
:MAIL_SUBJECT: Comments on Definition Assignment (Student One)
:END:
- Organization ::
- Clarity of Thesis ::
- Presentation of Evidence ::
- Grammar and Spelling ::
- Style ::
- Citations ::
- Further Comments ::
- Grade ::
** TODO Student Two
:PROPERTIES:
:GRADE:0
:MAIL_TO:  student@utoronto.edu
:MAIL_CC:  matt.pr...@utoronto.ca
:MAIL_REPLY: matt.pr...@utoronto.ca
:MAIL_SUBJECT: Comments on Definition Assignment (Student Two)
:END:
- Organization ::
- Clarity of Thesis ::
- Presentation of Evidence ::
- Grammar and Spelling ::
- Style ::
- Citations ::
- Further Comments ::
- Grade ::
** TODO Student Three
:PROPERTIES:
:GRADE:0
:MAIL_TO:  student.th...@utoronto.edu
:MAIL_CC:  matt.pr...@utoronto.ca
:MAIL_REPLY: matt.pr...@utoronto.ca
:MAIL_SUBJECT: Comments on Definition Assignment (Student Three)
:END:
- Organization ::
- Clarity of Thesis ::
- Presentation of Evidence ::
- Grammar and Spelling ::
- Style ::
- Citations ::
- Further Comments ::
- Grade ::


* Darwin
** TODO Student One
:PROPERTIES:
:GRADE:0
:MAIL_TO:  student@utoronto.edu
:MAIL_CC:  matt.pr...@utoronto.ca
:MAIL_REPLY: matt.pr...@utoronto.ca
:MAIL_SUBJECT: Comments on Darwin Assignment (Student One)
:END:
- Organization ::
- Clarity of Thesis ::
- Presentation of Evidence ::
- Grammar and Spelling ::
- Style ::
- Citations ::
- Further Comments ::
- Grade ::
** TODO Student Two
:PROPERTIES:
:GRADE:0
:MAIL_TO:  student@utoronto.edu
:MAIL_CC:  matt.pr...@utoronto.ca
:MAIL_REPLY: matt.pr...@utoronto.ca
:MAIL_SUBJECT: Comments on Darwin Assignment (Student Two)
:END:
- Organization ::
- Clarity of Thesis ::
- Presentation of Evidence ::
- Grammar and Spelling ::
- Style ::
- Citations ::
- Further Comments ::
- Grade ::
** TODO Student Three
:PROPERTIES:
:GRADE:0
:MAIL_TO:  student.th...@utoronto.edu
:MAIL_CC:  matt.pr...@utoronto.ca
:MAIL_REPLY: matt.pr...@utoronto.ca
:MAIL_SUBJECT: Comments on Darwin Assignment (Student Three)
:END:
- Organization ::
- Clarity of Thesis ::
- Presentation of Evidence ::
- Grammar and Spelling ::
- Style ::
- Citations ::
- Further Comments ::
- Grade ::
-

I have three remaining issues