Documentation
¶
Index ¶
- Constants
- func ExtractPageData(pageText string) []string
- func GetLen(input map[int][]PageData) int
- func GetPageDataFromFile(inputPath string) (map[int][]PageData, error)
- func MarshalPageData(c *creator.Creator, pd *PageData) error
- func OutputPdfText(inputPath string) ([]string, error)
- func PruneOldRevisions(pdmap *map[int][]PageData) error
- func ReadPageData(page *pdf.PdfPage) ([]string, error)
- func ReadPageString(page *pdf.PdfPage) (string, error)
- func WritePageData(c *creator.Creator, text string)
- func WritePageString(c *creator.Creator, text string)
- type AuthorDetails
- type ContactDetails
- type CustomDetails
- type ExamDetails
- type MarkDetails
- type MarkingAction
- type PageData
- type PageDetails
- type ParameterDetails
- type PdfSummary
- type ProcessingDetails
- type QuestionDetails
- type SubmissionDetails
Constants ¶
const ( Raw = iota ReadyToMark = iota Marked = iota ReadyToModerate = iota Moderated = iota ReadyToCheck = iota Checked = iota )
UnixTime is not all that portable as it is ... so only using it as a tiebreaker when likely that the process was repeated on the same machine For cases where marking is repeated after checking The overlay SHOULD just use a higher sequence number, sequence number is a step in sequence, not another name for a particular process
const ( StartTag = "<gradex-pagedata>" EndTag = "</gradex-pagedata>" StartTagOffset = len(StartTag) EndTagOffset = len(EndTag) )
Variables ¶
This section is empty.
Functions ¶
func ExtractPageData ¶
func OutputPdfText ¶
outputPdfText produces array of strings, one string per page mod from https://github.com/unidoc/unipdf-examples/blob/master/text/pdf_extract_text.go
func PruneOldRevisions ¶
func WritePageData ¶
func WritePageString ¶
Types ¶
type AuthorDetails ¶
type ContactDetails ¶
type CustomDetails ¶
type ExamDetails ¶
type MarkDetails ¶
type MarkingAction ¶
type MarkingAction struct {
Actor string `json:"actor"`
Contact ContactDetails `json:"contact"`
Mark MarkDetails `json:"mark"`
Done bool `json:"done"`
UnixTime int64 `json:"unixTime"`
Custom CustomDetails `json:"custom"`
}
type PageData ¶
type PageData struct {
Exam ExamDetails `json:"exam"`
Author AuthorDetails `json:"author"`
Page PageDetails `json:"page"`
Contact ContactDetails `json:"contact"`
Submission SubmissionDetails `json:"submission"`
Questions []QuestionDetails `json:"questions"`
Processing []ProcessingDetails `json:"processing"`
Custom []CustomDetails `json:"custom"`
Revision int `json:"revision"`
PreparedFor string `json:"preparedfor"`
ToDo string `json:"todo"`
}
func StripAuthorIdentity ¶
this function is for use in a co-operative environment - you can slip one past the gaolie in the custom fields in Questions/Processing/Custom
type PageDetails ¶
type ParameterDetails ¶
type PdfSummary ¶
func TriagePdf ¶
func TriagePdf(inputPath string) (PdfSummary, error)
type ProcessingDetails ¶
type ProcessingDetails struct {
UUID string `json:"UUID"`
Previous string `json:"previous"`
UnixTime int64 `json:"unixTime"`
Name string `json:"name"`
Parameters []ParameterDetails `json:"parameters"`
By ContactDetails `json:"by"`
Sequence int `json:"sequence"`
}
func SelectProcessByLast ¶
func SelectProcessByLast(pd PageData) (ProcessingDetails, error)
type QuestionDetails ¶
type QuestionDetails struct {
UUID string `json:"UUID"`
Name string `json:"name"` //what to call it in a dropbox etc
Section string `json:"section"`
Number int `json:"number"` //No Harry Potter Platform 9&3/4 questions
Parts []QuestionDetails `json:"parts"`
MarksAvailable float64 `json:"marksAvailable"`
MarksAwarded float64 `json:"marksAwarded"`
Marking []MarkingAction `json:"markers"`
Moderating []MarkingAction `json:"moderators"`
Checking []MarkingAction `json:"checkers"`
Sequence int `json:"sequence"`
UnixTime int64 `json:"unixTime"`
Previous string `json:"previous"`
}
use section for (a), (b) and number for (i)
func SelectQuestionByLast ¶
func SelectQuestionByLast(pd PageData) (QuestionDetails, error)
type SubmissionDetails ¶
type SubmissionDetails struct {
FilePrefix string `json:"filePrefix"`
OriginalFilename string `json:"originalFilename"`
OriginalFormat string `json:"originalFormat"`
NewFilename string `json:"newFilename"`
NewFormat string `json:"newFormat"`
}
don't use this in anonymous pages