Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adding classes to lesson module

  • Loading branch information...
commit a82fb0b629022fd7d38cc164baf9e0c977292711 1 parent 757e89d
Patrick Malley authored
8 mod/choice/lib.php
@@ -487,7 +487,7 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
487 487 }
488 488 echo "</table></td>";
489 489 }
490   - $count = 0;
  490 + $count = 1;
491 491 foreach ($choice->option as $optionid => $optiontext) {
492 492 echo '<td class="col'.$count.' data" >';
493 493
@@ -515,14 +515,14 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
515 515 echo '</table></td>';
516 516 }
517 517 echo "</tr><tr>";
518   - $count = 0;
  518 + $count = 1;
519 519
520 520 if ($choice->showunanswered) {
521 521 echo "<td></td>";
522 522 }
523   -
  523 +
524 524 foreach ($choice->option as $optionid => $optiontext) {
525   - echo "<td align=\"center\" class=\"count\">";
  525 + echo "<td align=\"center\" class=\"col$count count\">";
526 526 if ($choice->limitanswers) {
527 527 echo get_string("taken", "choice").":";
528 528 echo $columncount[$optionid];
4 mod/choice/view.php
@@ -100,11 +100,11 @@
100 100 $timenow = time();
101 101 if ($choice->timeclose !=0) {
102 102 if ($choice->timeopen > $timenow ) {
103   - echo $OUTPUT->box(get_string("notopenyet", "choice", userdate($choice->timeopen)));
  103 + echo $OUTPUT->box(get_string("notopenyet", "choice", userdate($choice->timeopen)), "generalbox notopenyet");
104 104 echo $OUTPUT->footer();
105 105 exit;
106 106 } else if ($timenow > $choice->timeclose) {
107   - echo $OUTPUT->box(get_string("expired", "choice", userdate($choice->timeclose)));
  107 + echo $OUTPUT->box(get_string("expired", "choice", userdate($choice->timeclose)), "generalbox expired");
108 108 $choiceopen = false;
109 109 }
110 110 }
2  mod/lesson/continue.php
@@ -185,7 +185,7 @@
185 185 $content = html_writer::empty_tag('input', array('type'=>'hidden', 'nam'=>'id', 'value'=>$cm->id));
186 186 $content .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'pageid', 'value'=>$page->id));
187 187 $content .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'submit', 'value'=>get_string('reviewquestionback', 'lesson')));
188   - echo html_writer::tag('form', "<div>$content</div>", array('method'=>'get', 'target'=>$url));
  188 + echo html_writer::tag('form', "<div class=\"singlebutton\">$content</div>", array('method'=>'get', 'target'=>$url));
