Home Reference Source

Function

Static Public Summary
public

Activity(activity: Object, setGoToActivity: function): Object

The landing page for activities.

public

ActivityList(setGoToActivity: function): Object

Component for making the activity list in main menu

public

Avatar(mood: number, full: boolean): Object

Method for making avatar

public

Round sticker with happy user avatar

public

Component displaying a square "back" button.

public

The base button used in the drawing and free text menu.

public

Component representing the base for a round button with shadow.

public

An ImageWrapper component containing a sticker

public

Component representing the base for a square button with shadow.

public

Component representing the base for a square button with shadow.

public

SVGR component depicting a bookshelf sticker.

public

The button clicked when clearing the drawing.

public

SVGR component representing a round "close" icon.

public

Close button, round button with shadow

public

The menu used to select a color, with horizontal scroll.

public

Component displaying an overlay on a view with a confirmation box.

public

Menu shown when user is exiting, prompting user to save the drawing

public

Component that display the date with year, month, day and weekday like on single page single day calendars

public

Component displaying a square "delete" button.

public

SVGR component representing a round "see details" icon.

public

Details button, round button with shadow

public

Front cover of the diary

public

Component displaying the right page of the diary with all the answers to assessment for an activity session.

public

View showing the diary

public

The button clicked when activating the pen.

public

Drawing(props: Object): Object

Component displaying the drawing made by the user, on a diary page.

public

Detailed view of drawing

public

DrawingView(setShowDrawingView: boolean): Object

The view where the user can draw.

public

The button to activate the eraser.

public

SVGR component depicting an eraser.

public

Face(mood: number, question: number, setAnswered: function): Object

Component for each face in Grading.

public

The button to change the color of the font.

public

SVGR component representing the "font color" symbol.

public

Component displaying the free text element on the diary page.

public

Detailed view of free text

public

FreeTextView(setShowFreeText: function): Object

The view where the user can write free text.

public

Component displaying the front size of a grading card.

public

Component displaying the backside of a grading card in the diary.

public

Component displaying an overview of all answers to questions related to an activity.

public

Header(props: Object): Object

Header of the diary.

public

Header(props: Object): Object

Component displaying the header of the journal, with info on the user currently logged in and logout button.

public

Returns the avatar of the lion with the given expression.

public

SVGR component depicting the round "home" icon.

public

Home round button with shadow

public

Wrapper for image.

public

Component displaying an overlay on a view with an information box and a single close button

public

Component displaying an overlay view with alert box for login to journal.

public

View displaying an assessment on an activity session in the journal.

public

JournalButton(props: Object, label: string, style: Object): Object

Component displaying a square button for the journal module, with the specified label.

public

Component displaying the login page of the journal.

public

Component displaying the landing view of the journal module, after successfull login.

public

Component displaying the label of a text input.

public

SVGR component representing an arrow pointing to the left.

public

The left side menu of FreeTextView and DrawingView.

public

SVGR component depicting a lion that looks curious.

public

SVGR component depicting a lion that looks in doubt, with a warning sign on its overalls.

public

SVGR component depicting a happy lion with a question mark on its overall.

public

SVGR component depicting a lion resting and in laying position.

public

SVGR component depicting a satisfied lion with a question mark on its overall.

public

SVGR component depicting a lion with a question mark on its overall, in sitting posture.

public

SVGR component depicting a lion with a thumb up, and a question mark on its overall.

public

SVGR component depicting a lion with a thumb up.

public

SVGR component representing a lock.

public

Component displayin a square login button

public

Menu(setGoToActivity: function): Object

The assessment menu where the user can go to Grading, Freetext, Drawing or back to StartView.

public

MenuIcon(delay: number, onPress: function, png: string): Object

Makes an icon in the assessment menu.

public

Diary menu bar to navigate to next page.

public

Diary menu bar to navigate to previous page.

public

Component displaying the menu to navigate to the cover page.

public

SVGR component representing the "next" round icon

public

Next button, round with shadow

public

Component displaying a notification message.

public

SVGR component representing the "ok" round icon.

public

Ok button, round button with shadow

public

Component displaying the title of a diary page.

public

The button to change the color of the paper.

public

SVGR component representing the "paper color" symbol.

public

SVGR component representing the "pen" symbol.

public

SVGR component depicting the bottom left photo corner.

public

SVGR component depicting a bottom right photo corner.

public

SVGR component depicting the top left photo corner.

public

SVGR component depicting the top right photo corner.

public

Component displaying the picture of the activity with photo corners.

public

SVGR component representing the "previous" round icon

public

"Previous" round button with shadow

public

SVGR component representing a red cross symbol.

public

SafeArea Wrapper

public

Component displaying an overlay on a view with an alert box.

public

SVGR component representing the "save" symbol.

public

Component displaying a Square save button.

public

The Landing page showing the main menu

public

Component displaying the size of the drawing stroke.

public

Component with slider controlling the width of the pen stroke, and an indicator displaying the stroke size.

public

Not happy face

public

Medium happy face

public

Happy face

public

Not happy avatar

public

Medium happy avatar

public

Very happy avatar

public

Unsure avatar

public

Component representing a cell in a table.

public

Component displaying the title cell of a table.

public

SVGR component depicting a teaddy bear sticker.

public

Component representing the button to navigate to diary.

public

Component representing the button to navigate to journal.

public

SVGR component representing the "back to start" round icon.

public

"Go to start" button, round button with shadow

public

SVGR component depicting a trash can symbol.

public

The button to undo a drawing action.

public

SVGR component representing the "undo" symbol.

public

If the activity is already defined, update it If the activity is not assessed, add assessment

public

Resets the assessment

public

convertDate(dateString: string): string[]

Convert a date in ISO format to an array of strings containing weekDay, day, month and year.

public

Return the title of the diary with the specified name as part of the title.

public

getActivity(activityId: number): Object

Returns activity with given id

public

Returns the activity create date

public

Returns the activity id

public

Returns the activity type

public

Return all activites

public

Returns all questions

public

getAssessment(assessmentID: number): Object

