File to change fill in the blanks field width
Submitted by ksen-pol on Mon, 11/26/2018 - 08:14
Forums:
Hello! I need to change width for the fill in the blanks field on the Drupal7 site.
How can I find the file to change it?
I see with F12
<input type="text" class="h5p-text-input" autocomplete="off" autocapitalize="off" aria-label="Blank input 1 of 1" style="width: 56px;">
.h5p-blanks .h5p-text-input {- font-family: H5PDroidSans, sans-serif;
- font-size: 1em;
- border-radius: 0.25em;
- border: 1px solid #a0a0a0;
- padding: 0.1875em 1em 0.1875em 0.5em;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- width: 6em;
Printscreen is attached.
otacke
Mon, 11/26/2018 - 10:11
Permalink
Hi ksen-pol!Please consult
Hi ksen-pol!
Please consult our documentation on visual customization with CSS.
Best,
Oliver
ksen-pol
Mon, 11/26/2018 - 11:26
Permalink
Thank you
Are you sure that I can do it just with css in this case? Cause a programmer told me I need a js file.
I think I need to change the script in the blanks file?
What should I do to make th efiled shorter?
otacke
Mon, 11/26/2018 - 11:36
Permalink
Hi ksen-pol!In the case of
Hi ksen-pol!
In the case of "Fill in the blanks": yes. The width of the blanks is computed dynamically, and you seem to have found the correct functions that do so. Without knowing what "rule" you have in mind for the width, it's impossible to tell what you should do.
Best,
Oliver
ksen-pol
Mon, 11/26/2018 - 12:57
Permalink
Thank you
The rule is for the width to be very short just for 2-3 letters in the begining (e.g. for questions where student needs to add just one letter) and it can become longer in the process of typing (as it is working now).
Or second way it would be very usefull is to have an opportunity to set up the minimal starting width in the process of creation (very short one couple letters answers and longer for long words answers)
otacke
Mon, 11/26/2018 - 13:10
Permalink
Hi ksen-pol!You'll probably
Hi ksen-pol!
You'll probably want to change the minimum width set to 3em which may already be enough to suit your needs. Otherwise, you'd also have to modify the computation of the width.
Cheers,
Oliver
ksen-pol
Mon, 11/26/2018 - 15:11
Permalink
I have edited files in
I have edited files in both
sites/default/files/h5p/libraries/H5P.Blanks-1.10/js
and
sites/default/files/h5p/libraries/H5P.Blanks-1.11/js
the width became 2 times shorter (screenshoot) after I had edited 1 instead of 3 in
when I tried to make it shorter by changing to 0.5 it did not work
otacke
Mon, 11/26/2018 - 15:19
Permalink
That's because the stylesheet
That's because the stylesheet defines a padding for the content of the text-input fields.
ksen-pol
Tue, 11/27/2018 - 13:44
Permalink
Thank you
Thank you
otacke
Tue, 11/27/2018 - 13:49
Permalink
You're welcome!
You're welcome!