Skip to content

Commit f933477

Browse files
committed
comment-as-csv feature
1 parent 6f2049d commit f933477

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

action.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,20 +614,24 @@
614614
$count = 0;
615615
foreach ($conversations as $conversation) {
616616
$post = new stdClass();
617+
$post->rawAnsweredquestion = $conversation->answeredquestion;
617618
$post->answeredquestion = pdfannotator_handle_latex($context, $conversation->answeredquestion);
618619
$post->answeredquestion = pdfannotator_extract_images($post->answeredquestion, $conversation->id, $context);
619620
$post->page = $conversation->page;
620621
$post->annotationtypeid = $conversation->annotationtypeid;
621622
$post->author = $conversation->author;
623+
$post->id = $conversation->id;
622624
$post->timemodified = $conversation->timemodified;
623625
$post->answers = [];
624626

625627
$answercount = 0;
626628
foreach ($conversation->answers as $ca) {
627629
$answer = new stdClass();
630+
$answer->rawAnswer = $ca->answer;
628631
$answer->answer = pdfannotator_handle_latex($context, $ca->answer);
629632
$answer->answer = pdfannotator_extract_images($answer->answer, $ca->id, $context);
630633
$answer->author = $ca->author;
634+
$answer->id = $ca->id;
631635
$answer->timemodified = $ca->timemodified;
632636
$post->answers[$answercount] = $answer;
633637
$answercount++;

classes/output/index.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636

3737
defined('MOODLE_INTERNAL') || die();
3838

39-
class index implements \renderable, \templatable { // Class should be placed elsewhere.
39+
class index implements \renderable, \templatable {
40+
// Class should be placed elsewhere.
4041

4142
private $usestudenttextbox;
4243
private $usestudentdrawing;
@@ -81,6 +82,8 @@ public function export_for_template(\renderer_base $output) {
8182
$data->printlink = $this->printurl;
8283
$data->pixprintdoc = $OUTPUT->image_url('download', 'mod_pdfannotator');
8384
$data->pixprintcomments = $OUTPUT->image_url('print_comments', 'mod_pdfannotator');
85+
$data->pixexportpdf = $OUTPUT->image_url('export_pdf', 'mod_pdfannotator');
86+
$data->pixexportcsv = $OUTPUT->image_url('export_csv', 'mod_pdfannotator');
8487

8588
return $data;
8689
}

lang/en/pdfannotator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@
144144
$string['error:voteComment'] = 'An error has occurred while saving the vote.';
145145
$string['error'] = 'Error!';
146146
$string['eventreport_added'] = 'A comment was reported';
147-
147+
$string['export_comments_csv'] = 'Export as CSV';
148+
$string['export_comments_csv_tooltip'] = 'Download comments as CSV file';
149+
$string['export_comments_pdf'] = 'Export as PDF';
150+
$string['export_comments_pdf_tooltip'] = 'Download comments as PDF file';
148151
$string['filenotfound'] = 'File not found, sorry.';
149152
$string['forward'] = 'Forward';
150153
$string['forwardedquestionhtml'] = '{$a->sender} forwarded the following question to you: <br /> <br />

pix/export_csv.svg

Lines changed: 1 addition & 0 deletions
Loading

pix/export_pdf.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)