示例#1
0
echo $details['exams_taken'];
?>
</p>
				<p><?php 
echo Lang::txt('out of %d', $details['exams_total']);
?>
</p>
			</div>
		</div>
	</div>

	<div class="clear"></div>

	<p class="info grading-policy-explanation">
		<?php 
echo $gradePolicy->get('description');
?>
	</p>

	<div class="units">
	<?php 
foreach ($this->course->offering()->units() as $unit) {
    ?>

		<div class="unit-entry">
			<div class="unit-overview">
				<div class="unit-title"><?php 
    echo $unit->get('title');
    ?>
</div>
				<div class="unit-score">
示例#2
0
 /**
  * Restore grading policy back to default
  *
  * @return void
  **/
 private function restoredefaults()
 {
     // Only allow for instructors
     if (!$this->course->offering()->section()->access('manage')) {
         // Redirect with message
         App::redirect(Route::url($this->base, false), 'You don\'t have permission to do this!', 'warning');
         return;
     }
     // Now, also make sure either section managers can edit, or user is a course manager
     if (!$this->course->config()->get('section_grade_policy', true) && !$this->course->offering()->access('manage')) {
         // Redirect with message
         App::redirect(Route::url($this->base . '&active=progress', false), 'You don\'t have permission to do this!', 'warning');
         return;
     }
     $section = $this->course->offering()->section();
     // Now set them back to the default
     $section->set('grade_policy_id', 1);
     $section->store();
     // If section managers can't edit, then also make the above change for all sections of this course
     if (!$this->course->config()->get('section_grade_policy', true)) {
         $sections = $this->course->offering()->sections();
         foreach ($sections as $s) {
             $s->set('grade_policy_id', 1);
             $s->store();
         }
     }
     if (Request::getInt('no_html', false)) {
         $gp = new \Components\Courses\Models\GradePolicies(1);
         $policy->description = $gp->get('description');
         $policy->exam_weight = $gp->get('exam_weight') * 100;
         $policy->quiz_weight = $gp->get('quiz_weight') * 100;
         $policy->homework_weight = $gp->get('homework_weight') * 100;
         $policy->threshold = $gp->get('threshold') * 100;
         echo json_encode(array('success' => true, 'message' => 'Scoring policy successfully restored to the default configuration!', 'gradepolicy' => $policy));
         exit;
     } else {
         // Redirect with message
         App::redirect(Route::url($this->base . '&active=progress', false), 'Scoring policy successfully restored to the default configuration!', 'passed');
         return;
     }
 }