emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to best correct exams (code matlab) using org mode (and tables)
@ 2022-05-08 16:53 Uwe Brauer
  2022-05-09 12:24 ` Ihor Radchenko
  2022-05-09 12:39 ` John Kitchin
  0 siblings, 2 replies; 7+ messages in thread
From: Uwe Brauer @ 2022-05-08 16:53 UTC (permalink / raw)
  To: emacs-orgmode



Hi 

I came around https://kitchingroup.cheme.cmu.edu/blog/2013/10/23/Writing-exams-in-org-mode/

Which is a bit outdated.

My use case are to correct of matlab files, so usually I have a single org file with a table and insert the results. 

However what I missing is that my comments, and observations are difficult to track.

I am now  experimenting with org-remark putting the remarks and marks in the property sections of headers and use than

columnview 
like
#+begin_src 
#+BEGIN: columnview :maxlevel 2  :skip-empty-rows t :indent nil :hlines 2  :format "%5TODO(Status) %5Ap(Name) %5com(Comment) %5Ej1(Ej1/20) %5Ej2(Ej2/25) %5Ej3(Ej3/55) %5Res(Result)" 
#+END:
#+end_src

What do others use?

Regards

Uwe Brauer 

-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to best correct exams (code matlab) using org mode (and tables)
  2022-05-08 16:53 how to best correct exams (code matlab) using org mode (and tables) Uwe Brauer
@ 2022-05-09 12:24 ` Ihor Radchenko
  2022-05-09 12:39 ` John Kitchin
  1 sibling, 0 replies; 7+ messages in thread
From: Ihor Radchenko @ 2022-05-09 12:24 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:

> I am now  experimenting with org-remark putting the remarks and marks in the property sections of headers and use than
> What do others use?

I haven't tried org-remark yet, but I am using something somewhat
similar (but much simpler). Every time I add a note to a heading with
C-c C-z, the last note contents is saved to SUMMARY heading property.
See https://github.com/yantar92/emacs-config/blob/master/config.org#column-mode

> I strongly condemn Putin's war of aggression against the Ukraine.
> I support to deliver weapons to Ukraine's military. 
> I support the ban of Russia from SWIFT.
> I support the EU membership of the Ukraine. 

Thanks!

Best,
Ihor


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to best correct exams (code matlab) using org mode (and tables)
  2022-05-08 16:53 how to best correct exams (code matlab) using org mode (and tables) Uwe Brauer
  2022-05-09 12:24 ` Ihor Radchenko
@ 2022-05-09 12:39 ` John Kitchin
  2022-05-10  7:14   ` [how to joint column/rows of tables that are in different files (id?)] (was: how to best correct exams (code matlab) using org mode (and tables)) Uwe Brauer
  1 sibling, 1 reply; 7+ messages in thread
From: John Kitchin @ 2022-05-09 12:39 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

I guess the best thing to do would be some combination of
`htmlize-buffer' and adding tooltips to the markups.

I don't see a super clear path to that at the moment. The htmlize-buffer
is straightforward, and it would show where your remarks are. Getting
from marginalia.org to tooltips in the right place though is not as
straightforward.

htmlize-buffer is only necessary if you want to see the syntax in the
buffer. Here is some rough code that wraps the file in <pre></pre> and
makes the text you added remarks on have tooltips associated with your
remarks. You could then return the feedback.html file.


#+BEGIN_SRC emacs-lisp
(let* ((hls (sort (org-remark-highlights-get) (lambda (a b) (> (caadr a) (caadr b)))))
       (notes (cl-loop for (key (start . end) type) in hls
		       collect
		       (progn
			 (with-current-buffer (org-remark-notes-buffer-get-or-create)
			   (goto-char
			    (org-find-property org-remark-prop-id key))
			   (save-restriction
			     (org-narrow-to-subtree)
			     (org-end-of-meta-data t)
			     (buffer-substring (point) (point-max))))))))

  (with-temp-file "feedback.html"    
    (insert-file-contents "some-file")
    
    (cl-loop for (key (start . end) type) in hls for note in notes
	     do
	     
	     (cl--set-buffer-substring start end
		   (format "<a href=\"#\" title=\"%s\"><font color=\"red\">%s</font></a>"
			   note
			   (buffer-substring start end))))   
    (goto-char (point-min))
    (insert "<pre>")
    (goto-char (point-max))
    (insert "</pre>"))
  
  (browse-url "feedback.html"))
#+END_SRC

Uwe Brauer <oub@mat.ucm.es> writes:

