Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav Gusain committed Aug 26, 2024
2 parents b7c8556 + 5bf21cd commit bf535df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion classes/model/survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static function get_surveys($filters) {
public static function get_survey_data($surveyId) {
global $DB;

$sql = "SELECT sq.*, q.text AS question_text, q.type AS question_type, cci.score_from, cci.score_to, cci.interpreted_as, cci.description, GROUP_CONCAT(o.option_text SEPARATOR ', ') AS option_texts, GROUP_CONCAT(o.score SEPARATOR ', ') AS score
$sql = "SELECT sq.*, q.text AS question_text, q.type AS question_type, cci.score_from, cci.score_to, cci.interpreted_as, cci.description, GROUP_CONCAT(o.option_text ORDER BY o.id SEPARATOR ', ') AS option_texts, GROUP_CONCAT(o.score ORDER BY o.id SEPARATOR ', ') AS score
FROM {cc_survey_questions} sq
LEFT JOIN {cc_questions} q ON sq.question_id = q.id
LEFT JOIN {cc_survey_question_options} o ON sq.id = o.survey_question_id
Expand Down
4 changes: 2 additions & 2 deletions templates/manage_survey_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ function get_survey_name($survey, $issurveylive, $USER, $dbhelper) {
if (has_capability('local/moodle_survey:can-assign-survey-to-users', $context)) {
$surveyassignstatus = $schoolsurvey->status;
$surveyassignees = $schoolsurvey->assigned_to;
$issurveyassign = true;
$issurveyassign = $surveyassignstatus == "assigned";
}

if (has_capability('local/moodle_survey:create-surveys', $context)) {
$surveyname = html_writer::link($editurl, $survey->name);
} elseif ($issurveyassign) {
} elseif (!$issurveyassign && is_counsellor()) {
$surveyname = html_writer::link($assignurl, $survey->name);
} elseif ($issurveylive && (is_student() || is_teacher())) {
$surveyinsights = $dbhelper->get_filling_survey_insights($survey->id, (int)$USER->id);
Expand Down

0 comments on commit bf535df

Please sign in to comment.