Differ multiple answer dropdown and global dropdown - refs BT#20086

pull/4380/head
Angel Fernando Quiroz Campos 4 years ago
parent fa8d9a92d5
commit d7d3613ecf
  1. 2
      main/exercise/MultipleAnswerDropdown.php
  2. 16
      main/exercise/MultipleAnswerDropdownGlobal.php
  3. 16
      main/exercise/exercise.class.php
  4. 1
      main/exercise/exercise_show.php
  5. 5
      main/exercise/export/qti2/qti2_classes.php
  6. 1
      main/exercise/export/qti2/qti2_export.php
  7. 54
      main/exercise/multiple_answer_dropdown_admin.php
  8. 6
      main/exercise/question.class.php
  9. 2
      main/exercise/question_admin.inc.php
  10. 9
      main/exercise/upload_exercise.php
  11. BIN
      main/img/icons/128/mcma_dropdown_global.png
  12. BIN
      main/img/icons/128/mcma_dropdown_global_na.png
  13. BIN
      main/img/icons/16/mcma_dropdown_global.png
  14. BIN
      main/img/icons/16/mcma_dropdown_global_na.png
  15. BIN
      main/img/icons/22/mcma_dropdown_global.png
  16. BIN
      main/img/icons/22/mcma_dropdown_global_na.png
  17. BIN
      main/img/icons/32/mcma_dropdown_global.png
  18. BIN
      main/img/icons/32/mcma_dropdown_global_na.png
  19. BIN
      main/img/icons/48/mcma_dropdown_global.png
  20. BIN
      main/img/icons/48/mcma_dropdown_global_na.png
  21. BIN
      main/img/icons/64/mcma_dropdown_global.png
  22. BIN
      main/img/icons/64/mcma_dropdown_global_na.png
  23. 10
      main/img/icons/svg/mcma_dropdown.svg
  24. 234
      main/img/icons/svg/mcma_dropdown_global.svg
  25. 234
      main/img/icons/svg/mcma_dropdown_global_na.svg
  26. 3
      main/inc/lib/api.lib.php
  27. 32
      main/inc/lib/exercise.lib.php

@ -98,7 +98,7 @@ class MultipleAnswerDropdown extends Question
$isCorrect = (int) $objAnswer->correct[$i];
}
$objAnswer->createAnswer($line, $isCorrect, '', 0, $i++);
$objAnswer->createAnswer($line, $isCorrect, '', $objAnswer->weighting[$i], $i++);
}
$objAnswer->save();

@ -0,0 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
class MultipleAnswerDropdownGlobal extends MultipleAnswerDropdown
{
public $typePicture = 'mcma_dropdown_global.png';
public $explanationLangVar = 'MultipleAnswerDropdownGlobal';
public function __construct()
{
parent::__construct();
$this->type = MULTIPLE_ANSWER_DROPDOWN_GLOBAL;
}
}

