NOBUG workshop: display the phases deadlines in the planner tool
This commit is contained in:
@@ -47,11 +47,13 @@ $string['assessmentbyunknown'] = 'Assessment';
|
||||
$string['assessmentbyyourself'] = 'Assessment by yourself';
|
||||
$string['assessmentdeleted'] = 'Assessment deallocated';
|
||||
$string['assessmentend'] = 'Assessing not allowed after';
|
||||
$string['assessmentenddatetime'] = 'Assessing ends on {$a->daydatetime} ({$a->distanceday})';
|
||||
$string['assessmentform'] = 'Assessment form';
|
||||
$string['assessmentreference'] = 'Reference assessment';
|
||||
$string['assessmentreferenceneeded'] = 'You have to assess this example submission to provide a reference assessment. Click \'Continue\' button to assess the submission.';
|
||||
$string['assessmentsettings'] = 'Assessment settings';
|
||||
$string['assessmentstart'] = 'Assessing not allowed before';
|
||||
$string['assessmentstartdatetime'] = 'Assessing starts on {$a->daydatetime} ({$a->distanceday})';
|
||||
$string['assignedassessments'] = 'Assigned submissions to assess';
|
||||
$string['assignedassessmentsnone'] = 'You have no assigned submission to assess';
|
||||
$string['backtoeditform'] = 'Back to editing form';
|
||||
@@ -66,6 +68,11 @@ $string['configgradedecimals'] = 'Default number of digits that should be shown
|
||||
$string['configgradinggrade'] = 'Default maximum grade for assessment in workshops';
|
||||
$string['configmaxbytes'] = 'Default maximum submission file size for all workshops on the site (subject to course limits and other local settings)';
|
||||
$string['configstrategy'] = 'Default grading strategy for workshops';
|
||||
$string['daysago'] = '{$a} days ago';
|
||||
$string['daysleft'] = '{$a} days left';
|
||||
$string['daystoday'] = 'today';
|
||||
$string['daystomorrow'] = 'tomorrow';
|
||||
$string['daysyesterday'] = 'yesterday';
|
||||
$string['editassessmentform'] = 'Edit assessment form';
|
||||
$string['editassessmentformstrategy'] = 'Edit assessment form ({$a})';
|
||||
$string['editingassessmentform'] = 'Editing assessment form';
|
||||
@@ -162,18 +169,20 @@ $string['strategy_help'] = 'The grading strategy determines the assessment form
|
||||
|
||||
* Accumulative grading - Comments and a grade are given regarding specified aspects
|
||||
* Comments - Comments are given regarding specified aspects but no grade can be given
|
||||
* Number of errors - Comments and a yes/no assessment are given regarding specified assertions
|
||||
* Number of errors - Comments and a yes/no assessment are given regarding specified assertions
|
||||
* Rubric - A level assessment is given regarding specified criteria';
|
||||
$string['strategyhaschanged'] = 'The workshop grading strategy has changed since the form was opened for editing.';
|
||||
$string['submission'] = 'Submission';
|
||||
$string['submissionattachment'] = 'Attachment';
|
||||
$string['submissioncontent'] = 'Submission content';
|
||||
$string['submissionend'] = 'Submitting not allowed after';
|
||||
$string['submissionenddatetime'] = 'Submitting ends on {$a->daydatetime} ({$a->distanceday})';
|
||||
$string['submissiongrade'] = 'Grade for submission';
|
||||
$string['submissiongrade_help'] = 'This setting specifies the maximum grade a student can obtain for their own submission. It is calculated as the weighted mean of all assessments done by peers and/or teachers.';
|
||||
$string['submissiongradeof'] = 'Grade for submission (of {$a})';
|
||||
$string['submissionsettings'] = 'Submission settings';
|
||||
$string['submissionstart'] = 'Submitting not allowed before';
|
||||
$string['submissionstartdatetime'] = 'Submitting starts on {$a->daydatetime} ({$a->distanceday})';
|
||||
$string['submissiontitle'] = 'Title';
|
||||
$string['switchingphase'] = 'Switching phase';
|
||||
$string['switchphase'] = 'Switch phase';
|
||||
|
||||
@@ -313,6 +313,44 @@ class workshop {
|
||||
return ($a / self::gcd($a,$b)) * $b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object suitable for strings containing dates/times
|
||||
*
|
||||
* The returned object contains properties date, datefullshort, datetime, ... containing the given
|
||||
* timestamp formatted using strftimedate, strftimedatefullshort, strftimedatetime, ... from the
|
||||
* current lang's langconfig.php
|
||||
* This allows translators and administrators customize the date/time format.
|
||||
*
|
||||
* @param int $timestamp the timestamp in UTC
|
||||
* @return stdclass
|
||||
*/
|
||||
public static function timestamp_formats($timestamp) {
|
||||
$formats = array('date', 'datefullshort', 'dateshort', 'datetime',
|
||||
'datetimeshort', 'daydate', 'daydatetime', 'dayshort', 'daytime',
|
||||
'monthyear', 'recent', 'recentfull', 'time');
|
||||
$a = new stdclass();
|
||||
foreach ($formats as $format) {
|
||||
$a->{$format} = userdate($timestamp, get_string('strftime'.$format, 'langconfig'));
|
||||
}
|
||||
$day = userdate($timestamp, '%Y%m%d', 99, false);
|
||||
$today = userdate(time(), '%Y%m%d', 99, false);
|
||||
$tomorrow = userdate(time() + DAYSECS, '%Y%m%d', 99, false);
|
||||
$yesterday = userdate(time() - DAYSECS, '%Y%m%d', 99, false);
|
||||
$distance = (int)round(abs(time() - $timestamp) / DAYSECS);
|
||||
if ($day == $today) {
|
||||
$a->distanceday = get_string('daystoday', 'workshop');
|
||||
} elseif ($day == $yesterday) {
|
||||
$a->distanceday = get_string('daysyesterday', 'workshop');
|
||||
} elseif ($day < $today) {
|
||||
$a->distanceday = get_string('daysago', 'workshop', $distance);
|
||||
} elseif ($day == $tomorrow) {
|
||||
$a->distanceday = get_string('daystomorrow', 'workshop');
|
||||
} elseif ($day > $today) {
|
||||
$a->distanceday = get_string('daysleft', 'workshop', $distance);
|
||||
}
|
||||
return $a;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Workshop API //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1687,7 +1725,9 @@ class workshop_user_plan implements renderable {
|
||||
|
||||
$this->workshop = $workshop;
|
||||
|
||||
// Prepare tasks for the setup phase
|
||||
//---------------------------------------------------------
|
||||
// * SETUP | submission | assessment | evaluation | closed
|
||||
//---------------------------------------------------------
|
||||
$phase = new stdclass();
|
||||
$phase->title = get_string('phasesetup', 'workshop');
|
||||
$phase->tasks = array();
|
||||
@@ -1736,7 +1776,9 @@ class workshop_user_plan implements renderable {
|
||||
}
|
||||
$this->phases[workshop::PHASE_SETUP] = $phase;
|
||||
|
||||
// Prepare tasks for the submission phase
|
||||
//---------------------------------------------------------
|
||||
// setup | * SUBMISSION | assessment | evaluation | closed
|
||||
//---------------------------------------------------------
|
||||
$phase = new stdclass();
|
||||
$phase->title = get_string('phasesubmission', 'workshop');
|
||||
$phase->tasks = array();
|
||||
@@ -1802,9 +1844,23 @@ class workshop_user_plan implements renderable {
|
||||
$phase->tasks['allocateinfo'] = $task;
|
||||
}
|
||||
}
|
||||
if ($this->workshop->submissionstart) {
|
||||
$task = new stdclass();
|
||||
$task->title = get_string('submissionstartdatetime', 'workshop', workshop::timestamp_formats($this->workshop->submissionstart));
|
||||
$task->completed = 'info';
|
||||
$phase->tasks['submissionstartdatetime'] = $task;
|
||||
}
|
||||
if ($this->workshop->submissionend) {
|
||||
$task = new stdclass();
|
||||
$task->title = get_string('submissionenddatetime', 'workshop', workshop::timestamp_formats($this->workshop->submissionend));
|
||||
$task->completed = 'info';
|
||||
$phase->tasks['submissionenddatetime'] = $task;
|
||||
}
|
||||
$this->phases[workshop::PHASE_SUBMISSION] = $phase;
|
||||
|
||||
// Prepare tasks for the peer-assessment phase (includes eventual self-assessments)
|
||||
//---------------------------------------------------------
|
||||
// setup | submission | * ASSESSMENT | evaluation | closed
|
||||
//---------------------------------------------------------
|
||||
$phase = new stdclass();
|
||||
$phase->title = get_string('phaseassessment', 'workshop');
|
||||
$phase->tasks = array();
|
||||
@@ -1853,9 +1909,23 @@ class workshop_user_plan implements renderable {
|
||||
$task->title = get_string('taskassessself', 'workshop');
|
||||
$phase->tasks['assessself'] = $task;
|
||||
}
|
||||
if ($this->workshop->assessmentstart) {
|
||||
$task = new stdclass();
|
||||
$task->title = get_string('assessmentstartdatetime', 'workshop', workshop::timestamp_formats($this->workshop->assessmentstart));
|
||||
$task->completed = 'info';
|
||||
$phase->tasks['assessmentstartdatetime'] = $task;
|
||||
}
|
||||
if ($this->workshop->assessmentend) {
|
||||
$task = new stdclass();
|
||||
$task->title = get_string('assessmentenddatetime', 'workshop', workshop::timestamp_formats($this->workshop->assessmentend));
|
||||
$task->completed = 'info';
|
||||
$phase->tasks['assessmentenddatetime'] = $task;
|
||||
}
|
||||
$this->phases[workshop::PHASE_ASSESSMENT] = $phase;
|
||||
|
||||
// Prepare tasks for the grading evaluation phase
|
||||
//---------------------------------------------------------
|
||||
// setup | submission | assessment | * EVALUATION | closed
|
||||
//---------------------------------------------------------
|
||||
$phase = new stdclass();
|
||||
$phase->title = get_string('phaseevaluation', 'workshop');
|
||||
$phase->tasks = array();
|
||||
@@ -1900,7 +1970,9 @@ class workshop_user_plan implements renderable {
|
||||
}
|
||||
$this->phases[workshop::PHASE_EVALUATION] = $phase;
|
||||
|
||||
// Prepare tasks for the "workshop closed" phase - todo
|
||||
//---------------------------------------------------------
|
||||
// setup | submission | assessment | evaluation | * CLOSED
|
||||
//---------------------------------------------------------
|
||||
$phase = new stdclass();
|
||||
$phase->title = get_string('phaseclosed', 'workshop');
|
||||
$phase->tasks = array();
|
||||
|
||||
Reference in New Issue
Block a user