Gets the assessment with given assessmentID

public

Returns the assessment object

public

Returns the assessment id

public

Gets all of the assessments in the user object

public

Function to convert CSS colors (first letter capitalized) to React colors (all lowercase)

public

Returns the comment object

public

Returns the drawing path

public

Get the source of the image of the emoji corresponding to the specified grading.

public

Gets the filename of activity picture

public

Returns the grading object

public

Looks for the given username in the database and returns the id if found.

public

getLegend(grading: number): string

Get the legend of the corresponding grading.

public

getName(activityId: number): string

Returns the activity name

public

Returns the name of the activity type

public

getPicture(activityId: number): Object

Returns the activity picture

public

Returns the picture of the activity type

public

Returns properties of the lion corresponding to the given help-object.

public

getQuestion(activityId: number, questionId: number): Object

Returns question with given questoinIdd from activity with given activityId

public

getQuestion(id: number, questionId: number): Object

Returns the question with the given activity type id and question id

public

getSpeech(grading: number): string

Get the speech sound for the specified grading

public

Gets the image from the therapist object with given id

public

Gets the name of a therapist with given id

public

Gets the user object

public

handleLogin(username: String, setUsername: function, password: String, setPassword: function, therapistId: number, setTherapistId: function, setIsValidConnection: function, setShowErrorMsg: function, setGoToJournal: function): function

Process the login and set the variables to the correct value.

public

handleLogout(setIsLoggedOut: function, setIsValidConnection: function, setGoToJournal: function): Object

Set values to the given states to process log out.

public

Return properties of the help object with the given id

public

iosPlaySound(filename: string)

Preferred way of playing sound on ios

public

Check if the given id is valid

public

isValidPassword(therapistId: number, password: string): boolean

Checks if the given password is the correct password for the given therapist id.

public

Returns the number of assessmetns

public

Returns the number of questions

public

playSound(filename: string)

Plays the .wav soundfile corresponding to the filename.

public

Sets the activityCreateDate

public

setActivityId(activityId: number)

Sets the id of the Activity

public

setActivityType(activityType: Object)

Sets the activity type

public

Overwrite assessment.

public

Sets the id of the assessment

public

setBorderStyle(paperColor: string, styles: Object): Object[]

Set the color of the border and add it to the specified style

public

setComment(content: string, textColor: string, paperColor: string)

Sets the comment which consists of content, and colors.

public

Sets the createDate

public

setDrawing(drawing: string)

Sets the drawing

public

setGrading(grading: Object)

Sets the grading for a question.

public

smileyometerAnimationDelay(grading: boolean, comment: boolean, drawing: boolean): number[]

Receives parts of assessment, and returns timer delay values based on true or false

public

Stops the currently playing sound.

public

timedEvent(func: function, time: number, id: number)

A timed event.

Static Public

public Activity(activity: Object, setGoToActivity: function): Object source

The landing page for activities.

Params:

NameTypeAttributeDescription
activity Object

The current activity that is to be assessed

setGoToActivity function

If set to false, the user is redirected back to main menu (StartView)

Return:

Object

The landing page for the chosen activity

public ActivityList(setGoToActivity: function): Object source

Component for making the activity list in main menu

Params:

NameTypeAttributeDescription
setGoToActivity function

If set to true, the user is redirected to ActivityView

Return:

Object

Scrollable list components containing activites which can be assessed

public Avatar(mood: number, full: boolean): Object source

Method for making avatar

Params:

NameTypeAttributeDescription
mood number

the mood the avatary should be in

full boolean

true if full avatar, false if only face

Return:

Object

The SVGR component of the avatar

public AvatarHappySticker(props: Object): Object source

Round sticker with happy user avatar

Params:

NameTypeAttributeDescription
props Object

Properties

props.dimensions Object

Style containing dimensions of avatar

props.position Object

Style containing position of avatar

Return:

Object

Sticker

public BackSquareButton(props: Object): Object source

Component displaying a square "back" button.

Params:

NameTypeAttributeDescription
props Object

Properties

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Square "back" button

public BaseDrawingButton(props: Object): Object source

The base button used in the drawing and free text menu.

Params:

NameTypeAttributeDescription
props Object

Properties

props.componentStyle Object

The style of the button

props.position ButtonPosition

Positioning of the button

props.onPress function

Action for the button

props.children Object

Child components of the button

Return:

Object

The base button used in the drawing and free text menu.

public BaseRoundButtonShadow(props: Object): Object source

Component representing the base for a round button with shadow.

Params:

NameTypeAttributeDescription
props Object

Properties

props.buttonSize RoundButtonSize

Size of the button

props.componentStyle Object

Styling of component

props.onPress function

Action to be executed when the button is pressedz

props.children Object

Content of the button

Return:

Object

Basis round button

public BaseRoundSticker(props: Object): Object source

An ImageWrapper component containing a sticker

Params:

NameTypeAttributeDescription
props Object

Properties

props.source string

Sticker image source

Return:

Object

ImageWrapper component containing a sticker

public BaseSquareButton(props: Object): Object source

Component representing the base for a square button with shadow.

Params:

NameTypeAttributeDescription
props Object

Properties

props.componentStyle Object

Styling of component (optional)

props.onPress function

Action to be executed when the button is pressed

props.children Object

Content of the button

Return:

Object

Basic square button with shadow used to construct square buttons.

public BaseSquareButtonLeftIcon(props: Object): Object source

Component representing the base for a square button with shadow. Used in dialog boxes.

Params:

NameTypeAttributeDescription
props Object

Properties

props.icon Object

Icon of the button

props.label string[]

Text label of the button

props.componentStyle Object

Styling of component

props.labelStyle Object

Styling of label

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Base for constructing a square button with shadow, to be used in dialog boxes.

public BookShelfStickerSvgr(props: Object): Object source

SVGR component depicting a bookshelf sticker.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a bookshelf sticker

public ClearAllButton(props: Object): Object source

The button clicked when clearing the drawing.

Params:

NameTypeAttributeDescription
props Object

