Skip to content

Commit

Permalink
Adding classes to lesson module
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Malley committed May 3, 2010
1 parent 757e89d commit a82fb0b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
8 changes: 4 additions & 4 deletions mod/choice/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
}
echo "</table></td>";
}
$count = 0;
$count = 1;
foreach ($choice->option as $optionid => $optiontext) {
echo '<td class="col'.$count.' data" >';

Expand Down Expand Up @@ -515,14 +515,14 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
echo '</table></td>';
}
echo "</tr><tr>";
$count = 0;
$count = 1;

if ($choice->showunanswered) {
echo "<td></td>";
}

foreach ($choice->option as $optionid => $optiontext) {
echo "<td align=\"center\" class=\"count\">";
echo "<td align=\"center\" class=\"col$count count\">";
if ($choice->limitanswers) {
echo get_string("taken", "choice").":";
echo $columncount[$optionid];
Expand Down
4 changes: 2 additions & 2 deletions mod/choice/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@
$timenow = time();
if ($choice->timeclose !=0) {
if ($choice->timeopen > $timenow ) {
echo $OUTPUT->box(get_string("notopenyet", "choice", userdate($choice->timeopen)));
echo $OUTPUT->box(get_string("notopenyet", "choice", userdate($choice->timeopen)), "generalbox notopenyet");
echo $OUTPUT->footer();
exit;
} else if ($timenow > $choice->timeclose) {
echo $OUTPUT->box(get_string("expired", "choice", userdate($choice->timeclose)));
echo $OUTPUT->box(get_string("expired", "choice", userdate($choice->timeclose)), "generalbox expired");
$choiceopen = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion mod/lesson/continue.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
$content = html_writer::empty_tag('input', array('type'=>'hidden', 'nam'=>'id', 'value'=>$cm->id));
$content .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'pageid', 'value'=>$page->id));
$content .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'submit', 'value'=>get_string('reviewquestionback', 'lesson')));
echo html_writer::tag('form', "<div>$content</div>", array('method'=>'get', 'target'=>$url));
echo html_writer::tag('form', "<div class=\"singlebutton\">$content</div>", array('method'=>'get', 'target'=>$url));
}

$url = new moodle_url('/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$result->newpageid));
Expand Down
7 changes: 4 additions & 3 deletions mod/lesson/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2192,9 +2192,9 @@ final public function record_attempt($context) {
$nretakes = $DB->count_records("lesson_grades", array("lessonid"=>$this->lesson->id, "userid"=>$USER->id));
$qattempts = $DB->count_records("lesson_attempts", array("userid"=>$USER->id, "retry"=>$nretakes, "pageid"=>$this->properties->id));
if ($qattempts == 1) {
$result->feedback = get_string("firstwrong", "lesson");
$result->feedback = $OUTPUT->box(get_string("firstwrong", "lesson"), 'feedback');
} else {
$result->feedback = get_string("secondpluswrong", "lesson");
$result->feedback = $OUTPUT->BOX(get_string("secondpluswrong", "lesson"), 'feedback');
}
} else {
$class = 'response';
Expand All @@ -2207,8 +2207,9 @@ final public function record_attempt($context) {
$options->noclean = true;
$options->para = true;
$result->feedback = $OUTPUT->box(format_text($this->properties->contents, FORMAT_MOODLE, $options), 'generalbox boxaligncenter');
$result->feedback .= '<em>'.get_string("youranswer", "lesson").'</em> : '.format_text($result->studentanswer, FORMAT_MOODLE, $options);
$result->feedback .= '<div class="correctanswer generalbox"><em>'.get_string("youranswer", "lesson").'</em> : '.format_text($result->studentanswer, FORMAT_MOODLE, $options);
$result->feedback .= $OUTPUT->box(format_text($result->response, FORMAT_MOODLE, $options), $class);
echo "</div>";
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions mod/lesson/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function lesson_clock_block_contents($cmid, $lesson, $timer, $page) {

$bc = new block_contents();
$bc->title = get_string('timeremaining', 'lesson');
$bc->attributes['class'] = 'clock';
$bc->attributes['class'] = 'clock sideblock';
$bc->content = $content;

return $bc;
Expand Down Expand Up @@ -543,7 +543,7 @@ function lesson_menu_block_contents($cmid, $lesson) {

$bc = new block_contents();
$bc->title = get_string('lessonmenu', 'lesson');
$bc->attributes['class'] = 'menu';
$bc->attributes['class'] = 'menu sideblock';
$bc->content = $content;

return $bc;
Expand Down
6 changes: 3 additions & 3 deletions mod/lesson/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public function ongoing_score(lesson $lesson) {

$context = get_context_instance(CONTEXT_MODULE, $this->page->cm->id);
if (has_capability('mod/lesson:manage', $context)) {
return '<p align="center">'.get_string('teacherongoingwarning', 'lesson').'</p>';
return $this->output->box(get_string('teacherongoingwarning', 'lesson'), "ongoing center");
} else {
$ntries = $DB->count_records("lesson_grades", array("lessonid"=>$lesson->id, "userid"=>$USER->id));
if (isset($USER->modattempts[$lesson->id])) {
Expand All @@ -461,11 +461,11 @@ public function ongoing_score(lesson $lesson) {
if ($lesson->custom) {
$a->score = $gradeinfo->earned;
$a->currenthigh = $gradeinfo->total;
return $this->output->box(get_string("ongoingcustom", "lesson", $a), "generalbox boxaligncenter");
return $this->output->box(get_string("ongoingcustom", "lesson", $a), "ongoing center");
} else {
$a->correct = $gradeinfo->earned;
$a->viewed = $gradeinfo->attempts;
return $this->output->box(get_string("ongoingnormal", "lesson", $a), "generalbox boxaligncenter");
return $this->output->box(get_string("ongoingnormal", "lesson", $a), "ongoing center");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions mod/lesson/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@
if ($lesson->timed) {
if ($lesson->retake) {
$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');
echo $lessonoutput->message(get_string('leftduringtimed', 'lesson'), $continuelink);
echo '<div class="center leftduring">'.$lessonoutput->message(get_string('leftduringtimed', 'lesson'), $continuelink).'</div>';
} else {
$courselink = new single_button(new moodle_url('/course/view.php', array('id'=>$PAGE->course->id)), get_string('returntocourse', 'lesson'), 'get');
echo $lessonoutput->message(get_string('leftduringtimednoretake', 'lesson'), $courselink);
echo '<div class="center leftduring">'.$lessonoutput->message(get_string('leftduringtimednoretake', 'lesson'), $courselink).'</div>';
}
} else {
echo $lessonoutput->continue_links($lesson, $lastpageseen);
Expand Down

0 comments on commit a82fb0b

Please sign in to comment.