Example #1
0
 public function displayDisciplinesOfSyllabus($syllabusId, $courseId)
 {
     $syllabusDisciplines = $this->getSyllabusDisciplines($syllabusId);
     $course = new Course();
     $foundCourse = $course->getCourseById($courseId);
     $data = array('syllabusDisciplines' => $syllabusDisciplines, 'syllabusId' => $syllabusId, 'course' => $foundCourse);
     loadTemplateSafelyByGroup("secretario", 'syllabus/course_syllabus_disciplines', $data);
 }
 public function __construct()
 {
     if (!isset($_GET['id']) || empty($_GET['id'])) {
         die("Please first select a course!");
     }
     $courseId = $this->secureString($_GET['id']);
     $this->course = Course::getCourseById($courseId);
     $this->view = new LessonAdminView($this->course);
 }
 public function __construct()
 {
     if (!isset($_GET['id']) || empty($_GET['id'])) {
         die("Please first select a lesson!");
     }
     $lessonId = $this->secureString($_GET['id']);
     $this->lesson = Lesson::getLesson($lessonId);
     $this->course = Course::getCourseById($this->lesson->getCourseId());
     $this->view = new TutorialAdminView($this->lesson, $this->course);
 }
 public function __construct()
 {
     if (!isset($_GET['id']) || empty($_GET['id'])) {
         die("Please first select a lesson!");
     }
     $lessonId = $this->secureString($_GET['id']);
     $this->lesson = Lesson::getLesson($lessonId);
     if (!isset($this->lesson)) {
         die("This lesson was not found!");
     }
     $this->course = Course::getCourseById($this->lesson->getCourseId());
     $this->view = new ExerciseView($this->lesson, $this->course);
 }
Example #5
0
 public function removeCourseFromProgram($courseId, $programId)
 {
     $course = new Course();
     $programExists = $this->checkIfProgramExists($programId);
     $courseExists = $course->checkIfCourseExists($courseId);
     $dataIsOk = $programExists && $courseExists;
     if ($dataIsOk) {
         $this->db->where('id_course', $courseId);
         $this->db->update('course', array('id_program' => NULL));
         $course = new Course();
         $foundCourse = $course->getCourseById($courseId);
         if ($foundCourse['id_program'] == $programId) {
             $wasRemoved = FALSE;
         } else {
             $wasRemoved = TRUE;
         }
     } else {
         $wasRemoved = FALSE;
     }
     return $wasRemoved;
 }
Example #6
0
<?php

if (!isset($_GET['id']) || empty($_GET['id'])) {
    die("Please first select a lesson!");
}
$lessonId = htmlspecialchars($_GET['id']);
$lessonId = DB::escapeString($lessonId);
$lesson = Lesson::getLesson($lessonId);
$course = Course::getCourseById($lesson->getCourseId());
if (!isset($lesson)) {
    die("This lesson was not found!");
}
$courseId = $lesson->getCourseId();
$filePath = PAGE_DIR . "lessons/{$courseId}-{$lessonId}.html";
$exerciseComponent = '<div class="well ui">
    <form action="' . ROOT_DIR . 'exercises/' . $lessonId . '" method="post">
      <button type="submit" class="btn btn-default btn-block">' . I18n::t('lesson.startexercises') . '</button>
    </form>
  </div>';
// display content
echo '<ol class="breadcrumb">
                <li><a href="' . ROOT_DIR . 'courseoverview">' . I18n::t('courseoverview.title') . '</a></li>
                <li><a href="' . ROOT_DIR . 'course/' . $course->getId() . '">' . $course->getName(I18n::getLang()) . '</a></li>
                <li class="active">' . $lesson->getName(I18n::getLang()) . '</li>
              </ol>';
echo $exerciseComponent;
echo '<h1>' . $lesson->getName(I18n::getLang()) . '</h1>';
if (file_exists($filePath) && filesize($filePath) > 1) {
    echo '<h2>Tutorial</h2>';
    echo file_get_contents($filePath);
    echo $exerciseComponent;
Example #7
0
 public function searchForStudentRequest()
 {
     $this->load->model("request_model");
     $searchType = $this->input->post('searchType');
     $courseId = $this->input->post('courseId');
     $semester = new Semester();
     $currentSemester = $semester->getCurrentSemester();
     define("SEARCH_BY_STUDENT_ID", "by_id");
     define("SEARCH_BY_STUDENT_NAME", "by_name");
     switch ($searchType) {
         case SEARCH_BY_STUDENT_ID:
             $studentIds = array();
             $studentId = $this->input->post('student_identifier');
             if (!empty($studentId)) {
                 $studentIds[] = $studentId;
             } else {
                 $studentIds[] = 0;
             }
             $courseRequests = $this->getStudentRequests($courseId, $currentSemester['id_semester'], $studentIds);
             break;
         case SEARCH_BY_STUDENT_NAME:
             $studentName = $this->input->post('student_identifier');
             $user = new Usuario();
             $foundUser = $user->getUserByName($studentName);
             if ($foundUser !== FALSE) {
                 $studentId = array();
                 foreach ($foundUser as $student) {
                     $studentId[] = $student['id'];
                 }
                 $courseRequests = $this->getStudentRequests($courseId, $currentSemester['id_semester'], $studentId);
             } else {
                 $courseRequests = FALSE;
             }
             break;
         default:
             break;
     }
     $course = new Course();
     $courseData = $course->getCourseById($courseId);
     $data = array('requests' => $courseRequests, 'course' => $courseData);
     loadTemplateSafelyByGroup("secretario", 'request/course_requests', $data);
 }
Example #8
0
 public function displayCourseStudents($courseId)
 {
     $course = new Course();
     $courseStudents = $course->getCourseStudents($courseId);
     $courseData = $course->getCourseById($courseId);
     $data = array('courseStudents' => $courseStudents, 'course' => $courseData);
     loadTemplateSafelyByGroup("coordenador", 'program/coordinator_course_students', $data);
 }
Example #9
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionAjaxCreate()
 {
     $model = new Semester();
     if (!isset($_SESSION['course_id'])) {
         $_SESSION['course_id'] = 1;
     }
     if (isset($_GET['ID'])) {
         $_SESSION['course_id'] = $_GET['ID'];
     }
     $course = Course::getCourseById($_SESSION['course_id']);
     if (!empty($course)) {
         $model->ID_Course = $course->Name;
     }
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['Semester'])) {
         $model->attributes = $_POST['Semester'];
         $model->ID_Course = $_SESSION['course_id'];
         if ($model->save()) {
             $this->redirect(array('index', 'id' => $model->ID));
         }
     }
     $this->renderPartial('_form', array('model' => $model), false, true);
 }
