Skip to content

Commit

Permalink
Replaces 'gradenoun' str by 'grade' for backward compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Carlos Rodríguez del Pino committed Jan 13, 2024
1 parent c4476a1 commit 052f429
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions forms/grade_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function definition() {
// Type value => introduce value.
$grade = $vpl->get_grade();
if ($grade != 0) {
$this->addHTML( s( get_string('gradenoun') . ' ' ) );
$this->addHTML( s( get_string('grade') . ' ' ) );
if ($grade > 0) {
$this->addText( 'grade', '', 6 );
$reduction = 0;
Expand All @@ -97,7 +97,7 @@ protected function definition() {
$this->addHTML( '  ' );
}
$class = " class='btn btn-secondary'";
$this->addSubmitButton( 'save', get_string('gradenoun') );
$this->addSubmitButton( 'save', get_string('grade') );
if ($inpopup) {
$this->addSubmitButton( 'savenext', get_string( 'gradeandnext', VPL ) );
}
Expand Down
2 changes: 1 addition & 1 deletion forms/gradesubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function vpl_grade_header($vpl, $inpopup) {
if ($inpopup) {
$vpl->print_header_simple();
} else {
$vpl->print_header( get_string('gradenoun') );
$vpl->print_header( get_string('grade') );
$vpl->print_view_tabs( basename( __FILE__ ) );
}
}
Expand Down
2 changes: 1 addition & 1 deletion forms/submissionview.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

if ($vpl->get_visiblegrade() || $vpl->has_capability( VPL_GRADE_CAPABILITY )) {
if ($submission->is_graded()) {
echo '<h2>' . get_string('gradenoun') . '</h2>';
echo '<h2>' . get_string('grade') . '</h2>';
$submission->print_grade( true );
\mod_vpl\event\submission_grade_viewed::log($submission);
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function get_select_detailedmore($urlbase, $value = '0') {
$table->align[] = 'right';
}
if ($student && ! $nograde) {
$table->head[] = get_string('gradenoun');
$table->head[] = get_string('grade');
$table->align[] = 'left';
}
if ($detailedmore) {
Expand Down
6 changes: 3 additions & 3 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ function vpl_user_outline($course, $user, $mod, $instance) {
$info = get_string( 'submission', VPL, count( $subs ) );
}
if ($subinstance->dategraded) {
$info .= '<br>' . get_string('gradenoun') . ': ' . $submission->get_grade_core();
$info .= '<br>' . get_string('grade') . ': ' . $submission->get_grade_core();
}
$url = vpl_mod_href( 'forms/submissionview.php', 'id', $vpl->get_course_module()->id, 'userid', $user->id );
$return->info = '<a href="' . $url . '">' . $info . '</a>';
Expand Down Expand Up @@ -683,7 +683,7 @@ function vpl_extend_navigation(navigation_node $vplnode, $course, $module, $cm)
if (! $example) {
if ($grader && $USER->id != $userid) {
$url = new moodle_url( '/mod/vpl/forms/gradesubmission.php', $parm);
$node = vpl_navi_node_create($vplnode, 'gradenoun', $url, navigation_node::TYPE_SETTING, 'core');
$node = vpl_navi_node_create($vplnode, 'grade', $url, navigation_node::TYPE_SETTING, 'core');
$vplnode->add_node( $node );
}
$url = new moodle_url( '/mod/vpl/forms/submissionview.php', $parm );
Expand Down Expand Up @@ -791,7 +791,7 @@ function vpl_extend_settings_navigation(settings_navigation $settings, navigatio
$testact->add_node( $node, $keybefore );
if ( $userid != $USER->id ) { // Auto grading has sense?
$url = new moodle_url( '/mod/vpl/forms/gradesubmission.php', $parms );
$node = vpl_navi_node_create($testact, 'gradenoun', $url, navigation_node::TYPE_SETTING, 'core');
$node = vpl_navi_node_create($testact, 'grade', $url, navigation_node::TYPE_SETTING, 'core');
$testact->add_node( $node, $keybefore );
}
$url = new moodle_url( '/mod/vpl/views/previoussubmissionslist.php', $parms );
Expand Down
8 changes: 4 additions & 4 deletions views/submissionslist.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function vpl_get_action_link($str, $link, $comp = 'mod_vpl') {
];
// Load strings.
$strsubtime = get_string( 'submittedon', VPL ) . vpl_submissionlist_arrow( $baseurl, 'datesubmitted', $sort, $sortdir );
$strgrade = get_string('gradenoun') . vpl_submissionlist_arrow( $baseurl, 'gradesortable', $sort, $sortdir );
$strgrade = get_string('grade') . vpl_submissionlist_arrow( $baseurl, 'gradesortable', $sort, $sortdir );
$strgrader = get_string( 'grader', VPL ) . vpl_submissionlist_arrow( $baseurl, 'grader', $sort, $sortdir );
$strgradedon = get_string( 'gradedon', VPL ) . vpl_submissionlist_arrow( $baseurl, 'dategraded', $sort, $sortdir );
$strcomments = get_string( 'gradercomments', VPL );
Expand Down Expand Up @@ -473,7 +473,7 @@ function vpl_get_action_link($str, $link, $comp = 'mod_vpl') {
$action = new popup_action( 'click', $hrefgrade, 'gradesub' . $user->id, $options );
$grade = $OUTPUT->action_link( $hrefgrade, $text, $action );
$link = new moodle_url('/mod/vpl/forms/gradesubmission.php', $linkparms);
$actions->add( vpl_get_action_link('gradenoun', $link, 'core') );
$actions->add( vpl_get_action_link('grade', $link, 'core') );
// Add new next user.
if ($lastid) {
$nextids[$lastid] = $user->id;
Expand Down Expand Up @@ -521,7 +521,7 @@ function vpl_get_action_link($str, $link, $comp = 'mod_vpl') {
$grader = '&nbsp;';
$gradedon = '&nbsp;';
$link = new moodle_url('/mod/vpl/forms/gradesubmission.php', $linkparms);
$actions->add(vpl_get_action_link('gradenoun', $link, 'core'));
$actions->add(vpl_get_action_link('grade', $link, 'core'));
// Add new next user.
if ($lastid) {
$nextids[$lastid] = $user->id;
Expand Down Expand Up @@ -577,7 +577,7 @@ function vpl_get_action_link($str, $link, $comp = 'mod_vpl') {
$namehead = get_string( 'firstname' ) . ' / ' . get_string( 'lastname' );
}
$tablegraders = new html_table();
$tablegraders->head = ['#', $namehead, get_string('gradenoun')];
$tablegraders->head = ['#', $namehead, get_string('grade')];
$tablegraders->align = ['right', 'left', 'center'];
$tablegraders->wrap = ['nowrap', 'nowrap', 'nowrap'];
$tablegraders->data = [];
Expand Down
4 changes: 2 additions & 2 deletions vpl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1684,8 +1684,8 @@ public function print_view_tabs($path) {
|| $subinstance->grader == $USER->id
|| $subinstance->grader == 0)) {
$href = vpl_mod_href( 'forms/gradesubmission.php', 'id', $cmid, 'userid', $userid );
$text = get_string('gradenoun');
$tabs[] = vpl_create_tabobject( 'gradesubmission.php', $href, 'gradenoun', 'core' );
$text = get_string('grade');
$tabs[] = vpl_create_tabobject( 'gradesubmission.php', $href, 'grade', 'core' );
}
if ($subinstance && ($grader || $similarity)) {
$href = vpl_mod_href( 'views/previoussubmissionslist.php', 'id', $cmid, 'userid', $userid );
Expand Down
2 changes: 1 addition & 1 deletion vpl_submission.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ public function print_grade($detailed = false, $return = false) {
$a->gradername = fullname( $grader );
$ret .= get_string( 'gradedonby', VPL, $a ) . '<br>';
if ($this->vpl->get_grade() != 0) {
$ret .= $this->vpl->str_restriction('gradenoun', $this->get_grade_core(), false, 'core') . '<br>';
$ret .= $this->vpl->str_restriction('grade', $this->get_grade_core(), false, 'core') . '<br>';
if ($detailed) {
$ret .= $this->get_detailed_grade();
}
Expand Down

0 comments on commit 052f429

Please sign in to comment.