Properties

props.componentStyle Object

The style of the button

props.position number

Positioning of the button: 0 for LEFT, 1 for RIGHT and 2 for MIDDLE

props.onPress function

Action for the button

Return:

Object

The button clicked when clearing the drawing

public CloseIconSvgr(props: Object): Object source

SVGR component representing a round "close" icon.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Round icon with "close" symbol

public CloseRoundButton(props: Object): Object source

Close button, round button with shadow

Params:

NameTypeAttributeDescription
props Object

Properties

props.buttonSize RoundButtonSize

Size of the button

props.containerStyle Object

Styling of the container

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Round "close" button

public ColorSelectorHorizontal(props: Object): Object source

The menu used to select a color, with horizontal scroll.

Params:

NameTypeAttributeDescription
props Object

Properties

props.showsPaperColorMenu boolean

Whether or not the color of paper is to be changed

props.showsBrushColorMenu boolean

Whetehr or not the color of the brush is to be changed

props.updatePaperColor function

The function to change the color of the paper

props.updateBrushColor funciton

The function to change the color of the brush

Return:

Object

Menu to pick color

public ConfirmationBoxOverlay(props: Object): Object source

Component displaying an overlay on a view with a confirmation box. Contains a single ok button.

Params:

NameTypeAttributeDescription
props Object

Properties

props.message string

Message displayed in the confirmation box.

props.modalVisible boolean

Defines if the overlay is shown. Shown if true

props.onModalRequestCloseAction function

Action to be executed when the device "back" button is pressed

props.onPressOkButtonAction function

Action to be executed when the ok button is pressed

Return:

Object

Overlay view displaying a confirmation box with a ok button.

public ConfirmationMenu(props: Object): Object source

Menu shown when user is exiting, prompting user to save the drawing

Params:

NameTypeAttributeDescription
props Object

Properties

props.onPressClose function

Function run when user presses Close button

props.onPressOk function

Function run when user presses OK button

Return:

Object

A view containing OK and Close buttons

public DateCalendar(props: Object): Object source

Component that display the date with year, month, day and weekday like on single page single day calendars

Params:

NameTypeAttributeDescription
props Object

Properties

props.date string

The date (YYY-MM-DD)

Return:

Object

The date shown as on a single page single day calendar

public DeleteSquareButton(props: Object): Object source

Component displaying a square "delete" button.

Params:

NameTypeAttributeDescription
props Object

Properties

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Square "delete" button

public DetailsIconSvgr(props: Object) source

SVGR component representing a round "see details" icon.

Params:

NameTypeAttributeDescription
props Object

Properties

public DetailsRoundButton(props: Object): Object source

Details button, round button with shadow

Params:

NameTypeAttributeDescription
props Object

Properties

props.buttonSize RoundButtonSize

Size of the button

props.containerStyle Object

Styling of the container

props.onPress function

Action to be executed when the button is pressed

Return:

Object

A round "details" button

public DiaryCover(): Object source

Front cover of the diary

Return:

Object

The front cover of the diary

public DiaryPage(): Object source

Component displaying the right page of the diary with all the answers to assessment for an activity session. The page/assessment that is displayed is given by the context (page number).

Return:

Object

Diary page with assessment for an activity

public DiaryView(props: Object): Object source

View showing the diary

Params:

NameTypeAttributeDescription
props Object

Properties

props.setGoToDiary boolean

If true, displays the diary (navigation)

Return:

Object

View component showing the diary

public DrawButton(props: Object): Object source

The button clicked when activating the pen.

Params:

NameTypeAttributeDescription
props Object

Properties

props.position ButtonPosition

Positioning of the button

props.fillColor string

Color to fill the tip of the pen

props.onPress function

Action for the button

Return:

Object

The button clicked when activating the pen

public Drawing(props: Object): Object source

Component displaying the drawing made by the user, on a diary page.

  • If none, displays a sticker instead.
  • If drawing is not null, but not a valid name, a message saying that the drawing cannot be displayed will be shown.

Params:

NameTypeAttributeDescription
props Object

Properties

props.source Object

Source of the image

props.componentStyle Object

Styling of the component

Return:

Object

Drawing displayed on a page of the diary

public DrawingDetails(props: Object): Object source

Detailed view of drawing

Params:

NameTypeAttributeDescription
props Object

Properties

props.source Object

Source of the image

Return:

Object

A detailed and large view of the drawing

public DrawingView(setShowDrawingView: boolean): Object source

The view where the user can draw.

Params:

NameTypeAttributeDescription
setShowDrawingView boolean

If set to false, user is redirected back to menu

Return:

Object

The view for drawing

public EraserButton(props: Object): Object source

The button to activate the eraser.

Params:

NameTypeAttributeDescription
props Object

Properties

props.componentStyle Object

The style of the button

props.position ButtonPosition

Positioning of the button

props.onPress function

Action for the button

Return:

Object

The button to activate the eraser

public EraserIconSvgr(props: Object): Object source

SVGR component depicting an eraser.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of an eraser

public Face(mood: number, question: number, setAnswered: function): Object source

Component for each face in Grading.

Params:

NameTypeAttributeDescription
mood number

The mood the face should be in

question number

The id of the current question

setAnswered function

If set to true, the user can go to next question

Return:

Object

The complete face component

public FontColorButton(props: Object): Object source

The button to change the color of the font.

Params:

NameTypeAttributeDescription
props Object

Properties

props.componentStyle Object

The style of the button

props.position ButtonPosition

Positioning of the button

props.fillColor string

The active color of the font, used to color the icon

props.onPress function

Action for the button

Return:

Object

The button to change the color of the font

public FontColorIconSvgr(props: Object): Object source

SVGR component representing the "font color" symbol.

Params:

NameTypeAttributeDescription
props Object

Properties

props.fillColor Object

Fill color of the symbol/letter

Return:

Object

Font color symbol

public FreeText(props: Object): Object source

Component displaying the free text element on the diary page. If there is no free text, the image of a sticker is displayed instead.

Params:

