Ejemplo n.º 1
0
require_once 'lib/php/vt/WimbaVoicetoolsAPI.php';
require_once 'lib/php/vt/VtAction.php';
$messageProduct = optional_param("messageProduct", "");
$messageAction = optional_param("messageAction", "");
$notool = optional_param("novoicetools", "false");
$keys = array_merge(getKeysOfGeneralParameters(), getKeyWimbaVoiceForm());
foreach ($keys as $param) {
    $value = optional_param($param["value"], $param["default_value"], $param["type"]);
    if ($value != null) {
        $params[$param["value"]] = $value;
    }
}
wimba_add_log(WIMBA_DEBUG, voiceboard_LOGS, "manageAction : parameters  \n" . print_r($params, true));
require_login($params["enc_course_id"]);
$session = new WimbaMoodleSession($params);
$redirectionUrl = 'welcome.php?id=' . $params["enc_course_id"] . '&' . voiceboard_get_url_params($params["enc_course_id"]) . '&time=' . $session->timeOfLoad;
$urlModuleForm = $CFG->wwwroot . '/course/mod.php?section=0&sesskey=' . sesskey() . '&id=' . $session->getCourseId() . '&add=voiceboard&rid=';
$messageType = "";
if ($session->error === false && $session != NULL) {
    $vtAction = new vtAction($session->getEmail(), $params);
    if ($params['action'] == 'launch') {
        $session->setCurrentVtUSer($params["type"]);
        if ($params["studentView"] == "true") {
            $session->setVtUserRigths($params["type"], "student");
        }
        $resource = voicetools_api_get_resource($params["resource_id"]);
        $result = $vtAction->getVtSession($resource, $session->getVtUser(), $session->getVtUserRigths());
        if ($result != NULL) {
            wimba_add_log(WIMBA_DEBUG, voiceboard_LOGS, "launch the " . $params["type"] . ", nid =" . $result->getNid());
            if (!empty($params["filter_screen_name"])) {
                redirection($CFG->voicetools_servername . '/' . $params["type"] . '?action=display_popup&nid=' . $result->getNid() . "&filter_screen_name=" . $params["filter_screen_name"]);
Ejemplo n.º 2
0
    //we get the student by getting the diff of the two arrays
    $users_key = array_keys($students);
    $vtAction = new vtAction($session->getEmail(), $params);
    $resource = $vtAction->getResource($resource_id);
    if ($resource === false) {
        //problem to get the grade
        redirection($redirectionUrl . '&error=problem_vt');
    }
    $options = $resource->getOptions();
    $isAverageMethodAvailable = true;
    $arrayAverageLength = $vtAction->getAverageMessageLengthPerUser($resource_id);
    if ($arrayAverageLength == "not_implemented") {
        $isAverageMethodAvailable = false;
    }
    $arrayNbMessage = $vtAction->getNbMessagePerUser($resource_id);
    $urlParams = 'resource_id=' . $resource_id . '&type=board&id=' . $params["enc_course_id"] . '&' . voiceboard_get_url_params($params["enc_course_id"]) . '&time=' . $session->timeOfLoad;
    $previousGrade = grade_get_grades($params["enc_course_id"], "mod", "voiceboard", $params["gradeId"], $users_key);
    if (!empty($previousGrade) && isset($previousGrade->items[0])) {
        //extract only the grade information from the object that we get
        //we take the items 0 because we ask only for one grade item
        $previousGrade = $previousGrade->items[0]->grades;
    }
    ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Voice Board grading page</title>
    <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
    <!--[if lt IE 7]>
Ejemplo n.º 3
0
    if ($course->id != SITEID) {
        $navigation[$course->shortname] = "{$CFG->wwwroot}/course/view.php?id={$course->id}";
    }
    $navigation[$strvoicetools] = "";
    $urls = array();
    foreach ($navigation as $text => $href) {
        if (empty($href)) {
            $urls[] = $text;
        } else {
            $urls[] = '<a href="' . $href . '">' . $text . '</a>';
        }
    }
    $breadcrumb = implode(' -> ', $urls);
    print_header("{$course->shortname}", "{$course->fullname}", "{$breadcrumb}", "", "", true, "", navmenu($course));
}
$url_params = voiceboard_get_url_params($course->id);
if (isset($action) && $action == "displayGrade") {
    $url = "grades.php?gradeId=" . $grade_id . "&resource_id=" . $resource_id . "&";
} else {
    $url = "welcome.php?";
}
//create the url which all the parameters needed
?>

<div align="center">
    <iframe id="iframeW"  width="702px" height="402px" name="frameWidget" frameborder="0" scrolling="no" align="middle" style="margin-top:50px">
        <p>Sorry your navigator can't display this iframe
    </iframe>
</div>

<script>