Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/survey/lib.php File Reference

Go to the source code of this file.

Namespaces

namespace  mod
 

Local Library of functions for module scorm.


Enumerations

enum  SURVEY_COLLES_ACTUAL
enum  SURVEY_COLLES_PREFERRED
enum  SURVEY_COLLES_PREFERRED_ACTUAL
enum  SURVEY_ATTLS
enum  SURVEY_CIQ

Functions

 survey_add_instance ($survey)
 survey_update_instance ($survey)
 survey_delete_instance ($id)
 survey_user_outline ($course, $user, $mod, $survey)
 survey_user_complete ($course, $user, $mod, $survey)
 survey_print_recent_activity ($course, $viewfullnames, $timestart)
 survey_get_participants ($surveyid)
 survey_log_info ($log)
 survey_get_responses ($surveyid, $groupid, $groupingid)
 survey_get_analysis ($survey, $user)
 survey_update_analysis ($survey, $user, $notes)
 survey_get_user_answers ($surveyid, $questionid, $groupid, $sort="sa.answer1,sa.answer2 ASC")
 survey_get_user_answer ($surveyid, $questionid, $userid)
 survey_add_analysis ($survey, $user, $notes)
 survey_already_done ($survey, $user)
 survey_count_responses ($surveyid, $groupid, $groupingid)
 survey_print_all_responses ($cmid, $results, $courseid)
 survey_get_template_name ($templateid)
 survey_shorten_name ($name, $numwords)
 survey_print_multi ($question)
 survey_print_single ($question)
 survey_question_rowclass ($qnum)
 survey_print_graph ($url)
 survey_get_view_actions ()
 survey_get_post_actions ()
 survey_reset_course_form_definition (&$mform)
 survey_reset_course_form_defaults ($course)
 survey_reset_userdata ($data)
 survey_get_extra_capabilities ()
 survey_supports ($feature)
 survey_extend_navigation ($navigation, $course, $module, $cm)
 survey_extend_settings_navigation ($settings, $surveynode)
 survey_page_type_list ($pagetype, $parentcontext, $currentcontext)

Variables

global $SURVEY_GHEIGHT = 500
global $SURVEY_GWIDTH = 900
global $SURVEY_QTYPE

Enumeration Type Documentation

Definition at line 55 of file lib.php.

enum SURVEY_CIQ

Definition at line 56 of file lib.php.

Definition at line 52 of file lib.php.

Definition at line 53 of file lib.php.

Definition at line 54 of file lib.php.


Function Documentation

survey_add_analysis ( survey,
user,
notes 
)

object

Parameters:
int$survey
int$user
string$notes
Returns:
bool|int

Definition at line 433 of file lib.php.

survey_add_instance ( survey)

Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the new instance.

object

Parameters:
object$survey
Returns:
int|bool

Definition at line 70 of file lib.php.

survey_already_done ( survey,
user 
)

object

Parameters:
int$survey
int$user
Returns:
bool

Definition at line 449 of file lib.php.

Here is the caller graph for this function:

survey_count_responses ( surveyid,
groupid,
groupingid 
)
Parameters:
int$surveyid
int$groupid
int$groupingid
Returns:
int

Definition at line 460 of file lib.php.

Here is the call graph for this function:

Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.

object

Parameters:
int$id
Returns:
bool

Definition at line 117 of file lib.php.

survey_extend_navigation ( navigation,
course,
module,
cm 
)

This fucntion extends the global navigation for the site. It is important to note that you should not rely on PAGE objects within this body of code as there is no guarantee that during an AJAX request they are available

Parameters:
navigation_node$navigationThe quiz node within the global navigation
stdClass$courseThe course object returned from the DB
stdClass$moduleThe module object returned from the DB
stdClass$cmThe course module instance returned from the DB

This is currently just a stub so that it can be easily expanded upon. When expanding just remove this comment and the line below and then add you content.

Definition at line 827 of file lib.php.

survey_extend_settings_navigation ( settings,
surveynode 
)

This function extends the settings navigation block for the site.

It is safe to rely on PAGE here as we will only ever be within the module context when this is called

Parameters:
navigation_node$settings
navigation_node$surveynode

Definition at line 845 of file lib.php.

Here is the call graph for this function:

survey_get_analysis ( survey,
user 
)

object

Parameters:
int$survey
int$user
Returns:
array

Definition at line 355 of file lib.php.

Returns all other caps used in module

Returns:
array

Definition at line 785 of file lib.php.

survey_get_participants ( surveyid)

Returns the users with data in one survey (users with records in survey_analysis and survey_answers, students)

Todo:
: deprecated - to be deleted in 2.2
Parameters:
int$surveyid
Returns:
array

Definition at line 279 of file lib.php.

Returns:
array

Definition at line 720 of file lib.php.

