Create test questions with multi choices

11 ビュー (過去 30 日間)
awesome2999 jacob
awesome2999 jacob 2012 年 3 月 25 日
回答済み: elias da costa lima 2021 年 4 月 2 日
Hi everyone,
I have an enquiry. Is it possible to create a set of questions that have multiple choices (multi- answers selection)? So that, the student can take the test, and then the system comes back with results.I really appreciate your ideas, so that I can start with my project, which is to build an Intelligent tutoring system using Matlab.
Thanks, Sam
  2 件のコメント
Rick Rosson
Rick Rosson 2012 年 3 月 25 日
Do you want to create a simple console-based interface, or a graphical user interface?
Geoff
Geoff 2012 年 3 月 25 日
You've asked this before <http://www.mathworks.com.au/matlabcentral/answers/33180-tutoring-system-using-matlab-gui>. Perhaps you need to rephrase your question. Rather than asking if it's possible, why not ask where to start?

サインインしてコメントする。

採用された回答

Geoff
Geoff 2012 年 3 月 25 日
How about this:
% Asks for a,b,c-style choices and returns the corresponding choice as a
% number from 1 to numel(choices).
function [x] = GetChoice( question, choices )
disp(question);
arrayfun(@(x)fprintf(' %c. %s\n', x-1+'a', choices{x}), 1:numel(choices));
while 1
x = lower(input('Your choice> ', 's'));
if numel(x) == 1 && x >= 'a' && x < 'a' + numel(choices)
x = x - 'a' + 1;
break;
end
end
end
% Example
question = 'What best describes your cognitive process?';
choices = {'logical', 'suspicious', 'erratic', 'optimistic'};
result = GetChoice( question, choices );

その他の回答 (1 件)

elias da costa lima
elias da costa lima 2021 年 4 月 2 日
function [x] = GetChoice( question, choices )
disp(question);
arrayfun(@(x)fprintf(' %c. %s\n', x-1+'a', choices{x}), 1:numel(choices));
while 1
x = lower(input('Your choice> ', 's'));
if numel(x) == 1 && x >= 'a' && x < 'a' + numel(choices)
x = x - 'a' + 1;
break;
end
end
end
% Example
question = 'What best describes your cognitive process?';
choices = {'logical', 'suspicious', 'erratic', 'optimistic'};
result = GetChoice( question, choices );

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by