Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Course units: add h5p content as resource.
--HG-- branch : 3.12
- Loading branch information
Showing
6 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/** | ||
* @brief display available h5p | ||
*/ | ||
function list_h5p() { | ||
global $id, $course_id, $tool_content, $urlServer, | ||
$langAddModulesButton, $langChoice, $langH5pNoContent, | ||
$course_code, $langH5p; | ||
|
||
$result = Database::get()->queryArray("SELECT * FROM h5p_content WHERE course_id = ?d ORDER BY title", $course_id); | ||
$h5pinfo = array(); | ||
foreach ($result as $row) { | ||
$h5pinfo[] = array( | ||
'id' => $row->id, | ||
'title' => $row->title); | ||
} | ||
if (count($h5pinfo) == 0) { | ||
$tool_content .= "<div class='alert alert-warning'>$langH5pNoContent</div>"; | ||
} else { | ||
$tool_content .= "<form action='insert.php?course=$course_code' method='post'>" . | ||
"<input type='hidden' name='id' value='$id'>" . | ||
"<table class='table-default'>" . | ||
"<tr class='list-header'>" . | ||
"<th><div class='text-left'> $langH5p</div></th>" . | ||
"<th width='80'>$langChoice</th>" . | ||
"</tr>"; | ||
foreach ($h5pinfo as $entry) { | ||
$tool_content .= "<tr>"; | ||
$tool_content .= "<td> " . icon('fa fa-tablet') . " <a href='${urlServer}modules/h5p/view.php?id=$entry[id]&course=$course_code'>" . q($entry['title']) . "</a></td>"; | ||
$tool_content .= "<td class='text-center'><input type='checkbox' name='h5p[]' value='$entry[id]'></td>"; | ||
$tool_content .= "</tr>"; | ||
} | ||
$tool_content .= "</table>"; | ||
$tool_content .= "<div class='text-right'>"; | ||
$tool_content .= "<input class='btn btn-primary' type='submit' name='submit_h5p' value='$langAddModulesButton'></div></form>"; | ||
|
||
} | ||
} |