Overview

Packages

  • ClipIt
    • clipit
      • api
    • urjc
      • backend
  • Elgg
    • Core
      • Access
      • Authentication
      • Cache
      • Caches
      • Core
      • DataMode
        • Site
      • DataModel
        • Annotations
        • Entities
        • Extender
        • File
        • Importable
        • Loggable
        • Notable
        • Object
        • User
      • DataStorage
      • Exception
      • Exceptions
        • Stub
      • FileStore
        • Disk
      • Groups
      • Helpers
      • HMAC
      • Memcache
      • Metadata
      • Navigation
      • ODD
      • Output
      • Plugins
        • Settings
      • Sessions
      • SocialModel
        • Friendable
        • Locatable
      • WebServicesAPI
      • Widgets
      • XML
      • XMLRPC
    • Exceptions
      • Stub
  • None
  • PHP

Classes

  • ClipitActivity
  • ClipitChat
  • ClipitComment
  • ClipitEvent
  • ClipitExample
  • ClipitFile
  • ClipitGroup
  • ClipitLA
  • ClipitLabel
  • ClipitPerformanceItem
  • ClipitPerformanceRating
  • ClipitPost
  • ClipitQuiz
  • ClipitQuizQuestion
  • ClipitQuizResult
  • ClipitRating
  • ClipitRemoteTrickyTopic
  • ClipitRemoteVideo
  • ClipitResource
  • ClipitSite
  • ClipitStoryboard
  • ClipitTag
  • ClipitTagRating
  • ClipitTask
  • ClipitTrickyTopic
  • ClipitUser
  • ClipitVideo
  • Overview
  • Package
  • Class
  • Tree

Class ClipitQuiz

A collection of Quiz Questions, with a link to a Tricky Topic, links to the Tricky Topic Tool Quiz answering and score review URLs, and Author name.

UBItem
Extended by ClipitQuiz
Package: ClipIt\clipit\api
License: Affero General Public License v3
Author: Pablo LlinĂ¡s Arnaiz <pebs74@gmail.com>, URJC JuxtaLearn Team
Located at ClipitQuiz.php
Methods summary
protected
# copy_from_elgg( ElggEntity $elgg_entity )

Loads object parameters stored in Elgg

Loads object parameters stored in Elgg

Parameters

$elgg_entity
ElggEntity
$elgg_entity Elgg Object to load parameters from.

Overrides

UBItem::copy_from_elgg()
protected
# copy_to_elgg( ElggEntity $elgg_entity )

Copy $this object parameters into an Elgg entity.

Copy $this object parameters into an Elgg entity.

Parameters

$elgg_entity
ElggEntity
$elgg_entity Elgg object instance to save $this to

Overrides

UBItem::copy_to_elgg()
protected boolean|integer
# save( boolean $double_save = false )

Saves this instance to the system.

Saves this instance to the system.

Parameters

$double_save
boolean
$double_save if $double_save is true, this object is saved twice to ensure that all properties are updated properly. E.g. the time created property can only beset on ElggObjects during an update. Defaults to false!

Returns

boolean|integer
Returns the Id of the saved instance, or false if error

Overrides

UBItem::save()
public static boolean|integer
# create_clone( integer $id, boolean $linked = true, boolean $keep_owner = false )

Clones a ClipitQuiz, including the contained ClipitQuizQuestions

Clones a ClipitQuiz, including the contained ClipitQuizQuestions

Parameters

$id
integer
$id ID of Quiz to clone
$linked
boolean
$linked Whether the clone will be linked to the parent object
$keep_owner
boolean
$keep_owner Selects whether the clone will keep the parent item's owner (default: no)

Returns

boolean|integer
ID of new cloned object

Throws

InvalidParameterException
if error

Overrides

UBItem::create_clone()
public static integer|boolean
# set_properties( integer $id, array $prop_value_array )

Sets values to specified properties of an Item

Sets values to specified properties of an Item

Parameters

$id
integer
$id Id of Item to set property values
$prop_value_array
array
$prop_value_array Array of property=>value pairs to set into the Item

Returns

integer|boolean
Returns Id of Item if correct, or false if error

Throws

InvalidParameterException

Overrides

UBItem::set_properties()
public static
# get_task( mixed $id )
public static
# get_tricky_topic( mixed $id )
public static
# set_tricky_topic( mixed $id, mixed $tricky_topic )
public static
# get_from_tricky_topic( mixed $tricky_topic_id )
public static
# set_quiz_as_finished( mixed $id, mixed $user_id )
public static
# set_quiz_start( mixed $id, mixed $user_id )
public static
# remove_quiz_start( mixed $id, mixed $user_array )
public static integer|null
# get_quiz_start( mixed $id, mixed $user_id )

Parameters

$id
mixed
$id
$user_id
mixed
$user_id

Returns

integer|null
public static boolean
# has_finished_quiz( integer $id, integer $user_id )

Returns whether a user has finished a Quiz

Returns whether a user has finished a Quiz

Parameters

$id
integer
$id The Quiz ID
$user_id
integer
$user_id The User ID

Returns

boolean
'true' if yes, 'false' if no
public static
# questions_answered_by_user( mixed $id, mixed $user_id )
public static array
# get_user_results_by_question( integer $id, integer $user_id )

Returns the average results by Question for a Quiz for a User, normalized from 0 to 1.

Returns the average results by Question for a Quiz for a User, normalized from 0 to 1.

Parameters

$id
integer
$id Quiz ID
$user_id
integer
$user_id User ID

Returns

