dokeos-exercise
[ class tree: dokeos-exercise ] [ index: dokeos-exercise ] [ all elements ]

Procedural File: hotpotatoes.lib.php

Source Location: /main/exercice/hotpotatoes.lib.php



Page Details:

Code library for HotPotatoes integration.



Tags:

author:  Istvan Mandak
version:  $Id: hotpotatoes.lib.php 10789 2007-01-18 19:18:27Z pcool $








CheckImageName [line 312]

mixed CheckImageName( reference &$imgparams, string $string)

Look for the image name into an array



Tags:

return:  String given if found, false otherwise
uses:  myarraysearch() - This function is just an additional layer on the myarraysearch() function


Parameters

reference   &$imgparams   Reference to an array to search
string   $string   String to look for
[ Top ]



CheckSubFolder [line 428]

integer CheckSubFolder( string $path)

Checks if there are subfolders



Tags:

return:  1 if a subfolder was found, 0 otherwise


Parameters

string   $path   Path
[ Top ]



FillFolderName [line 352]

string FillFolderName( string $name, integer $nsize)

Fills the folder name up to a certain length with "0"



Tags:

return:  Modified folder name


Parameters

string   $name   Original folder name
integer   $nsize   Length to reach
[ Top ]



GenerateHiddenList [line 270]

string GenerateHiddenList( array $imgparams)

Generates a list of hidden fields with the image params given as parameter to this function



Tags:

return:  String containing the hidden parameters built from the list given


Parameters

array   $imgparams   List of image parameters
[ Top ]



GenerateHpFolder [line 368]

string GenerateHpFolder( string $folder)

Generates the HotPotato folder tree



Tags:

return:  Folder name (modified)


Parameters

string   $folder   Folder path
[ Top ]



GetComment [line 105]

string GetComment( string $path)

Gets the comment about a file from the corresponding database record



Tags:

return:  Comment from the database record


Parameters

string   $path   File path
[ Top ]



GetFileName [line 138]

string GetFileName( string $fname)

Get the name of the file from a path (without the extension)

This assumes the path is made of elements split by '/', not '\' or '\\'




Tags:

return:  File name
usedby:  GetImgName() - No comment


Parameters

string   $fname   Path
[ Top ]



GetFolderName [line 402]

string GetFolderName( string $fname)

Gets the folder name (strip down path)



Tags:

return:  Folder name stripped down


Parameters

string   $fname   Path
[ Top ]



GetFolderPath [line 414]

string GetFolderPath( string $fname)

Gets the folder path (withouth the name of the folder itself) ?



Tags:

return:  Path stripped down


Parameters

string   $fname   Path
[ Top ]



GetImgName [line 181]

string GetImgName( string $imgtag)

Gets the name of an img whose path is given (without directories or extensions)



Tags:

return:  The image file name or an empty string
uses:  GetFileName() - No comment


Parameters

string   $imgtag   An image tag (<img src="...." ...>)
[ Top ]



GetImgParams [line 243]

void GetImgParams( string $fname, string $fpath, reference &$imgparams, reference &$imgcount)

Gets the image parameters from an image path



Parameters

string   $fname   File name
string   $fpath   File path
reference   &$imgparams   Reference to a list of image parameters (emptied, then used to return results)
reference   &$imgcount   Reference to a counter of images (emptied, then used to return results)
[ Top ]



GetQuizName [line 71]

string GetQuizName( string $fname, string $fpath)

Gets the title of the quizz file given as parameter



Tags:

return:  The exercise title


Parameters

string   $fname   File name
string   $fpath   File path
[ Top ]



GetSrcName [line 219]

string GetSrcName( string $imgtag)

Gets the source path of an image tag



Tags:

return:  The image source or ""


Parameters

string   $imgtag   An image tag
[ Top ]



hotpotatoes_init [line 39]

boolean hotpotatoes_init( string $baseWorkDir)

Creates a hotpotato directory

If a directory of that name already exists, don't create any. If a file of that name exists, remove it and create a directory




Tags:

return:  Always true so far


Parameters

string   $baseWorkDir   Wanted path
[ Top ]



HotPotGCt [line 454]

void HotPotGCt( string $folder, integer $flag, integer $userID)

Hotpotato Garbage Collector



Tags:

return:  No return value, but echoes results


Parameters

string   $folder   Path
integer   $flag   Flag
integer   $userID   User id
[ Top ]



myarraysearch [line 288]

mixed myarraysearch( reference &$array, string $node)

Searches for a node in the given array



Tags:

return:  Node name or false if not found
usedby:  CheckImageName() - This function is just an additional layer on the myarraysearch() function


Parameters

reference   &$array   Reference to the array to search
string   $node   Node we are looking for in the array
[ Top ]



ReadFileCont [line 150]

string ReadFileCont( string $full_file_path)

Reads the file contents into a string



Tags:

return:  The file contents


Parameters

string   $full_file_path   Urlencoded path
[ Top ]



ReplaceImgTag [line 323]

string ReplaceImgTag( string $content)

Replaces an image tag by ???



Tags:

return:  The modified content


Parameters

string   $content   The content to replace
[ Top ]



SetComment [line 123]

string SetComment( string $path, string $comment)

Sets the comment in the database for a particular path



Tags:

return:  Result of the database operation (api_sql_query will output some message directly on error anyway)


Parameters

string   $path   File path
string   $comment   Comment to set
[ Top ]



WriteFileCont [line 166]

void WriteFileCont( string $full_file_path, string $content)

Writes the file contents into the file given



Parameters

string   $full_file_path   Urlencoded path
string   $content   The file contents
[ Top ]



Documentation generated on Wed, 05 Sep 2007 06:14:46 +0200 by phpDocumentor 1.4.0