> Hi 
>
> I came around https://kitchingroup.cheme.cmu.edu/blog/2013/10/23/Writing-exams-in-org-mode/
>
> Which is a bit outdated.
>
> My use case are to correct of matlab files, so usually I have a single org file with a table and insert the results. 
>
> However what I missing is that my comments, and observations are difficult to track.
>
> I am now  experimenting with org-remark putting the remarks and marks in the property sections of headers and use than
>
> columnview 
> like
>
> #+begin_src 
> #+BEGIN: columnview :maxlevel 2  :skip-empty-rows t :indent nil :hlines 2  :format "%5TODO(Status) %5Ap(Name) %5com(Comment) %5Ej1(Ej1/20) %5Ej2(Ej2/25) %5Ej3(Ej3/55) %5Res(Result)" 
> #+END:
> #+end_src
>
> What do others use?
>
> Regards
>
> Uwe Brauer 


-- 
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
Pronouns: he/him/his


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [how to joint column/rows of tables that are in different files (id?)] (was: how to best correct exams (code matlab) using org mode (and tables))
  2022-05-09 12:39 ` John Kitchin
@ 2022-05-10  7:14   ` Uwe Brauer
  2022-05-10 15:56     ` John Kitchin
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Brauer @ 2022-05-10  7:14 UTC (permalink / raw)
  To: emacs-orgmode


I think I almost have a working workflow.

What I need is a functionality to join either columns or rows of tables
that are in different files.

Here is what I have in mind for tables that are in the same file


** Columns

#+NAME: T1
| col1 | col2 |
|    1 | 2    |
#+NAME: T2
| col3 |
| 3    |
#+BEGIN_SRC emacs-lisp :var t1=T1 t2=T2
(cl-mapcar #'append t1 t2)
#+END_SRC

#+RESULTS:
| col1 | col2 | col3 |
|    1 |    2 |    3 |

** Rows
#+BEGIN_SRC emacs-lisp :var t1=T1 t2=T2
(append t1 t2)
#+END_SRC

#+RESULTS:
| col1 | col2 |
|    1 |    2 |
| col3 |      |
|    3 |      |



Now the 3rd package orgtbl-aggregate allows me to aggerate column of
tables that are in different files, via an ID generated via  org-id-get-create 
and saved via org-id-update-id-locations
as in 

#+BEGIN: aggregate :table "uwe"  :cols "Level" 
#+END:

Where the table uwe is located in a different file. However it seems
only to work for one table at the time, so if you have 20 tables in 20
files that a bit complicated

Any idea how to append column or rows from different table in different
files in one go?

Thanks

Uwe 



-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [how to joint column/rows of tables that are in different files (id?)] (was: how to best correct exams (code matlab) using org mode (and tables))
  2022-05-10  7:14   ` [how to joint column/rows of tables that are in different files (id?)] (was: how to best correct exams (code matlab) using org mode (and tables)) Uwe Brauer
@ 2022-05-10 15:56     ` John Kitchin
  2022-05-11  6:32       ` [how to joint column/rows of tables that are in different files (id?)] Uwe Brauer
  2022-05-11 13:45       ` Uwe Brauer
  0 siblings, 2 replies; 7+ messages in thread
From: John Kitchin @ 2022-05-10 15:56 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

Can you make a temporary org-buffer that copies all those tables into
one place, and then join them?

Uwe Brauer <oub@mat.ucm.es> writes:

> I think I almost have a working workflow.
>
> What I need is a functionality to join either columns or rows of tables
> that are in different files.
>
> Here is what I have in mind for tables that are in the same file
>
>
> ** Columns
>
> #+NAME: T1
> | col1 | col2 |
>
> |    1 | 2    |
>
> #+NAME: T2
> | col3 |
>
> | 3    |
>
> #+BEGIN_SRC emacs-lisp :var t1=T1 t2=T2
> (cl-mapcar #'append t1 t2)
> #+END_SRC
>
>
> #+RESULTS:
> | col1 | col2 | col3 |
> |    1 |    2 |    3 |
>
> ** Rows
>
> #+BEGIN_SRC emacs-lisp :var t1=T1 t2=T2
> (append t1 t2)
> #+END_SRC
>
>
> #+RESULTS:
> | col1 | col2 |
> |    1 |    2 |
> | col3 |      |
> |    3 |      |
>
>
>
> Now the 3rd package orgtbl-aggregate allows me to aggerate column of
> tables that are in different files, via an ID generated via  org-id-get-create 
> and saved via org-id-update-id-locations
> as in 
>
> #+BEGIN: aggregate :table "uwe"  :cols "Level" 
> #+END:
>
> Where the table uwe is located in a different file. However it seems
> only to work for one table at the time, so if you have 20 tables in 20
> files that a bit complicated
>
> Any idea how to append column or rows from different table in different
> files in one go?
>
> Thanks
>
> Uwe 


-- 
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
Pronouns: he/him/his


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [how to joint column/rows of tables that are in different files (id?)]
  2022-05-10 15:56     ` John Kitchin