189 189 }
190 190
191 191 $url = new moodle_url('/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$result->newpageid));
7 mod/lesson/lib.php
@@ -2192,9 +2192,9 @@ public function is_sub_page_of_type($pageid, array $types, array $ends) {
2192 2192 $nretakes = $DB->count_records("lesson_grades", array("lessonid"=>$this->lesson->id, "userid"=>$USER->id));
2193 2193 $qattempts = $DB->count_records("lesson_attempts", array("userid"=>$USER->id, "retry"=>$nretakes, "pageid"=>$this->properties->id));
2194 2194 if ($qattempts == 1) {
2195   - $result->feedback = get_string("firstwrong", "lesson");
  2195 + $result->feedback = $OUTPUT->box(get_string("firstwrong", "lesson"), 'feedback');
2196 2196 } else {
2197   - $result->feedback = get_string("secondpluswrong", "lesson");
  2197 + $result->feedback = $OUTPUT->BOX(get_string("secondpluswrong", "lesson"), 'feedback');
2198 2198 }
2199 2199 } else {
2200 2200 $class = 'response';
@@ -2207,8 +2207,9 @@ public function is_sub_page_of_type($pageid, array $types, array $ends) {
2207 2207 $options->noclean = true;
2208 2208 $options->para = true;
2209 2209 $result->feedback = $OUTPUT->box(format_text($this->properties->contents, FORMAT_MOODLE, $options), 'generalbox boxaligncenter');
2210   - $result->feedback .= '<em>'.get_string("youranswer", "lesson").'</em> : '.format_text($result->studentanswer, FORMAT_MOODLE, $options);
  2210 + $result->feedback .= '<div class="correctanswer generalbox"><em>'.get_string("youranswer", "lesson").'</em> : '.format_text($result->studentanswer, FORMAT_MOODLE, $options);
2211 2211 $result->feedback .= $OUTPUT->box(format_text($result->response, FORMAT_MOODLE, $options), $class);
  2212 + echo "</div>";
2212 2213 }
2213 2214 }
2214 2215 }
4 mod/lesson/locallib.php
@@ -489,7 +489,7 @@ function lesson_clock_block_contents($cmid, $lesson, $timer, $page) {
489 489
490 490 $bc = new block_contents();
491 491 $bc->title = get_string('timeremaining', 'lesson');
492   - $bc->attributes['class'] = 'clock';
  492 + $bc->attributes['class'] = 'clock sideblock';
493 493 $bc->content = $content;
494 494
495 495 return $bc;
@@ -543,7 +543,7 @@ function lesson_menu_block_contents($cmid, $lesson) {
543 543
544 544 $bc = new block_contents();
545 545 $bc->title = get_string('lessonmenu', 'lesson');
546   - $bc->attributes['class'] = 'menu';
  546 + $bc->attributes['class'] = 'menu sideblock';
547 547 $bc->content = $content;
548 548
549 549 return $bc;
6 mod/lesson/renderer.php
@@ -450,7 +450,7 @@ public function ongoing_score(lesson $lesson) {
450 450
451 451 $context = get_context_instance(CONTEXT_MODULE, $this->page->cm->id);
452 452 if (has_capability('mod/lesson:manage', $context)) {
453   - return '<p align="center">'.get_string('teacherongoingwarning', 'lesson').'</p>';
  453 + return $this->output->box(get_string('teacherongoingwarning', 'lesson'), "ongoing center");
454 454 } else {
455 455 $ntries = $DB->count_records("lesson_grades", array("lessonid"=>$lesson->id, "userid"=>$USER->id));
456 456 if (isset($USER->modattempts[$lesson->id])) {
@@ -461,11 +461,11 @@ public function ongoing_score(lesson $lesson) {
461 461 if ($lesson->custom) {
462 462 $a->score = $gradeinfo->earned;
463 463 $a->currenthigh = $gradeinfo->total;
464   - return $this->output->box(get_string("ongoingcustom", "lesson", $a), "generalbox boxaligncenter");
  464 + return $this->output->box(get_string("ongoingcustom", "lesson", $a), "ongoing center");
465 465 } else {
466 466 $a->correct = $gradeinfo->earned;
467 467 $a->viewed = $gradeinfo->attempts;
468   - return $this->output->box(get_string("ongoingnormal", "lesson", $a), "generalbox boxaligncenter");
  468 + return $this->output->box(get_string("ongoingnormal", "lesson", $a), "ongoing center");
469 469 }
470 470 }
471 471 }
4 mod/lesson/view.php
@@ -219,10 +219,10 @@
219 219 if ($lesson->timed) {
220 220 if ($lesson->retake) {
221 221 $continuelink = new single_button(new moodle_url('/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$lesson->firstpageid, 'startlastseen'=>'no')), get_string('continue', 'lesson'), 'get');
222   - echo $lessonoutput->message(get_string('leftduringtimed', 'lesson'), $continuelink);
  222 + echo '<div class="center leftduring">'.$lessonoutput->message(get_string('leftduringtimed', 'lesson'), $continuelink).'</div>';
223 223 } else {
224 224 $courselink = new single_button(new moodle_url('/course/view.php', array('id'=>$PAGE->course->id)), get_string('returntocourse', 'lesson'), 'get');
225   - echo $lessonoutput->message(get_string('leftduringtimednoretake', 'lesson'), $courselink);
  225 + echo '<div class="center leftduring">'.$lessonoutput->message(get_string('leftduringtimednoretake', 'lesson'), $courselink).'</div>';
226 226 }
227 227 } else {
228 228 echo $lessonoutput->continue_links($lesson, $lastpageseen);

0 comments on commit a82fb0b

Please sign in to comment.
Something went wrong with that request. Please try again.