@ -3914,7 +3914,7 @@ class Exercise
);
}
if (MULTIPLE_ANSWER_DROPDOWN == $answerType) {
if (in_array($answerType, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])) {
$questionScore = $questionWeighting;
if ($from_database) {
@ -6224,9 +6224,19 @@ class Exercise
$questionDuration
);
}
} elseif ($answerType == MULTIPLE_ANSWER || $answerType == GLOBAL_MULTIPLE_ANSWER || MULTIPLE_ANSWER_DROPDOWN == $answerType) {
} elseif (
in_array(
$answerType,
[
MULTIPLE_ANSWER,
GLOBAL_MULTIPLE_ANSWER,
MULTIPLE_ANSWER_DROPDOWN,
MULTIPLE_ANSWER_DROPDOWN_GLOBAL,
]
)
) {
if ($choice != 0) {
if (MULTIPLE_ANSWER_DROPDOWN == $answerType) {
if (in_array($answerType, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])) {
$reply = array_values($choice);
} else {
$reply = array_keys($choice);

@ -453,6 +453,7 @@ foreach ($questionList as $questionId) {
case READING_COMPREHENSION:
case MATCHING_DRAGGABLE:
case MULTIPLE_ANSWER_DROPDOWN:
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
$question_result = $objExercise->manage_answer(
$id,
$questionId,

@ -45,6 +45,7 @@ class Ims2Question extends Question
return $answer;
case MCMA:
case MULTIPLE_ANSWER_DROPDOWN:
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
$answer = new ImsAnswerMultipleChoice($this->iid);
return $answer;
@ -134,7 +135,7 @@ class ImsAnswerMultipleChoice extends Answer implements ImsAnswerInterface
{
$this->answerList = $this->getAnswersList(true);
$type = $this->getQuestionType();
if (in_array($type, [MCMA, MULTIPLE_ANSWER_DROPDOWN])) {
if (in_array($type, [MCMA, MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])) {
$cardinality = 'multiple';
} else {
$cardinality = 'single';
@ -157,7 +158,7 @@ class ImsAnswerMultipleChoice extends Answer implements ImsAnswerInterface
if (is_array($this->answerList)) {
$out .= ' <mapping';
if (MULTIPLE_ANSWER_DROPDOWN == $this->getQuestionType()) {
if (MULTIPLE_ANSWER_DROPDOWN_GLOBAL == $this->getQuestionType()) {
$out .= ' defaultValue="'.$question->selectWeighting().'"';
}

@ -462,6 +462,7 @@ function export_question_qti($questionId, $standalone = true)
|| $qst instanceof MultipleAnswer
|| $qst instanceof FreeAnswer
|| $qst instanceof MultipleAnswerDropdown
|| $qst instanceof MultipleAnswerDropdownGlobal
;
if (!$isValid) {

@ -16,6 +16,8 @@ if (!is_object($objQuestion)) {
$objQuestion = Question::read($questionId);
}
$isGlobal = MULTIPLE_ANSWER_DROPDOWN_GLOBAL === (int) $objQuestion->type;
$objAnswer = new Answer($objQuestion->iid, 0, $objExercise);
$options = [];
@ -34,18 +36,40 @@ if ($submitAnswers) {
'intval',
(array) $httpRequest->request->get('answer', [])
);
$questionWeighting = (float) $httpRequest->request->get('weighting', 0);
$tblQuizAnswer = Database::get_course_table(TABLE_QUIZ_ANSWER);
Database::query(
"UPDATE $tblQuizAnswer SET correct = 0 WHERE question_id = ".$objQuestion->iid
"UPDATE $tblQuizAnswer SET correct = 0, ponderation = 0 WHERE question_id = ".$objQuestion->iid
);
Database::query(
"UPDATE $tblQuizAnswer SET correct = 1
WHERE question_id = {$objQuestion->iid} AND iid IN (".implode(', ', $questionAnswers).")"
);
if ($isGlobal) {
$questionWeighting = (float) $httpRequest->request->get('weighting', 0);
} else {
$questionWeighting = 0;
$choiceWeighting = array_map(
'intval',
(array) $httpRequest->request->get('c_weighting', [])
);
foreach ($questionAnswers as $key => $questionAnswer) {
if (empty($choiceWeighting[$key])) {
continue;
}
$questionWeighting += $choiceWeighting[$key];
Database::query(
"UPDATE $tblQuizAnswer SET ponderation = {$choiceWeighting[$key]}
WHERE question_id = {$objQuestion->iid} AND iid = $questionAnswer"
);
}
}
$objQuestion->updateWeighting($questionWeighting);
$objQuestion->save($objExercise);
@ -64,6 +88,7 @@ if ($questionId) {
$answers[] = [
$objAnswer->iid[$i],
$objAnswer->answer[$i],
$objAnswer->weighting[$i],
];
}
@ -98,7 +123,10 @@ if ($questionId) {
<thead>
<tr>
<th class="text-right"><?php echo get_lang('Number'); ?></th>
<th style="width: 90%;"><?php echo get_lang('Answer'); ?></th>
<th style="width: 85%;"><?php echo get_lang('Answer'); ?></th>
<?php if (!$isGlobal) { ?>
<th class="text-right"><?php echo get_lang('Weighting') ?></th>
<?php } ?>
<th>&nbsp;</th>
</tr>
</thead>
@ -106,13 +134,15 @@ if ($questionId) {
</tbody>
</table>
</fieldset>
<div class="form-group">
<label for="weighting" class="control-label col-sm-2"><?php echo get_lang('Weighting'); ?></label>
<div class="col-sm-8">
<input type="number" required min="0" class="form-control" step="any" id="weighting" name="weighting"
value="<?php echo $objQuestion->weighting; ?>">
<?php if ($isGlobal) { ?>
<div class="form-group">
<label for="weighting" class="control-label col-sm-2"><?php echo get_lang('Weighting'); ?></label>
<div class="col-sm-8">
<input type="number" required min="0" class="form-control" step="any" id="weighting" name="weighting"
value="<?php echo $objQuestion->weighting; ?>">
</div>
</div>
</div>
<?php } ?>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" name="submitAnswers" value="submitAnswers">
@ -139,7 +169,7 @@ if ($questionId) {
return;
}
answers.push([selected, lines[selected]]);
answers.push([selected, lines[selected], 0]);
$txtOption.val(-1).selectpicker('refresh');
@ -169,6 +199,10 @@ if ($questionId) {
+ line[1] + "\n"
+ '<input type="hidden" name="answer[]" value="' + line[0] + '">'
+ '</td><td class="text-right">'
<?php if (!$isGlobal) { ?>
+ '<input type="number" required min="0" class="form-control" step="any" name="c_weighting[]" value="' + line[2] + '">'
+ '</td><td class="text-right">'
<?php } ?>
+ '<button type="button" class="btn btn-default btn-remove" data-index="' + key + '" aria-label="<?php echo get_lang('Remove'); ?>">'
+ '<?php echo Display::returnFontAwesomeIcon('minus', '', true); ?>'
+ '</button>'

@ -74,6 +74,7 @@ abstract class Question
READING_COMPREHENSION => ['ReadingComprehension.php', 'ReadingComprehension'],
UPLOAD_ANSWER => ['UploadAnswer.php', 'UploadAnswer'],
MULTIPLE_ANSWER_DROPDOWN => ['MultipleAnswerDropdown.php', 'MultipleAnswerDropdown'],
MULTIPLE_ANSWER_DROPDOWN_GLOBAL => ['MultipleAnswerDropdownGlobal.php', 'MultipleAnswerDropdownGlobal'],
];
/**
@ -1822,6 +1823,7 @@ abstract class Question
switch ($this->type) {
case UNIQUE_ANSWER:
case MULTIPLE_ANSWER_DROPDOWN:
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
$buttonGroup = [];
$buttonGroup[] = $form->addButtonSave(
$text,
@ -2565,8 +2567,9 @@ abstract class Question
{
$oppositeAnswers = [
UNIQUE_ANSWER => [MULTIPLE_ANSWER],
MULTIPLE_ANSWER => [UNIQUE_ANSWER, MULTIPLE_ANSWER_DROPDOWN],
MULTIPLE_ANSWER => [UNIQUE_ANSWER, MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL],
MULTIPLE_ANSWER_DROPDOWN => [MULTIPLE_ANSWER],
MULTIPLE_ANSWER_DROPDOWN_GLOBAL => [MULTIPLE_ANSWER],
];
$this->type = $oppositeAnswers[$this->type][$index];
Database::update(
@ -2578,6 +2581,7 @@ abstract class Question
UNIQUE_ANSWER => 'UniqueAnswer',
MULTIPLE_ANSWER => 'MultipleAnswer',
MULTIPLE_ANSWER_DROPDOWN => 'MultipleAnswerDropdown',
MULTIPLE_ANSWER_DROPDOWN_GLOBAL => 'MultipleAnswerDropdownGlobal',
];
$swappedAnswer = new $answerClasses[$this->type]();
foreach ($this as $key => $value) {

@ -60,7 +60,7 @@ if (is_object($objQuestion)) {
if (in_array($objQuestion->type, [HOT_SPOT, HOT_SPOT_GLOBAL, HOT_SPOT_DELINEATION])) {
echo '<script type="text/javascript">window.location.href="admin.php?exerciseId='.$exerciseId.'&page='.$page.'&hotspotadmin='.$objQuestion->iid.'&'.api_get_cidreq(
).'"</script>';
} elseif (MULTIPLE_ANSWER_DROPDOWN == $objQuestion->type) {
} elseif (in_array($objQuestion->type, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])) {
$url = 'admin.php?'
.api_get_cidreq().'&'
.http_build_query(['exerciseId' => $exerciseId, 'page' => $page, 'mad_admin' => $objQuestion->iid]);

@ -86,6 +86,7 @@ function lp_upload_quiz_main()
UNIQUE_ANSWER => get_lang('UniqueSelect'),
MULTIPLE_ANSWER => get_lang('MultipleSelect'),
MULTIPLE_ANSWER_DROPDOWN => get_lang('MultipleAnswerDropdown'),
MULTIPLE_ANSWER_DROPDOWN_GLOBAL => get_lang('MultipleAnswerDropdownGlobal'),
FILL_IN_BLANKS => get_lang('FillBlanks'),
FILL_IN_BLANKS_GLOBAL => get_lang('FillBlanksGlobal'),
MATCHING => get_lang('Matching'),
@ -333,6 +334,9 @@ function lp_upload_quiz_action_handling()
case MULTIPLE_ANSWER_DROPDOWN:
$answer = new MultipleAnswerDropdown();
break;
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
$answer = new MultipleAnswerDropdownGlobal();
break;
case FILL_IN_BLANKS:
case FILL_IN_BLANKS_GLOBAL:
$answer = new FillBlanks();
@ -367,6 +371,7 @@ function lp_upload_quiz_action_handling()
switch ($detectQuestionType) {
case GLOBAL_MULTIPLE_ANSWER:
case MULTIPLE_ANSWER_DROPDOWN:
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
case MULTIPLE_ANSWER:
case UNIQUE_ANSWER:
$total = 0;
@ -429,7 +434,7 @@ function lp_upload_quiz_action_handling()
//$total = $total - $score;
}
break;
case MULTIPLE_ANSWER_DROPDOWN:
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
$score = 0;
break;
}
@ -458,7 +463,7 @@ function lp_upload_quiz_action_handling()
if ($questionObj) {
switch ($detectQuestionType) {
case GLOBAL_MULTIPLE_ANSWER:
case MULTIPLE_ANSWER_DROPDOWN:
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
$questionObj->updateWeighting($globalScore);
break;
case UNIQUE_ANSWER:

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -94,14 +94,14 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.5443549"
inkscape:cx="30.188851"
inkscape:cy="73.638225"
inkscape:cx="30.18885"
inkscape:cy="73.638224"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1366"
inkscape:window-height="731"
inkscape:window-x="0"
inkscape:window-width="1920"
inkscape:window-height="1043"
inkscape:window-x="1366"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="0" />

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@ -0,0 +1,234 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
sodipodi:docname="mcma_dropdown_global.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
version="1.1"
viewBox="0 0 124 124"
id="svg7613"
height="124"
width="124"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs7615">
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4799"
id="radialGradient7559"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.55758631,0,0,0.57073983,33.783815,180.81737)"
cx="55.21796"
cy="458.46527"
fx="55.21796"
fy="458.46527"
r="15.213428" />
<linearGradient
id="linearGradient4799">
<stop
style="stop-color:#ffde00;stop-opacity:1;"
offset="0"
id="stop4801" />
<stop
style="stop-color:#ffa700;stop-opacity:1;"
offset="1"
id="stop4803" />
</linearGradient>
<radialGradient
r="15.213428"
fy="458.46527"
fx="55.21796"
cy="458.46527"
cx="55.21796"
gradientTransform="matrix(0.55758631,0,0,0.57073983,33.783815,180.81737)"
gradientUnits="userSpaceOnUse"
id="radialGradient7646"
xlink:href="#linearGradient4799"
inkscape:collect="always" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4799-9"
id="radialGradient7557"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.55758631,0,0,0.57073983,104.95785,180.81737)"
cx="55.21796"
cy="458.46527"
fx="55.21796"
fy="458.46527"
r="15.213428" />
<linearGradient
id="linearGradient4799-9">
<stop
style="stop-color:#ffde00;stop-opacity:1;"
offset="0"
id="stop4801-0" />
<stop
style="stop-color:#ffa700;stop-opacity:1;"
offset="1"
id="stop4803-9" />
</linearGradient>
<radialGradient
r="15.213428"
fy="458.46527"
fx="55.21796"
cy="458.46527"
cx="55.21796"
gradientTransform="matrix(1.0803234,0,0,1.1058083,-31.969647,523.39062)"
gradientUnits="userSpaceOnUse"
id="radialGradient7869"
xlink:href="#linearGradient4799-9"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.5443549"
inkscape:cx="30.18885"
inkscape:cy="73.638224"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1043"
inkscape:window-x="1366"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="0" />
<metadata
id="metadata7618">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-928.36218)">
<g
id="g9959">
<rect
style="opacity:0;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.9375"
id="rect4141"
width="123.99998"
height="123.99998"
x="0.14107606"
y="928.7854" />
<rect
style="fill:#2d404e;fill-opacity:1;stroke:none;stroke-width:1.9375"
id="rect4143"
width="83.096649"
height="103.31303"
x="22.55817"
y="940.23615"
ry="6.2725754" />
<rect
ry="6.2725754"
y="937.75317"
x="20.075216"
height="103.31303"
width="83.096649"
id="rect4145"
style="fill:#ffffff;fill-opacity:1;stroke:#70acc7;stroke-width:1.9375;stroke-opacity:1" />
<path
sodipodi:nodetypes="csssscc"
inkscape:connector-curvature="0"
id="rect8010"
d="m 89.608699,962.37229 v 38.08361 c 0,3.9836 -2.942747,7.1904 -6.598084,7.1904 H 40.974066 c -3.655339,0 -6.598085,-3.2068 -6.598085,-7.1904 v -38.08361 z"
style="fill:#ffffff;fill-opacity:1;stroke:#2f7ea6;stroke-width:2.20385;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="3.8419447"
y="950.85077"
x="34.103207"
height="16.660213"
width="55.775013"
id="rect8000"
style="fill:#70acc7;fill-opacity:1;stroke:#2f7ea6;stroke-width:1.6506;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:#2f7ea6;fill-opacity:1;stroke:none;stroke-width:1.26366"
d="m 77.713426,950.11975 8.18356,0.0392 c 2.685773,0.0129 4.839793,2.30745 4.825224,4.58237 l -0.05864,9.15791 c -0.01115,1.74067 -1.891887,4.27381 -4.60529,4.2696 l -8.344846,-0.0132 z"
id="path8006"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csssscc" />
<path
style="fill:#ffffff;stroke:none;stroke-width:1.0791"
d="m 80.762274,958.05706 3.254053,4.39126 3.219109,-4.39207 z"
id="path8008"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:7.95532px;line-height:0%;font-family:Arial;-inkscape-font-specification:'Arial Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:0.662943"
x="37.096527"
y="1066.9473"
id="text8002"
transform="scale(1.09082,0.91674152)"><tspan
sodipodi:role="line"
x="37.096527"
y="1066.9473"
style="font-size:10.2756px;line-height:1.25;stroke-width:0.662943"
id="tspan2508">a</tspan><tspan
sodipodi:role="line"
x="37.096527"
y="1079.7917"
style="font-size:10.2756px;line-height:1.25;stroke-width:0.662943"
id="tspan2512">b</tspan><tspan
sodipodi:role="line"
x="37.096527"
y="1092.6364"
style="font-size:10.2756px;line-height:1.25;stroke-width:0.662943"
id="tspan2514">c</tspan></text>
<path
id="path4274"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.04538;marker:none;enable-background:accumulate"
d="m 82.984827,972.12652 -3.160165,4.05231 -1.215446,-1.24304 -0.996663,0.99448 1.774555,1.8397 a 0.70016745,0.71606856 0 0 0 1.045283,-0.0746 l 3.646339,-4.67385 z"
inkscape:connector-curvature="0" />
<path
id="path4274-9"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.04538;marker:none;enable-background:accumulate"
d="m 82.93607,995.93544 -3.160165,4.05234 -1.215446,-1.24307 -0.996663,0.99448 1.774554,1.83981 a 0.70016745,0.71606856 0 0 0 1.045284,-0.075 l 3.646339,-4.67396 z"
inkscape:connector-curvature="0" />
<path
style="fill:url(#radialGradient7869);fill-opacity:1;stroke:#ff4100;stroke-width:1.62048;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 26.096234,1025.4956 -0.05503,-9.8333 c 0.06297,-2.1592 3.965636,-2.0353 4.229969,-0.055 v 9.7234 l 6.537221,-6.5921 c 1.604153,-1.5049 3.93762,1.1364 2.526985,2.6369 l -6.097739,6.8668 8.569795,0.055 c 2.499859,0.3246 2.184782,4.4543 0.109856,4.6145 l -8.295115,-0.055 6.262542,6.0428 c 1.478545,1.6554 -0.493966,4.523 -2.691788,3.0764 l -7.031632,-6.757 -0.05503,9.7234 c 0.2486,2.0648 -3.983171,2.455 -4.394773,0.055 l 0.05503,-9.229 -6.207614,6.2076 c -2.185306,0.5379 -3.979237,-1.0157 -3.131271,-2.9116 l 6.59215,-6.3174 -9.503689,0.11 c -2.341042,-0.4546 -2.284235,-4.3097 0.05502,-4.6145 l 9.72342,-0.055 -6.811881,-6.702 c -1.325327,-2.1093 0.948697,-4.2446 2.746736,-2.9665 z"
id="path5136"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccc" />
<path
style="fill:#81c2e7;fill-opacity:1;stroke:#8e8e8e;stroke-width:0.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 36.666536,980.48038 H 87.172848"
id="path5283" />
<path
style="fill:#81c2e7;fill-opacity:1;stroke:#8e8e8e;stroke-width:0.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 36.666537,993.39969 H 87.172846"
id="path5283-0" />
</g>
<text
id="text6075"
y="1037.1279"
x="73.217209"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:23.25px;line-height:0%;font-family:Arial;-inkscape-font-specification:'Arial Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#2f7ea6;fill-opacity:1;stroke:none;stroke-width:1.9375"
xml:space="preserve"><tspan
y="1037.1279"
x="73.217209"
id="tspan6077"
sodipodi:role="line"
style="font-size:35.4987px;line-height:1.25;stroke-width:1.9375">G</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

@ -0,0 +1,234 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="124"
height="124"
id="svg7613"
viewBox="0 0 124 124"
version="1.1"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
sodipodi:docname="mcma_dropdown_global_na.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs7615">
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4799"
id="radialGradient7559"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.55758631,0,0,0.57073983,33.783815,180.81737)"
cx="55.21796"
cy="458.46527"
fx="55.21796"
fy="458.46527"
r="15.213428" />
<linearGradient
id="linearGradient4799">
<stop
style="stop-color:#ffde00;stop-opacity:1;"
offset="0"
id="stop4801" />
<stop
style="stop-color:#ffa700;stop-opacity:1;"
offset="1"
id="stop4803" />
</linearGradient>
<radialGradient
r="15.213428"
fy="458.46527"
fx="55.21796"
cy="458.46527"
cx="55.21796"
gradientTransform="matrix(0.55758631,0,0,0.57073983,33.783815,180.81737)"
gradientUnits="userSpaceOnUse"
id="radialGradient7646"
xlink:href="#linearGradient4799"
inkscape:collect="always" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4799-9"
id="radialGradient7557"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.55758631,0,0,0.57073983,104.95785,180.81737)"
cx="55.21796"
cy="458.46527"
fx="55.21796"
fy="458.46527"
r="15.213428" />
<linearGradient
id="linearGradient4799-9">
<stop
style="stop-color:#cfcfcf;stop-opacity:1"
offset="0"
id="stop4801-0" />
<stop
style="stop-color:#aeaeae;stop-opacity:1"
offset="1"
id="stop4803-9" />
</linearGradient>
<radialGradient
r="15.213428"
fy="458.46527"
fx="55.21796"
cy="458.46527"
cx="55.21796"
gradientTransform="matrix(1.0803234,0,0,1.1058083,-31.969647,523.39062)"
gradientUnits="userSpaceOnUse"
id="radialGradient7869"
xlink:href="#linearGradient4799-9"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.5443549"
inkscape:cx="30.18885"
inkscape:cy="73.638224"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1043"
inkscape:window-x="1366"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="0" />
<metadata
id="metadata7618">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-928.36218)">
<g
id="g9959">
<rect
style="opacity:0;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.9375"
id="rect4141"
width="123.99998"
height="123.99998"
x="0.14107606"
y="928.7854" />
<rect
style="fill:#3c3c3c;fill-opacity:1;stroke:none;stroke-width:1.9375"
id="rect4143"
width="83.096649"
height="103.31303"
x="22.55817"
y="940.23615"
ry="6.2725754" />
<rect
ry="6.2725754"
y="937.75317"
x="20.075216"
height="103.31303"
width="83.096649"
id="rect4145"
style="fill:#ffffff;fill-opacity:1;stroke:#9d9d9d;stroke-width:1.9375;stroke-opacity:1" />
<path
sodipodi:nodetypes="csssscc"
inkscape:connector-curvature="0"
id="rect8010"
d="m 89.608699,962.37229 v 38.08361 c 0,3.9836 -2.942747,7.1904 -6.598084,7.1904 H 40.974066 c -3.655339,0 -6.598085,-3.2068 -6.598085,-7.1904 v -38.08361 z"
style="fill:#ffffff;fill-opacity:1;stroke:#6b6b6b;stroke-width:2.20385;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="3.8419447"
y="950.85077"
x="34.103207"
height="16.660213"
width="55.775013"
id="rect8000"
style="fill:#9d9d9d;fill-opacity:1;stroke:#6b6b6b;stroke-width:1.6506;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:#6b6b6b;fill-opacity:1;stroke:none;stroke-width:1.26366"
d="m 77.713426,950.11975 8.18356,0.0392 c 2.685773,0.0129 4.839793,2.30745 4.825224,4.58237 l -0.05864,9.15791 c -0.01115,1.74067 -1.891887,4.27381 -4.60529,4.2696 l -8.344846,-0.0132 z"
id="path8006"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csssscc" />
<path
style="fill:#ffffff;stroke:none;stroke-width:1.0791"
d="m 80.762274,958.05706 3.254053,4.39126 3.219109,-4.39207 z"
id="path8008"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:7.95532px;line-height:0%;font-family:Arial;-inkscape-font-specification:'Arial Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:0.662943"
x="37.096527"
y="1066.9473"
id="text8002"
transform="scale(1.09082,0.91674152)"><tspan
sodipodi:role="line"
x="37.096527"
y="1066.9473"
style="font-size:10.2756px;line-height:1.25;stroke-width:0.662943"
id="tspan2508">a</tspan><tspan
sodipodi:role="line"
x="37.096527"
y="1079.7917"
style="font-size:10.2756px;line-height:1.25;stroke-width:0.662943"
id="tspan2512">b</tspan><tspan
sodipodi:role="line"
x="37.096527"
y="1092.6364"
style="font-size:10.2756px;line-height:1.25;stroke-width:0.662943"
id="tspan2514">c</tspan></text>
<path
id="path4274"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.04538;marker:none;enable-background:accumulate"
d="m 82.984827,972.12652 -3.160165,4.05231 -1.215446,-1.24304 -0.996663,0.99448 1.774555,1.8397 a 0.70016745,0.71606856 0 0 0 1.045283,-0.0746 l 3.646339,-4.67385 z"
inkscape:connector-curvature="0" />
<path
id="path4274-9"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.04538;marker:none;enable-background:accumulate"
d="m 82.93607,995.93544 -3.160165,4.05234 -1.215446,-1.24307 -0.996663,0.99448 1.774554,1.83981 a 0.70016745,0.71606856 0 0 0 1.045284,-0.075 l 3.646339,-4.67396 z"
inkscape:connector-curvature="0" />
<path
style="fill:url(#radialGradient7869);fill-opacity:1;stroke:#727272;stroke-width:1.62048;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 26.096234,1025.4956 -0.05503,-9.8333 c 0.06297,-2.1592 3.965636,-2.0353 4.229969,-0.055 v 9.7234 l 6.537221,-6.5921 c 1.604153,-1.5049 3.93762,1.1364 2.526985,2.6369 l -6.097739,6.8668 8.569795,0.055 c 2.499859,0.3246 2.184782,4.4543 0.109856,4.6145 l -8.295115,-0.055 6.262542,6.0428 c 1.478545,1.6554 -0.493966,4.523 -2.691788,3.0764 l -7.031632,-6.757 -0.05503,9.7234 c 0.2486,2.0648 -3.983171,2.455 -4.394773,0.055 l 0.05503,-9.229 -6.207614,6.2076 c -2.185306,0.5379 -3.979237,-1.0157 -3.131271,-2.9116 l 6.59215,-6.3174 -9.503689,0.11 c -2.341042,-0.4546 -2.284235,-4.3097 0.05502,-4.6145 l 9.72342,-0.055 -6.811881,-6.702 c -1.325327,-2.1093 0.948697,-4.2446 2.746736,-2.9665 z"
id="path5136"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccccccc" />
<path
style="fill:#b3b3b3;fill-opacity:1;stroke:#8e8e8e;stroke-width:0.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 36.666536,980.48038 H 87.172848"
id="path5283" />
<path
style="fill:#b3b3b3;fill-opacity:1;stroke:#8e8e8e;stroke-width:0.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 36.666537,993.39969 H 87.172846"
id="path5283-0" />
</g>
<text
id="text6075"
y="1037.1279"
x="73.217209"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:23.25px;line-height:0%;font-family:Arial;-inkscape-font-specification:'Arial Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#6b6b6b;fill-opacity:1;stroke:none;stroke-width:1.9375"
xml:space="preserve"><tspan
y="1037.1279"
x="73.217209"
id="tspan6077"
sodipodi:role="line"
style="font-size:35.4987px;line-height:1.25;stroke-width:1.9375">G</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

@ -528,7 +528,8 @@ define('MATCHING_GLOBAL', 24);
define('MATCHING_DRAGGABLE_GLOBAL', 25);
define('HOT_SPOT_GLOBAL', 26);
define('FILL_IN_BLANKS_GLOBAL', 27);
define('MULTIPLE_ANSWER_DROPDOWN', 28);
define('MULTIPLE_ANSWER_DROPDOWN_GLOBAL', 28);
define('MULTIPLE_ANSWER_DROPDOWN', 29);
define('EXERCISE_CATEGORY_RANDOM_SHUFFLED', 1);
define('EXERCISE_CATEGORY_RANDOM_ORDERED', 2);

@ -341,6 +341,18 @@ class ExerciseLib
$form->addHtml('</div>');
$s .= $form->returnForm();
break;
case MULTIPLE_ANSWER_DROPDOWN:
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
if ($debug_mark_answer) {
$s .= '<p><strong>'
.(
MULTIPLE_ANSWER_DROPDOWN == $answerType
? '<span class="pull-right">'.get_lang('Weighting').'</span>'
: ''
)
.get_lang('CorrectAnswer').'</strong></p>';
}
break;
}
// Now navigate through the possible answers, using the max number of
@ -1457,17 +1469,24 @@ HTML;
}
break;
case MULTIPLE_ANSWER_DROPDOWN:
if ($debug_mark_answer) {
if ($answerCorrect) {
$s .= '<p>'.Display::returnFontAwesomeIcon('check-square-o', '', true);
$s .= Security::remove_XSS($objAnswerTmp->answer[$answerId]).'</p>';
}
case MULTIPLE_ANSWER_DROPDOWN_GLOBAL:
if ($debug_mark_answer && $answerCorrect) {
$s .= '<p>'
.(
MULTIPLE_ANSWER_DROPDOWN == $answerType
? '<span class="pull-right">'.$objAnswerTmp->weighting[$answerId].'</span>'
: ''
)
.Display::returnFontAwesomeIcon('check-square-o', '', true);
$s .= Security::remove_XSS($objAnswerTmp->answer[$answerId]).'</p>';
}
break;
}
}
if (MULTIPLE_ANSWER_DROPDOWN == $answerType && !$debug_mark_answer) {
if (in_array($answerType, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])
&& !$debug_mark_answer
) {
$userChoiceList = array_unique($userChoiceList);
$input_id = "choice-$questionId";
@ -6189,6 +6208,7 @@ EOT;
MATCHING_GLOBAL,
FILL_IN_BLANKS_GLOBAL,
MULTIPLE_ANSWER_DROPDOWN,
MULTIPLE_ANSWER_DROPDOWN_GLOBAL,
];
$defaultTypes = [UNIQUE_ANSWER, MULTIPLE_ANSWER, UNIQUE_ANSWER_IMAGE];
$types = $defaultTypes;

Loading…
Cancel
Save