Skip to content

Commit

Permalink
Allows to reveal sebkeys in the activity information page
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Carlos Rodríguez del Pino committed Jan 19, 2024
1 parent 9d301c3 commit b17f2fb
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions vpl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1775,11 +1775,6 @@ public function str_restriction($str, $value = null, $raw = false, $comp = 'mod_
if ($value === null) {
$value = $this->instance->$str;
}
if ($str == 'password') {
$infohs = new mod_vpl\util\hide_show();
$value .= $infohs->generate();
$value .= $infohs->content_in_span(s($this->get_instance()->password));
}
$html .= $value;
return $html;
}
Expand Down Expand Up @@ -1902,8 +1897,13 @@ public function str_submission_restriction($userid = null) {
}
$html .= $this->str_gradereduction($userid);
if ($grader) {
if (trim( $instance->password ) > '') {
$html .= $this->str_restriction_with_icon( 'password', $stryes, false, true, 'moodle' );
$password = trim($this->get_effective_setting('password'));
if ($password) {
$html .= $this->str_restriction_with_icon( 'password', $stryes, false, false, 'moodle');
$infohs = new mod_vpl\util\hide_show();
$html .= $infohs->generate();
$html .= $infohs->content_in_span(s($password));
$html .= "<br>\n";
}
if (trim( $instance->requirednet ) > '') {
$html .= $this->str_restriction_with_icon( 'requirednet', s( $instance->requirednet ));
Expand All @@ -1912,7 +1912,11 @@ public function str_submission_restriction($userid = null) {
$html .= $this->str_restriction_with_icon('sebrequired', $stryes );
}
if (trim( $instance->sebkeys ) > '') {
$html .= $this->str_restriction_with_icon('sebkeys', $stryes );
$html .= $this->str_restriction_with_icon('sebkeys', $stryes, false, false);
$infohs = new mod_vpl\util\hide_show();
$html .= $infohs->generate();
$html .= $infohs->content_in_div(nl2br(s($instance->sebkeys)));
$html .= "<br>\n";
}
if ($instance->restrictededitor) {
$html .= $this->str_restriction_with_icon( 'restrictededitor', $stryes );
Expand Down

0 comments on commit b17f2fb

Please sign in to comment.