array
Array of question_id=>$result, where the result is a float from 0 to 1. Empty array if the user has not finished the Quiz.
public static array
# get_group_results_by_question( integer $id, integer $group_id )

Returns the average results by Question for a Quiz among a Group. Students who have not finished the Quiz will not be counted.

Returns the average results by Question for a Quiz among a Group. Students who have not finished the Quiz will not be counted.

Parameters

$id
integer
$id Quiz ID
$group_id
integer
$group_id Group ID

Returns

array
Array of $question_id=>$result, where the result is a float from 0 to 1. Empty array if none of the students in the group have answered the Quiz.
public static array
# get_user_results_by_tag( integer $id, integer $user_id )

Returns the average results by Tag for a Quiz for a User, normalized from 0 to 1.

Returns the average results by Tag for a Quiz for a User, normalized from 0 to 1.

Parameters

$id
integer
$id Quiz ID
$user_id
integer
$user_id User ID

Returns

array
Array of tag_id=>$result, where the result is a float from 0 to 1. Empty array if the user has not finished the Quiz.
public static array
# get_group_results_by_tag( integer $id, integer $group_id )

Returns the average results by Tag for a Quiz among a Group. Students who have not finished the Quiz will not be counted.

Returns the average results by Tag for a Quiz among a Group. Students who have not finished the Quiz will not be counted.

Parameters

$id
integer
$id Quiz ID
$group_id
integer
$group_id Group ID

Returns

array
Array of $tag_id=>$result, where the result is a float from 0 to 1. Empty array if none of the students in the group have answered the Quiz.
public static array
# get_quiz_results_by_tag( integer $id )

Returns the average results by Tag for a Quiz among all the results. Results from students who have not finished the Quiz will not be counted.

Returns the average results by Tag for a Quiz among all the results. Results from students who have not finished the Quiz will not be counted.

Parameters

$id
integer
$id Quiz ID

Returns

array
Array of $tag_id=>$result where the result is a float from 0 to 1. Empty array of there are no results for the Quiz.
public static
# evaluate_results( mixed $id )
public static boolean
# add_quiz_questions( integer $id, array $question_array )

Adds Quiz Questions to a Quiz.

Adds Quiz Questions to a Quiz.

Parameters

$id
integer
$id Id from Quiz to add Questions to
$question_array
array
$question_array Array of Questions to add

Returns

boolean
Returns true if success, false if error
public static boolean
# set_quiz_questions( integer $id, array $question_array )

Sets Quiz Questions to a Quiz.

Sets Quiz Questions to a Quiz.

Parameters

$id
integer
$id Id from Quiz to set Questions to
$question_array
array
$question_array Array of Questions to set

Returns

boolean
Returns true if success, false if error
public static boolean
# remove_quiz_questions( integer $id, array $question_array )

Remove Quiz Questions from a Quiz.

Remove Quiz Questions from a Quiz.

Parameters

$id
integer
$id Id from Quiz to remove Questions from
$question_array
array
$question_array Array of Questions to remove

Returns

boolean
Returns true if success, false if error
public static array|boolean
# get_quiz_questions( integer $id )

Get an array of Quiz Questions included in a Quiz.

Get an array of Quiz Questions included in a Quiz.

Parameters

$id
integer
$id The Id of the Quiz to get questions from

Returns

array|boolean
Returns an array of ClipitQuizQuestion IDs, or false if error
public static
# export_to_excel( mixed $id )
Methods inherited from UBItem
__construct(), count_all(), create(), delete_all(), delete_by_id(), get_all(), get_all_parents(), get_by_id(), get_by_owner(), get_clone_tree(), get_cloned_from(), get_clones(), get_events(), get_from_search(), get_properties(), link_parent_clone(), list_properties(), sort_by_date(), sort_by_date_inv(), sort_by_name(), sort_by_name_inv(), sort_numbers(), sort_numbers_inv(), unlink_from_clones(), unlink_from_parent()
Constants summary
string REL_QUIZ_TRICKYTOPIC "ClipitQuiz-ClipitTrickyTopic"
#
string REL_QUIZ_QUIZQUESTION "ClipitQuiz-ClipitQuizQuestion"
#
string REL_QUIZ_USER "ClipitQuiz-ClipitUser"
#
string VIEW_MODE_LIST "list"
#
string VIEW_MODE_PAGED "paged"
#
string TARGET_CLIPIT "clipit"
#
string TARGET_LARGEDISPLAY "large_display"
#
Constants inherited from UBItem
REL_PARENT_CLONE, SUBTYPE, TYPE
Properties summary
public string $target ""
#

Target interface for Quiz display (e.g.: "clipit", "large display"...)

Target interface for Quiz display (e.g.: "clipit", "large display"...)

public boolean $public false
#

Specifies whether the Quiz can be reused by other teachers (optional, default = false)

Specifies whether the Quiz can be reused by other teachers (optional, default = false)

public array $quiz_question_array array()
#

Array of ClipitQuizQuestion ids (int) included in this Quiz (optional)

Array of ClipitQuizQuestion ids (int) included in this Quiz (optional)

public integer $tricky_topic 0
#

Id of tricky topic used for this Quiz (optional)

Id of tricky topic used for this Quiz (optional)

public string $view_mode ""
#
public integer $max_time 0
#

$max_time Maximum time in seconds to perform the quiz since it's opened by a student (0 = unlimited)

$max_time Maximum time in seconds to perform the quiz since it's opened by a student (0 = unlimited)

Properties inherited from UBItem
$clone_array, $cloned_from, $description, $id, $name, $owner_id, $time_created, $url
API documentation generated by ApiGen 2.8.0