Example #10
0
 public function student_offerList($courseId)
 {
     $semester = new Semester();
     $currentSemester = $semester->getCurrentSemester();
     $course = new Course();
     $courseData = $course->getCourseById($courseId);
     $offer = new Offer();
     $offerListDisciplines = $offer->getCourseApprovedOfferListDisciplines($courseId, $currentSemester['id_semester']);
     $data = array('currentSemester' => $currentSemester, 'course' => $courseData, 'offerListDisciplines' => $offerListDisciplines);
     loadTemplateSafelyByGroup("estudante", 'usuario/student_offer_list', $data);
 }
Example #11
0
<div class = "column">
    <div class="column-content">
        <!-- course second section image  -->
        <?php 
if (isset($_GET['id']) && !empty($_GET['id'])) {
    $id = $_GET['id'];
    $crs = new Course();
    $c = $crs->getCourseById($id);
}
?>
        <div class="col-img">
            <a href="#">
                <img  alt="<?php 
echo $c->img_alt;
?>
" src="<?php 
echo $c->course_img;
?>
">
            </a>
        </div>
        <!-- course second section links  -->
        <div class="col-txt">
            <header class="crs-header">
                <h5><a href="#"><?php 
echo $c->course_name;
?>
</a></h5>
                <a class="author" href="#"><?php 
echo $c->course_author;
?>
Example #12
0
<?php

require AUTH_DIR . 'requirelogin.routine.php';
?>

<?php 
if (!isset($_GET['id']) || empty($_GET['id'])) {
    die("Please first select a course!");
}
$courseId = htmlspecialchars($_GET['id']);
$courseId = DB::escapeString($courseId);
$course = Course::getCourseById($courseId);
if (!isset($course)) {
    die("This course was not found!");
}
?>
 <ol class="breadcrumb">
   <li><a href="<?php 
echo ROOT_DIR;
?>
courseoverview"><?php 
echo I18n::t('courseoverview.title');
?>
</a></li>
   <li class="active"><?php 
echo $course->getName(I18n::getLang());
?>
</li>
</ol>

<h1><?php 
Example #13
0
function showCapesAvaliationsNews($atualizations)
{
    $courseController = new Course();
    if ($atualizations) {
        echo "<div class='panel panel-primary'>";
        echo "<div class='panel-heading'><h4> Ultimas atualizações de avaliações <i>CAPES</i> </h4></div>";
        foreach ($atualizations as $new => $courseAtualization) {
            $course = $courseController->getCourseById($courseAtualization['id_course']);
            echo "<div class='panel-body'>";
            echo "<div class='modal-info'>";
            echo "<div class='modal-content'>";
            echo "<div class='modal-header bg-news'";
            echo "<h4 class='model-title'>" . $course['course_name'] . "</h4>";
            echo "</div>";
            echo "<div class='modal-body'>";
            echo "<h3>";
            echo "<label class='label label-info'>";
            echo "Nota Obtida: " . $courseAtualization['course_grade'] . "";
            echo "</label>";
            echo "               " . anchor("capesavaliation/checkAsVisualized/{$courseAtualization['id_avaliation']}", "<span class='fa fa-check'></span>", "class='btn btn-success'");
            echo "</h3>";
            echo "</div>";
            echo "</div>";
            echo "</div>";
            echo "</div>";
        }
        echo "<div class='panel-footer' align='center'><i>Clique em <span class='fa fa-check'></span> para marcar como vizualizada</i></div>";
        echo "</div>";
    } else {
        echo "<div class='panel panel-primary'>";
        echo "<div class='panel-heading'><h4> Ultimas atualizações de avaliações <i>CAPES</i> </h4></div>";
        echo "<h3>";
        echo "<label class='label label-info'>";
        echo "Não existem atualizações até o momento.";
        echo "</label>";
        echo "</h3>";
        echo "</div>";
    }
}