diff --git a/mod/lesson/essay.php b/mod/lesson/essay.php index e1fe9c3ac2c..a67623c2c23 100644 --- a/mod/lesson/essay.php +++ b/mod/lesson/essay.php @@ -367,7 +367,8 @@ switch ($mode) { // Setup table $table = new html_table(); - $table->head = array(get_string('name'), get_string('essays', 'lesson'), get_string('email', 'lesson')); + $table->head = array(get_string('name'), get_string('essays', 'lesson'), get_string('status'), + get_string('email', 'lesson')); $table->attributes['class'] = 'standardtable generaltable'; $table->align = array('left', 'left', 'left'); $table->wrap = array('nowrap', 'nowrap', ''); @@ -376,6 +377,7 @@ switch ($mode) { foreach (array_keys($studentessays) as $userid) { $studentname = fullname($users[$userid], true); $essaylinks = array(); + $essaystatuses = array(); // Number of attempts on the lesson $attempts = $lesson->count_user_retries($userid); @@ -403,30 +405,39 @@ switch ($mode) { // link for each essay $url = new moodle_url('/mod/lesson/essay.php', array('id'=>$cm->id,'mode'=>'grade','attemptid'=>$essay->id,'sesskey'=>sesskey())); - $attributes = array(); + $linktitle = userdate($essay->timeseen, get_string('strftimedatetime')).' '. + format_string($pages[$essay->pageid]->title, true); + // Different colors for all the states of an essay (graded, if sent, not graded) if (!$essayinfo->graded) { - $attributes['class'] = "essayungraded"; + $class = "label label-warning"; + $status = get_string('notgraded', 'lesson'); } elseif (!$essayinfo->sent) { - $attributes['class'] = "essaygraded"; + $class = "label label-success"; + $status = get_string('graded', 'lesson'); } else { - $attributes['class'] = "essaysent"; + $class = "label label-success"; + $status = get_string('sent', 'lesson'); } - $essaylinks[] = html_writer::link($url, userdate($essay->timeseen, get_string('strftimedatetime')).' '.format_string($pages[$essay->pageid]->title,true), $attributes); + $attributes = array('tabindex' => 0); + + $essaylinks[] = html_writer::link($url, $linktitle); + $essaystatuses[] = html_writer::span($status, $class, $attributes); } } // email link for this user $url = new moodle_url('/mod/lesson/essay.php', array('id'=>$cm->id,'mode'=>'email','userid'=>$userid,'sesskey'=>sesskey())); $emaillink = html_writer::link($url, get_string('emailgradedessays', 'lesson')); - $table->data[] = array($OUTPUT->user_picture($users[$userid], array('courseid'=>$course->id)).$studentname, implode("
", $essaylinks), $emaillink); + $table->data[] = array($OUTPUT->user_picture($users[$userid], array('courseid' => $course->id)) . $studentname, + implode("
", $essaylinks), implode("
", $essaystatuses), $emaillink); } // email link for all users $url = new moodle_url('/mod/lesson/essay.php', array('id'=>$cm->id,'mode'=>'email','sesskey'=>sesskey())); $emailalllink = html_writer::link($url, get_string('emailallgradedessays', 'lesson')); - $table->data[] = array(' ', ' ', $emailalllink); + $table->data[] = array(' ', ' ', ' ', $emailalllink); echo html_writer::table($table); break; diff --git a/mod/lesson/lang/en/lesson.php b/mod/lesson/lang/en/lesson.php index c4252352f01..a5cd95ff28e 100644 --- a/mod/lesson/lang/en/lesson.php +++ b/mod/lesson/lang/en/lesson.php @@ -236,6 +236,7 @@ $string['gotoendoflesson'] = 'Go to the end of the lesson'; $string['grade'] = 'Grade'; $string['gradebetterthan'] = 'Grade better than (%)'; $string['gradebetterthanerror'] = 'Earn a grade better than {$a} percent'; +$string['graded'] = 'Graded'; $string['gradeessay'] = 'Grade essay questions ({$a->notgradedcount} not graded and {$a->notsentcount} not sent)'; $string['gradeis'] = 'Grade is {$a}'; $string['gradeoptions'] = 'Grade options'; @@ -375,6 +376,7 @@ $string['notyetcompleted'] = 'Lesson has been started, but not yet completed'; $string['notdefined'] = 'Not defined'; $string['notenoughsubquestions'] = 'Not enough sub-questions have been defined!'; $string['notenoughtimespent'] = 'You completed this lesson in {$a->timespent}, which is less than the required time of {$a->timerequired}. You might need to attempt the lesson again.'; +$string['notgraded'] = 'Not graded'; $string['notitle'] = 'No title'; $string['numberofcorrectanswers'] = 'Number of correct answers: {$a}'; $string['numberofcorrectanswersheader'] = 'Number of correct answers'; @@ -478,6 +480,7 @@ $string['scores'] = 'Scores'; $string['search:activity'] = 'Lesson - activity information'; $string['secondpluswrong'] = 'Not quite. Would you like to try again?'; $string['selectaqtype'] = 'Select a question type'; +$string['sent'] = 'Sent'; $string['shortanswer'] = 'Short answer'; $string['showanunansweredpage'] = 'Show an unanswered page'; $string['showanunseenpage'] = 'Show an unseen page';