survey_get_responses ( surveyid,
groupid,
groupingid 
)

object

Parameters:
int$surveyid
int$groupid
int$groupingid
Returns:
array

Definition at line 324 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

survey_get_template_name ( templateid)

object

Parameters:
int$templateid
Returns:
string

Definition at line 494 of file lib.php.

survey_get_user_answer ( surveyid,
questionid,
userid 
)

object

Parameters:
int$surveyid
int$questionid
int$userid
Returns:
array

Definition at line 415 of file lib.php.

Here is the caller graph for this function:

survey_get_user_answers ( surveyid,
questionid,
groupid,
sort = "sa.answer1,sa.answer2 ASC" 
)

object

Parameters:
int$surveyid
int$groupid
string$sort
Returns:
array

Definition at line 385 of file lib.php.

Here is the call graph for this function:

Returns:
array

Definition at line 713 of file lib.php.

survey_log_info ( log)

object

Parameters:
sting$log
Returns:
array

Definition at line 310 of file lib.php.

survey_page_type_list ( pagetype,
parentcontext,
currentcontext 
)

Return a list of page types

Parameters:
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block

Definition at line 876 of file lib.php.

survey_print_all_responses ( cmid,
results,
courseid 
)
Parameters:
int$cmid
array$results
int$courseid

Definition at line 473 of file lib.php.

Here is the call graph for this function:

survey_print_graph ( url)

object int int

Parameters:
string$url

Definition at line 698 of file lib.php.

Here is the caller graph for this function:

survey_print_multi ( question)
Todo:
Check this function

object object int void This is never defined object This is defined twice?

Parameters:
object$question

Definition at line 531 of file lib.php.

Here is the call graph for this function:

survey_print_recent_activity ( course,
viewfullnames,
timestart 
)

stdClass object

Parameters:
object$course
mixed$viewfullnames
int$timestamp
Returns:
bool

Definition at line 214 of file lib.php.

Here is the call graph for this function:

survey_print_single ( question)

object int

Parameters:
object$question

Definition at line 640 of file lib.php.

Here is the call graph for this function:

Parameters:
int$qnum
Returns:
string

Definition at line 683 of file lib.php.

Here is the caller graph for this function:

Course reset form defaults.

Returns:
array

Definition at line 742 of file lib.php.

Implementation of the function for printing the form elements that control whether the course reset functionality affects the survey.

Parameters:
object$mformform passed by reference

Definition at line 731 of file lib.php.

survey_reset_userdata ( data)

Actual implementation of the reset course functionality, delete all the survey responses for course $data->courseid.

object

Parameters:
$datathe data submitted from the reset course.
Returns:
array status array

Definition at line 754 of file lib.php.

survey_shorten_name ( name,
numwords 
)
Parameters:
string$name
array$numwords
Returns:
string

Definition at line 512 of file lib.php.

survey_supports ( feature)

FEATURE_GROUPS FEATURE_GROUPINGS FEATURE_GROUPMEMBERSONLY FEATURE_MOD_INTRO FEATURE_COMPLETION_TRACKS_VIEWS FEATURE_GRADE_HAS_GRADE FEATURE_GRADE_OUTCOMES

Parameters:
string$featureFEATURE_xx constant for requested feature
Returns:
mixed True if module supports feature, false if not, null if doesn't know

Definition at line 800 of file lib.php.

survey_update_analysis ( survey,
user,
notes 
)

object

Parameters:
int$survey
int$user
string$notes

Definition at line 369 of file lib.php.

survey_update_instance ( survey)

Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.

object

Parameters:
object$survey
Returns:
bool

Definition at line 94 of file lib.php.

survey_user_complete ( course,
user,
mod,
survey 
)

stdObject object SURVEY_CIQ

Parameters:
object$course
object$user
object$mod
object$survey

Definition at line 172 of file lib.php.

Here is the call graph for this function:

survey_user_outline ( course,
user,
mod,
survey 
)

object

Parameters:
object$course
object$user
object$mod
object$survey
Returns:
$result

Definition at line 149 of file lib.php.


Variable Documentation

$SURVEY_GHEIGHT = 500

Graph size int $SURVEY_GHEIGHT

Definition at line 28 of file lib.php.

$SURVEY_GWIDTH = 900

Graph size int $SURVEY_GWIDTH

Definition at line 34 of file lib.php.

$SURVEY_QTYPE
Initial value:
 array (
        "-3" => "Virtual Actual and Preferred",
        "-2" => "Virtual Preferred",
        "-1" => "Virtual Actual",
         "0" => "Text",
         "1" => "Actual",
         "2" => "Preferred",
         "3" => "Actual and Preferred",
        )

Question Type array $SURVEY_QTYPE

Definition at line 40 of file lib.php.

 All Data Structures Namespaces Files Functions Variables Enumerations