function varargout = Question_test(varargin)
% QUESTION_TEST MATLAB code for Question_test.fig
% QUESTION_TEST, by itself, creates a new QUESTION_TEST or raises the existing
% singleton*.
%
% H = QUESTION_TEST returns the handle to a new QUESTION_TEST or the handle to
% the existing singleton*.
%
% QUESTION_TEST('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in QUESTION_TEST.M with the given input arguments.
%
% QUESTION_TEST('Property','Value',...) creates a new QUESTION_TEST or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Question_test_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Question_test_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Question_test
% Last Modified by GUIDE v2.5 10-Jan-2019 19:44:43
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Question_test_OpeningFcn, ...
'gui_OutputFcn', @Question_test_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Question_test is made visible.
function Question_test_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Question_test (see VARARGIN)
% Choose default command line output for Question_test
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Question_test wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Question_test_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in Confirm_button.
function Confirm_button_Callback(hObject, eventdata, handles)
% hObject handle to Confirm_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
value_A = get(handles.Choice_A,'Value');%获取选项A的状态值
value_B = get(handles.Choice_B,'Value');%获取选项B的状态值
value_C = get(handles.Choice_C,'Value');%获取选项C的状态值
value_D = get(handles.Choice_D,'Value');%获取选项D的状态值
%比对正确答案
%这里正确答案为 D
if value_A == 1 %如果用户选择 A
set(handles.Choice_A,'BackgroundColor','red'); %将选项A的背景色设置为“红色”
set(handles.Choice_D,'BackgroundColor','green');%将选项D的背景色设置为“绿色”
elseif value_B == 1 %如果用户选择 B
set(handles.Choice_B,'BackgroundColor','red'); %将选项B的背景色设置为“红色”
set(handles.Choice_D,'BackgroundColor','green');%将选项D的背景色设置为“绿色”
elseif value_C == 1 %如果用户选择 C
set(handles.Choice_C,'BackgroundColor','red'); %将选项C的背景色设置为“红色”
set(handles.Choice_D,'BackgroundColor','green');%将选项D的背景色设置为“绿色”
else %如果用户选择 D
set(handles.Choice_D,'BackgroundColor','green');%将选项D的背景色设置为“绿色”
end
% --- Executes on button press in radiobutton5.
function radiobutton5_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton5
% --- Executes on button press in radiobutton6.
function radiobutton6_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton6