diff --git a/lang/en/choice.php b/lang/en/choice.php index ad8e1f42c2b..bf83bdefa2b 100644 --- a/lang/en/choice.php +++ b/lang/en/choice.php @@ -38,6 +38,7 @@ $string['spaceleft'] = 'space available'; $string['spacesleft'] = 'spaces available'; $string['taken'] = 'Taken'; $string['timerestrict'] = 'Restrict answering to this time period'; +$string['yourselection'] = 'Your selection'; $string['viewallresponses'] = 'View $a responses'; ?> diff --git a/mod/choice/view.php b/mod/choice/view.php index 26482eeeec6..a44bf8985bf 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -116,6 +116,10 @@ print_simple_box(format_text($choice->text, $choice->format), 'center', '70%', '', 5, 'generalbox', 'intro'); } + //if user has already made a selection, and they are not allowed to update it, show their selected answer. + if (isset($USER->id) && ($current = get_record('choice_answers', 'choiceid', $choice->id, 'userid', $USER->id)) && !$choice->allowupdate) { + print_simple_box(get_string("yourselection", "choice", userdate($choice->timeopen)).": ".format_string(choice_get_option_text($choice, $current->optionid)), "center"); + } /// Print the form