@ 2022-05-11  6:32       ` Uwe Brauer
  2022-05-11 13:45       ` Uwe Brauer
  1 sibling, 0 replies; 7+ messages in thread
From: Uwe Brauer @ 2022-05-11  6:32 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

>>> "JK" == John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Can you make a temporary org-buffer that copies all those tables into
> one place, and then join them?

Thanks, I think will use a different approach and only copy certain
rows, via the remote function as in

** The target Rows
| Nombre | Color | Level | Quantity |
| Monday | Red   |    30 |       11 |
|        |       |       |          |
#+TBLFM: @1=remote(test,@2$$#)::@2=remote(test,@3$$#)

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [how to joint column/rows of tables that are in different files (id?)]
  2022-05-10 15:56     ` John Kitchin
  2022-05-11  6:32       ` [how to joint column/rows of tables that are in different files (id?)] Uwe Brauer
@ 2022-05-11 13:45       ` Uwe Brauer
  1 sibling, 0 replies; 7+ messages in thread
From: Uwe Brauer @ 2022-05-11 13:45 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3125 bytes --]

>>> "JK" == John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Can you make a temporary org-buffer that copies all those tables into
> one place, and then join them?

My workflow (in case anybody finds this helpful)
#+begin_src 

* Localisation of the program files

Each file you want to correct is located in a different easy to identify directory (folder).

* Correction of the program files

** Run the code
In case they are Matlab file, you can use emacs powerful matlab-mode and its corresponding shell to check the code

** Annotate your remarks 

I recommend using org-remark-mark (3rd party package) and org-remark-open
Put your comments, and qualification as Properties. They are saved in a file called marginalia.org in the same directory

Here is an example

#+begin_src 
** DONE The summary of all exercises
   :PROPERTIES:
   :Ap: Student1
   :Com1: E1: Bad formatted file, no explanation of the results
   :Com2: E2: Results are ok, again the results are not interpreted.
   :Com3: E3: Only one of the ODE has been solved.
   :org-remark-beg: 5498
   :Ej1: 15
   :Ej2: 20
   :Ej3: 35
   :org-remark-end: 5460
   :org-remark-id: 50040a36
   :org-remark-label: nil
   :org-remark-link: [[file:annu_examen_mayo_student1.m::176]]
   :END:

#+end_src

Then you generate a table via
** Table
   :PROPERTIES:
   :ID: student1
   :END:


#+BEGIN: columnview :maxlevel 2  :skip-empty-rows t :indent nil :hlines 2  :format "%5TODO(Status) %5Ap(Name) %5Ej1(Ej1/20)  %5Ej2(Ej2/25)  %5Ej3(Ej3/55)  %5Res(Result) %5Com1(Com1) %5Com2(Com2) %5Com3(Com3)" 
| Status | Name     | Ej1/20 | Ej2/25 | Ej3/55 | Result | Com1                                               | Com2                                                       | Com3                                     |
|--------+----------+--------+--------+--------+--------+----------------------------------------------------+------------------------------------------------------------+------------------------------------------|
| DONE   | Student1 |     15 |     20 |     35 |      7 | E1: Bad formatted file, no explanation of the results | E2: Results are ok, again the results are not interpreted. | E3: Only one of the ODE has been solved. |
#+TBLFM: $6=vsum($3..$5)/10;
#+END

** Run =org-id-update-id-locations=

* The master file

Create a master file with the following content

| Status | Name     | Ej1/20 | Ej2/25 | Ej3/55 | Result | Comment1                                           | Comment2                                                   | Comment3                                 |
|--------+----------+--------+--------+--------+--------+----------------------------------------------------+------------------------------------------------------------+------------------------------------------|
| DONE   | Student1 |     15 |     20 |     35 |      7 | E1: Bad formatted file, no explanation of the results | E2: Results are ok, again the results are not interpreted. | E3: Only one of the ODE has been solved. |
#+TBLFM: @2='(identity remote(student1,@>$$#));




#+end_src

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-11 13:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-08 16:53 how to best correct exams (code matlab) using org mode (and tables) Uwe Brauer
2022-05-09 12:24 ` Ihor Radchenko
2022-05-09 12:39 ` John Kitchin
2022-05-10  7:14   ` [how to joint column/rows of tables that are in different files (id?)] (was: how to best correct exams (code matlab) using org mode (and tables)) Uwe Brauer
2022-05-10 15:56     ` John Kitchin
2022-05-11  6:32       ` [how to joint column/rows of tables that are in different files (id?)] Uwe Brauer
2022-05-11 13:45       ` Uwe Brauer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).