Module frontend.app.helpers
Functions
def create_monitoring(id, form)-
Creates a cron job for monitoring based on the provided form data.
Args
id:int- The ID of the monitoring task.
form:MonitoringForm- The form containing the scheduling details.
def get_options(question)-
Retrieves and formats answer options for a given question based on its type.
Args
question:Question- The question object for which to get options.
Returns
AnswerForm- A form with fields populated based on the question's options and type.
def percentage_calc(value, total_value, type)-
Calculates the percentage of a given value relative to a total value.
Args
value:float- The value to calculate the percentage of.
total_value:float- The total value used for percentage calculation.
type:str- The format of the result - "int", "float", or "str".
Returns
strorfloat- The calculated percentage in the specified format.