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 ClipitQuizQuestion

A Quiz Question containing a main question (in the "name" and "description" properties), with a set of Options, a Validation array with the correct pattern of Options, a Difficulty value, can be Tagged, can be linked to a Video, and contains links to all Results submitted by Students to this Question.

UBItem
Extended by ClipitQuizQuestion
Package: ClipIt\clipit\api
License: Affero General Public License v3
Author: Pablo LlinĂ¡s Arnaiz <pebs74@gmail.com>, URJC JuxtaLearn Team
Located at ClipitQuizQuestion.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 static[]
# get_from_quiz( integer $quiz_id )

Get all Questions from a Quiz ID

Get all Questions from a Quiz ID

Parameters

$quiz_id
integer
$quiz_id Quiz ID

Returns

static[]
Quiz question array
public static integer|null
# get_image( integer $id )

Get the image ID (ClipitFile) linked to a Quiz Question

Get the image ID (ClipitFile) linked to a Quiz Question

Parameters

$id
integer
$id ID of the ClipitQuizQuestion

Returns

integer|null
ID of linked image file (ClipitFile)
public static boolean
# set_image( integer $id, integer $image_id )

Set the image (ClipitFile) linked to a Quiz Question

Set the image (ClipitFile) linked to a Quiz Question

Parameters

$id
integer
$id ID of Quiz Question
$image_id
integer
$image_id ID of image file (ClipitFile)

Returns

boolean
True if ok, False if error.
public static static[]
# get_from_video( mixed $video_url )

Get Quiz Questions linked to a Video URL

Get Quiz Questions linked to a Video URL

Parameters

$video_url
mixed
$video_url URL of video (optionally in Base64)

Returns

static[]
Array of Quiz Questions
public static
# evaluate_results( mixed $id )
public static boolean
# add_quiz_results( integer $id, array $result_array )

Parameters

$id
integer
$id
$result_array
array
$result_array

Returns

boolean
public static boolean
# set_quiz_results( integer $id, array $result_array )

Parameters

$id
integer
$id
$result_array
array
$result_array

Returns

boolean
public static boolean
# remove_quiz_results( mixed $id, mixed $result_array )

Parameters

$id
mixed
$id
$result_array
mixed
$result_array

Returns

boolean
public static array|boolean
# get_quiz_results( integer $id )

Get all Quiz Results from a specified Quiz Question.

Get all Quiz Results from a specified Quiz Question.

Parameters

$id
integer
$id Id of Quiz Question to get Results form

Returns

array|boolean
Array of Quiz Result IDs, or false if error
public static boolean
# add_tags( integer $id, array $tag_array )

Add a list of Stumbling Block Tags to a Quiz Question.

Add a list of Stumbling Block Tags to a Quiz Question.

Parameters

$id
integer
$id Id of the Quiz Question
$tag_array
array
$tag_array Array of Tags to add to the Quiz Question

Returns

boolean
True if success, false if error
public static boolean
# set_tags( integer $id, array $tag_array )

Set a list of Stumbling Block Tags to a Quiz Question.

Set a list of Stumbling Block Tags to a Quiz Question.

Parameters

$id
integer
$id Id of the Quiz Question
$tag_array
array
$tag_array Array of Tags to set to the Quiz Question

Returns

boolean
True if success, false if error
public static boolean
# remove_tags( integer $id, array $tag_array )

Remove a list of Stumbling Block Tags from a Quiz Question.

Remove a list of Stumbling Block Tags from a Quiz Question.

Parameters

$id
integer
$id Id of the Quiz Question
$tag_array
array
$tag_array Array of Tags to remove from the Quiz Question

Returns

boolean
True if success, false if error
public static array|boolean
# get_tags( integer $id )

Get all Stumbling Block Tags for a Quiz Question.

Get all Stumbling Block Tags for a Quiz Question.

Parameters

$id
integer
$id Id from the Quiz Question to get Stumbling Block Tags from

Returns

array|boolean
Returns an array of Tag IDs, or false if error
public static
# set_type_true_false( mixed $id )
public static
# set_type_select_one( mixed $id )
public static
# set_type_select_multi( mixed $id )
public static
# set_type_number( mixed $id )
Methods inherited from UBItem
__construct(), count_all(), create(), create_clone(), 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(), set_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_QUIZQUESTION_TAG "ClipitQuizQuestion-ClipitTag"
#
string REL_QUIZQUESTION_QUIZRESULT "ClipitQuizQuestion-ClipitQuizResult"
#
string REL_QUIZQUESTION_IMAGE "ClipitQuizQuestion-ClipitFile"
#
string TYPE_TRUE_FALSE "true_false"
#
string TYPE_SELECT_ONE "select_one"
#
string TYPE_SELECT_MULTI "select_multi"
#
string TYPE_NUMBER "number"
#
Constants inherited from UBItem
REL_PARENT_CLONE, SUBTYPE, TYPE
Properties summary
public array $option_array array()
#

Array of options to chose from as an answer to the question

Array of options to chose from as an answer to the question

public array $validation_array array()
#

Array for validation of the options

Array for validation of the options

public string $option_type ""
#

Type of Question: single choice, multiple choice, select 2...

Type of Question: single choice, multiple choice, select 2...

public array $tag_array array()
#

Array of Tags relevant to this question

Array of Tags relevant to this question

public array $quiz_result_array array()
#

Array of Quiz Results which answer this Quiz Question

Array of Quiz Results which answer this Quiz Question

public string $video ""
#

URL of ClipitVideo refered to by this question (optional)

URL of ClipitVideo refered to by this question (optional)

public integer $image 0
#

ID of image file (ClipitFile) to show next to the Quiz Question (optional)

ID of image file (ClipitFile) to show next to the Quiz Question (optional)

public integer $difficulty 0
#

Difficulty of the QuizQuestion, in an integer scale from 1 to 10.

Difficulty of the QuizQuestion, in an integer scale from 1 to 10.

public integer $order 0
#

Order in which this QuizQuestion will be displayed to students

Order in which this QuizQuestion will be displayed to students

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