NameTypeAttributeDescription
props Object

Properties

props.freeText string

Free text

props.componentStyle Object

Styling of the component

Return:

Object

The free text element as displayed on a diary page

public FreeTextDetails(props: Object): Object source

Detailed view of free text

Params:

NameTypeAttributeDescription
props Object

Properties

props.freeText string

Free text

Return:

Object

A detailed and large view of the free text

public FreeTextView(setShowFreeText: function): Object source

The view where the user can write free text.

Params:

NameTypeAttributeDescription
setShowFreeText function

If set to false, the user is redirected back to menu

Return:

Object

The view for freetext

public GradingCard(props: Object): Object source

Component displaying the front size of a grading card. It displays the question number and the grad, shown with an emoticon having the corresponding mood.

Params:

NameTypeAttributeDescription
props Object

Properties

props.grading Object

The grading with question id, question and answer

props.cardColor string

Color of the grading card

props.activityType number

Type of activity

Return:

Object

The front size of the grading card

public GradingCardBack(props: Object): Object source

Component displaying the backside of a grading card in the diary.

Params:

NameTypeAttributeDescription
props Object

Properties

props.grading Object

Grading of an activity

props.randomNumber number

Random nummer to generate color of the card

props.questionNumber number

Number of the queation

props.activityType number

Activity type

Return:

Object

The backside of a grading card

public GradingsOverview(props: Object): Object source

Component displaying an overview of all answers to questions related to an activity. The number of questions the user has answered to is also displayed.

Params:

NameTypeAttributeDescription
props Object

Properties

props.activityType number

Type of activity

props.grading Object[]

Array of grading for an activity

Return:

Object

Box containing the number of answered questions, and cards showing the answers.

public Header(props: Object): Object source

Header of the diary.

Params:

NameTypeAttributeDescription
props Object

Properties

props.leftComponent Object

Left element of the header

props.middleComponent Object

Middle element of the header

props.rightComponent Object

Right element of the header

Return:

Object

Header of the diary.

public Header(props: Object): Object source

Component displaying the header of the journal, with info on the user currently logged in and logout button.

Params:

NameTypeAttributeDescription
props Object

Properties

props.setGoToJournal function

If true, displays the journal (navigation)

Return:

Object

Header of the journal

public HelperAvatar(props: Object): Object source

Returns the avatar of the lion with the given expression. Function (help, warning) is combined with expression to make it simple, but they should be separated in next version.

Params:

NameTypeAttributeDescription
props Object

Properties

props.expression number

Number corresponding to the expression of the helper.

Return:

Object

SVGR file of the lion with the correct expression

public HomeIconSvgr(props: Object): Object source

SVGR component depicting the round "home" icon.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Round home icon

public HomeRoundButton(props: Object): Object source

Home round button with shadow

Params:

NameTypeAttributeDescription
props Object

Properties

props.buttonSize RoundButtonSize

Size of the button

props.containerStyle Object

Styling of the container

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Round "home" button

public ImageWrapper(props: Object): Object source

Wrapper for image.

Params:

NameTypeAttributeDescription
props Object

Properties

props.source string

source, style (don't use wrapperStyle, but use style as props)

Return:

Object

ImageWrapper containing the specified image

public InfoBoxOverlay(props: Object): Object source

Component displaying an overlay on a view with an information box and a single close button

Params:

NameTypeAttributeDescription
props Object

Properties

props.onModalRequestCloseAction function

Action to be executed when the device "back" button is pressed

props.onPressButtonAction function

Action to be executed when close button is pressed

props.modalVisible boolean

Defines if the overlay is shown. Shown if true

props.children Object

Content of the information box

Return:

Object

Overlay view with an information box and a close button

public JournalAlertBoxOverlay(props: Object): Object source

Component displaying an overlay view with alert box for login to journal. Contains a button to go back to the previous view and another to login.

Params:

NameTypeAttributeDescription
props Object

Properties

props.onModalRequestCloseAction function

Action to be executed when the device "back" button is pressed

props.onPressOkButtonAction function

Action to be executed when the ok button is pressed

props.onPressCancelButtonAction function

Action to be executed when the cancel button is pressed

props.modalVisible boolean

Defines if the overlay is shown. Shown if true

Return:

Object

Overlay alert box for login to journal

public JournalAssessmentScreen(props: Object): Object source

import JournalAssessmentScreen from 'aktivitetsmodulrn/src/views/journal/AssessmentView.js'

View displaying an assessment on an activity session in the journal. It shows details about the assessment.

Params:

NameTypeAttributeDescription
props Object

Properties

props.setGoToAssessment function

If true, displays AssessmentView

props.setGoToJournal function

If true, displays the journal overview.

props.assessmentId number

Id of the assessment to be displayed

Return:

Object

An assessment on an activity session (journal)

public JournalButton(props: Object, label: string, style: Object): Object source

Component displaying a square button for the journal module, with the specified label.

Params:

NameTypeAttributeDescription
props Object

Properties

props.lightness ButtonLightness

Lightness of the color of the button

props.length ButtonLength

Length of the button

label string

Text label of the button

style Object

Styling of the component

props.onPress function

Action for the button

Return:

Object

A square button with specified text label

public JournalLoginView(props: Object): Object source

Component displaying the login page of the journal.

Params:

NameTypeAttributeDescription
props Object

Properties

props.setGoToJournalLogin function

If true, shows the login view of the journal. If false, go back to the landing view of the activity module

Return:

Object

Login view to the journal

public JournalView(props: Object): Object source

Component displaying the landing view of the journal module, after successfull login. Shows an overview of all assessments of the user that is logged in.

Params:

NameTypeAttributeDescription
props Object

Properties

props.setGoToJournal function

If true, displays the journal overview.

Return:

Object

Overview of all assessments made by an user (journal)

public LabelTextInput(props: Object): Object source

Component displaying the label of a text input.

Params:

NameTypeAttributeDescription
props Object

Properties

props.label string

Label

Return:

Object

Label of a text input

public LeftArrowSvgr(props: Object): Object source

SVGR component representing an arrow pointing to the left.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Symbol with arrow pointing to the left.

public LeftMenu(props: Object): Object source

The left side menu of FreeTextView and DrawingView.

Params:

NameTypeAttributeDescription
props Object

Properties

props.module Module

Type of module

props.toggleBackgroundImage function

Toggle the background image on and off

props.canvasRef function

Reference to the canvas

Return:

Object

Left side menu of FreeTextView and DrawingView

public LionCuriousHelpSvgr(props: Object): Object source

SVGR component depicting a lion that looks curious.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a lion that seems curious.

public LionDoubtWarningSvgr(props: Object): Object source

SVGR component depicting a lion that looks in doubt, with a warning sign on its overalls.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a lion in doubt with a warning sign.

public LionHappyHelpSvgr(props: Object): Object source

SVGR component depicting a happy lion with a question mark on its overall.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a happy lion as helper.

public LionRestingSvgr(props: Object): Object source

SVGR component depicting a lion resting and in laying position.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a lion that is laying.

public LionSatisfiedHelpSvgr(props: Object): Object source

SVGR component depicting a satisfied lion with a question mark on its overall.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a satisfied lion as helper.

public LionSittingHelpSvgr(props: Object): Object source

SVGR component depicting a lion with a question mark on its overall, in sitting posture.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a sitting lion as helper.

public LionThumbUpHelpSvgr(props: Object): Object source

SVGR component depicting a lion with a thumb up, and a question mark on its overall.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a lion with thump up as helper.

public LionThumbUpSvgr(props: Object): Object source

SVGR component depicting a lion with a thumb up.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a lion with thump up.

public LockIconSvgr(props: Object): Object source

SVGR component representing a lock.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Lock symbol

public LoginSquareButton(props: Object): Object source

Component displayin a square login button

Params:

NameTypeAttributeDescription
props Object

Properties

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Login button

public Menu(setGoToActivity: function): Object source

The assessment menu where the user can go to Grading, Freetext, Drawing or back to StartView.

Params:

NameTypeAttributeDescription
setGoToActivity function

If set to false, the user is redirected back to main menu (StartView)

Return:

Object

The menu and button to finish assessing the activity

public MenuIcon(delay: number, onPress: function, png: string): Object source

Makes an icon in the assessment menu.

Params:

NameTypeAttributeDescription
delay number

Delay before icon is displayed

onPress function

Function to be run when icon is pressed

png string

Path of the icon picture

Return:

Object

The icon component

public NavNextPage(props: Object): Object source

Diary menu bar to navigate to next page. Button is visible if props.isVisible is true.

Params:

NameTypeAttributeDescription
props Object

Properties

props.containerStyle Object

Style of the container view

props.isVisible boolean

If true, the button is visible. Otherwise not visible

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Menu to navigate to the next page

public NavPreviousPage(props: Object): Object source

Diary menu bar to navigate to previous page. Button and background image are displayed if the props.isVisible is true.

Params:

NameTypeAttributeDescription
props Object

Properties

props.containerStyle Object

Style of the container view

props.isVisible boolean

If true, the button is visible. Otherwise not visible

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Menu to navigate to previous page

public NavToStart(props: Object): Object source

Component displaying the menu to navigate to the cover page. Button is displayed if props.isVisible is true.

Params:

NameTypeAttributeDescription
props Object

Properties

props.containerStyle Object

Style of container

props.isVisible boolean

If true, the button is visible. Otherwise not visible

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Navigation menu to go back to the cover page

public NextIconSvgr(props: Object): Object source

SVGR component representing the "next" round icon

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Round "next" icon.

public NextRoundButton(props: Object): Object source

Next button, round with shadow

Params:

NameTypeAttributeDescription
props Object

Properties

props.buttonSize RoundButtonSize

Size of the button

props.containerStyle Object

Styling of the container

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Round "to next" button

public NotificationText(props: Object): Object source

Component displaying a notification message. The style (color) depends on the type of notification.

Params:

NameTypeAttributeDescription
props Object

Properties

props.value string

Text of the notification

props.type NotificationType

Type of notification

Return:

Object

public OkIconSvgr(props: Object): Object source

SVGR component representing the "ok" round icon.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Round "ok" icon

public OkRoundButton(props: Object): Object source

Ok button, round button with shadow

Params:

NameTypeAttributeDescription
props Object

Properties

props.buttonSize RoundButtonSize

Size of the button

props.containerStyle Object

Styling of the container

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Round "ok" button

public PageTitle(props: Object): Object source

Component displaying the title of a diary page.

Params:

NameTypeAttributeDescription
props Object

Properties

props.title string

Title of the page

Return:

Object

Styled title

public PaperColorButton(props: Object): Object source

The button to change the color of the paper.

Params:

NameTypeAttributeDescription
props Object

Properties

props.componentStyle Object

The style of the button

props.position ButtonPosition

Positioning of the button

props.fillColor string

The active color of the paper, used to color the icon

props.onPress function

Action for the button

Return:

Object

The button to change the color of the paper

public PaperColorIconSvgr(props: Object): Object source

SVGR component representing the "paper color" symbol.

Params:

NameTypeAttributeDescription
props Object

Properties

props.fillColor Object

Fill color of the paper

Return:

Object

Paper color symbol

public PenIconSvgr(props: Object): Object source

SVGR component representing the "pen" symbol.

Params:

NameTypeAttributeDescription
props Object

Properties

props.fillColor Object

Fill color of the pen

Return:

Object

Pen symbol

public PhotoCornerBottomLeft(props: Object): Object source

SVGR component depicting the bottom left photo corner.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a bottom left photo corner

public PhotoCornerBottomRight(props: Object): Object source

SVGR component depicting a bottom right photo corner.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a bottom right photo corner

public PhotoCornerTopLeft(props: Object): Object source

SVGR component depicting the top left photo corner.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a top left photo corner

public PhotoCornerTopRight(props: Object): Object source

SVGR component depicting the top right photo corner.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a top right photo corner

public PictureActivity(props: Object): Object source

Component displaying the picture of the activity with photo corners.

Params:

NameTypeAttributeDescription
props Object

Properties

props.source Object

Source of the image

Return:

Object

Picture of the activity

public PreviousIconSvgr(props: Object): Object source

SVGR component representing the "previous" round icon

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Round "previous" icon.

public PreviousRoundButton(props: Object): Object source

"Previous" round button with shadow

Params:

NameTypeAttributeDescription
props Object

Properties

props.buttonSize RoundButtonSize

Size of the button

props.containerStyle Object

Styling of the container

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Round "previous" button

public RedCrossIconSvgr(props: Object): Object source

SVGR component representing a red cross symbol.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a red cross

public SafeAreaWrapper(props: Object): Object source

SafeArea Wrapper

Params:

NameTypeAttributeDescription
props Object

Properties

props.children Object

Component to be wrapped

props.safeAreaStyle Object

Styling for the wrapper

Return:

Object

SafeAreaWrapper

public SaveAlertBoxOverlay(props: Object): Object source

Component displaying an overlay on a view with an alert box. Contains a three buttons: cancel, delete changes, save changes.

Params:

NameTypeAttributeDescription
props Object

Properties

props.message string

Message to be displayed in the alert box

props.modalVisible boolean

Defines if the overlay is shown. Shown if true

props.onModalRequestCloseAction function

Action to be executed when the device "back" button is pressed

props.onPressCancelButtonAction function

Action to be executed when the cancel button is pressed

props.onPressSaveButtonAction function

Action to be executed when the save button is pressed

props.onPressDeleteButtonAction function

Action to be executed when the delete button is pressed

Return:

Object

Overlay with an alert box and 3 buttons

public SaveIconWhiteSvgr(props: Object): Object source

SVGR component representing the "save" symbol.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

"Save" symbol

public SaveSquareButton(props: Object): Object source

Component displaying a Square save button.

Params:

NameTypeAttributeDescription
props Object

Properties

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Square "save" button

public StartView(): Object source

The Landing page showing the main menu

Return:

Object

The main window with all of its components

public StrokeWidthIndicator(props: Object): Object source

Component displaying the size of the drawing stroke.

Params:

NameTypeAttributeDescription
props Object

Properties

props.strokeWidth number

How wide the stroke of the brush currently is

props.maximumStrokeWidth number

The maximum width the stroke can be

props.brushColor string

Current color of the brush

Return:

Object

An indicator showing the size of the brush stroke

public StrokeWidthSlider(props: Object): Object source

Component with slider controlling the width of the pen stroke, and an indicator displaying the stroke size.

Params:

NameTypeAttributeDescription
props Object

Properties

props.componentStyle Object

The style for this component

props.brushColor string

The current color of the brush

props.strokeWidth number

The current width of the stroke

props.minimumStrokeWidth number

The minimum width of the stroke

props.maximumStrokeWidth number

The maximum width of the stroke

props.updateStrokeWidth function

Function to update stroke width

Return:

Object

The slider with indicator

public SvgAnsiktIkkeLyst(props: Object): Object source

Not happy face

Params:

NameTypeAttributeDescription
props Object

Return:

Object

SVGR component of avatar face

public SvgAnsiktLittLyst(props: Object): Object source

Medium happy face

Params:

NameTypeAttributeDescription
props Object

Return:

Object

SVGR component of avatar face

public SvgAnsiktVeldigLyst(props: Object): Object source

Happy face

Params:

NameTypeAttributeDescription
props Object

Return:

Object

SVGR component of avatar face

public SvgAvatarIkkeLyst(props: Object): Object source

Not happy avatar

Params:

NameTypeAttributeDescription
props Object

Return:

Object

SVGR component of avatar

public SvgAvatarLittLyst(props: Object): Object source

Medium happy avatar

Params:

NameTypeAttributeDescription
props Object

Return:

Object

SVGR component of avatar

public SvgAvatarVeldigLyst(props: Object): Object source

Very happy avatar

Params:

NameTypeAttributeDescription
props Object

Return:

Object

SVGR component of avatar

public SvgAvatarVetIkke(props: Object): Object source

Unsure avatar

Params:

NameTypeAttributeDescription
props Object

Return:

Object

SVGR component of avatar

public TableCell(props: Object): Object source

Component representing a cell in a table.

Params:

NameTypeAttributeDescription
props Object

Properties

props.style Object

Style of the table cell

props.text string

Content of the table cell

Return:

Object

Table cell

public TableTitle(props: Object): Object source

Component displaying the title cell of a table.

Params:

NameTypeAttributeDescription
props Object
props.style Object

Style of the table cell

props.text string

Content of the table cell

Return:

Object

Title cell of a table

public TeddyBearSticker(props: Object): Object source

SVGR component depicting a teaddy bear sticker.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Image of a teaddy bear sticker

public ToDiaryButton(props: Object): Object source

Component representing the button to navigate to diary.

Params:

NameTypeAttributeDescription
props Object

Properties

props.style Object

Styling of the component

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Button to navigate to diary

public ToJournalButton(props: Object): Object source

Component representing the button to navigate to journal.

Params:

NameTypeAttributeDescription
props Object

Properties

props.style Object

Styling of the component

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Button to navigate to journal

public ToStartIconSvgr(props: Object): Object source

SVGR component representing the "back to start" round icon.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Round "back to start" icon

public ToStartRoundButton(props: Object): Object source

"Go to start" button, round button with shadow

Params:

NameTypeAttributeDescription
props Object

Properties

props.buttonSize RoundButtonSize

Size of the button

props.containerStyle Object

Styling of the container

props.onPress function

Action to be executed when the button is pressed

Return:

Object

Round "go to start" button

public TrashIconSvgr(props: Object): Object source

SVGR component depicting a trash can symbol.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Trash can symbol

public UndoButton(props: Object): Object source

The button to undo a drawing action.

Params:

NameTypeAttributeDescription
props Object

Properties

props.componentStyle Object

The style of the button

props.position ButtonPosition

Positioning of the button

props.onPress function

Action for the button

Return:

Object

The button to undo a drawing action

public UndoIconSvgr(props: Object): Object source

SVGR component representing the "undo" symbol.

Params:

NameTypeAttributeDescription
props Object

Properties

Return:

Object

Undo icon

public addAssessment() source

import {addAssessment} from 'aktivitetsmodulrn/src/database/UsersDAO.js'

If the activity is already defined, update it If the activity is not assessed, add assessment

public clearAssessment() source

import {clearAssessment} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Resets the assessment

public convertDate(dateString: string): string[] source

Convert a date in ISO format to an array of strings containing weekDay, day, month and year.

Params:

NameTypeAttributeDescription
dateString string

A string with the date (YYY-MM-DD)

Return:

string[]

words array of strings [weekDay, day, month, year]

public formatTitleAndName(name: string): string source

import {formatTitleAndName} from 'aktivitetsmodulrn/src/utils/FormatterUtils.js'

Return the title of the diary with the specified name as part of the title.

Params:

NameTypeAttributeDescription
name string

The name to be formated

Return:

string

Title with name

public getActivity(activityId: number): Object source

Returns activity with given id

Params:

NameTypeAttributeDescription
activityId number

the id of the activity

Return:

Object

the activity

public getActivityCreateDate(): Date source

import {getActivityCreateDate} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Returns the activity create date

Return:

Date

activity create dates

public getActivityId(): number source

import {getActivityId} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Returns the activity id

Return:

number

activity id

public getActivityType(): Object source

import {getActivityType} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Returns the activity type

Return:

Object

activity type

public getAllActivites(): Object[] source

import {getAllActivites} from 'aktivitetsmodulrn/src/database/ActivitiesDAO.js'

Return all activites

Return:

Object[]

the activites

public getAllQuestions(id: number): string[] source

Returns all questions

Params:

NameTypeAttributeDescription
id number

the activity id

Return:

string[]

The questions

public getAssessment(assessmentID: number): Object source

import {getAssessment} from 'aktivitetsmodulrn/src/database/UsersDAO.js'

Gets the assessment with given assessmentID

Params:

NameTypeAttributeDescription
assessmentID number

The id of the assessment that should be returned

Return:

Object

the assessment

public getAssessment(): Object source

import {getAssessment} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Returns the assessment object

Return:

Object

assessment object

public getAssessmentId(): number source

import {getAssessmentId} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Returns the assessment id

Return:

number

assessment id

public getAssessments(): Object[] source

import {getAssessments} from 'aktivitetsmodulrn/src/database/UsersDAO.js'

Gets all of the assessments in the user object

Return:

Object[]

the assessments

public getColors(): string[] source

Function to convert CSS colors (first letter capitalized) to React colors (all lowercase)

Return:

string[]

All CSS colors with names understood by React

public getComment(): Object source

Returns the comment object

Return:

Object

comment

public getDrawing(): string source

Returns the drawing path

Return:

string

drawing path

public getEmojiImage(grading: number): Object source

import {getEmojiImage} from 'aktivitetsmodulrn/src/utils/GradingScale.js'

Get the source of the image of the emoji corresponding to the specified grading.

Params:

NameTypeAttributeDescription
grading number

The grading of the object contiaining the emoji

Return:

Object

source of image

public getFilename(id: number): string source

Gets the filename of activity picture

Params:

NameTypeAttributeDescription
id number

the activity id

Return:

string

the filename for activity picture

public getGrading(): Object source

Returns the grading object

Return:

Object

grading

public getIdFromUsername(username: string): number source

import {getIdFromUsername} from 'aktivitetsmodulrn/src/database/TherapistsDAO.js'

Looks for the given username in the database and returns the id if found.

Params:

NameTypeAttributeDescription
username string

username of therapist

Return:

number

the id number if the therapist is found. -1 if username is empty string -2 if username is not found in the database.

public getLegend(grading: number): string source

Get the legend of the corresponding grading.

Params:

NameTypeAttributeDescription
grading number

The grading of the object contiaining the legend

Return:

string

the legend of the corresponding grading object

public getName(activityId: number): string source

Returns the activity name

Params:

NameTypeAttributeDescription
activityId number

id of activity

Return:

string

name of activity

public getName(id: number): string source

Returns the name of the activity type

Params:

NameTypeAttributeDescription
id number

the activity id

Return:

string

the name of the activity

public getPicture(activityId: number): Object source

Returns the activity picture

Params:

NameTypeAttributeDescription
activityId number

id of activity

Return:

Object

the picture from the activity object

public getPicture(id: number): Object source

Returns the picture of the activity type

Params:

NameTypeAttributeDescription
id number

the activity id

Return:

Object

the picture of the activity

public getPropertiesWithHelp(help: Object): Object[] source

import {getPropertiesWithHelp} from 'aktivitetsmodulrn/src/objects/LionAvatars.js'

Returns properties of the lion corresponding to the given help-object.

Params:

NameTypeAttributeDescription
help Object

Help object

Return:

Object[]

Array containing the posture corresponding to the given parameter, and the image. Returns null if the paramter is undefined.

public getQuestion(activityId: number, questionId: number): Object source

Returns question with given questoinIdd from activity with given activityId

Params:

NameTypeAttributeDescription
activityId number

the id of the activity

questionId number

the id of the question

Return:

Object

the question object

public getQuestion(id: number, questionId: number): Object source

Returns the question with the given activity type id and question id

Params:

NameTypeAttributeDescription
id number

the activity id

questionId number

the id of the question

Return:

Object

the question with given questinonId from activity with given id

public getSpeech(grading: number): string source

Get the speech sound for the specified grading

Params:

NameTypeAttributeDescription
grading number

The grading of the object contiaining the speech

Return:

string

the path of speech of the corresponding grading object

public getTherapistImageFromId(id: number): Object source

import {getTherapistImageFromId} from 'aktivitetsmodulrn/src/database/TherapistsDAO.js'

Gets the image from the therapist object with given id

Params:

NameTypeAttributeDescription
id number

therapist id

Return:

Object

the image of the therapist

public getTherapistNameFromId(id: number): string source

import {getTherapistNameFromId} from 'aktivitetsmodulrn/src/database/TherapistsDAO.js'

Gets the name of a therapist with given id

Params:

NameTypeAttributeDescription
id number

therapist id

Return:

string

name of therapist

public getUser(): Object source

Gets the user object

Return:

Object

the user object

public handleLogin(username: String, setUsername: function, password: String, setPassword: function, therapistId: number, setTherapistId: function, setIsValidConnection: function, setShowErrorMsg: function, setGoToJournal: function): function source

Process the login and set the variables to the correct value.

Params:

NameTypeAttributeDescription
username String

Username of the user

setUsername function

Set the username of the user (string)

password String

Password of the user

setPassword function

Set the password of the user (string)

therapistId number

Id of the therapist

setTherapistId function

Set the id of the therapist (number)

setIsValidConnection function

Set the validity of the connection (boolean, true for valid)

setShowErrorMsg function

Set the code of the error message to be displayed (number)

setGoToJournal function

Set the visibility of the journal (boolean, true to show)

Return:

function

Set values

public handleLogout(setIsLoggedOut: function, setIsValidConnection: function, setGoToJournal: function): Object source

Set values to the given states to process log out.

Params:

NameTypeAttributeDescription
setIsLoggedOut function

Set to true to log out

setIsValidConnection function

Set to true if the connection is valid

setGoToJournal function

Set to true to display the journal

Return:

Object

Logout

public initHelp(id: number): Object[] source

import {initHelp} from 'aktivitetsmodulrn/src/objects/Help.js'

Return properties of the help object with the given id

Params:

NameTypeAttributeDescription
id number

id of help object

Return:

Object[]

help object with extracted information

public iosPlaySound(filename: string) source

import {iosPlaySound} from 'aktivitetsmodulrn/src/utils/SoundUtils.js'

Preferred way of playing sound on ios

Params:

NameTypeAttributeDescription
filename string

name of file that is to be played

public isValidId(id: number): boolean source

Check if the given id is valid

Params:

NameTypeAttributeDescription
id number

The id to be checked.

Return:

boolean

True if the given id is valid

public isValidPassword(therapistId: number, password: string): boolean source

import {isValidPassword} from 'aktivitetsmodulrn/src/database/TherapistsDAO.js'

Checks if the given password is the correct password for the given therapist id.

Params:

NameTypeAttributeDescription
therapistId number

The id of the therapist;

password string

The password to be checked;

Return:

boolean

True if the password is correct. Otherwise false.

public numberOfAssessments(): number source

import {numberOfAssessments} from 'aktivitetsmodulrn/src/database/UsersDAO.js'

Returns the number of assessmetns

Return:

number

The number of assessments

public numberOfQuestions(id: number): number source

import {numberOfQuestions} from 'aktivitetsmodulrn/src/database/ActivityTypesDAO.js'

Returns the number of questions

Params:

NameTypeAttributeDescription
id number

the activity id

Return:

number

the number of questions in activity with given id

public playSound(filename: string) source

Plays the .wav soundfile corresponding to the filename.

Params:

NameTypeAttributeDescription
filename string

name of file that is to be played

public setActivityCreateDate(date: Date) source

import {setActivityCreateDate} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Sets the activityCreateDate

Params:

NameTypeAttributeDescription
date Date

new activityCreateDate

public setActivityId(activityId: number) source

import {setActivityId} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Sets the id of the Activity

Params:

NameTypeAttributeDescription
activityId number

the new id

public setActivityType(activityType: Object) source

import {setActivityType} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Sets the activity type

Params:

NameTypeAttributeDescription
activityType Object

the activity type

public setAssessment(a: Object) source

import {setAssessment} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Overwrite assessment. Used if user already have an assessment for current activity

Params:

NameTypeAttributeDescription
a Object

assessment that should overwrite the assessment object

public setAssessmentId(id: number) source

import {setAssessmentId} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Sets the id of the assessment

Params:

NameTypeAttributeDescription
id number

the new id

public setBorderStyle(paperColor: string, styles: Object): Object[] source

import {setBorderStyle} from 'aktivitetsmodulrn/src/utils/FormatterUtils.js'

Set the color of the border and add it to the specified style

Params:

NameTypeAttributeDescription
paperColor string

The color of the paper

styles Object

The styles

Return:

Object[]

array of styles containting the border color

public setComment(content: string, textColor: string, paperColor: string) source

Sets the comment which consists of content, and colors. Need colors to display comment in diary

Params:

NameTypeAttributeDescription
content string

the text

textColor string

the color of the text

paperColor string

the color of the paper

public setCreateDate(date: Date) source

import {setCreateDate} from 'aktivitetsmodulrn/src/objects/Assessment.js'

Sets the createDate

Params:

NameTypeAttributeDescription
date Date

new createDate

public setDrawing(drawing: string) source

Sets the drawing

Params:

NameTypeAttributeDescription
drawing string

The path to the drawing

public setGrading(grading: Object) source

Sets the grading for a question. Overwrites previous gradings for same question

Params:

NameTypeAttributeDescription
grading Object

new grading

public smileyometerAnimationDelay(grading: boolean, comment: boolean, drawing: boolean): number[] source

import {smileyometerAnimationDelay} from 'aktivitetsmodulrn/src/utils/TimerUtils.js'

Receives parts of assessment, and returns timer delay values based on true or false

Params:

NameTypeAttributeDescription
grading boolean

True if the timer delay is for grading

comment boolean

True if the timer delay is for free text

drawing boolean

True if the timer delay is for drawing

Return:

number[]

Array of timer delay values as ints [gradingDelay, commentDelay, drawingDelay, complimentDelay]

public stopSound() source

Stops the currently playing sound.

public timedEvent(func: function, time: number, id: number) source

A timed event. Runs function after time

Params:

NameTypeAttributeDescription
func function

Function to be executed after time

time number

Time before function should execute

id number

Id of event